Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to combine two multi-dimensional dictionaries easily? [solved]

Asked by
gitrog 326 Moderation Voter
5 years ago
Edited 5 years ago

So, I'm doing translations for a game, and I have different dictionaries. If a translation doesn't exist in one language, I want to set it to the English translation. Every method I've tried to combine the dictionaries has ended up incredibly inefficient.

Here are some cut down examples

local translation-sr = {
    Buttons = {
        Confirm = "???????";
        Submit = "?????";
    };
    Countries = {
        Bloxell = "???????";
        USA = "????????? ???????? ??????";
    };
    Firearms = {
        Manufacturers = {
            GenMot = "????????? ??????";
            Intratec = "????????";
            TF = "?? ??????";
        };
    };
};

local translation-en = {
    Buttons = {
        Confirm = "Confirm";
        Purchase = "Purchase";
        Submit = "Submit";
    };
    Countries = {
        Bloxell = "Bloxell";
        USA = "United States";
    };
    Firearms = {
        Manufacturers = {
            GenMot = "General Motors";
            Intratec = "Intratec ";
            TF = "TF Armaments";
        };
    };
    Languages = {
        Belarusian = "Belarusian";
        English = "English";
        French = "French";
        German = "German";
        Italian = "Italian";
        Russian = "Russian";
        Serbian = "Serbian";
        Spanish = "Spanish";
    };
};
0
wow y'all ain't even use UTF-8 on scripting helpers smh gitrog 326 — 5y
0
Out of curiosity -- why not use Roblox's localization tools? They are made to do this kind of thing. SummerEquinox 643 — 5y
0
A lot of the text in my game uses a "typewriter" effect, which gets undesired results with the built-in localization. gitrog 326 — 5y

Answer this question