ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   The Multilingual Support Thread (https://www.esoui.com/forums/showthread.php?t=1039)

Iyanga 04/20/14 02:15 PM

The Multilingual Support Thread
 
This thread is about the multilingual aspects of the game, the development and...especially, to hopefully get translations for terms you are looking for and have no clue how the proper translation would be in a different language. So feel free to ask any questions or request translations.

And...surprisingly, the coincidence is astonishing, I'm just looking for some translations :D

"gold coin"
"gold coins"
"Backpack is nearly full."
"Warning: Backpack is full now!"

If someone would be so kind and translate this to French...

ins 04/20/14 05:00 PM

Think these are already translated in the UI.

SI_INVENTORY_ERROR_INVENTORY_FULL = "Your inventory is full".
SI_INVENTORY_ERROR_INSUFFICIENT_SPACE = "You need <<1>> open inventory <<1/slot/slots>>"


SI_CURRENCY_YOUR_GOLD = "Carried Gold"
SI_CURRENCY_YOUR_BANKED_GOLD = "Banked Gold"

Etc.

Suggest you grab ZGOO addon and look around with it in game.

Easier to use the already translated terms than having to create new ones (and then get them translated) I would think.

Saucy 04/21/14 10:07 AM

ins, would it be possible for you (or someone else) to post a small example on how to use the string functions you posted?

ins 04/21/14 10:44 AM

Well, in game you could just type
/script d(GetString(SI_CURRENCY_YOUR_GOLD)) and it should print the localized version of this string to your chat text.
So the output would be "Carried Gold" for "en" localization. The same "d(variable_name)" will work in an addon context.
These are global strings so they are available "all" the time.



Changing the CVar ("language.2") to "de" or "fr" would possibly let you see the other, unless EsoStrings (where these strings are from) needs to be reloaded to get other languages.

You can change the CVar in game

/script SetCVar("language.2","de")
/script GetCVar("language.2")

Etc.

Saucy 04/21/14 11:09 AM

Weird, when I try /script d(SI_CURRENCY_YOUR_GOLD), it prints the numbers 3278 in my chat, same thing if I print it from my addon.

I've ran /script d(GetCVar("language.2")) and it is set to "en".

Iyanga 04/21/14 11:10 AM

Quote:

Originally Posted by ins (Post 5060)
Think these are already translated in the UI.

I don't need to write "Carried Gold" or "Banked Gold". I need to write "gold coin".

Quote:

Easier to use the already translated terms than having to create new ones (and then get them translated) I would think.
I don't think that I should turn reasonable output into a weird one, just so I can use terms that were translated already. :)

I got my terms translated by now, so all is good.

Seerah 04/21/14 11:18 AM

That's because SI_CURRENCY_YOUR_GOLD is just an ID for the string. ;) You have to use GetString()

ins 04/21/14 11:27 AM

That is what I get for typing while not being in game. :)

Example of use:

GetString(SI_NOT_ENOUGH_MONEY), which incidental should be the name of my next character. An Argonian.

Saucy 04/21/14 12:34 PM

Aha! Now it works, thanks guys.

If I had known about the GetString function, I would have a higher chance of figuring it out (instead of asking for more help). I appreciate the time both of you took to help a newb like me. :)

Mars85 04/23/14 12:28 AM

Is there something in the API to get original/english names? Especially because of the megaserver I'm really missing the CTRL feature of GW2 (having localized client and seeing english names while holding key).

But I can't find anything in the API to return i.e. the original quest or dungeon name.

Stormknight 04/23/14 09:45 AM

It seems that the global variables are loaded with your localised language strings.

I just noticed that Lodur updated the wiki page on the manifest file to include localisation.

http://wiki.esoui.com/Addon_manifest_(.txt)_format
Quote:

Some variable expansions are available:
localization/$(language).lua
Is there a list of the different language codes around?

- en
- de
- fr

I'm mostly trying to extract the text from the game for my addons wherever possible, so the game does all the localisation for me.

Halja 04/23/14 10:33 AM

That is the only three languages supported by the game at this time. It is driven from the game settings on what you play in. During runtime it is stored as a CVar. That is "Language.2" string. This matches the variable name in the setting.txt in the launcher application folder.

Code:

PlayersLanguage = GetCVar("Language.2")
That said you can expand to other languages using your own string lists but the manifest flip won't help you. You will have to track and load all your strings yourself for other languages. Before knowing about the manifest option, I was doing just that for my add-on.

The $(language) is just a variable swapped out. You are free to add text it i.e.
localization/AddonName$(language)IjustLikeLongNames.lua

localization/AddonNameDEIjustLikeLongNames.lua
--Halja


All times are GMT -6. The time now is 09:05 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI