1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Mod Text Localization Question

Discussion in 'Civ5 - SDK / LUA' started by Cobalt_Blue, Mar 29, 2011.

  1. Cobalt_Blue

    Cobalt_Blue Chieftain

    Joined:
    Jul 30, 2009
    Messages:
    65
    Gender:
    Female
    Location:
    SoCal
    In my mod (here:http://forums.civfanatics.com/showthread.php?t=416215), I grant one free resource upon researching certain techs. So, I changed the text in the tech tree for those techs, so that the user could see in-game what would happen.

    Here's the code.
    Spoiler :
    Code:
    
    UPDATE Language_en_US SET Text = (Text || ' Grants [COLOR_POSITIVE_TEXT]1 Free [ICON_RES_HORSE]Horse[ENDCOLOR]. ') WHERE Tag = 'TXT_KEY_TECH_HORSEBACK_RIDING_HELP';
    UPDATE Language_en_US SET Text = (Text || ' Grants [COLOR_POSITIVE_TEXT]1 Free [ICON_RES_IRON]Iron[ENDCOLOR]. ') WHERE Tag = 'TXT_KEY_TECH_STEEL_HELP';
    UPDATE Language_en_US SET Text = (Text || ' Grants [COLOR_POSITIVE_TEXT]1 Free [ICON_RES_COAL]Coal[ENDCOLOR]. ') WHERE Tag = 'TXT_KEY_TECH_STEAM_POWER_HELP';
    UPDATE Language_en_US SET Text = (Text || ' Grants [COLOR_POSITIVE_TEXT]1 Free [ICON_RES_OIL]Oil[ENDCOLOR]. ') WHERE Tag = 'TXT_KEY_TECH_COMBUSTION_HELP';
    UPDATE Language_en_US SET Text = (Text || ' Grants [COLOR_POSITIVE_TEXT]1 Free [ICON_RES_ALUMINUM]Aluminum[ENDCOLOR]. ') WHERE Tag = 'TXT_KEY_TECH_ELECTRONICS_HELP';
    UPDATE Language_en_US SET Text = (Text || ' Grants [COLOR_POSITIVE_TEXT]1 Free [ICON_RES_URANIUM]Uranium[ENDCOLOR]. ') WHERE Tag = 'TXT_KEY_TECH_NUCLEAR_FUSION_HELP';
    


    Since I am changing the table "Language_en_US", does that mean that the text won't show up in, say, the German version of the game? Or the British?

    If so, is there an easy way to add text to other language versions? Even ignoring localizing the text, could I just put English in some sort of "Language_ALL"? Or do I have to copy the commands for every possible localization table (and if so how do I find all their names)?

    Thanks in advance.
     
  2. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    That's exactly what it means. And no, there's no simple way to modify all of the languages at once; one line per language. (And remember that they just added Korean language support yesterday, so that's one more!)

    Now, they DID add a "fallback" language algorithm, where if the game couldn't find an applicable entry in the user's language it'd use the US English version instead. This is very handy for modders, I suppose, since it means that people playing, say, my own mod, wouldn't see TXT_KEY_whatever for all of the unit and building names. (After all, I'm obviously not going to translate the hundreds of new text keys into a half-dozen other languages.)
    But this doesn't help for updates like you're describing.
     
  3. Cobalt_Blue

    Cobalt_Blue Chieftain

    Joined:
    Jul 30, 2009
    Messages:
    65
    Gender:
    Female
    Location:
    SoCal
    Drat!

    I see that the wiki lists some of the languages and their table names here: http://wiki.2kgames.com/civ5/index.php/XML_Reference. I guess I'll just do those manually and hope for a better system to come. Well, thanks for the response!

    (For those curious, it lists German (de_DE), English (EN_US), Spanish (es_ES), French (fr_FR), Italian (it_IT) and Japanese (JA_JP) )
     
  4. MouseyPounds

    MouseyPounds Prince

    Joined:
    Nov 8, 2010
    Messages:
    417
    Location:
    Maryland, USA
    If you open up Civ5LocalizationDatabase.db, you'll get a list of other supported languages. As of patch 1.221 I see the following:


    I assume that KO_KR is Korean, PL_PL is Polish, and RU_RU is Russian.

    EDIT: I'm not sure why the capitalization is different on those than the "en_US" though.
     
  5. Cobalt_Blue

    Cobalt_Blue Chieftain

    Joined:
    Jul 30, 2009
    Messages:
    65
    Gender:
    Female
    Location:
    SoCal
    Beautiful! Thank you! :)

    EDIT: For the sake of future searches and searchers: Language_en_US, Language_DE_DE, Language_FR_FR, Language_JA_JP, Language_KO_KR, Language_ES_ES, Language_IT_IT, Language_PL_PL, Language_RU_RU
     
  6. SamBC

    SamBC Emperor

    Joined:
    Feb 2, 2010
    Messages:
    1,052
    Location:
    Lancaster
    I think a better solution in this case would have been to mod the tech tree presentation to add a new category of marker in a tech, and created new entries in the DB for them, and then the tooltip gets to be on the specific icon...

    Much harder though, so I don't mean this as criticism, more a thought. It would be really nice if someone came up with a community standard tech tree mod that allowed arbitrary icons with arbitrary tooltips...
     

Share This Page