Bay 12 Games Forum

Dwarf Fortress => DF Modding => Topic started by: insolor on May 03, 2012, 01:42:10 pm

Title: Dwarf Fortress localization patch
Post by: insolor on May 03, 2012, 01:42:10 pm
Greetings!
For a few months I'm working on a utility that replaces strings hardcoded in Dwarf Fortress.exe with ones it get from an external file, ie. it can be used to translate Dwarf Fortress to some language other than English (in particular we are working on Russian translation of DF). If someone interested I will provide additional info.
Title: Re: Dwarf Fortress localization patch
Post by: Tierre on May 03, 2012, 01:48:48 pm
Wow i'd like to see Russian version of DF. Though grammar would be a real pain. Maybe i'd be able to make my wife ply it at last:)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on May 03, 2012, 02:29:56 pm
You are right. Because of grammar differences between English and Russian, almost every report looks improperly. At least we can correctly translate whole phrases in menus, dialogs etc. Another problem is that the "Thoughts and Prefences" screen still can't be output with TTF font, so there's no a simple solution how to use cyrillic there.

There's some screenshots:
Spoiler (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: IamanElfCollaborator on May 03, 2012, 02:33:43 pm
I know this might not be on your list of targets, but Tagalog localization might be possible? In case there might be that small niche of players who speak that primarily. Just placing it here as a suggestion.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on May 03, 2012, 02:44:45 pm
I know this might not be on your list of targets, but Tagalog localization might be possible? In case there might be that small niche of players who speak that primarily. Just placing it here as a suggestion.
Wikipedia says that Tagalog currently uses Latin writing system, so it won't be very difficult to make localization. Of course translation of text strings is up to you and anyone interested, I can only provide the utilty program.
Title: Re: Dwarf Fortress localization patch
Post by: IamanElfCollaborator on May 03, 2012, 02:57:02 pm
Ah, good, I'm willing to help out on translation on various languages. I'll be using various translators and dictionaries, but this is a good thing to have for those niche players who can't speak English too well.
Title: Re: Dwarf Fortress localization patch
Post by: AVE on May 03, 2012, 03:01:42 pm
Binary l10n is always a pain, especially with languages whose word sizes differ when translated. It is an extremely hard work, and not always successful. Be strong and don't give up!

BTW, binary patches (and partial disassembly) might require Toady One permission. Just sayin'.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on May 03, 2012, 04:59:44 pm
Binary l10n is always a pain, especially with languages whose word sizes differ when translated.
If memory serves me, about 25 percent text strings translated in Russian are much longer then corresponding original strings. That was rather tricky, but I've solved the problem.

BTW, binary patches (and partial disassembly) might require Toady One permission. Just sayin'.
I've just sent him a letter e-mail.
Title: Re: Dwarf Fortress localization patch
Post by: teloft on November 05, 2012, 04:42:00 pm
Hey, what's is new with the language translations stuff?

I saw this tread on the:
http://www.bay12forums.com/smf/index.php?topic=60742.30


What I like is some way to translate DF to my local Icelandic so that I can let the little people play the game. But there is some problems with the files that are locked.
Title: Re: Dwarf Fortress localization patch
Post by: muange on March 02, 2013, 02:32:08 am
so, what is that 'utillity'?
if you finished making that utility, can u send it to me?
i'm trying to translate DF to other languge
Title: Re: Dwarf Fortress localization patch
Post by: Mesa on March 03, 2013, 10:15:00 am
I could do a Polish localization of Dwarf Fortress, maybe even single-handily, BUT BOY, it would be the worst translation ever.
Polish is a very, VERY context-heavy language (every single word has at least 7 or so forms depending on context of the sentence)

Let me give you an example (COMRADES, BEWARE!):
"góra" (pronunciation (http://upload.wikimedia.org/wikipedia/commons/b/bd/Pl-góra.ogg)) ("mountain" and "up").
"To jest góra." ("This is a mountain.")
"Tu nie ma góry." ("There is no mountain here.")
"On jest na górze." ("He is on the mountain." OR "He is upstairs.")

Translating it to make it work in Dwarf Fortress is crazily hard, if not impossible.
While Dwarf Fortress IS hard by definition, one would need to rewrite most of the game's code to make it work - and it probably wouldn't be worth the hassle.

That's the problem with most games that use pseudo-random generation (of text).
While Minecraft succeeded at translating the game (but still no proper Polish font is available - there IS a Polish font support, but it's not the Minecraft-style pixelated font), it did so only because of lack of randomly generated text.

Enough of derailing...
Title: Re: Dwarf Fortress localization patch
Post by: Meph on March 03, 2013, 01:29:17 pm
A while ago I did send the source code of my GUI to someone, and he said the russian masterwork mod is about 50% done... I saw screenshots, it works. :)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on March 04, 2013, 10:33:27 am
The utility is mostly completed since last August. But currently it needs some changes to support languages other then Russian. I am going to do latin version after a couple weeks, and then add support for custom codepages (currently the utility has only cyrillic codepage support).

As for noted localization problems, probably most of the East-European languages will have the same problems with declination. However for now most of menus and static inscriptions are translated more or less adequately.

The problematic places are:

Furthermore, order of words in names of various objects must be reversed to avoid necessity of declination, eg. "X of steel" ("ботинки из стали", "шлем из стали", "кольчуга из стали" еtc.) instead of "steel X" ("стальные ботинки", "стальной шлем", "стальная кольчуга" etc.)
Currently this problem is nearly impossible to overcome.

A while ago I did send the source code of my GUI to someone, and he said the russian masterwork mod is about 50% done... I saw screenshots, it works. :)
As far as I know russian masterwork mod uses my localization patch. Someone I know under Rian Ashes nickname said he is going to translate the masterwork mod :)
Moreover, we already translated Dwarf Therapist and made Soundsence to understand russian messages (thanks to Soundsence developer).
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 12, 2013, 05:42:14 am
Quote from: PM
Hey, found your thread on the forums, I'm interested on making a Lithuanian (at least partial) localization. Any chance I could get my hands on your program? Did you add Latin characters yet?
It's better to say, "did you remove cyrillic characters?" :) It's not so hard to do. The greater problem for me is how to name the new utility? For now it is called dfrus, it's obvious that the universal utility needs another name.
Anyway I am going to show you the program this weekend. Trust me ;)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 14, 2013, 03:53:07 am
So, there is the utility: https://bitbucket.org/dfint/df-i18n/downloads/df-i18n.zip
The package contains two files: dfint.exe and template.lng, the utility itself and the template of language file appropriately.
You must rename template.lng as you wish, then change it's first line.
The first line contains the name of a copy of the Dwarf Fortress executable, that will be patched. The original Dwarf Fortress.exe won't be changed.
The remaining part of the language file looks like:
Code: [Select]
|Activity|Activity|
|Training Session|Training Session|
|Activity Event|Activity Event|
|Go to Combat Training|Go to Combat Training|
|Organize Combat Training|Organize Combat Training|
|Lead Combat Training|Lead Combat Training|
|Wait for Combat Training|Wait for Combat Training|
...

To translate some string you must change the text after the second | , i.e.:
Code: [Select]
|Activity event|Ytivitca tneve| some comment hereBe careful with lines that ends with ==. The length of translation in that lines must be the same as the length of the original string to prevent the game from crash.

To apply your translation to the DF, place the dfint.exe and your .lng file to the directory that contains Dwarf Fortress.exe and then execute dfint.exe. The changed DF executable with the name from the first line of your .lng file will be appeared.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on April 24, 2013, 10:22:09 am
I just tested this, and it enables a lot of things of interest to people with total conversions. You can rename everything with this, all vanilla things. All vanilla reactions, even procedually generated demons, titans and FBs. You can make steampunk-themed FBs and alien-titans with this if you so desire. Or make clowns actual clowns, at least from the name.

Same with reactions. I know the Necromunda total conversion uses "brew drink" to make clean drinking water, so it could be renamed to "clean water". Or rename it to "press juice", if you play humans that dont need booze.

Same with furniture. Instead of doors you could make "vault doors", for the fallout mod. And replace "a vile force of darkness" with "a marauding group of supermutants" ;)

You can also hide endless amounts of easter eggs with this in the game. "Winter is upon you" turns to "Ned Stark was right: Winter is coming"

All in all, a very powerful tool.

EDIT: Proof of concept:
(http://i.imgur.com/gpouANy.png)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 24, 2013, 10:42:20 am
I just tested this, and it enables a lot of things of interest to people with total conversions. You can rename everything with this, all vanilla things. All vanilla reactions, even procedually generated demons, titans and FBs. You can make steampunk-themed FBs and alien-titans with this if you so desire. Or make clowns actual clowns, at least from the name.

Same with reactions. I know the Necromunda total conversion uses "brew drink" to make clean drinking water, so it could be renamed to "clean water". Or rename it to "press juice", if you play humans that dont need booze.

Same with furniture. Instead of doors you could make "vault doors", for the fallout mod. And replace "a vile force of darkness" with "a marauding group of supermutants" ;)

You can also hide endless amounts of easter eggs with this in the game. "Winter is upon you" turns to "Ned Stark was right: Winter is coming"

All in all, a very powerful tool.
I even didn't suppose such an application for the tool :D From this point of view it opens new horizons for modding :)
Title: Re: Dwarf Fortress localization patch
Post by: Meph on April 24, 2013, 10:45:42 am
Well, I did.  :D

And it works beautifully. Not sure how much this is suitable for normal mods, but some bigger projects and/or total conversion can use this for quite a few things. Its just a lot of work to read through the text and change things without messing anything up. After all, its 12,000 lines of text.  :o

But yeah, thank you. :) This is one more tool for intrepid modders, opening previously closed doors.

EDIT: Still reading, some really interesting parts in there. Werebeasts and Vampires, all body descriptors, seasonal announcements, texts from liaison and diplomats, these:
Quote
|An ambush!  Drive them out!|An ambush!  Drive them out!|
|Thief!  Protect the hoard from skulking filth!|Thief!  Protect the hoard from skulking filth!|
|An ambush!  Skulking vermin!|An ambush!  Skulking vermin!|
|An ambush!  Curse all friends of nature!|An ambush!  Curse all friends of nature!|
|An ambush!  Curse them!|An ambush!  Curse them!|

I have never even seen the ambush, skulking vermin... that must be from a kobold ambush.

EDIT2: OMG. Professions. Anyone wants Mage-labor, Sorcery, Poison making, Priests or Praying in there?

ITS LIKE CHRISTMAS!!!

Spoiler (click to show/hide)

EDIT3: Yep, works. :D :D :D

(http://i.imgur.com/BqlfwxD.png)

EDIT4: Also interesting:
|Toys|Toys|
|Tools|Tools|
|Instruments|Instruments|

could be made into

Toys|Electronic
Tools|Tools
Instruments|Machinery

And voila, Fallout/Steampunk mod. Just take all vanilla toys/instruments and replace them with the actual items you want to use.

|Statue|Statue| to |Statue|Computer|. Add to the bookkeeper noble. "You bookkeeper requires a computer". Remake statue garden to computer room. Rename party to lan party. "Your bookkeeper has organized a LAN party at the computer room." LOL
Title: Re: Dwarf Fortress localization patch
Post by: Vherid on April 27, 2013, 11:32:47 pm
Well this is certainly interesting.
Title: Re: Dwarf Fortress localization patch
Post by: cainiao on April 28, 2013, 06:17:45 am
I know some DFfans in China had already done a simplified chinese localization version.
Perhaps you could ask them for some help?
Spoiler (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 28, 2013, 06:47:35 am
I know some DFfans in China had already done a simplified chinese localization version.
Perhaps you could ask them for some help?
Spoiler (click to show/hide)
I haven't hear about Chinese localization before.
Could you give me some link please?
It's obvious they are going another way, not binary patch. There are no "Slaves to Armok:" nor "Chapter II: Dwarf Fortress" strings unobfuscated in the Dwarf Fortress.exe.
Probably they modified sdl_ttf.dll or something like that.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on April 28, 2013, 07:04:25 am
Quote
There are no "Slaves to Armok:" nor "Chapter II: Dwarf Fortress" strings unobfuscated in the Dwarf Fortress.exe.
Thats exactly what I thought... not that I tried finding those, no... never... ^^
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 28, 2013, 11:01:24 am
I found this page: http://bbs.3dmgame.com/thread-3635876-1-1.html
As far as I understood, he is going in parallel to us: he made patched version of Dwarf Fortress.exe (I guess manually), and now he is trying to make modified version of sdl_ttf.dll.
Perhaps we can help each other.
Title: Re: Dwarf Fortress localization patch
Post by: MaximumZero on May 06, 2013, 02:40:44 pm
This is ridiculously awesome. PTW.
Title: Re: Dwarf Fortress localization patch
Post by: LordBaal on May 06, 2013, 02:58:44 pm
Wait, what about string length? Does that mean that for example if I want to translate "Carpenter's workshop" (20 chars), that in Spanish would be "Taller de carpintería" or "Taller del carpintero" (both 21 char), then I could only write "Taller de carpinterí" or "Taller del carpinter"?

Other way less convoluted to ask, if a string is 20 chars long, at the moment of translation I need to replace it for exactly for a word(s) 20 chars long? Can't it be more (21), or less (19)?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on May 06, 2013, 11:15:16 pm
Wait, what about string length? Does that mean that for example if I want to translate "Carpenter's workshop" (20 chars), that in Spanish would be "Taller de carpintería" or "Taller del carpintero" (both 21 char), then I could only write "Taller de carpinterí" or "Taller del carpinter"?

Other way less convoluted to ask, if a string is 20 chars long, at the moment of translation I need to replace it for exactly for a word(s) 20 chars long? Can't it be more (21), or less (19)?
In the most cases string length doesn't matter (within reason, of course). There are some problematic strings, which length must be the same as in the original, most of them are marked with == at the end of line, some are yet to be discovered.
Title: Re: Dwarf Fortress localization patch
Post by: Deon on June 23, 2013, 01:32:11 pm
I seem to be unable to translate the (Start Playing->) Dwarf Fortress option. The included "Dwarf Fortress" when changed to something like "Vault mode" does not produce the desired result.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on June 24, 2013, 12:36:33 am
Its encrypted, but ask Quietust. He found and uncrypted it, and can change it, its more WTF-text then string dump. ;)

And btw, if you really want to change that, let me know how it went. :)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on June 24, 2013, 03:15:16 am
I seem to be unable to translate the (Start Playing->) Dwarf Fortress option. The included "Dwarf Fortress" when changed to something like "Vault mode" does not produce the desired result.
The included "Dwarf Fortress" affects only on the window's caption. The text you are searching is encrypted as Meph already said.
Title: Re: Dwarf Fortress localization patch
Post by: Halfling on June 24, 2013, 05:15:45 am
Very cool idea. To do this on linux for the linux version: you maybe don't need any extra programs. Sample:

cd df_linux/libs
strings Dwarf_Fortress > stringdump.txt


(http://s9.postimg.org/h0xdj2n3z/Screenshot_06242013_12_58_44_PM.png)

sed -i 's/Your\ Civilization/Harmless\ Pumpkins/g' Dwarf_Fortress

(http://s9.postimg.org/6cp16hnr3/Screenshot_06242013_01_03_17_PM.png)

I am not smart enough to know whether this is an equivalent method. Sorry if that was obvious to everyone.
Title: Re: Dwarf Fortress localization patch
Post by: Jaso11111 on August 27, 2013, 12:50:20 pm
So where can i download this? I wish too use it for my own mod (with the author's permission of course).
Title: Re: Dwarf Fortress localization patch
Post by: Putnam on August 27, 2013, 04:01:29 pm
http://www.bay12forums.com/smf/index.php?topic=108721.msg4175521#msg4175521
Title: Re: Dwarf Fortress localization patch
Post by: Jaso11111 on August 28, 2013, 05:47:28 am
http://www.bay12forums.com/smf/index.php?topic=108721.msg4175521#msg4175521
Oh...


Dont you just hate it when you are blind  :-[
Title: Re: Dwarf Fortress localization patch
Post by: Meph on August 30, 2013, 12:57:57 am
Say, what happens to this when DF is updated? I assume the utility has to be changed, at the very least the string-dump...

Just asking, because I cant really update my mod without this. ^^
Title: Re: Dwarf Fortress localization patch
Post by: Putnam on August 30, 2013, 01:46:41 am
Yes, both. You'll also have to wait for DFHack :D
Title: Re: Dwarf Fortress localization patch
Post by: Meph on August 30, 2013, 01:51:16 am
And Therapist, and isoworld, embark everywhere, nano fortress, stonesense, quickfort, and the updates for the updates because Toady release 3 bug-fix versions in the meantime. ^^
Title: Re: Dwarf Fortress localization patch
Post by: Putnam on August 30, 2013, 02:20:19 am
If it helps, I'm pretty sure DFHack has Embark Everywhere now. I think maybe nano, too? It has a Quickfort clone, as well. Stonesense is also included in DFHack. There's a therapist clone in it, too.

Hehe, fun.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on August 30, 2013, 02:48:45 am
Ui, if nanofortress and embark everywhere could be run automatically when entering the site-selector (together with a opo-up asking about number of dwarves and embark points) that would be fancy indeed. :)

The Quickfort and Therapist in dfhack is lacking in user-interface though, so the original it has to be.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 13, 2013, 08:17:11 am
Say, what happens to this when DF is updated? I assume the utility has to be changed, at the very least the string-dump...

Just asking, because I cant really update my mod without this. ^^
The utility will work as is without any modifications, assuming that DF will be compiled with the same compiler as previously. Of course the string-dump has to be updated.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on September 13, 2013, 08:32:20 am
Thanks for the answer. I assume that the dfhack crew and other smart people will be able to find the string-dump. One way or another, I will write you a PM if an update happens... not that there wasnt one for over a year. ^^
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 14, 2013, 08:53:04 am
Another tool for i18n and modding:
https://bitbucket.org/dfint/changetextpy/downloads

In short: Download it and unpack into DF folder, then run install_fake_ttf.bat.
This will rename SDL_ttf.dll to Real_ttf.dll and newly unpacked Fake_ttf.dll to SDL_ttf.dll.
Run the bat-file again and the names will be restored.

What does it do:

When DF wants to render some text (assuming that [TRUETYPE:YES]), it calls a couple of functions from SDL_ttf.dll. The SDL_ttf.dll replaced with our Fake_ttf.dll at first passes the text it get from DF to the ChangeText.dll, that uses a Python script in turn to translate the text or change it in some way.

An example of a script and the result see below
(http://thumbnails105.imagebam.com/27592/b0ba25275919707.gif) (http://www.imagebam.com/image/b0ba25275919707)

Update 1:
Added output of the Python error message when the changetext.py module import failed (eg. "SyntaxError: invalid syntax" or "ImportError: No module named 'changetext'")
Title: Re: Dwarf Fortress localization patch
Post by: Meph on September 14, 2013, 11:43:18 am
So this new utility does effectively the same as the old one, but can also translate the menu-text, which was slightly encrypted before...

Does it lead to crashes, like the localisation patcher, if you change the length of certain strings? I had some mean crashes after I changed death-messages... my versions were too long it seems.
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on September 14, 2013, 12:36:06 pm
You don't give this thing enough credit, Meph.

Spoiler (click to show/hide)

You can just point to a piece of text on your screen and say "This needs to be that instead." It also may be a smidge more safer than prodding around in the executable, since you're just taking a magic marker to the finished package instead of manipulating the starting conditions to make it come out right.
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on September 14, 2013, 01:10:27 pm
Oh and @insolor:

I can't seem to add new lines to the "phrases" part. I can replace the contents of the ready ones with other stuff and everything works just fine, but having one more line than default inside phrases{...} makes it spit up an error at startup and not change anything.

Do you need to declare the amount of altered strings somewhere or am I offending Python in some way?
Title: Re: Dwarf Fortress localization patch
Post by: Meph on September 14, 2013, 02:29:38 pm
Well yes, but how does that differ from translating the string dump? I know that you can do it on-the-fly, but I mean for the average player of the mod...

btw, is this your way of saying that seperate should be separate? :P
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 14, 2013, 02:34:30 pm
Oh and @insolor:

I can't seem to add new lines to the "phrases" part. I can replace the contents of the ready ones with other stuff and everything works just fine, but having one more line than default inside phrases{...} makes it spit up an error at startup and not change anything.

Do you need to declare the amount of altered strings somewhere or am I offending Python in some way?
If you mean "Error: Failed to import changetext.py module", this is probably because of syntax errors in the module, eg. missing comma between key:value entries.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 14, 2013, 03:21:17 pm
Does it lead to crashes, like the localisation patcher, if you change the length of certain strings?
It doesn't and it's the first advantage. Strings that are too long are just truncated. The truncation occurs because the width of "plate" on which text is drawn calculates as width of some "wide" letter multiplied by the original text length. (Btw, we get black tails after end of text in the game for non-monotype fonts by the same reason: plates turn way longer than text they contain)
On another hand in most cases patch can make text much longer then Fake_ttf.dll do.

As for me (as a localizer), the main advantage is that SDL_ttf.dll gets text already prepared to output (ei. it gets whole phrases instead of separate words), so that we can affect on the sentence building logic, we can decline words according to genders and cases, etc.

/Never mind if I get confused in phases somewhere, it's still hard to me to communicate in English/
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on September 14, 2013, 03:27:57 pm
If you mean "Error: Failed to import changetext.py module", this is probably because of syntax errors in the module, eg. missing comma between key:value entries.

That's what it was. Thank you.

btw, is this your way of saying that seperate should be separate? :P

Spoiler (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: Meph on September 14, 2013, 04:06:18 pm
Quote
(Btw, we get black tails after end of text in the game for non-monotype fonts by the same reason: plates turn way longer than text they contain)

Does this mean it can fix some of the TTF display errors?

For Example:
"Make magenta bricks from blocks (4)" is so long ingame, that it overwrites the 'R' and 'S', the repeat and suspended letters. But the TTF version is short enough not to block them. Usually, DF would still overwrite the 'R' and 'S', because the Non-TTF version is long enough to overwrite them. But with this new utility of yours it wouldnt be the case anymore?

Hope that was somehow clearer in writing then in my head. :P
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 14, 2013, 05:34:23 pm
Does this mean it can fix some of the TTF display errors?

For Example:
"Make magenta bricks from blocks (4)" is so long ingame, that it overwrites the 'R' and 'S', the repeat and suspended letters. But the TTF version is short enough not to block them. Usually, DF would still overwrite the 'R' and 'S', because the Non-TTF version is long enough to overwrite them. But with this new utility of yours it wouldnt be the case anymore?

Hope that was somehow clearer in writing then in my head. :P
Nope, it cannot. Toady One can. Or some person who can fix the problem inside the game without having source code.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on September 15, 2013, 01:47:45 am
Oh, ok.  :-[

It would have been a lot of work anyway, not worth the trouble, I just wanted to know if it exists. So when it comes down to it, it doesnt add new features, at least from the stand point of the end user. Regardless of using the first or second utility, the product will stay the same.

EDIT: Actually... string dump replacement sometimes results in hacked together things, because it doesnt have complete sentences, but single words... like "earrring", which has the plural of "earrings". I changed "earring" to "hourglass", and the plural suddenly is "hourglasss", because I cant tell it to add ES instead of S. So this I could fix...
Title: Re: Dwarf Fortress localization patch
Post by: Meph on July 17, 2014, 12:20:59 am
Super-epic-necro-of-necroness

Because... without this utility updated to be used with DF2014, updating MasterworkDF is pretty difficult. ;)
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on July 17, 2014, 02:40:29 am
It still works, homes. Extract a string dump from the running 34.11 .exe, extract a string dump from the running 40.03 .exe, slap both into a file comparison utility and write the new/changed tags into template.lng.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on July 17, 2014, 03:25:14 am
Quote
extract a string dump from the running 40.03 .exe
How?
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on July 17, 2014, 04:19:36 am
I used Process Explorer. If you open the Properties on a running process, you can view the plaintext strings inside it and save them to a text file.

It seems the "extraction" is a little messy and sometimes loses letters from the beginnings of sentences, but anything that looks off can be cross-referenced with the original stringdump.txt graciously formatted by Insolor himself (https://bitbucket.org/dfint/df-i18n/downloads) and sorted out.

In any case, not a lot got deleted outright, so whatever you have right now should work without destroying everything. Mostly it's the order getting scrambled a bit and a big lump of new stuff going in, particularly the conversation bits.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on July 17, 2014, 04:22:01 am
Thank you, I will try it out, and if I can, upload a working version for 40.x :)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 17, 2014, 11:39:54 am
Just uploaded string dumps for 0.40.2, 0.40.3 (and 0.34.11 too):
https://bitbucket.org/dfint/df-i18n/downloads
Spoiler: About "IDs" (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on July 17, 2014, 11:41:08 am
You're too good for us.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 18, 2014, 06:15:00 am
Btw, are there anybody who tried to translate DF into languages other then Russian and Chinese?
Please, share ;)

Spoiler: OT (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on July 18, 2014, 08:31:26 am
You didn't exactly foster a golden age of Dwarf Fortress localization, I'm afraid. You just facilitated wonderful changes like "modifiable proc-gen creatures" and "no more walls of text in description screens":

Spoiler (click to show/hide)

Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 20, 2014, 03:41:47 pm
https://bitbucket.org/dfint/df-i18n/downloads
Uploaded string dump for DF 0.40.04
Updated older ones (some cleanup have been made)
Title: Re: Dwarf Fortress localization patch
Post by: Meph on July 20, 2014, 06:12:04 pm
You didn't exactly foster a golden age of Dwarf Fortress localization, I'm afraid. You just facilitated wonderful changes like "modifiable proc-gen creatures" and "no more walls of text in description screens":

Spoiler (click to show/hide)
How did you get the line breaks in the item description?

https://bitbucket.org/dfint/df-i18n/downloads
Uploaded string dump for DF 0.40.04
Updated older ones (some cleanup have been made)
Thank you. :)
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on July 20, 2014, 07:08:55 pm
How did you get the line breaks in the item description?

Very carefully.




























Turns out, the description screens operate with the same text viewer mechanism as the help screen. And you remember the weird tags that control colors and line formatting in the decoded help files, right?

Spoiler (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 20, 2014, 11:30:57 pm
decoded help files
Thank you for mention. We had some untranslated parts of text (specifically announcements). I've just searched the forum and found some useful posts about this.
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on July 21, 2014, 04:07:49 am
I can't know what information you found or are still missing, but here's the translator.pl that Putnam very kindly handed off to me, just in case. This thread is all about farting around in the forbidden zone, after all.

Code: [Select]
#!/usr/bin/perl

# Script to encode and decode the Dwarf Fortress compressed
# announcement / help / dipscript files.
#
# Released into the public domain by Ilmari Karonen (Vyznev).
# Do whatever you want with it.
#
# Usage: Run once in your main DF folder with the --reverse switch to
# decode all compressed files from data/ to data_src/.  After editing
# the decoded text files, run without the --reverse switch to update
# the compressed files.  See below for more options.

use strict;
use warnings;
use Compress::Zlib qw'compress uncompress $gzerrno';
use Getopt::Long qw'GetOptions';

my $basedir = ".";
my $datadir = "data";
my $textdir = "data_src";

my $usage = <<"END";
Usage: $0 [options] <subdir(s)>
Options:
  --reverse, -r
    Decode compressed files into text files, rather than the opposite.
  --force, -f
    Overwrite target files even if they are newer than the source files.
  --quiet, -q
    Print nothing unless something goes wrong.
  --verbose, -v
    Show exactly what is being en/decoded.
  --basedir=<dir>, -d <dir>
    Look for the data/text directories under <dir> instead of "$basedir".
  --datadir=<dir>
    Subdirectory containing compressed data files (default: "$datadir").
  --textdir=<dir>
    Subdirectory containing uncompressed text files (default: "$textdir").
The remaining arguments should be file or directory names found under the
data/text subdirectories.
END

GetOptions( 'r|reverse'   => \my $reverse,
            'f|force'     => \my $force,
            'q|quiet'     => \my $quiet,
            'v|verbose'   => \my $verbose,
            'd|basedir=s' => \$basedir,
            'datadir=s'   => \$datadir,
            'textdir=s'   => \$textdir,
    ) or die $usage;

undef $quiet if $verbose;

# strip trailing slashes, strip base dir names from subdirs
# XXX: this is kind of a kluge, but allows use of command line completion and/or shell wildcards for subdirs
s!/*$!! for $basedir, $datadir, $textdir;
s!^\Q$basedir\E/!!, s!^(\Q$datadir\E|\Q$textdir\E)/!! for @ARGV;

$_ = "$basedir/$_" for $datadir, $textdir;
my $srcdir = ($reverse ? $datadir : $textdir);
my $dstdir = ($reverse ? $textdir : $datadir);

die "Source directory $srcdir not found.\n" unless -d $srcdir;
mkdir $dstdir or die "Error creating target directory $dstdir: $!\n" unless -d $dstdir;

my %skipdirs = ("." => 1, ".." => 1);  # don't recurse into these directories!

# traverse the directories:
my @stack = (@ARGV ? reverse @ARGV : ".");
while (@stack) {
    my $name = pop @stack;
    # catch errors with eval, resume from next entry:
    eval {
        my $srcpath = "$srcdir/$name";
        my $dstpath = "$dstdir/$name";
        s!(^|/)(\./)+!$1!g for $srcpath, $dstpath;  # strip useless /./ from paths

        if (!-e $srcpath) {
            warn "$srcpath does not exist.\n";
        }
        elsif (-d _) {
            # make sure the target directory exists:
            unless (-d $dstpath) {
                mkdir $dstpath or die "Error creating $dstpath: $!\n";
            }
            # push contents of source directory on stack:
            opendir DIR, $srcpath or die "Error opening directory $srcpath: $!\n";
            push @stack, reverse map "$name/$_", grep !$skipdirs{$_}, readdir DIR;
            closedir DIR, $srcpath or die "Error opening directory $srcpath: $!\n";
        }
        else {
            # assume it's a file:
            if ($reverse) {
                die "$srcpath already has .txt suffix, skipping.\n" if $srcpath =~ /\.txt$/;
                $dstpath .= ".txt";
            } else {
                die "$srcpath doesn't have a .txt suffix, skipping.\n" unless $srcpath =~ /\.txt$/;
                $dstpath =~ s/\.txt$//;
            }

            my $srctime = (stat _)[9];
            my $dsttime = (stat $dstpath)[9] || 0;

            if ($dsttime >= $srctime and not $force) {
                # XXX: if the times are identical, silently assume the files to be up to date
                warn "$dstpath is newer than $srcpath (use --force to overwrite)\n" unless $dsttime == $srctime;
                return;
            }
               if ($reverse) {
                decode_datafile($srcpath, $dstpath);
            } else {
                encode_datafile($srcpath, $dstpath);
            }
            # set the target file's timestamp equal to the source file's:
            utime $srctime, $srctime, $dstpath;
        }
    };
    # announce any errors caught by eval, then resume from next file:
    warn $@ if $@;
}
exit;


# decode compressed DF data file to a plain text file:
sub decode_datafile {
    my ($zipfile, $txtfile) = @_;
    my $filename = (split "/", $zipfile)[-1];

    # decode compressed file to text file
    open my $zip, '<', $zipfile or die "Failed to open $zipfile: $!\n";
    binmode $zip;
    local $/; # slurp mode
    my ($len, $deflate) = unpack "Va*", <$zip>;
    close $zip or die "Error reading $zipfile: $!\n";
    defined $len or die "Something went wrong reading $zipfile!\n";
   
    # verify length tag (also works as a file format check):
    die "$zipfile has mismatched length tag ($len != ".length($deflate).").\n"
        if $len != length $deflate;
   
    # kluge: deobfuscate index file
    my $index_mode = ($zipfile =~ m!/index$!);
    warn "Note: automatically deobfuscating index file $zipfile\n" if $index_mode and not $quiet;
   
    # decompress input data (secondary format check):
    my $data = uncompress $deflate;
    die "Uncompressing $zipfile failed: $gzerrno\n" unless defined $data;
   
    # open output file:
    open my $txt, '>:crlf', $txtfile or die "Failed to open $txtfile: $!\n";
   
    # extract line count from data stream:
    (my $n, $data) = unpack "Va*", $data;
    warn "Decoding $n lines from $zipfile to $txtfile\n" unless $quiet;
   
    # extract and print lines from data stream:
    foreach my $line (1 .. $n) {
        (my $len, my $len2, $data) = unpack "Vva*", $data;
        die "Error: length mismatch for line $line: $len != $len2\n" if $len != $len2;

        (my $str, $data) = unpack "a[$len]a*", $data;
        warn "Warning: expected $len bytes for line $line, got only ".length($str)."\n"
            if $len != length $str;
       
        # kluge: deobfuscate index file
        $str =~ s/(.)/chr(255 - ($-[1] % 5) - ord $1)/seg if $index_mode;
       
        warn "Warning: non-ASCII characters found on line $line of $zipfile.\n" if $str =~ /[^\t -~]/;
        warn "Warning: first line \"$txt\" does not match file name $zipfile.\n"
            if $line == 1 and $str ne $filename;

        print $txt $str, "\n";

        if ($verbose) {
            s/\\/\\\\/g, s/\r/\\r/g, s/\n/\\n/g, s/\t/\\t/g for $str;
            s/([^ -~])/sprintf "\\x%02X", ord $1/eg for $str;
            warn "  line $line: \"$str\" ($len bytes)\n";
        }
    }
   
    # close output file:
    close $txt or die "Error writing to $txtfile: $!\n";
}


# encode plain text file to compressed DF data file:
sub encode_datafile {
    my ($txtfile, $zipfile) = @_;
    my $filename = (split "/", $zipfile)[-1];

    # open input text file:
    open my $txt, '<:crlf', $txtfile or die "Failed to open $txtfile: $!\n";
    my @lines = <$txt>;
    close $txt or die "Error reading $txtfile: $!\n";

    # strip newlines and trailing blank lines:
    s/\r?\n$// for @lines;
    pop @lines while @lines and $lines[-1] !~ /\S/;

    # consistency checks:
    warn "Encoding ".@lines." lines from $txtfile to $zipfile\n" unless $quiet;
    warn "Warning: first line \"$lines[0]\" does not match file name $zipfile.\n"
        if @lines and $lines[0] ne $filename;

    if ($verbose) {
        foreach my $line (1 .. @lines) {
            my $str = $lines[$line-1];
            my $len = length $str;
            s/\\/\\\\/g, s/\r/\\r/g, s/\n/\\n/g, s/\t/\\t/g for $str;
            s/([^ -~])/sprintf "\\x%02X", ord $1/eg for $str;
            warn "  line $line: \"$str\" ($len bytes)\n";
        }
    }

    # kluge: obfuscate index file
    if ($zipfile =~ m!/index$!) {
        warn "Note: automatically obfuscating index file $zipfile\n" unless $quiet;
        s/(.)/chr(255 - ($-[1] % 5) - ord $1)/seg for @lines;
    }

    # prepend length tags:
    $_ = pack "Vva*", length, length, $_ for @lines;
   
    # concatenate lines, prepend count tag and compress data:
    my $data = pack "V/(a*)*", @lines;
    my $deflate = compress $data;

    # write output file:
    open my $zip, '>', $zipfile or die "Failed to open $zipfile: $!\n";
    binmode $zip;
    print $zip pack("V", length $deflate), $deflate;
    close $zip or die "Error writing to $zipfile: $!\n";
}
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 21, 2014, 05:36:24 am
I can't know what information you found or are still missing, but here's the translator.pl that Putnam very kindly handed off to me, just in case. This thread is all about farting around in the forbidden zone, after all.
Thank you a lot :)
I found general description of the file format and some perl scripts in the "DF from scratch and so on" topic. The file format description is nearly all I need, but the working script surely will save time for me.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on July 21, 2014, 12:14:05 pm
Quote
And you remember the weird tags that control colors and line formatting in the decoded help files, right?
No I dont, but I know the formatted embark message, but never noticed any tags.

So this will work?
Code: [Select]
[B] => linebreak
[P] => linebreak with empty line in between

And if I replace 000226A5| twisted into humanoid form| with 000226A5| twisted into humanoid form[P]| I would get a nicer unit description? Man, I have to try this with dwarves asap.

Title: Re: Dwarf Fortress localization patch
Post by: scamtank on July 21, 2014, 12:51:53 pm
The other way around. P is one Enter press. B is two, giving you that neat gap.

Annnnnnd I'm not too confident with the citizen descriptions. Ideally, you want to be able to jam the tags right before the first character in the sentence or just after the punctuation. Anything else looks really dumb and broken. Like here, where I put a [P] in front of every descriptive sentence about voices and cheekbones:

Spoiler (click to show/hide)

You're still limited. And before you think about using those tags in front of the very, very common pronouns, look at this horrorshow:

Spoiler (click to show/hide)

"He", "she", "his", "him" and "her" all got a [P] in front of them, nothing more.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on July 21, 2014, 02:26:51 pm
Mh, yeah that looks difficult to do. But the item description you made is great. Artefacts could look a lot better that way, as do statues, slabs, books and everything else with a wall of text... engravings...
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 28, 2014, 03:41:04 am
Just uploaded stringdump_0_40_05.txt here: https://bitbucket.org/dfint/stringdumps/downloads
Title: Re: Dwarf Fortress localization patch
Post by: Deon on July 28, 2014, 07:15:03 am
Thanks, you are awesome.

It will be very useful for my Fallout mod (again).
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 28, 2014, 10:11:12 am
Thanks, you are awesome.

It will be very useful for my Fallout mod (again).
Nothing to. When the tools are sharpened, it takes only a few minutes to extract and slightly filter the string dump.
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on July 28, 2014, 10:20:56 am
Since I keep forgetting how to sweep away the hex addresses from the front and duplicate the string proper, I'll jot them down here while I still remember. You only need two regular expressions in Notepad++:

Select first seven characters, make them go away:
Find: ^.{1,7}
Replace: nothing

Take note of the bit with the bars around it, then make it double:
Find: (\|.*\|)
Replace: \1\1

Then just use the standard search to replace the ||:s with single |:s. All done.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 28, 2014, 01:00:42 pm
Since I keep forgetting how to sweep away the hex addresses from the front and duplicate the string proper, I'll jot them down here while I still remember. You only need two regular expressions in Notepad++:

Select first seven characters, make them go away:
Find: ^.{1,7}
Replace: nothing

Take note of the bit with the bars around it, then make it double:
Find: (\|.*\|)
Replace: \1\1

Then just use the standard search to replace the ||:s with single |:s. All done.
My bad, I forgot to include instruction :)
Actually, you do not need to prepare a stringdump at all. The patch just ignores any line, which contains less then 3 bars.
Some examples:
Code: [Select]
This line doesn't contain any bars, consider this as a comment
| only one bar - ignore this!
12345whatever|somestring| There is two bars (like in a stringdump), it's just a template
1256|abc|| Here is an action: replace abc with an empty string
6346|cde|xyz| replace cde with xyz
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 04, 2014, 04:04:20 am
Well, you know, what I am going to say: https://bitbucket.org/dfint/stringdumps/downloads
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on August 04, 2014, 06:56:38 am
I should've known that your code was more robust than I knew. Still, uniform formatting is great for WinMerge shit. That thing hiccups on the dumbest things.

Thanks for doing the drudge work for us again.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on August 04, 2014, 07:03:07 am
Yeah, its lovely. I tried that formatting trick with 'B' for linebreaks, and suddenly all the coins, artefacts and items are very readable. :)
Title: Re: Dwarf Fortress localization patch
Post by: BatCountry on August 06, 2014, 08:50:27 pm
Still, uniform formatting is great for WinMerge shit. That thing hiccups on the dumbest things.

For the sake of sanity, check out a tool called DiffMerge from SourceGear.  Works on Windows and Linux.

I used it constantly at work to unravel ugly diffs in code.  The killer feature is being able to insert manual alignment markers - in other words you can tell the diff algorithm "no, dammit, this line is the same as this line, stupid."
Title: Re: Dwarf Fortress localization patch
Post by: Roses on August 06, 2014, 09:31:55 pm
Yeah, its lovely. I tried that formatting trick with 'B' for linebreaks, and suddenly all the coins, artefacts and items are very readable. :)

So I don't quite understand, what do I do to make it look pretty?
Title: Re: Dwarf Fortress localization patch
Post by: Meph on August 06, 2014, 09:38:44 pm
You know that descriptions always start with the same words. "It is decorated with blabla" "On the item is a" "The artwork relates to"

And if you add a
Code: [Select]
[B] in front of that, you get a linebreak. Just like adding a tag here on the board. I made a post about it here, including all lines I altered: http://www.bay12forums.com/smf/index.php?topic=141686.0

You just open the string dump, find the lines you want, add that 'B', and patch the exe. And then it looks like this:
(http://i.imgur.com/pRFJWk3.png)
Title: Re: Dwarf Fortress localization patch
Post by: Roses on August 06, 2014, 09:56:57 pm
Hmm, that is very nice, is it possible to do something similar for creature descriptions? If I had directly into the creatures description will it create a linebreak? Or do I need to use the stringdump replace?
Title: Re: Dwarf Fortress localization patch
Post by: Meph on August 06, 2014, 10:20:46 pm
It doesnt work in the creature descriptions, because the
Code: [Select]
[] itself are read out by DF, it thinks you are ending the descriptions tag. It only works in the string dump, or in the weird-text-files, which are the diplomat texts and the embark text. And the ingame manual.

Edit: It does work on descriptions that are procedually generated, because they are not in the raws, but also in the .exe. :) So titans, megabeasts, fbs...

Edit: these are the most likely candidates: All the "Its" with capital I could get a linebreak.
Code: [Select]
|soot|soot|
|embers|embers|
|cinders|cinders|
|composed of ash|composed of ash|
|shade|shade|
|sludge|sludge|
|composed of mud|composed of mud|
|brown|brown|
|slick|slick|
|quagmire|quagmire|
|composed of vomit|composed of vomit|
|green|green|
|disgusting appearance|disgusting appearance|
|brine|brine|
|composed of salt|composed of salt|
|white|white|
|composed of grime and filth|composed of grime and filth|
|waste|waste|
|composed of snow|composed of snow|
|blizzard|blizzard|
|sleet|sleet|
|composed of water|composed of water|
|flood|flood|
|tear|tear|
| of tears| of tears|
|composed of steam|composed of steam|
|boiling|boiling|
|flame|flame|
|composed of flame|composed of flame|
|red|red|
|inferno|inferno|
|flare|flare|
|flash|flash|
|flaming|flaming|
|scorching|scorching|
|composed of amber|composed of amber|
|composed of coral|composed of coral|
|composed of green glass|composed of green glass|
|composed of clear glass|composed of clear glass|
|composed of crystal glass|composed of crystal glass|
|composed of coke|composed of coke|
|composed of charcoal|composed of charcoal|
|black|black|
|composed of solid salt|composed of solid salt|
|composed of ice|composed of ice|
|composed of |composed of |
| great| great|
| gigantic| gigantic|
| towering| towering|
|n enormous|n enormous|
| huge| huge|
| large| large|
| small| small|
| very small| very small|
|hairy |hairy |
|feathered |feathered |
|scaly |scaly |
|armored |armored |
|fleshy |fleshy |
|eyeless |eyeless |
|one-eyed |one-eyed |
|three-eyed |three-eyed |
|beakless |beakless |
|noseless |noseless |
|skinless |skinless |
|six-legged |six-legged |
|eight-legged |eight-legged |
| twisted into humanoid form| twisted into humanoid form|
| in humanoid form| in humanoid form|
| with external ribs| with external ribs|
| with lidless eyes| with lidless eyes|
|  It has |  It has |
|thin wings of stretched skin|thin wings of stretched skin|
|wings|wings|
|feathered wings|feathered wings|
|lacy wings|lacy wings|
|  It has two |  It has two |
|  It has three |  It has three |
|  It has a |  It has a |
|long, hanging|long, hanging|
|long, straight|long, straight|
|long, curly|long, curly|
|short|short|
|stubby|stubby|
|narrow|narrow|
| tails| tails|
| tail| tail|
|  It has a proboscis|  It has a proboscis|
|  It has a long, swinging trunk|  It has a long, swinging trunk|
|  It has a short trunk|  It has a short trunk|
|  It has a fat, bulging trunk|  It has a fat, bulging trunk|
|  It has a twisting, jointed trunk|  It has a twisting, jointed trunk|
|  It has a curling trunk|  It has a curling trunk|
|  It has a knobby trunk|  It has a knobby trunk|
|  It has a round shell|  It has a round shell|
|  It has a spiral shell|  It has a spiral shell|
|  It has a square shell|  It has a square shell|
|  It has a knobby shell|  It has a knobby shell|
|  It has an enormous shell|  It has an enormous shell|
|  It has a broad shell|  It has a broad shell|
|  It has a pair of long antennae|  It has a pair of long antennae|
|  It has a pair of fan-like antennae|  It has a pair of fan-like antennae|
|  It has a pair of spindly antennae|  It has a pair of spindly antennae|
|  It has a pair of squat antennae|  It has a pair of squat antennae|
|  It has a pair of branching antennae|  It has a pair of branching antennae|
|  It has a pair of knobby antennae|  It has a pair of knobby antennae|
|  It has four |  It has four |
|long, spiral|long, spiral|
|long, curving|long, curving|
|broad|broad|
| horns| horns|
| horn| horn|
|  It has large mandibles|  It has large mandibles|
|it mutters to itself as it moves aimlessly|it mutters to itself as it moves aimlessly|
|muttering|muttering|
|grumbling|grumbling|
|whispering|whispering|
|brooding|brooding|
|it groans from time to time|it groans from time to time|
|groaning|groaning|
|moaning|moaning|
|it howls into high winds|it howls into high winds|
|screaming|screaming|
|howling|howling|
|baying|baying|
|bellowing|bellowing|
|shrieking|shrieking|
|wailing|wailing|
|it shambles sluggishly|it shambles sluggishly|
|it stamps the ground and snorts|it stamps the ground and snorts|
|it has a bloated body|it has a bloated body|
|bloated|bloated|
|it lumbers along steadily from place to place|it lumbers along steadily from place to place|
|lumbering|lumbering|
|hulking|hulking|
|its joints are backward|its joints are backward|
|backward|backward|
|it moves with uneven jerking motions|it moves with uneven jerking motions|
|its limbs jut out at asymmetric angles|its limbs jut out at asymmetric angles|
|crooked|crooked|
|twisted|twisted|
|it lopes quickly along the ground|it lopes quickly along the ground|
|it strides in silence with purpose|it strides in silence with purpose|
|starved|starved|
|emaciated|emaciated|
|it hurls vicious insults constantly|it hurls vicious insults constantly|
|it bears a look of unbelievable peace|it bears a look of unbelievable peace|
|peaceful nature|peaceful nature|
|it emanates an aura of giving and kindness|it emanates an aura of giving and kindness|
|kind nature|kind nature|
|joy marks its every movement|joy marks its every movement|
|joyful nature|joyful nature|
|it moves its will in accordance with the truth of things|it moves its will in accordance with the truth of things|
|it is ravening|it is ravening|
|it is slavering|it is slavering|
|it belches and croaks|it belches and croaks|
|it undulates rhythmically|it undulates rhythmically|
|rhythmic undulations|rhythmic undulations|
|it squirms and fidgets|it squirms and fidgets|
|bloated appearance|bloated appearance|
|it has a gaunt appearance|it has a gaunt appearance|
|it appears to be emaciated|it appears to be emaciated|
|it chants ceaselessly|it chants ceaselessly|
|it murmurs horrible curses|it murmurs horrible curses|
|it spouts gibberish periodically|it spouts gibberish periodically|
|it knows and intones the names of all it encounters|it knows and intones the names of all it encounters|
|it repeatedly makes threats of torture and death|it repeatedly makes threats of torture and death|
|it has a regal bearing|it has a regal bearing|
|it has an austere look about it|it has an austere look about it|
|it moves deliberately|it moves deliberately|
|it moves about carelessly|it moves about carelessly|
Title: Re: Dwarf Fortress localization patch
Post by: Roses on August 06, 2014, 10:29:30 pm
Ah right... but we should be able to do something like put abcdef in the creature description and do a string replace for |abcdef||

I forgot all about string replaces, opens up a lot of different possibilities for modders.

Title: Re: Dwarf Fortress localization patch
Post by: Meph on August 06, 2014, 11:13:59 pm
No, you cant. The string dump is in the exe, it patches the exe. It doesnt change the process after it started, so you can do anything about the raw texts it reads out. Insolor posted an alternate way to translate content that is displayed, but it wouldnt add linebreaks into the text.

The strings are all in the template.lng, which is included in the download. Its a lot of text... but nothing except that can be altered.
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on August 11, 2014, 09:03:34 am
An all-new string dump ready for us?? What a kind man.
Title: Re: Dwarf Fortress localization patch
Post by: Roses on August 15, 2014, 03:10:39 pm
No, you cant. The string dump is in the exe, it patches the exe. It doesnt change the process after it started, so you can do anything about the raw texts it reads out. Insolor posted an alternate way to translate content that is displayed, but it wouldnt add linebreaks into the text.

The strings are all in the template.lng, which is included in the download. Its a lot of text... but nothing except that can be altered.

Bummer, could really use some line breaks in some of my creatures descriptions. Oh well. Still at a lot that can be done.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 16, 2014, 05:48:18 am
I didn't add string dump for 0.40.08 to downloads, because it exactly matches to the previous one. Anyway, you can see all the files on the source page (https://bitbucket.org/dfint/stringdumps/src)
Title: Re: Dwarf Fortress localization patch
Post by: TioFuna on August 28, 2014, 08:42:52 pm
Very Nice Topic!!! Thanks insolor by this localization patch.

I´ll try localize to Brazilian Portuguese (PT-BR), but I have a problem...

How I can insert characters like ' ç ã â ó ' ?

I see its possible, because appear to me these characters in game like 'ó'.

â = ├ó
ç = ├º

Code: [Select]
Dwarf Fortress Brasil
|Continue Playing|Continuar Jogando|
|Start Playing|Começar a Jogar|
|Create New World!|Criar Novo Mundo!|
|Design New World with Advanced Parameters|Projetar Novo Mundo com Parâmetros Avançados|
|Object Testing Arena|Arena para Testar Objetos|
|About DF|Sobre DF|
|Quit|Sair-|

(http://s30.postimg.org/6m0fv5o9d/Menu_Inicial_DFPTBR.jpg)
Title: Re: Dwarf Fortress localization patch
Post by: Meph on August 28, 2014, 08:49:46 pm
Thats the ttf fonts fault. Try pressing F12 (you probably get very strange icons, but is worth a try). Otherwise replace the font.ttf in data/art with any true-type font that is freely available online that supports portuguese characters.
Title: Re: Dwarf Fortress localization patch
Post by: Pidgeot on August 29, 2014, 12:10:10 pm
â = ├ó
ç = ├º

The font likely needs to be swapped, but this particular set of characters also suggests you have saved your file as UTF-8, but the game and/or the utility doesn't handle that encoding correctly (I don't know which one.). It seems you need to save the file in the appropriate single-byte code page (which your editor will likely call something like Windows-1252, Latin1, or possibly ANSI).
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 29, 2014, 12:19:21 pm
â = ├ó
ç = ├º

The font likely needs to be swapped, but this particular set of characters also shows you have saved your file as UTF-8, but the game and/or the utility doesn't handle that encoding. You need to save the file in the appropriate single-byte code page (which your editor will likely call something like Windows-1252, Latin1, or possibly ANSI).
You are right, the utility (and DF itself) does not support UTF-8. The native codepage for DF is cp437 (https://en.wikipedia.org/wiki/Code_page_437).
Title: Re: Dwarf Fortress localization patch
Post by: TioFuna on August 29, 2014, 05:04:17 pm
â = ├ó
ç = ├º

The font likely needs to be swapped, but this particular set of characters also shows you have saved your file as UTF-8, but the game and/or the utility doesn't handle that encoding. You need to save the file in the appropriate single-byte code page (which your editor will likely call something like Windows-1252, Latin1, or possibly ANSI).
You are right, the utility (and DF itself) does not support UTF-8. The native codepage for DF is cp437 (https://en.wikipedia.org/wiki/Code_page_437).

Yesss.  :D

I open in other editor and save in MS-DOS format.

(http://s9.postimg.org/v79vawm3z/DFBrasil.jpg)
Title: Re: Dwarf Fortress localization patch
Post by: Deon on August 30, 2014, 03:06:52 am
Can someone share a template.lng for 0.40.10 please? I tried to prepare one from string dump and it looked like it worked, but then my game stopped understanding what "SHIELD" is.
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on August 30, 2014, 04:31:58 am
That'd be kinda finicky, considering that Pastebin doesn't like 500+ KB entries. This regular expression does the job fine in Notepad++:

Code: [Select]
^.{1,8}\|

replaced with

\|

If it comes down to it, you don't really need to prepare them. The interpreter only looks at things between the ||:s. Getting rid of the hex addresses only makes it look neater.
Title: Re: Dwarf Fortress localization patch
Post by: Deon on August 31, 2014, 10:27:57 am
I did that, why the hell does my game not like SHIELD type after that :P. Weird. Just as soon as I used the .exe dump, it told me that 5 raws are modified even though I did not change anything. I will try to find out what caused it.

P.S. Also you could just upload the .txt file anywhere :).
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on August 31, 2014, 01:13:21 pm
So much for teaching a man to fish, I guess.

Here you are. Mind the strings that go haywire if you exceed the character limit. (https://dl.dropboxusercontent.com/u/7025840/template.lng)
Title: Re: Dwarf Fortress localization patch
Post by: Deon on August 31, 2014, 01:21:20 pm
Nah, I already did what you suggested (because it was listed a page or two back) and it was breaking something in the game. I literally removed ^.{1,8}\| and then duplicated \1\1. My notpad++ crashed once but then worked, and then the game started to understand what a SHIELD is. I still wonder what did I do wrong :D. Thanks for the upload bro.

So I already was able to fish, but I fished out an abomination instead of a carp. Thanks for the help!
Title: Re: Dwarf Fortress localization patch
Post by: insolor on November 01, 2014, 07:17:36 am
Just uploaded stringdump_0_40_13_noprefix.txt, stringdump_0_40_14_noprefix.txt (without hexadecimal prefixes):
https://bitbucket.org/dfint/stringdumps/src
Title: Re: Dwarf Fortress localization patch
Post by: insolor on November 28, 2014, 06:43:17 am
Now string dumps from 0.40.15 through 0.40.19 available here:
https://bitbucket.org/dfint/stringdumps/src

Also string extracting script extract_strings.py (Python 3) is now available in this repo:
https://bitbucket.org/dfint/dfrus-py
P.S. You need to download the whole repository (except maybe dfrus.py and disasm.py), because extract_string.py depends on modules from it.
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on November 28, 2014, 08:08:19 am
Hah, it's almost as if you noticed me poking around your repositories, looking if you had the string extraction tool lying around somewhere. Thank you.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on November 29, 2014, 11:40:39 am
Hah, it's almost as if you noticed me poking around your repositories, looking if you had the string extraction tool lying around somewhere. Thank you.
I've translated it to Python (earlier it was in Euphoria) and considered it could be usefull for somebody. Glad to see that I was right :)
Title: Re: Dwarf Fortress localization patch
Post by: Meph on November 29, 2014, 01:42:19 pm
Thank you kindly :)
Title: Re: Dwarf Fortress localization patch
Post by: Meph on December 06, 2014, 10:29:51 pm
Edit: I posted a string dump, but apparently it doesnt work correctly with the current version.
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on December 19, 2014, 09:43:55 am
Hey, now that a new version is on the table again, I have a problem. After guessing how it works, I do this:

(http://i.imgur.com/znu7ay5.png)

...but that's all it does. Do you know what's up?
Title: Re: Dwarf Fortress localization patch
Post by: Meph on December 19, 2014, 12:42:01 pm
Forgot a ' before the stringdump.txt' ? Just guessing, I dont know python. Maklak always knows quite a bit.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 19, 2014, 10:34:25 pm
Hey, now that a new version is on the table again, I have a problem. After guessing how it works, I do this:

(http://i.imgur.com/znu7ay5.png)

...but that's all it does. Do you know what's up?
Use python3 (eg. python 3.4) instead of python2.
Title: Re: Dwarf Fortress localization patch
Post by: Meph on December 20, 2014, 03:50:28 am
Insolor, could you please be so kind and post a string-dump that ready to work with 40.20? I downloaded the one for 40.19, ran a command to copy all lines and tried it, but it did not quite work correctly.
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on December 20, 2014, 05:47:34 am
It worked a treat! Thanks a ton.

Insolor, could you please be so kind and post a string-dump that ready to work with 40.20? I downloaded the one for 40.19, ran a command to copy all lines and tried it, but it did not quite work correctly.

There's only a few tiny differences between versions 19 and 21. You probably got something wrong.

There's the new labor tokens BUILD_ROAD and BUILD_CONSTRUCTION among the others, the generic tags "Mine" and "Channel" were removed and the new keyboard shortcuts were tacked on the list (DESIGNATE_STANDARD_MARKER/TOGGLE_MARKER/MINE_MODE and BUILDJOB_NOW). Nothing else got changed.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 20, 2014, 06:48:48 am
Oops, found a bug in extract_strings.py: it ignores strings with spaces. Please download the extract_strings.py again.
Also, I've just uploaded string dumps for 0.40.20, 0.40.21 and made some changes in 0.40.19:
https://bitbucket.org/dfint/stringdumps/src
Title: Re: Dwarf Fortress localization patch
Post by: insolor on January 25, 2015, 12:02:02 pm
As a side project of russian localization we are currently working on ttf output on screens like "Thought and Prefences"
Spoiler (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 11, 2015, 07:31:24 am
Some info/documentation of the project:
https://bitbucket.org/dfint/dfint-docs
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on April 11, 2015, 11:30:06 am
You're the expert, so you'll probably know for sure: I've been recently banging my head against the fact that certain strings are read in several different places at once. Could there be some potential way to forward replacement strings only to certain memory addresses?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 12, 2015, 10:42:47 am
You're the expert, so you'll probably know for sure: I've been recently banging my head against the fact that certain strings are read in several different places at once. Could there be some potential way to forward replacement strings only to certain memory addresses?

I can implement separation of such "conjoint" strings. In the language file it will look like this:

Code: [Select]
|string|translation1| # default translation
|string|translation2|reference address|DF timestamp|

The custom translation will work only for specific DF version, so you will have to explicitly define the timestamp of the DF executable.

But I will add this functionality not earlier then I complete translation of dfint/dfrus to Python.

Currently, when I encounter such problems, I'm trying to fix them with changetext.py script. For example, the word "well" in Russian must be translated differently depending on if it is a construction or a feeling. In the changetex.py I added code which determines, if there is "I" pronoun in the statement. If it is, the code will translate "well" as "good" ("I am feeling well" == "I am feeling good" but not "I am feeling a well"  ;) ).
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 08, 2015, 03:00:24 pm
Announcement
We translated DF to Russian for about a year at transifex.com:
https://www.transifex.com/projects/p/dwarf-fortress/
Today we also added two more languages: Ukrainian and Esperanto (the latter added mainly just for fun). Belarusian probably will be added soon too.
You can request addition of a new language there. If you already started translation, I can import you translation to the transifex.com.

The main limitation - writing system must be Latin or Cyrillic. I know, that there is Chinese translation of DF, but I cannot guarantee, that I can add support of any hieroglyphic language. The same applies to languages with right-to-left writing system.

Update: added Italian and Belarusian.
(http://i.imgur.com/V8cPpHa.png)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 24, 2015, 12:00:42 pm
Meanwhile, the Python version of dfint/dfrus utility is nearly ready for use.
https://bitbucket.org/dfint/dfrus-py/src

You already can try to test it, but for now it lacks of documentation.
To download it go to the downloads (https://bitbucket.org/dfint/dfrus-py/downloads) page, then tags, and there click on 'zip' (or the format you prefer) next to the stable tag.
To get some help, execute the dfrus.py script with the `--help` switch (you need python3 to execute it):
Code: [Select]
python dfrus.py --help
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on August 25, 2015, 04:42:08 pm
Cool beans, appears to be working fine. Any new features? Functions? Patches to horrible bugs we never noticed?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 25, 2015, 05:45:02 pm
Cool beans, appears to be working fine. Any new features? Functions? Patches to horrible bugs we never noticed?
Glad to see, that someone already tried it  :)
Generally, that is all. Functionality must be the same more or less. Moreover, there is a weird bug, which was recently discovered in the 'old' (written in Euphoria) dfrus, and which can be reproduced with the 'new' (rewritten in Python) dfrus. I will try to fix it as soon as possible.

Keep in mind, that the code was rewritten from scratch, and not yet tested thoroughly, I only fixed several most obvious bugs.
If you notice any new bugs, which were not in the 'good old' dfint, please let me know.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on October 25, 2015, 06:37:30 am
Some news.

To add Portugese I've added support of cp860 (https://en.wikipedia.org/wiki/Code_page_860) to the patch. Actually some special characters are correctly displayed only in TTF mode, but it's possible to edit graphic fonts to support cp860. There are only a few differences (http://i.imgur.com/XtBAGDm.png?1) between cp437 (which is basic codepage for DF) and cp860.

I'm also going to add cp850 support.
Title: Re: Dwarf Fortress localization patch
Post by: Teneb on October 25, 2015, 10:17:49 am
Some news.

  • I'm still working on bugs in the patch. Although causes of the most of bugs are already discovered, it need some work to eliminate them.
  • We have 10 languages to which DF is translated, but not all the translators continue the work.
    Spoiler (click to show/hide)
  • Last night I was requested to make exe for Portugese (Brasil). It was really sudden for me, because about a week ago it was only 3% completed (just ahead of Ukrainian), but now all the hardcoded strings are translated. That's really impressive. The translator's nickname is danijfbm.
    Spoiler (click to show/hide)
To add Portugese I've added support of cp860 (https://en.wikipedia.org/wiki/Code_page_860) to the patch. Actually some special characters are correctly displayed only in TTF mode, but it's possible to edit graphic fonts to support cp860. There are only a few differences (http://i.imgur.com/XtBAGDm.png?1) between cp437 (which is basic codepage for DF) and cp860.

I'm also going to add cp850 support.
There is a few typos in the menu and the game screen, from the screenshots. Though I guess you are not the best person to report it to.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on October 25, 2015, 10:23:50 am
Some news.

  • I'm still working on bugs in the patch. Although causes of the most of bugs are already discovered, it need some work to eliminate them.
  • We have 10 languages to which DF is translated, but not all the translators continue the work.
    Spoiler (click to show/hide)
  • Last night I was requested to make exe for Portugese (Brasil). It was really sudden for me, because about a week ago it was only 3% completed (just ahead of Ukrainian), but now all the hardcoded strings are translated. That's really impressive. The translator's nickname is danijfbm.
    Spoiler (click to show/hide)
To add Portugese I've added support of cp860 (https://en.wikipedia.org/wiki/Code_page_860) to the patch. Actually some special characters are correctly displayed only in TTF mode, but it's possible to edit graphic fonts to support cp860. There are only a few differences (http://i.imgur.com/XtBAGDm.png?1) between cp437 (which is basic codepage for DF) and cp860.

I'm also going to add cp850 support.
There is a few typos in the menu and the game screen, from the screenshots. Though I guess you are not the best person to report it to.
Sure. But you can fix them on transifex: https://www.transifex.com/dwarf-fortress-translation/dwarf-fortress/
Title: Re: Dwarf Fortress localization patch
Post by: danijfbm on October 26, 2015, 10:59:34 am
Some news.

  • I'm still working on bugs in the patch. Although causes of the most of bugs are already discovered, it need some work to eliminate them.
  • We have 10 languages to which DF is translated, but not all the translators continue the work.
    Spoiler (click to show/hide)
  • Last night I was requested to make exe for Portugese (Brasil). It was really sudden for me, because about a week ago it was only 3% completed (just ahead of Ukrainian), but now all the hardcoded strings are translated. That's really impressive. The translator's nickname is danijfbm.
    Spoiler (click to show/hide)
To add Portugese I've added support of cp860 (https://en.wikipedia.org/wiki/Code_page_860) to the patch. Actually some special characters are correctly displayed only in TTF mode, but it's possible to edit graphic fonts to support cp860. There are only a few differences (http://i.imgur.com/XtBAGDm.png?1) between cp437 (which is basic codepage for DF) and cp860.

I'm also going to add cp850 support.
There is a few typos in the menu and the game screen, from the screenshots. Though I guess you are not the best person to report it to.


Olá Teneb,

Eu estou traduzindo o game para português BR sozinho, se você verificar as frases ainda não foram revisadas!
Preciso saber como gerar o .exe do game com o arquivo PO, para realizar as devidas correções da tradução, se alguém no grupo poder criar um pequeno tutorial sobre como juntar o PO no EXE, em alguns dias eu entrego a tradução 100% revisada.

Obrigado
Title: Re: Dwarf Fortress localization patch
Post by: insolor on October 26, 2015, 11:46:34 am
Some news.

  • I'm still working on bugs in the patch. Although causes of the most of bugs are already discovered, it need some work to eliminate them.
  • We have 10 languages to which DF is translated, but not all the translators continue the work.
    Spoiler (click to show/hide)
  • Last night I was requested to make exe for Portugese (Brasil). It was really sudden for me, because about a week ago it was only 3% completed (just ahead of Ukrainian), but now all the hardcoded strings are translated. That's really impressive. The translator's nickname is danijfbm.
    Spoiler (click to show/hide)
To add Portugese I've added support of cp860 (https://en.wikipedia.org/wiki/Code_page_860) to the patch. Actually some special characters are correctly displayed only in TTF mode, but it's possible to edit graphic fonts to support cp860. There are only a few differences (http://i.imgur.com/XtBAGDm.png?1) between cp437 (which is basic codepage for DF) and cp860.

I'm also going to add cp850 support.
There is a few typos in the menu and the game screen, from the screenshots. Though I guess you are not the best person to report it to.


Olá Teneb,

Eu estou traduzindo o game para português BR sozinho, se você verificar as frases ainda não foram revisadas!
Preciso saber como gerar o .exe do game com o arquivo PO, para realizar as devidas correções da tradução, se alguém no grupo poder criar um pequeno tutorial sobre como juntar o PO no EXE, em alguns dias eu entrego a tradução 100% revisada.

Obrigado
I need some time to make some of my tools ready for everyone use (a couple days ago I had to write a name of codepage directly in the source code, which is not acceptable at all). After that I will write partial instruction.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 01, 2015, 04:16:48 pm
String dump for DF 0.42.01 added:
https://bitbucket.org/dfint/stringdumps/src

Also, source strings (hardcoded, raws, compressed, plain text) for translation were updated, in a few hours transifex.com will grab them from bitbucket repository, and then everyone are welcomed to continue translation ;)
https://www.transifex.com/dwarf-fortress-translation/dwarf-fortress
Title: Re: Dwarf Fortress localization patch
Post by: insolor on January 12, 2016, 07:01:23 pm
A time has come when the good old "pipe-separated values" intermediate format is no longer acceptable...

(http://i.imgur.com/Tp9l1Si.png)
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on January 12, 2016, 09:15:26 pm
Welp. Any ideas yet?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on January 12, 2016, 09:52:55 pm
Welp. Any ideas yet?
Some sort of CSV, I think.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on January 14, 2016, 04:59:21 am
Some changes I've made:
1. Stringdumps (at least new ones) will be in a "plain-text" format, i.e. it's lines won't be enclosed into pipes ('|' symbols).
2. dfrus.py now supports CSV, but also it still supports the old format. I managed to do it with the Sniffer class from the Python's csv module, which can guess which format of file (delimiter type etc.) it is fed with.
3. For interchange between my utility programs (po2csv.py -> dfrus.py) I will use regular CSV format.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 21, 2016, 09:34:41 pm
Hello, someone who can send instructions for using the partial translations? I want to translate for the Hispanic community. Thank..  :)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 22, 2016, 08:58:24 am
Hello, someone who can send instructions for using the partial translations? I want to translate for the Hispanic community. Thank..  :)
Hello!
I will write them and post a link soon.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 22, 2016, 10:20:53 am
Thank you.. I will be waiting..  :D:D
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 22, 2016, 11:00:26 am
Thank you.. I will be waiting..  :D:D

Here the instruction how to make translated executable file: https://bitbucket.org/dfint/dfint-docs/wiki/Translate%20Executable
Later I will add instructions for translation of text files.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 22, 2016, 09:40:21 pm
Thanks you @insolor ..with the speed that characterizes you.. ;)
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 23, 2016, 08:58:56 am
@insolor.. the file po2csv.py it is included in the python installation? because i a have this message "python: can't open file po2csv.py: (Errno 2) No such file or directory" .. the po2csv.py file must be placed in the same directory that the .po file meaby?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 23, 2016, 09:02:22 am
@insolor.. the file po2csv.py it is included in the python installation? because i a have this message "python: can't open file po2csv.py: (Errno 2) No such file or directory" .. the po2csv.py file must be placed in the same directory that the .po file meaby?
po2csv.py is in the downloaded df-gettext-toolkit zip archive.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 23, 2016, 10:28:11 am
I dont have this file.. Here my screenshoot.. http://imgur.com/Srm5iGW
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 23, 2016, 10:30:17 am
I dont have this file.. Here my screenshoot.. http://imgur.com/Srm5iGW

Sorry, download the archive again, now everything must be ok.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 23, 2016, 10:46:59 am
ok.. I supposed that must be the file, but groping on their own in stranges scrip dont work for me haha

p/d: I have the translation of the instructions, what do you think.. start a new thread for publication? or do it right here?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 23, 2016, 11:03:55 am
ok.. I supposed that must be the file, but groping on their own in stranges scrip dont work for me haha

p/d: I have the translation of the instructions, what do you think.. start a new thread for publication? or do it right here?

So, have you managed to get translated exe file?

As for translated instruction, I think it's better to place it on bitbucket, where the original instruction is. If you will register on bitbucket, I can give you permissions to edit this wiki. It has markdown syntax.

Another option: I can send you this page as a text file, you'll edit it, and then I'll add it to the wiki.
Title: Re: Dwarf Fortress localization patch
Post by: Dozebôm Lolumzalìs on February 23, 2016, 03:47:17 pm
Spoiler: btw (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 23, 2016, 05:20:46 pm
So, have you managed to get translated exe file?

As for translated instruction, I think it's better to place it on bitbucket, where the original instruction is. If you will register on bitbucket, I can give you permissions to edit this wiki. It has markdown syntax.

Another option: I can send you this page as a text file, you'll edit it, and then I'll add it to the wiki.

Yes.. I can "traslated" the exe file.. dont problem..
As for the instructions, I also think its best to place it on bitbucket.. my username is "hessed elohim"

Spoiler: btw (click to show/hide)

that paradox.. the person responsible for translating texts from English dont know type the word translator.. thank you grammar-spelling-police man xD
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 24, 2016, 10:22:27 am
I have a question .. there in the Russian accent marks? ("tilde" in spanish) as if it were made to appear?
we could make the translation of the .exe but not shown symbols for accented letters..
we must re-translate everything without putting accent marks to letters?

* for example, in Spanish, redemption is written "redención" .. accented on the "o"
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 24, 2016, 04:08:45 pm
I have a question .. there in the Russian accent marks? ("tilde" in spanish) as if it were made to appear?
we could make the translation of the .exe but not shown symbols for accented letters..
we must re-translate everything without putting accent marks to letters?

* for example, in Spanish, redemption is written "redención" .. accented on the "o"
Have you modified the init.txt as said in the instruction? This must solve the problem.

In Russian accent marks are used only in educational books (and dictionaries, of course) or sometimes in sentences when different accent may change the meaning of a sentence.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 24, 2016, 07:46:28 pm
that was .. mistake on the file correction.. thanks! :D
Title: Re: Dwarf Fortress localization patch
Post by: TioFuna on March 01, 2016, 12:58:02 pm
Hello!!!

I'm back in localization of Dwarf Fortress to Brazilian Portuguese (PT-BR).

I'm using Transifex that @insolor have created and start make a tool in Java to translate plain texts (*.txt). Starting from easy way.  ;D
Maybe continue with uncompressed texts and hardcoded texts. If I understand how to do this.

I created a project in GitHub and the First Release is out.
https://github.com/TioFuna/DFLocalizationTool/releases (https://github.com/TioFuna/DFLocalizationTool/releases)

Some Instructions:

Please, send comments and report issues.
For more languages and code pages, send me a message to include them.

Next steps:
 - Write a readme with instructions.
 - Continue translate in Transifex.
 - Try include translations with compressed texts and hardcoded texts

Ps1: I'm not a fluent english, I do my best. So, if you find any error, please let me know.
Ps2: I'm starting programming Java and using github, same here, helps are welcome.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on March 01, 2016, 03:19:02 pm
Hello..
thank you very much for the contribution .. I tried to use the tool, but nothing happens when I click the "Translate Files" button .. I placed the .po files (both.. those downloaded to "translate" as those downloaded for "use") .. I have placed them in the Localization/Translation folder (that was created by the tool itself) .. I dont know if I should be doing something wrong. Regards
Title: Re: Dwarf Fortress localization patch
Post by: insolor on March 01, 2016, 04:38:46 pm
Spoiler (click to show/hide)

I already have some utilities in df-gettext-toolkit (https://bitbucket.org/dfint/df-gettext-toolkit/src) repository, but they has only console interface. In particular, translate_raws_batch.py tries to translate all the text files, and works for Starter Pack, for example. But it needs update for languages then Russian, and some instructions need to be written too.
Title: Re: Dwarf Fortress localization patch
Post by: TioFuna on March 01, 2016, 08:12:43 pm
Hello..
thank you very much for the contribution .. I tried to use the tool, but nothing happens when I click the "Translate Files" button .. I placed the .po files (both.. those downloaded to "translate" as those downloaded for "use") .. I have placed them in the Localization/Translation folder (that was created by the tool itself) .. I dont know if I should be doing something wrong. Regards

Fixed this issue. I changed the release, please, download again the JAR file.

Spoiler (click to show/hide)

I already have some utilities in df-gettext-toolkit (https://bitbucket.org/dfint/df-gettext-toolkit/src) repository, but they has only console interface. In particular, translate_raws_batch.py tries to translate all the text files, and works for Starter Pack, for example. But it needs update for languages then Russian, and some instructions need to be written too.

I tryed understand and use this toolkit, but using console and Python doesn't work very well with me. So I start this java tool.
But with a list of instructions probably I can.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on March 01, 2016, 09:17:16 pm
Quote
I tryed understand and use this toolkit, but using console and Python doesn't work very well with me. So I start this java tool.
But with a list of instructions probably I can.

não acho q tipo de instrucoes voce quer, mas aqui voce vai encontrar as instrucoes q deixo @insolor pra seus scrips..
Quanto a sua ferramenta .. agora ja funcionou sem problema .. obrigado

Eu fiz as traducoes em espanhol para os scrips de @insolor, se me permite, vou fazer o mesmo com sua ferramenta ..

p/d: desculpe a minha Portugues
Title: Re: Dwarf Fortress localization patch
Post by: TioFuna on March 02, 2016, 02:32:20 pm
Quote
I tryed understand and use this toolkit, but using console and Python doesn't work very well with me. So I start this java tool.
But with a list of instructions probably I can.

não acho q tipo de instrucoes voce quer, mas aqui voce vai encontrar as instrucoes q deixo @insolor pra seus scrips..
Quanto a sua ferramenta .. agora ja funcionou sem problema .. obrigado

Eu fiz as traducoes em espanhol para os scrips de @insolor, se me permite, vou fazer o mesmo com sua ferramenta ..

p/d: desculpe a minha Portugues

Few errors with portuguese, but no problem, I understand and appreciate your dedication.
I saw the instructions to hardcoded texts, that was very good. I refer to instructions to translate plain texts.
I was waiting for these instruction, and in the meantime I develop my tool. To see if it helped in something and do a bit of programming.
Feel free to translate my tool. Maybe you can create a fork for Spanish.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 13, 2016, 01:33:08 pm
A question for mod developers:
Who is using the localization patch in their mods (or used it earlier)?
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on August 13, 2016, 03:15:59 pm
I still lean on it pretty hard, although I don't expect that level of fiddling from anyone downloading my trash. The most I had was my personal custom "dictionary" as an optional module for the brave. Are there going to be tools that can stomach the 64bit executables?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 13, 2016, 03:29:45 pm
I still lean on it pretty hard, although I don't expect that level of fiddling from anyone downloading my trash. The most I had was my personal custom "dictionary" as an optional module for the brave. Are there going to be tools that can stomach the 64bit executables?
64bit support is planned but it is not at the first place in my list. At first I'm going to do some GUI-thing to simplify applying of translation to the game. Then I need to fix charmap patching for 32bit DF 0.32.04 and newer and check if all other things function well. After that I will try to add support of 64bit executables.
Title: Re: Dwarf Fortress localization patch
Post by: Putnam on August 13, 2016, 10:40:58 pm
I don't use it anymore, but I definitely used to. I don't think those versions are anywhere, though.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 26, 2016, 07:47:35 pm
I've merged experimental branch of dfrus-py into develop one. Using of the develop branch of dfrus-py is recommended. Also, dfrus.py must be supplied with dictionary.csv in utf-8 encoding (just don't specify codepage in the po2csv.py command line, it will produce a file in utf-8 by default). I've changed instructions (https://bitbucket.org/dfint/dfint-docs/wiki/Home) accordingly (both English and Spanish versions), download links ("zip") on that pages are updated too.

Dfrus-py currently supports DF 0.43.03 (more or less stable). Support of DF 0.43.04 and higher is coming (only 32bit). At least it doesn't complain about codepage table anymore, and you can get working executable (with some artifacts in strings, but this will be fixed).
Title: Re: Dwarf Fortress localization patch
Post by: milo christiansen on September 01, 2016, 03:42:26 pm
Is there any way to use this (or something like this) with Linux DF binaries?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 04, 2016, 03:30:28 am
Is there any way to use this (or something like this) with Linux DF binaries?
There are some utilities by other developer (https://github.com/kateby), but I don't know how stable they are and they definitely haven't tested on languages other then Russian.
I've send her a link to your message, but probably she is busy now with some real life things.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 04, 2016, 03:49:53 am
I'm working on a utility to automate a process of making translated DF package.
Spoiler (click to show/hide)
Currently only the first tab is partially implemented. The layout of controls if far from ideal now, so it will be changed.
I will try to make minimal working build as soon as possible.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on September 04, 2016, 10:54:37 am
I've merged experimental branch of dfrus-py into develop one. Using of the develop branch of dfrus-py is recommended. Also, dfrus.py must be supplied with dictionary.csv in utf-8 encoding (just don't specify codepage in the po2csv.py command line, it will produce a file in utf-8 by default). I've changed instructions (https://bitbucket.org/dfint/dfint-docs/wiki/Home) accordingly (both English and Spanish versions), download links ("zip") on that pages are updated too.

Dfrus-py currently supports DF 0.43.03 (more or less stable). Support of DF 0.43.04 and higher is coming (only 32bit). At least it doesn't complain about codepage table anymore, and you can get working executable (with some artifacts in strings, but this will be fixed).

@insolor.. So you have already changed the Spanish instructions too?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 05, 2016, 02:01:18 am
I've merged experimental branch of dfrus-py into develop one. Using of the develop branch of dfrus-py is recommended. Also, dfrus.py must be supplied with dictionary.csv in utf-8 encoding (just don't specify codepage in the po2csv.py command line, it will produce a file in utf-8 by default). I've changed instructions (https://bitbucket.org/dfint/dfint-docs/wiki/Home) accordingly (both English and Spanish versions), download links ("zip") on that pages are updated too.

Dfrus-py currently supports DF 0.43.03 (more or less stable). Support of DF 0.43.04 and higher is coming (only 32bit). At least it doesn't complain about codepage table anymore, and you can get working executable (with some artifacts in strings, but this will be fixed).

@insolor.. So you have already changed the Spanish instructions too?
Yes, there weren't any difficulties. But it would be nice if someone check them.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on September 05, 2016, 07:49:59 am
I've merged experimental branch of dfrus-py into develop one. Using of the develop branch of dfrus-py is recommended. Also, dfrus.py must be supplied with dictionary.csv in utf-8 encoding (just don't specify codepage in the po2csv.py command line, it will produce a file in utf-8 by default). I've changed instructions (https://bitbucket.org/dfint/dfint-docs/wiki/Home) accordingly (both English and Spanish versions), download links ("zip") on that pages are updated too.

Dfrus-py currently supports DF 0.43.03 (more or less stable). Support of DF 0.43.04 and higher is coming (only 32bit). At least it doesn't complain about codepage table anymore, and you can get working executable (with some artifacts in strings, but this will be fixed).

@insolor.. So you have already changed the Spanish instructions too?
Yes, there weren't any difficulties. But it would be nice if someone check them.


I have already checked also, all in order, thanks for taking the time :D . regards
Title: Re: Dwarf Fortress localization patch
Post by: milo christiansen on September 06, 2016, 11:16:35 am
There are some utilities by other developer (https://github.com/kateby), but I don't know how stable they are and they definitely haven't tested on languages other then Russian.
I've send her a link to your message, but probably she is busy now with some real life things.

Thank you very much!

It looks like there is even a version of the tool written in Go (my primary/favorite language) so if something doesn't work I can probably fix it myself without too much trouble :) Of course all the comments are in russian... (Go Google translate!)
Title: Re: Dwarf Fortress localization patch
Post by: ockmonek on September 14, 2016, 04:12:08 pm
Hi Folks,

I did translated some strings in transifex to german.
Now I want create the hardcored .exe for testing.

I used this discription: https://bitbucket.org/dfint/dfint-docs/wiki/Translate%20Executable (https://bitbucket.org/dfint/dfint-docs/wiki/Translate%20Executable)
Creating the dictionary.csv wasn't the problem with this code:
Code: [Select]
py -3 po2csv.py de.po de.csv cp1252I used cp1252 because the german umlauts (ä,ü,ö etc.)
Is this codepage works?

Then I want create the patched exe with this: (DF 0.43.03 legacy)
Code: [Select]
py -3 dfrus.py -p "Dwarf Fortress.exe" -d de.csv --codepage cp1252
Unfortunally, I was become this UnicodeDecodeError:
Spoiler (click to show/hide)

I try to fix it in dfrus.py to change line 501 so:
Code: [Select]
with open(args.dictionary, encoding='iso-8859-1') as trans:
Then I become this:
Spoiler (click to show/hide)

Any ideas?
My motivation to continue translating is not so big, as long as this test version isn't running.  :-[
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 15, 2016, 12:38:25 am
Hi!
Legacy versions of DF are not supported (in the best case dfrus just will fail to patch charmap table, because there is no such table), only SDL versions are supported.

As for po2csv arguments, dfrus.py currently assumes that csv file is in utf-8 encoding. So the command line must look like this:
Code: [Select]
py -3 po2csv.py de.po de.csv utf-8or
Code: [Select]
py -3 po2csv.py de.po de.csv(utf-8 is used by default)

As for codepages, the patcher currently supports only a limited range of them: cp437 (natively supported by DF), cp737 (Greek), cp850 (Spanish and Portuguese, if I recall correctly), cp860 (Brazilian Portuguese), cp866 and cp1251 (for Russian and other East European languages). As far as I know, cp437 is suitable for German. If not, there must be added suitable DOS codepage into "codepages" dict in patchdf.py. You can ask me and I will add it.
Title: Re: Dwarf Fortress localization patch
Post by: ockmonek on September 15, 2016, 03:46:38 am
Thanks a lot.
The legacy-version was the problem. ;)
Now, i can create the patched exe and can use csv in any codepage.

The problem now is the missing codepage for german.
Umlauts are not the right one. See here:
Spoiler (click to show/hide)
"About DF" must be "Über DF" Or "Press" = "Drücke"

dfrus doesn't work with cp437 (Codepage437 not implemented.Skipping.). i can't try, but i think isn't the right one for german.
the csv with cp1252 looks good. i think thats the right one for the codepages dict.
I would be nice when you could add it.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 15, 2016, 05:00:47 am
Thanks a lot.
The legacy-version was the problem. ;)
Now, i can create the patched exe and can use csv in any codepage.

The problem now is the missing codepage for german.
Umlauts are not the right one. See here:
Spoiler (click to show/hide)
"About DF" must be "Über DF" Or "Press" = "Drücke"

dfrus doesn't work with cp437 (Codepage437 not implemented.Skipping.). i can't try, but i think isn't the right one for german.
the csv with cp1252 looks good. i think thats the right one for the codepages dict.
I would be nice when you could add it.
Try not to specify codepage both for po2csv.py and dfrus.py:
Code: [Select]
py -3 po2csv.py de.po de.csv
py -3 dfrus.py -p "Dwarf Fortress.exe" -d de.csv
If it won't work anyway, I'll test and fix it.

Update: I've added stub cp437 entry to the codepages dict, so dfrus.py will not complain that cp437 is not implemented anymore. You need to update your local copy of dfrus-py repository.
Title: Re: Dwarf Fortress localization patch
Post by: ockmonek on September 15, 2016, 07:45:14 am
Works. :)
Thanks a lot.
Now, i will translate.....
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on September 15, 2016, 10:02:21 am
@ockmonek.. you are @Maxxxel on Transifex? Because a few months ago he was the only translator in German. You can try find him. Regards
Title: Re: Dwarf Fortress localization patch
Post by: ockmonek on September 16, 2016, 04:20:39 am
No, i'm ockmonek there.
But I have wrote Maxxxel.

Transifex listed 24 german translators as german translators for Dwarf Fortress.  8)
Maybe i contact them too....  :)
Title: Re: Dwarf Fortress localization patch
Post by: Maxxxel18 on September 16, 2016, 05:17:40 am
Sorry my private situation is currently very busy
But maybe this helps http://www.indiegameforum.de/viewtopic.php?f=14&t=135
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on November 16, 2016, 10:47:07 pm
@insolor .. How to make-a-translation from a MAC? the tuto its only for window..
Title: Re: Dwarf Fortress localization patch
Post by: insolor on November 17, 2016, 12:16:21 am
@insolor .. How to make-a-translation from a MAC? the tuto its only for window..
You mean, make translation for mac version of DF? Currently there's no way to do this.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on November 17, 2016, 07:08:52 am
You mean, make translation for mac version of DF? Currently there's no way to do this.

Ok. Thanks for answer. Regards.
Title: Re: Dwarf Fortress localization patch
Post by: Dirst on November 17, 2016, 11:14:38 am
You mean, make translation for mac version of DF? Currently there's no way to do this.

Ok. Thanks for answer. Regards.
Don't Mac executables have a "resource fork" that include all of the strings?  It might be possible to simply edit that (obviously on a copy of your DF).
Title: Re: Dwarf Fortress localization patch
Post by: insolor on November 17, 2016, 03:59:22 pm
You mean, make translation for mac version of DF? Currently there's no way to do this.

Ok. Thanks for answer. Regards.
Don't Mac executables have a "resource fork" that include all of the strings?  It might be possible to simply edit that (obviously on a copy of your DF).
Actually I don't know. The main problem here is that mac is absolutely foreign platform for me: I have not mac, I have no knowledges on executable file format (and on other technical details).
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on December 11, 2016, 11:10:42 pm
I have a problem at the time of apply translation to the Dwarf Fortress executable:

Code: [Select]
D:\JUEGOS\DF\TRADUCIR HARDCODED>python dfrus.py -p "D:\JUEGOS\DF\PeridexisErrant's Starter Pack 0.43.03-r09\Dwarf Fortress 0.43.03\Dwarf Fortress.exe" -d dictionary.csv --codepage cp850
Loading translation file...
Traceback (most recent call last):
  File "dfrus.py", line 562, in <module>
    _main()
  File "dfrus.py", line 522, in _main
    trans_table = dict(trans_table)
  File "D:\JUEGOS\DF\TRADUCIR HARDCODED\patchdf.py", line 91, in load_trans_file
    for parts in reader:
  File "C:\Program Files\Python35\lib\codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa2 in position 50: invalid start byte

This is the line 50 of my dictionary.csv:

Code: [Select]
Watch ,"Vigilar"
This did not happen a while ago, with earlier versions of .po  :(  :-\
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 12, 2016, 03:13:58 am
It complains about 50 position, probably the 50 character of the file. Is the csv file encoded in utf-8? Please attach the csv file, I will check it.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on December 12, 2016, 06:18:10 am
There mi csv

https://drive.google.com/open?id=0B8b47oDt3w8kNnFFS21jaE1XY3M

Quote
NOTE: I had to change the first code, since I asked for the "codepage" as variable:

python po2csv.py po-filename.po dictionary.csv cp850
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 12, 2016, 06:36:49 am
python po2csv.py po-filename.po dictionary.csv cp850
Now dfrus needs utf-8, so codepage in the command must be utf-8. It also can be omitted (utf-8 will be used by default), but you need to update your copy of df-gettext-toolkit.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on December 12, 2016, 04:35:32 pm
I can run the command now.. the code page was.. thanks!
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on December 14, 2016, 09:08:47 pm
I translated the plain-text with the @TioFauna app but have been having problems running the game, it gets stuck when loading the saved game. I discovered that it is this file, any idea what the problem might be?

https://drive.google.com/open?id=0B8b47oDt3w8kZUR3R2tDTjhtSXM
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 15, 2016, 12:49:10 am
I translated the plain-text with the @TioFauna app but have been having problems running the game, it gets stuck when loading the saved game. I discovered that it is this file, any idea what the problem might be?

https://drive.google.com/open?id=0B8b47oDt3w8kZUR3R2tDTjhtSXM
You mean if the file is not translated the game runs normally?
I will investigate the problem later.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on December 15, 2016, 07:57:25 am
Yes, if you use the original file, it runs without problem. Its strange, since of all the plain text files, only with this I have problems, so I do not think the problem is in the app. Thanks for you time @insolor. Regards :D
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 15, 2016, 08:56:07 am
Yes, if you use the original file, it runs without problem. Its strange, since of all the plain text files, only with this I have problems, so I do not think the problem is in the app. Thanks for you time @insolor. Regards :D
Are you using translated exe file? Try running original exe, and check if it runs normally. Probably there is some bug in translated exe.
Title: Re: Dwarf Fortress localization patch
Post by: utunnels on December 15, 2016, 10:28:03 am
I tried the script po2csv.py, but it didn't output anything but an empty csv file (0kb).
So do I really need to get python 3.4 (currently I have python 3.5)?

Edit*
Never mind, I made a silly mistake. :P
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on December 16, 2016, 01:10:07 am
Yes, if you use the original file, it runs without problem. Its strange, since of all the plain text files, only with this I have problems, so I do not think the problem is in the app. Thanks for you time @insolor. Regards :D
Are you using translated exe file? Try running original exe, and check if it runs normally. Probably there is some bug in translated exe.

Its the same thing with the original .exe .. Remember that this is related to the translation of text files (made by @TioFuna), not with the translation of the executable (made by @insolor)

But I need to correct me, this is the "bug" file

https://drive.google.com/open?id=0B8b47oDt3w8kTGpaRm9QMHdmTzg

I think it is due to some sign or symbol in the file that can not be recognized
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 16, 2016, 01:28:35 am
Yes, if you use the original file, it runs without problem. Its strange, since of all the plain text files, only with this I have problems, so I do not think the problem is in the app. Thanks for you time @insolor. Regards :D
Are you using translated exe file? Try running original exe, and check if it runs normally. Probably there is some bug in translated exe.

Its the same thing with the original .exe .. Remember that this is related to the translation of text files (made by @TioFuna), not with the translation of the executable (made by @insolor)

But I need to correct me, this is the "bug" file

https://drive.google.com/open?id=0B8b47oDt3w8kTGpaRm9QMHdmTzg

I think it is due to some sign or symbol in the file that can not be recognized

Ok, I will test it
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 16, 2016, 02:53:39 pm
Yes, if you use the original file, it runs without problem. Its strange, since of all the plain text files, only with this I have problems, so I do not think the problem is in the app. Thanks for you time @insolor. Regards :D
Are you using translated exe file? Try running original exe, and check if it runs normally. Probably there is some bug in translated exe.

Its the same thing with the original .exe .. Remember that this is related to the translation of text files (made by @TioFuna), not with the translation of the executable (made by @insolor)

But I need to correct me, this is the "bug" file

https://drive.google.com/open?id=0B8b47oDt3w8kTGpaRm9QMHdmTzg

I think it is due to some sign or symbol in the file that can not be recognized

Probably the problem appears because there CVCT_TARGET tag required instead of SYN_NAME in some places. See, original file to the right, translated file to the left:

(http://i.imgur.com/ySwpc9N.png)

After I replaced SYN_NAME with CVCT_TARGET in such places, the game seems to be working fine.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on December 16, 2016, 09:36:29 pm
Yes, if you use the original file, it runs without problem. Its strange, since of all the plain text files, only with this I have problems, so I do not think the problem is in the app. Thanks for you time @insolor. Regards :D
Are you using translated exe file? Try running original exe, and check if it runs normally. Probably there is some bug in translated exe.

Its the same thing with the original .exe .. Remember that this is related to the translation of text files (made by @TioFuna), not with the translation of the executable (made by @insolor)

But I need to correct me, this is the "bug" file

https://drive.google.com/open?id=0B8b47oDt3w8kTGpaRm9QMHdmTzg

I think it is due to some sign or symbol in the file that can not be recognized

Probably the problem appears because there CVCT_TARGET tag required instead of SYN_NAME in some places. See, original file to the right, translated file to the left:

After I replaced SYN_NAME with CVCT_TARGET in such places, the game seems to be working fine.

Thank you very much man! The truth is that you are a f*** genius, I still cant fully understand how that "files" work .. how did you find the discrepancy? with what soft?
Title: Re: Dwarf Fortress localization patch
Post by: Putnam on December 16, 2016, 11:44:02 pm
errorlog.txt ought to catch that, since SYN_NAME is not a valid creature or creature variation token
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 17, 2016, 06:06:11 am
I still cant fully understand how that "files" work .. how did you find the discrepancy? with what soft?

1 - I tried to run the game with the file you supplied. It hangs on loading of creatures.
2 - I compared original and translated files with comparation tool built-in into Total Commander.
3 - Step by step I reverted changes and tried to run game until it runs normally.

When I found the first CVCT_TARGET/SYN_NAME discrepancy, I tried to revert changes in all similar places.

errorlog.txt doesn't help much, in this case it only complains about "ENT... INP..._BODY: Did not find plural token following NAME".

I don't know how raw files work well, but in this case:

Code: [Select]
[CREATURE:GILA_MONSTER_MAN] - create new creature class
[COPY_TAGS_FROM:GILA_MONSTER] - copy (inherit) all properties from the GILA_MONSTER creature class
[CV_CONVERT_TAG] - convert (repalce) some properties
[CVCT_MASTER:STATE_NAME] - in which tag
[CVCT_TARGET:gila monster] - which text to replace
[CVCT_REPLACEMENT:gila monster man] - which text must be inserted as a replacement
... - the same for other "CV_CONVERT_TAG" blocks

What it does, it replaces "gila monster" with "gila monster man" in such places:

Code: [Select]
[STATE_NAME:ALL_SOLID:frozen gila monster venom]
...
[STATE_NAME:LIQUID:gila monster venom]
...
[STATE_NAME:GAS:boiling gila monster venom]
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 19, 2016, 01:02:57 am
BTW, I am too lazy to add it to the instruction, but you can use script translate_raws.py from df-gettext-toolkit to translate files in the DF\raw\objects.

Example of usage:
Code: [Select]
python for_translation_dwarf-fortress_raw-objects_ru.po c:\path\to\DF\raw\objects\ cp1251
(of course you need to use actual filename, path and encoding)

It makes backups for all files it translates. If there are existing backup files, it tries to translate backup files and replaces .txt files.

There also are scripts for all the other files (eg. raw\objects\text\*, data\speech\* etc.), but I see in some of them hardcoded cp1251 encoding, so I need to fix them before I update instructions.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on December 19, 2016, 07:45:09 am
Thank you very much for the info, I didnt know the TotalComander tool as well as your scrip (I dont dig enough hehe). Could that be what @TioFauna used?
Also, some idea of if with that same script one could translate the plain-texts of DF\data\(uncompressed)?
And since we are, although I dont know Russian grammar, I suppose it doesnt look very much like English, did you do something about it? Or for the moment only make a "literal" translation?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on December 19, 2016, 08:02:51 am
Thank you very much for the info, I didnt know the TotalComander tool as well as your scrip (I dont dig enough hehe). Could that be what @TioFauna used?
Also, some idea of if with that same script one could translate the plain-texts of DF\data\(uncompressed)?
And since we are, although I dont know Russian grammar, I suppose it doesnt look very much like English, did you do something about it? Or for the moment only make a "literal" translation?

To unpack/pack compressed files we use a script decode_raw_dwarf_fortress.py (https://github.com/insolor/df_raw_decoder). It is a Python version of analogous script in Perl, which was once posted in this thread. To translate unpacked files there is translate_plain_text.py script in the df-gettext-toolkit repo.

Also there is translate_raws_batch.py script which tries to translate all text files (including uncompressed ones) in the given directory. It works recursively, and can handle such packs as LNP (ie. it translates all included graphical packs at once).

As for grammar: there is another tool - a proxy dll, which intercepts text, which DF passes to SDL_ttf.dll, changes it in some way, and passes it to the SDL_ttf.dll. I posted info about it in this thread earlier: changetext (http://www.bay12forums.com/smf/index.php?topic=108721.msg4603343;topicseen#msg4603343)

> Could that be what @TioFauna used?
I don't know for sure. If I recall correctly, TioFauna tries to make his own version of toolkit in Java.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 16, 2017, 07:24:17 am
Would it be possible to make an "interface" that allows the translation to be more intuitive? And why not, to unify the whole process? As for the "proxy-dll", any guide that you can give me? so that I can make one of Spanish. Thanks
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 18, 2017, 04:19:33 am
Would it be possible to make an "interface" that allows the translation to be more intuitive? And why not, to unify the whole process?

I'm working on it

Spoiler: Screenshots (click to show/hide)

I'll try to complete it next week. Fortunately, we have 4 days off that week because of Defender of the Fatherland Day (Feb, 23) in Russia.

Quote
As for the "proxy-dll", any guide that you can give me? so that I can make one of Spanish. Thanks

I've just found out that in the ChangeTextPy.7z located at https://bitbucket.org/dfint/changetextpy/downloads there is ChangeText.dll which depends on python33.dll, but there is python34.dll instead in the package. I'll fix the package and add some guide how to use it.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on February 19, 2017, 03:01:29 pm
:o (ohhhh) .. thanks for doing so (I thought to offer myself to collaborate in what I could, but...) in any case, if you want, you can delegate me the part of the translation (I do not know if the interface will be multilingual)

I'm waiting for that guide

greetings and happy day (I guess?)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 24, 2017, 06:14:53 am
ChangeTextPy.7z (https://bitbucket.org/dfint/changetextpy/downloads/ChangeTextPy.7z) is fixed now.
How to use: unpack it into DF directory (where Dwarf Fortress.exe is located). All DF 32-bit SDL versions are supported. Run install_fake_ttf.bat. In the init.txt of DF must [PRINT_MODE:2D] and [TRUETYPE:YES].

changetext.py which goes with the package does the following: replaces "Dwarf" with "Human", and reverses order of words in sentences

Code: [Select]
def _ChangeText(s):
    # Examples
    # Replace 'Dwarf' with 'Human':
    s = s.replace('Dwarf', 'Human')
    # Reverse words:
    s = ' '.join(reversed(s.split()))
    return s

Spoiler: Screenshot (click to show/hide)

You can do nearly everything as far as you can implement it in Python :)

For example, here is rather complicated changetext.py (https://bitbucket.org/dfint/changetextpy_script/src/tip/changetext.py) script which we use for Russian.
It tries to fix inflection (using Pymorphy2 (https://github.com/kmike/pymorphy2) library) and order of words in sentences, and does some logging for debugging.

P.S. Please notify me if something is not working.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on March 06, 2017, 12:52:42 pm
Here the first testing version of df-translate tool:
https://bitbucket.org/dfint/df-translation-client/downloads/df-translate.7z

Only two tabs are implemented for now (I posted screenshots of them earlier in this thread).
GUI hangs during downloading of files on the first tab, I will try to make downloading to be performed in the separate process later. Fixed.
The second tab is functional, so you can use this tool as a replacement of command-line dfrus-py.
The application remembers state of controls between session. Configuration file is stored in user's home directory (c:\users\username\.df-translate.json), you can remove it manually to restore default settings.

I'm planning to implement the third tab in the future to apply translation to external files of DF. I don't know how long it will take.

Source code is located here: https://bitbucket.org/dfint/df-translation-client/src
Title: Re: Dwarf Fortress localization patch
Post by: insolor on March 08, 2017, 11:02:37 am
Fixed package of df-translate is uploaded. It did not run if there wasn't some keys in config file (or if there wasn't config file at all). Now the problem is fixed. Also it doesn't hang during translation file downloading.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on March 26, 2017, 07:56:27 am
df-translate updated again: https://bitbucket.org/dfint/df-translation-client/downloads/
* Fixed bug because of which patch worked only with Russian language (thanks to Uğur Öztürk for the report)
* Now you can stop download and patch processes
* Support of a lot of encoding is added. Also, when translation file is chosen in the combobox you see only encodings to which it's possible to encode translation file (i.e. different set of encodings for different languages)
* The program now will show error messages instead of ignoring them. Please, report any errors or problems in this thread or on the issue tracker (https://bitbucket.org/dfint/df-translation-client/issues).

Spoiler (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on March 27, 2017, 08:52:42 am
Many thanks @insolor .. I was looking for, and I found that in df-translate.pyw are the "texts" of the app .. I could upload/send u a Spanish version, so that you compile it? (If I remember correctly, can be done as variants of the same project) or if you explain to me how I do it myself.

Title: Re: Dwarf Fortress localization patch
Post by: insolor on March 27, 2017, 12:09:05 pm
Many thanks @insolor .. I was looking for, and I found that in df-translate.pyw are the "texts" of the app .. I could upload/send u a Spanish version, so that you compile it? (If I remember correctly, can be done as variants of the same project) or if you explain to me how I do it myself.
I will try to use gettext (https://docs.python.org/3.6/library/gettext.html) in the application, so it will possible to export text strings as a po file and eg. upload to transifex. For now I think it's too early because the application will change a lot. And also it would be great if someone review and fix English texts of the app before translation to other languages.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on March 27, 2017, 01:48:31 pm
I will try to use gettext (https://docs.python.org/3.6/library/gettext.html) in the application, so it will possible to export text strings as a po file and eg. upload to transifex. For now I think it's too early because the application will change a lot. And also it would be great if someone review and fix English texts of the app before translation to other languages.

I understand.. i will try to help u with that. :D
Title: Re: Dwarf Fortress localization patch
Post by: insolor on March 27, 2017, 02:23:44 pm
It seems it works, although UI needs some tweaks.
But the program doesn't work when it is complied with PyInstaller (it says "Failed to execute script df-translate"). I will try to use dev version PyInstaller later.

Spoiler (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on June 28, 2017, 06:14:41 pm
Hi.. query.. does anyone have any idea what this is used for?

Spoiler (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: scamtank on June 28, 2017, 08:33:18 pm
Announcements, probably. Just because your basic default citizens will never give birth to more than 2 sprogs at a time doesn't mean the engine just gets to slack off and not be ready for the possibility.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on June 28, 2017, 08:53:39 pm
Thanks x answer :)
Title: Re: Dwarf Fortress localization patch
Post by: milo christiansen on June 30, 2017, 09:25:21 am
Does this work with 64 bit? The repository has no readme or anything...
Title: Re: Dwarf Fortress localization patch
Post by: insolor on June 30, 2017, 09:26:28 am
Does this work with 64 bit? The repository has no readme or anything...
No, 64 bit version is not supported yet
Title: Re: Dwarf Fortress localization patch
Post by: armoha on July 05, 2017, 05:58:36 am
There is Korean translation of DF using modified SDL_ttf.dll. (page: http://nethack.byus.net/gnu4/bbs/board.php?bo_table=df_ko (http://nethack.byus.net/gnu4/bbs/board.php?bo_table=df_ko) )
Spoiler (click to show/hide)

The issues
output looks simmilar to translation using ChangeTextPy alone.

I have questions about Russian version DF, insolor. How is the TTF output project on "Thoughts and Preferences" screen coming along? How did you manage long combat reports, like named noble dorf hits long-named guy with artifact weapon? Thank you.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 05, 2017, 07:20:34 am
There is Korean translation of DF using modified SDL_ttf.dll. (page: http://nethack.byus.net/gnu4/bbs/board.php?bo_table=df_ko (http://nethack.byus.net/gnu4/bbs/board.php?bo_table=df_ko) )
Spoiler (click to show/hide)

The issues
  • multi-line report/announcement is translated improperly, due to word order and grammer differences between English and Korean.
  • "Help", DFHack helper functions and "Thoughts and Prefences" aren't translated. They use graphic font.
  • masterwork mark(☼) is broken(?). dunno why.
  • descriptions in symbol screen
output looks simmilar to translation using ChangeTextPy alone.

I have questions about Russian version DF, insolor. How is the TTF output project on "Thoughts and Preferences" screen coming along? How did you manage long combat reports, like named noble dorf hits long-named guy with artifact weapon? Thank you.

Looks cool  :)

I'll answer you after about 5 hours.
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 05, 2017, 05:02:45 pm
Spoiler (click to show/hide)

As for output of Thougths and Prefences and similar screens in TTF.
Spoiler: some technical info (click to show/hide)

As for long complex sentences (eg. in combat log), now they are looking rather ugly in Russian, even when they fit into one line, but we are working on it. I also tried to transfer some morphological information from each current line to the further line, but the result is still far from ideal.

I don't know what's the problem with the masterwork mark in your case. In case of Russian translation it is broken because it has the same code as Russian letter р (r) in cp1251. I'm thinking of using cp866 instead. In your case I don't see any reason why it could be broken.
Title: Re: Dwarf Fortress localization patch
Post by: maxjonata on July 27, 2017, 06:25:27 am
Portuguese translation are almost completely unrevised, we have a brazillian community here trying to translate some things but would like some attention for us to use it properly if possible
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 27, 2017, 11:59:55 pm
Portuguese translation are almost completely unrevised, we have a brazillian community here trying to translate some things but would like some attention for us to use it properly if possible

I've added you to reviewers for Portuguese (Brazil) (pt_BR).
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on August 21, 2017, 11:42:42 am
Any idea what it might be?

(http://i.imgur.com/VLwvXN2.png)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 21, 2017, 01:35:28 pm
Any idea what it might be?

Spoiler (click to show/hide)

This is a type hint. Type hints in Python are supported since Python 3.3 as far as I remember. The code itself was tested on Python 3.4

Btw. I see you use "bleeding edge" dfrus, so I must warn you that it's usage is changed:

1. Say, you download it as dfrus.zip
2. You must install it with pip install dfrus.zip (I suppose it must be pip3 install dfrus.zip on Linux)
3. Then you can use it from any directory like this:
python -m dfrus.dfrus -p "d:\Games\df_43_05_win32_s\Dwarf Fortress.exe" -n "Dwarf Fortress develop.exe" --debug -d trans_utf8.csv --codepage cp1251
(or python3 for Linux)
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on November 25, 2017, 10:09:18 am
Hi.. another problem when running po2csv  :-\

Quote
Traceback (most recent call last):
  File "po2csv.py", line 7, in <module>
    from .po import load_po, escape_string
SystemError: Parent module '' not loaded, cannot perform relative import

try with the df-translate app and show me this:

Quote
Copying 'D:/****/df_44_02_win/Dwarf Fortress.exe'
To 'D:/****/df_44_02_win\Dwarf Fortress Patched.exe'...
Success.
Finding cross-references...

[PROCESS FINISHED]

But nothing in the game appears translated

CLARIFIED:

Title: Re: Dwarf Fortress localization patch
Post by: insolor on November 26, 2017, 04:26:50 am
Hi.. another problem when running po2csv  :-\

Quote
Traceback (most recent call last):
  File "po2csv.py", line 7, in <module>
    from .po import load_po, escape_string
SystemError: Parent module '' not loaded, cannot perform relative import

try with the df-translate app and show me this:

Quote
Copying 'D:/****/df_44_02_win/Dwarf Fortress.exe'
To 'D:/****/df_44_02_win\Dwarf Fortress Patched.exe'...
Success.
Finding cross-references...

[PROCESS FINISHED]

But nothing in the game appears translated

CLARIFIED:
  • I have Py 3.4.4
  • try with cp850 and cp819 (default in the app)

I will check the first issue. As for the second one, ensure that you are trying to patch 32 bit version of DF. 64 bit versions are not supported yet.
Title: Re: Dwarf Fortress localization patch
Post by: keynux on February 23, 2018, 08:15:30 pm
Quote
Hi.. another problem when running po2csv  :-\

Quote

    Traceback (most recent call last):
      File "po2csv.py", line 7, in <module>
        from .po import load_po, escape_string
    SystemError: Parent module '' not loaded, cannot perform relative import

Hi Isolador. I have the same error, can't put the Spanish traduction. Is Load_po and escape_string a command or need .py archive?

Sorry my bad english! :P
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 25, 2018, 12:17:46 pm
Well, the instruction is rather outdated. Untill I update it, try to use df translation client from this post

Here the first testing version of df-translate tool:
https://bitbucket.org/dfint/df-translation-client/downloads/df-translate.7z

Only two tabs are implemented for now (I posted screenshots of them earlier in this thread).
GUI hangs during downloading of files on the first tab, I will try to make downloading to be performed in the separate process later. Fixed.
The second tab is functional, so you can use this tool as a replacement of command-line dfrus-py.
The application remembers state of controls between session. Configuration file is stored in user's home directory (c:\users\username\.df-translate.json), you can remove it manually to restore default settings.

I'm planning to implement the third tab in the future to apply translation to external files of DF. I don't know how long it will take.

Source code is located here: https://bitbucket.org/dfint/df-translation-client/src
Title: Re: Dwarf Fortress localization patch
Post by: keynux on February 25, 2018, 01:37:38 pm
Df translation client isn't 64 bit compatible.  :'(
I tried but nothing change in the new .exe
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 25, 2018, 01:51:42 pm
Df translation client isn't 64 bit compatible.  :'(
I tried but nothing change in the new .exe

Df translation client uses the same dfrus-py tool which is mentioned in the instruction. It doesn't matter how you use dfrus-py - directly or from df translation client, it doesn't support 64 bit DF anyway.
Title: Re: Dwarf Fortress localization patch
Post by: keynux on February 25, 2018, 07:59:14 pm
Mmm i see, last question.
Hessed.Elohim tries to put the translation in linux, ¿is running good on Linux?

Thanks isolor!
Title: Re: Dwarf Fortress localization patch
Post by: insolor on February 25, 2018, 08:35:51 pm
For Linux there is different project which is supported by other person: https://github.com/kateBy/df_rus_linux
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on April 19, 2018, 05:39:30 pm
Hi.. I have this message:

(https://i.imgur.com/fJc5TCb.png)

any ideas?

EDIT: I wrote "cp819" manually and get this..

(https://i.imgur.com/mVbufIC.png)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 20, 2018, 12:12:55 am
Hi.. I have this message:

Spoiler (click to show/hide)
I'll look today
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 21, 2018, 08:51:52 am
Hi.. I have this message:

Spoiler (click to show/hide)
Simple answer: there is Unicode character \u222b (https://unicode-table.com/en/222B/) (∫) in Spanish translation which is not representable in cp819 (or any 1-byte encoding which why you get empty encoding combo box).

See this: https://www.transifex.com/dwarf-fortress-translation/dwarf-fortress/translate/#es/raw-objects/140188331?q=translation_text%3A∫
(https://i.imgur.com/J2N14xv.png)
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on April 21, 2018, 10:25:12 pm
Perfect.. how do u find the wrong string?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on April 22, 2018, 05:46:50 am
Perfect.. how do u find the wrong string?
At first, I've searched "Unicode 222b" in Google, then I've searched the character I found in translation text for the Spanish language. That's all.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on April 22, 2018, 10:56:46 am
Thakns good man :D
Title: Re: Dwarf Fortress localization patch
Post by: maxjonata on August 13, 2018, 05:57:32 pm
Im looking into Brazillian translations and already did a tutorial on how to use the dftranslate for the translations, but i didnt understood how we can put the uncompressed one, is it not ready yet or there is another app for it?
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on August 13, 2018, 10:42:42 pm
oi @maxjonata .. vou tentar escrever no meu melhor portugues .. primeiro de tudo, voce tentou o app para traduzir o jogo? deixo o link:

https://bitbucket.org/dfint/df-translation-client/downloads/df-translate.7z

(voce precisa ter um usuario transifex)

Saudacoes :D

H . E .
Title: Re: Dwarf Fortress localization patch
Post by: insolor on August 14, 2018, 12:12:55 am
Im looking into Brazillian translations and already did a tutorial on how to use the dftranslate for the translations, but i didnt understood how we can put the uncompressed one, is it not ready yet or there is another app for it?
As for uncompressed files, this functionality is temporarily switched off in the df-translation-client because I planned to make it unpack files in memory instead of writing temporary files on disk. I'm going to work on it in the future (I don't know how soon it will be though).

Spoiler: Code (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on December 03, 2018, 06:55:43 am
Hi @insolor .. Its been a while since we've heard about you. You've been able to make those changes in the df-translate? Regards

H . E .
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on August 29, 2019, 07:41:56 am
Hi
Anyone who can help me interpret this error?
It appears when I want to load the file: "hardcoded_en.po"
Thank you

(https://i.imgur.com/yze0MwA.png)

H . E .
Title: Re: Dwarf Fortress localization patch
Post by: insolor on October 25, 2019, 01:28:13 am
Some news

I've migrated all the repositories (including my personal ones) to Github because I used the Mercurial version control system instead of Git,
and Bitbucket had announced that they will discontinue support of Mercurial soon (Sunsetting Mercurial support in Bitbucket (http://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket)).
I had decided that it is easier to migrate to Github (and convert the repos to Git during the migration) since Bitbucket doesn't have tools to convert repos from Mercurial to Git in place.
Also, Github is more convenient then Bitbucket for my taste.

The new home of the project is https://github.com/dfint

Repositories on Bitbucket will exist at most until June 2020.

Second, I've started to write a new patch that will support new DF versions (both 32-bit and 64-bit).
I don't know how long it will take to get it working, probably a few months.

Spoiler (click to show/hide)

Well, it seems that combo box of available encodings is empty, probably because the application doesn't know which encodings to use for English :)

I'll try to fix all the problems with the client after the new patch is in the working state (more or less).
Title: Re: Dwarf Fortress localization patch
Post by: Seradest on July 01, 2020, 03:02:32 pm
I would love to see a german translation of DF

Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on July 01, 2020, 05:49:06 pm
Hi @Seradest .. new here? We already have a german translation :)

No, i'm ockmonek there.
But I have wrote Maxxxel.

Transifex listed 24 german translators as german translators for Dwarf Fortress.  8)
Maybe i contact them too....  :)

Transifex link:

https://www.transifex.com/dwarf-fortress-translation/dashboard/all_projects/de/

H . E .
Title: Re: Dwarf Fortress localization patch
Post by: Seradest on July 02, 2020, 01:59:35 pm
there is none
i am login and there is no translation of dwarf fortress in german
Title: Re: Dwarf Fortress localization patch
Post by: bloop_bleep on July 02, 2020, 02:06:16 pm
Just an idea -- for the == lines, which you said should be made so that the replacement is the same length as the original, is it perhaps possible to insert null characters into the replacement to allow the replacement to be shorter than the original?
Title: Re: Dwarf Fortress localization patch
Post by: insolor on July 02, 2020, 02:19:22 pm
there is none
i am login and there is no translation of dwarf fortress in german
To be clear: transifex is a place where the translation is performed, but actually there is no DF with the translation applied on this site. And I don't even know if someone tried to do this for the German language. Though you can participate in the translation: translation to German is at about 49% ready.

Just an idea -- for the == lines, which you said should be made so that the replacement is the same length as the original, is it perhaps possible to insert null characters into the replacement to allow the replacement to be shorter than the original?
There are no more == marks. As far as I remember, as of 2016, there were very few places, where length mattered.
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on July 02, 2020, 05:49:39 pm
there is none
i am login and there is no translation of dwarf fortress in german

Hi bro.. here a screenshoot from the link that i send you last time..


Transifex link:

https://www.transifex.com/dwarf-fortress-translation/dashboard/all_projects/de/


(https://i.imgur.com/VqotLcG.png)

H . E .

( EDIT: Sorry @insolor , i dont see ur post  :P )
Title: Re: Dwarf Fortress localization patch
Post by: nasobema on January 17, 2021, 11:17:28 am
Hi all. I am unsure if I should contribute to the translation efforts at transifex.
While I could do some work on the german translation I have no idea (even after reading this old and long thread) if it would ever work reasonably.

Does anyone have experience with applying the translation except for the russion version which apparently does work?
I'm afraid there might be difficulties with grammar leading to ridiuclous results.

And what will Umlauts be a problem, because we have plenty of words with "special" characters in German (äöü and our favorite: ß). I guess, if it manages with cyrillic it should work, right?
Title: Re: Dwarf Fortress localization patch
Post by: ShrekLich on February 18, 2022, 06:07:40 am
Hi all. I am unsure if I should contribute to the translation efforts at transifex.
While I could do some work on the german translation I have no idea (even after reading this old and long thread) if it would ever work reasonably.

Does anyone have experience with applying the translation except for the russion version which apparently does work?
I'm afraid there might be difficulties with grammar leading to ridiuclous results.

And what will Umlauts be a problem, because we have plenty of words with "special" characters in German (äöü and our favorite: ß). I guess, if it manages with cyrillic it should work, right?
CP437 as i seen, has german fonts. So your language shouldn't be problem.

But unfortunately polish fonts are missing. I don't know how actually you guys change fonts to cyrillic, but when i tried load polish translation (not complete yet), game throw some weird signs. I am using cp1250 coding. I decided to change fonts directly in game png image and it worked for me. Of course some of these characters is using in game, but if you are using textures, it doesn't matter at all. For anybody, who wants use it:

go to data/art and paste there this image instead of curses_640x300.png
Spoiler (click to show/hide)

It looks like this:
Spoiler (click to show/hide)
Title: Re: Dwarf Fortress localization patch
Post by: FengMaster on June 14, 2022, 10:14:32 pm
Hello, can I ask whether you can use a coding format other than 1251, such as UTF-8? Although I see that your code seems to support utf8, when I( https://github.com/dfint/df-translate-hook )After the "df_rus.csv" in is changed to utf8 format, the interface displays garbled code.

 ::) ::)
Title: Re: Dwarf Fortress localization patch
Post by: insolor on September 23, 2022, 12:52:27 pm
Hey guys
I have an announcement
I live in Russia, and as you know, Russia is waging a war of aggression against Ukraine. And a few days ago, mobilization was announced. At any moment, I can be taken to the war. I will resist it as much as possible, but I am not immune from it.
Let's hope for the best, but in case of "unforeseen circumstances" I give full administrative rights to https://github.com/dfint github organization to these two people: Hessed.Elohim, TioFuna

Love ya all, guys
Title: Re: Dwarf Fortress localization patch
Post by: PolyZen on October 29, 2022, 03:37:51 pm
I am sorry to read the last message and hope that everything will be resolved as soon as possible....
I am an amateur Italian translator and I am trying to transpose all the information I can about the possibility of translating independently this wonderful game. I've read about the resources on GitHub but following the instructions I can't convert the .po file to CSV nor did I understand if I'm actually translating the correct thing.
I have read that basically the translation is based on extracting the files from the game executable, but can I do this myself via a tool or not? I'm available to talk to someone who is handling this, even in another language to exchange opinions or whatever, maybe on Discord or here if I don't clog too much :)
I thank you as of now!
Title: Re: Dwarf Fortress localization patch
Post by: Hessed.Elohim on October 31, 2022, 01:50:51 am
INSOLOR

I am very sorry for the situation, I hope you are well, and I am waiting for your news.
My situation, a bit complicated too, currently living in Syria (because of that my disconnection situation).
I thank you in advance for your trust and I will do everything in my power to keep all your efforts alive.
Tight hug.
Cheers.  :-*
Title: Re: Dwarf Fortress localization patch
Post by: Braunbert on November 28, 2022, 02:15:45 pm
Dear Insolor,

I hope the war will end soon and you dont have to go there. I wish you the best and pray for you.

To all, i have startet to translater more words in german today on Transifex. I would go on, but can someone tell me if it work in the new version which we get next week?

Regards
Bert
Title: Re: Dwarf Fortress localization patch
Post by: insolor on November 30, 2022, 12:31:21 am
To all, i have startet to translater more words in german today on Transifex. I would go on, but can someone tell me if it work in the new version which we get next week?
We never know before a new release (any release, not only the steam release), if the old tools will still work on it. So, no predictions.
Title: Re: Dwarf Fortress localization patch
Post by: Braunbert on December 01, 2022, 07:24:26 am
Thanks Insolor, this answer is good for me. So I will go on to translate the stuff in german. I will hope, that the new version will work with it else I will play a version which works with your translation.
Title: Re: Dwarf Fortress localization patch
Post by: Crongdyne on February 13, 2023, 07:56:39 pm
Hey Insolor, I hope you are well, I finally managed to translate the hardcoded_steam.po with help from Luca_PolyZen but unfortunately both of us are having issues applying the translation.
He found out about it now that we were trying to test if everything worked fine with the latest conversion programs.

We set up python and gettext, then we converted the translation file, but it appears like the steam_hook doesn't apply it even though they are present; are there any known issues similar to this? We checked the final translation file and the words are indeed translated, just not applied.
The game results half English/half translated as if it was missing words and whole sentences, this was more evident by trying to follow the tutorial.

(https://i.imgur.com/4bg3hUh.png)

As an example here we have the sentence #2025 that is "To change the camera's elevation, press ","Per cambiare la quota della visuale premi ", the hook only "hooks" the word "the" turning it correctly into "la", the rest remains unchanged.

I hope to hear from you soon, and wish to thank you for all the work you're doing for us with this piece of software, issues aside. Strike the Earth!
Title: Re: Dwarf Fortress localization patch
Post by: Seradest on March 28, 2023, 02:32:35 pm
Hier ein video wie man Dwarf Fortress in deutsch übersetzt. Es ist einfach.
Allerdings brauchen die Übersetzer auf der Seite wo die Übersetzungsdatei her kommt noch Hilfe alle restlichen Worte zu übersetzen.
Manches wurde übersetzt aber dafür falsch oder dort steht nut das es übersetzt wurde aber dann isses trotzdem auf englisch.

Here is an video how to translate DwarfFortress in German. Its Easy
Problem is that not many people work on the translation.
https://youtu.be/zkCyfvHYBNM (https://youtu.be/zkCyfvHYBNM)
Title: Re: Dwarf Fortress localization patch
Post by: Moradin on May 07, 2024, 08:02:34 pm
Hey Insolor, I hope you are well, I finally managed to translate the hardcoded_steam.po with help from Luca_PolyZen but unfortunately both of us are having issues applying the translation.
He found out about it now that we were trying to test if everything worked fine with the latest conversion programs.

We set up python and gettext, then we converted the translation file, but it appears like the steam_hook doesn't apply it even though they are present; are there any known issues similar to this? We checked the final translation file and the words are indeed translated, just not applied.
The game results half English/half translated as if it was missing words and whole sentences, this was more evident by trying to follow the tutorial.

(https://i.imgur.com/4bg3hUh.png)

As an example here we have the sentence #2025 that is "To change the camera's elevation, press ","Per cambiare la quota della visuale premi ", the hook only "hooks" the word "the" turning it correctly into "la", the rest remains unchanged.

I hope to hear from you soon, and wish to thank you for all the work you're doing for us with this piece of software, issues aside. Strike the Earth!

Hey all and ciao Crongdyne, I'm also from Italy and I've checked the Italian translation available. However, after trying it out it feels as piecemeal as your screen from last year showed, not gonna lie. Any chances I could pick it up again and possibly fill in its gaps? I hope to hear back from you, or from insolor (who appears to be still active -ish... despite the war and s**t).  8)