Jump to content

Creating a translation using the PO Format


Bigfoot
 Share

Recommended Posts

[MENTION=11840]aliriza[/MENTION]Theoretically, yes...You just have to find the file that contains the scripts and basically do the same thing you do on the Steam version....Put the po file in the "scripts/languages/" folder and change the language.lua file in that folder to reference it....LanguageTranslator:LoadPOFile("data\\scripts\\languages\\english.po", "en")EDIT:The game files on chrome have no extension but are actually mostly zip files with the same folder structure found on the Steam version, just split up across these zip files.

Link to comment
Share on other sites

[MENTION=569]Salsa[/MENTION]This was changed in the strings.lua file but did not get exported to the current strings.pot fileIt now reads for WX78: "I CAN REBOOT IN THERE" and generic is now: "I get crazy when I don't sleep."

Link to comment
Share on other sites

  • Developer

[MENTION=2]Bigfoot[/MENTION]Um....yeah....told you so! :DThere is just sooo much text in the game that keying off of it versus the internal ids just does not make sense.BUT this really should not be a big deal....There is nothing wrong with having 2 po entries whose text are the same, i.e. "Light", they just have to have unique "#:" ids, not msgid's.#. STRINGS.ACTIONS.LIGHT#: STRINGS.ACTIONS.LIGHTmsgid "Light"msgstr ""#. STRINGS.TABS.LIGHT#: STRINGS.TABS.LIGHTmsgid "Light"msgstr ""It should not matter what POedit keys of off as that program is focused on translating the text and when sorting the above you see 2 entries with the same text to translate....all good.

So I investigated this. If I create a string.pot file with duplicates like:#. STRINGS.ACTIONS.LIGHT#: STRINGS.ACTIONS.LIGHTmsgid "Light"msgstr ""#. STRINGS.TABS.LIGHT#: STRINGS.TABS.LIGHTmsgid "Light"msgstr ""and you try to use that as a POT file to update your translation, POEdit automatically complains and strips the duplicates. Basically I made all the scripts work as described, but POEdit pukes all over it.So a few solutions that I see:1) Live with a few annoying translation issues like "Light"2) Don't use POEdit and find another PO editor that doesn't throw up all over the duplicates3) Set up the strings like this instead:#. STRINGS.TABS.LIGHT#: "Light"msgid "STRINGS.TABS.LIGHT"msgstr ""Except when you do that POEdit makes it way harder to translate as it shows up in that little window on the bottom right4) Use a different system entirely.For the next 2 weeks at least, I'm probably going to go with (1), then we'll see. By the way, I use "createstringspo.lua" to create the POT file. If you have lua installed, just run that file.Blech!
Link to comment
Share on other sites

[MENTION=2]Bigfoot[/MENTION]I hope you have left work already and blissfully forget all this nonesense for the next two weeks....I'll play around with this....I added the duplicated to a po file so figured the pot file would be fine....what was that expression about assuming? :DNo worries, we'll find a way to make this po business work....whether it likes it or not! :lol:

Link to comment
Share on other sites

Ok...having done some more reading and testing....

I know believe the correct po/t format we should use is....

#. STRINGS.ACTIONS.LIGHT

msgctxt STRINGS.ACTIONS.LIGHT

msgid "Light"

msgstr ""

#. STRINGS.TABS.LIGHT

msgctxt STRINGS.TABS.LIGHT

msgid "Light"

msgstr ""

i.e. because we have some msgid's that are the same then use the "context" option to differentiate them (and use this id when importing to match up to the internal strings data structure)

But alas, of course.....PoEdit nor seemingly any other Windows based po editor supports this option in the po file format....which I find rather ridiculous but whatever. :S

So...since POedit is on github....maybe one of the lurking programmers on this forum could take on the task of making a DS fork of POedit to add support for this? Yeah, thought not. :(

Why must the simplest of things always be so difficult.

Link to comment
Share on other sites

[MENTION=10271]WrathOf[/MENTION] PO Edit removes the string right? I mean I can see the ID string, I can see the original text and there's a place for the translated text. i can figure out the context by reading the ID but I see the problem.I guess I'm not aware of anything better tha PO edit, right now. Have you tried GTed? It's an Eclipse plugin though.

Link to comment
Share on other sites

[MENTION=569]Salsa[/MENTION],I checked over POedit's bug tracker....an entry implied that support for msgctxt (which is not in the current po/t files you all have) was added but after some testing, I found that it ignores the info and strips it out when saving po files.Ok, well thought I'd ask in case you had more experience with these types of programs. I'll take a look at GTed....thxI went ahead and commented on the related POedit bug entry so hopefully this will get addressed eventually.I am thinking for now, we may just have to live with editing the po files directly....but Notepad does not support unix line feeds either....arg....I hope Notepad++ does....this is getting soo tiresome. :S

Link to comment
Share on other sites

Ok, finally ironed this po business out. I goofed on the syntax for the msgctxt field...the correct syntax works in POedit....derp.

In any case, I am currently working on providing a new version of the strings.pot file that includes *all* items defined in the strings.lua file. The new version can be used for new translations and for updating existing ones. (after upgrade)

In addition, I will need to upgrade any existing language po files "in the wild" to the new format required to address the missing duplicates issue.

Beyond that, the language mods will have to use a new mod (similar to my Alternative Fonts one) that upgrades the way the game handles po files so it can use the new format.....at least until Bigfoot gets back and this change can be incorporated into the base game.

I'll post here when I have all of this setup for use. Stay tuned. :D

Link to comment
Share on other sites

[MENTION=14857]Macbet[/MENTION]

Not at this time, even if you make an alternative font, the game does not support unicode or other code pages other than the western one.

Would a "romanized" russian translation be of any use? Is knowledge of that version of russian widespread enough to be worthwhile?

Link to comment
Share on other sites

I would like to translate this great game into Russian, but I suspect that Russian, not in ascii can I use other fonts? or are in any other ways to transfer?

i could help maybe but first i need to check out the russian translation first. [MENTION=14857]Macbet[/MENTION], maybe you could translate it into 100% russian.regardsDontStarver Edited by dontstarver.wiki
Link to comment
Share on other sites

In our Russian community of about 3.5 thousand people, the benefits may not be, but it's worth itfor 2-3 days, I do the translation, at the moment I have 26% translated

Edited by Macbet
Link to comment
Share on other sites

Just in time for the new update...I have finally ironed out a replacement for the game's language translator to support a new PO file format that can handle *all* of the entries in the strings.lua file.Please refer here for more information....New PO File Translator ModI will be posting upgraded versions of the po file used by existing language mods but anyone that is working on a translation (strings.lua, newlanguage.lua or newlanguage.po) should contact me so I can get your file upgraded to this new format.Once the new game update is available, I will post new versions of the included stringsv2.pot and english.po files so you can translate all entries defined in the latest strings.lua file. [MENTION=8]Kevin[/MENTION] and [MENTION=2]Bigfoot[/MENTION] (when you get back)Please review this mod to determine if the code is suitable for incorporating into the game. I think I have noted it enough to be clear on what I am doing and why. I was able to add support for the old and new formats so I felt it was ok to get this posted in preparation for the pending game update. Also, I have a script for upgrading old format po files to the new format that I can share.

Link to comment
Share on other sites

Sorry to write here, but I have one idea that will not replace Unicode, but it will give users the ability to play in their language.Representatives of Serbo-Croatian, Slovenian, Czech, Slovak, Polish, Upper and nizhneluzhitskogo, Hungarian, Romanian. Ukrainian, Belarusian, Serbian, Macedonian and Bulgarian, Greek, Turkish, Estonian, Latvian and Lithuanian,please contact me, unless there are any, I will try to help you run your tongue in the game

Link to comment
Share on other sites

[MENTION=8]Kevin[/MENTION]I have reviewed my new PO file format mod and updated it for the Rain release.This will allow the translators to handle *all* entries found in the strings.lua file versus what you are shipping.Please review and give me feedback on how else I can be of help on this. If Bigfoot get's back in time, hopefully this change can be integrated into the game directly before the next release instead of having to use a mod.Thanks

Link to comment
Share on other sites

I'm currently writing a mod which will sometimes make characters saying different strings. How should I create this strings in my mod in "right" way, so translators will be able to translate it in the same way as they was translating original strings?

Link to comment
Share on other sites

[MENTION=1020]AlexXsWx[/MENTION]This concept has not been addressed yet and I have not had a chance to upgrade my Sanity Creatures Speech mod to provide an example.I wrote a script to export the STRINGS table to the new v2 format but we need something specific to a mod's new strings. If you do not have too many new text items you could create the pot file manually for the translators to import into their po files.So in modmain:

--Localize global variables from game's environmentSTRINGS = GLOBAL.STRINGS--Add strings for our new prefabSTRINGS.NAMES.MYNEWPREFAB = "My New Prefab"STRINGS.RECIPE_DESC.MYNEWPREFAB = "Make my new prefab!"STRINGS.CHARACTERS.GENERIC.DESCRIBE.MYNEWPREFAB = {GENERIC = "That's my new prefab!"}

And in a mynewprefabv2.pot file

#. STRINGS.NAMES.MYNEWPREFABmsgctxt "STRINGS.NAMES.MYNEWPREFAB"msgid "My New Prefab"msgstr ""#. STRINGS.RECIPE_DESC.MYNEWPREFABmsgctxt "STRINGS.RECIPE_DESC.MYNEWPREFAB"msgid "Make my new prefab!"msgstr ""#. STRINGS.CHARACTERS.GENERIC.DESCRIBE.MYNEWPREFAB.GENERICmsgctxt "STRINGS.CHARACTERS.GENERIC.DESCRIBE.MYNEWPREFAB.GENERIC"msgid "That's my new prefab!"msgstr ""

or older format if you don't want to use my New PO Translator mod :Sin a mynewprefab.pot file

#. STRINGS.NAMES.MYNEWPREFAB#: STRINGS.NAMES.MYNEWPREFABmsgid "My New Prefab"msgstr ""#. STRINGS.RECIPE_DESC.MYNEWPREFAB#: STRINGS.RECIPE_DESC.MYNEWPREFABmsgid "Make my new prefab!"msgstr ""#. STRINGS.CHARACTERS.GENERIC.DESCRIBE.MYNEWPREFAB.GENERIC#: STRINGS.CHARACTERS.GENERIC.DESCRIBE.MYNEWPREFAB.GENERICmsgid "That's my new prefab!"msgstr ""

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...