Translate the GUI

Translate the GUI

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
KobraKorp
Posts: 1
Joined: 03 Jan 2009, 16:58

Translate the GUI

Post by KobraKorp »

I want to translate the GUI into french but I don't know how to do it. Does anybody know the best way to find the text files to translate in the source-code ?
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Translate the GUI

Post by manolo_ »

nice idea, the gui could be translated into some languages (if its simple possible)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Translate the GUI

Post by smoth »

which gui? the lobby or in game?

Ingame you are going to have a problem as the game has no language support and as modders several of us are starting to use custom gui elements that offer little language support and will not be able to support it as the engine has no way of storing any language support and we would have to build it ourselves.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: Translate the GUI

Post by BrainDamage »

smoth wrote: Ingame you are going to have a problem as the game has no language support and as modders several of us are starting to use custom gui elements that offer little language support and will not be able to support it as the engine has no way of storing any language support and we would have to build it ourselves.
I recall trepan mentioning a lua lib/api to allow localization, I am not sure if the work got committed / is documented, but might be worth a shot
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Translate the GUI

Post by smoth »

like I said, if the games were to have any language support, we would have to add it. Spring isn't like ta where we can have alternate language descriptions esp with lua stuff going on like custom econs. It has to be added by each modder to their project.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Translate the GUI

Post by Argh »

Well... on our side (i.e., game designers)... we have all of the things needed for localization, the only trick is providing UI elements to allow users to select their local language, and a translation of all terms provided based on that.

It's not impossible, just difficult, and something that would require a fairly large amount of time. There aren't any real changes that need to be made in Spring itself, tbh.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: Translate the GUI

Post by trepan »

Look at the top of layout.lua. IIRC, the now defunct
gui_tooltips.lua also used the same mechanism (or
at least the one on my machine did).
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Translate the GUI

Post by Argh »

Ah, so...

Code: Select all

local langSuffix = Spring.GetConfigString('Language', 'fr')
local l10nName = 'L10N/commands_' .. langSuffix .. '.lua'
local success, translations = pcall(VFS.Include, l10nName)
if (not success) then
  translations = nil
end
...gives us a way to know when players have selected a new language. Cool, that makes things relatively simple then, it's "just" a matter of having the time to translate all of the text, and displaying it using a non-crappy UI.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Translate the GUI

Post by hoijui »

hmm...
i don't know...
it all really seems way too much work (if not the coding, then the translating) for the outcome. i mean.. lobbies: ok
but with the rest, it are things like move, shoot and so on. every computer gamer today knows these words. we would be translating widgets that are used by maybe a hundred players, of which maybe 5 would profit from having it in an other language, and 4 of those speak a strange siberian language (not french or german or anything else that the widget is likely to get translated to).
sure, it would be nice, but there are many other things that could be done with this time which are much more interesting.

it is your time, sadly
aehhh... though
Post Reply

Return to “Engine”