Author Topic: Translation: strings.xml and stringtable.xml  (Read 329 times)

redhound

  • Hydlaa Resident
  • *
  • Posts: 97
    • View Profile
Translation: strings.xml and stringtable.xml
« on: April 02, 2016, 12:28:15 pm »
I have the question about PS translation resources. There are strings.xml in the lang folder, and stringtable.xml for each language in the lang/{language} folder. The string.xml are in format of "Android String Resources" - at least, then I've added XML header and fixed duplicate name attributes, and it was uploaded on Transifex.com as "Android String Resources" file successfully. The stringtable.xml have different format and looks very buggy - even no root XML element!

Now to the question - if I translate strings.xml and place it into the lang/{language} folder, would it provide UI translation for PlaneShift client, or do I have no other option than to create stringtable.xml with translated strings?
Though it's not too diffucult to generate stringtable.xml from strings.xml...

And also - the stringtable.xml in the 'english' folder - does it relate to american english (en-US) or something else?


« Last Edit: April 02, 2016, 01:11:56 pm by redhound »

redhound

  • Hydlaa Resident
  • *
  • Posts: 97
    • View Profile
« Last Edit: April 02, 2016, 01:10:14 pm by redhound »

Ravna

  • Hydlaa Resident
  • *
  • Posts: 65
  • Insane
    • View Profile
Re: Translation: strings.xml and stringtable.xml
« Reply #2 on: April 02, 2016, 01:25:02 pm »

Not entirely sure, it seems like the stringtable.xml can overwrite any of the standard values set in string.xml.

To answer the last question, it seems to be an empty stringtable in the /english folder, to indicate that it does not overwrite any values from string.xml This in turn leads me to believe that it does expect 1 stringtable.xml per language and thus that just putting a strings.xml file in a /language folder will not have the desired effect.

You can however test this quite easily, by just copying any existing file, translating the an easy to find message like "quit" or something, and then checking if it works or not. If it does you can then translate the rest in the same fashion.

Anyway, it seems to me like you'll either need to make a stringtable.xml in a language folder, or change the root strings.xml (though in that case, it will break the English support as it is). A quick test as mentioned above will give you a definitive answer.
Find me on IRC if you need me, don't use pms.

redhound

  • Hydlaa Resident
  • *
  • Posts: 97
    • View Profile
Re: Translation: strings.xml and stringtable.xml
« Reply #3 on: April 02, 2016, 03:07:43 pm »
Not entirely sure, it seems like the stringtable.xml can overwrite any of the standard values set in string.xml.

To answer the last question, it seems to be an empty stringtable in the /english folder, to indicate that it does not overwrite any values from string.xml

My great thanks, Ravna!

I've converted existing translations from PlaneShift source from 'stringtable.xml' format into 'strings.xml' format via script (only with slight manual fixing at this time) and uploaded them to the newly created PlaneShift translation project on Transifex.com. They all available to the translation online now! :)

The conversion script and converted files are available in the public repository on GitLab.com: https://gitlab.com/roman-yagodin/PlaneShift.Translation. There are more things to do - like do reverse conversion from 'strings.xml' format to 'stringtable.xml' format and scripts to sync the code repository with Transifex - but this looks quite simple to implement :sorcerer:

I'd like to invite the translators to join the PlaneShift Community translation team on Transifex.com! 8)

Ravna

  • Hydlaa Resident
  • *
  • Posts: 65
  • Insane
    • View Profile
Re: Translation: strings.xml and stringtable.xml
« Reply #4 on: April 02, 2016, 03:26:01 pm »

Very nice.

Keep in mind though, that if you want any translations to be bundled with the client, you should submit them to any of the devs, so they can be put on SVN.
Additionally you could contact Talad (not sure if you already spoke to him before any of this) if you want to set up a community to support things like a translation project for Planeshift.
Find me on IRC if you need me, don't use pms.

redhound

  • Hydlaa Resident
  • *
  • Posts: 97
    • View Profile
Re: Translation: strings.xml and stringtable.xml
« Reply #5 on: April 02, 2016, 04:34:37 pm »
I'll write more complete announce post later, maybe after I do some tweaks. I'm doing this primary to support and organize my work on the russian translation, but think that the instrumentation developed in the process could also be useful to translate PlaneShift client to any language.