Author Topic: Translators, don't forget menus.txt  (Read 314 times)

0 Members and 1 Guest are viewing this topic.

Daneel53

  • Knight at Arms
  • *
    • View Profile
    • Le site de Daneel53
  • Faction: Neutral
  • WBVC
Translators, don't forget menus.txt
« on: April 16, 2019, 10:14:08 PM »
Hello all Viking Conquest translators !

A very long message (sorry) to talk upon a file that all translators forget: menus.txt!

This file is the origin of the file that we must translate, game_menus.csv, that contains all the game menus. All? In fact, if we do nothing, no !

Let's recall how is made a line in all the .csv files, in game_menus for example:
menu_start_game_3|Choose your scenario:
= a label + sign '|' + text to be displayed

You know that by default the English .csv files do not exist into a module. Into Native, for example, if you look into the directory Modules\Native\languages\, you see that there is no directory 'en' at all. So where are the English texts displayed by the game ? Into the .txt files ! The game read all the English texts into the .txt files, and then if another language is required, it look into the languages directories to see if it can find the relevant .csv files. If yes, it loads the foreign texts besides the English ones and match the right texts with the labels.

When you use the Warband function View -> Create Language Template -> Default, the .txt files are read, the text labels and contents are extracted and listed into the .csv files that are generated into the special directory new_language. To generate game_menus.csv, this is the file menus.txt that is read. If you look near the beginning of this file you can find:
Quote
menu_start_game_3 512 Choose_your_scenario: none 2 2133 2 144115188075856180 0 2133 2 144115188075856180 144115188075856180 1
 mno_go_back  0  Go_back  1 2055 0  .
You see that you can find the label and the text given above as example: the label, several numbers and the text (the '_' are replaced by a spaces when written into the .csv file).

This seems fine: each text is identified by its label, we have just to translate the text that is behind the '|', the game will find the translations thanks to the label, perfect! Perfect? No! No, because there is a big issue with menus.txt : a lot of labels are duplicated!

The problem

Let's come back to this label, mno_go_back. If you search through menus.txt, you will find three occurences of this label :
mno_go_back, Text 1 : Go_back
mno_go_back, Text 2 : Go_back.
mno_go_back, Text 3 : No.


And what do we find into the game_menus.csv file?
mno_go_back|Go back

And that's it! Where are the two other possible texts related to the label mno_go_back? Nowhere! Because in the .csv file there can be only one entry for a certain label, so only one line is present into the .csv file, the other ones are lost for the translations in foreign language. To be clear, if the game in English shall display in different menus 'Go back', 'Go back.' or 'No', into a translation only the translation of 'Go back" shall be displayed, even when it should be written 'No'!

You may think that, in this case, this is not very important to display 'Go back' instead of 'No'. But there are cases of duplications that are much more confusing. This one for example :

mno_choice_26_3b, Text 1 : Prove_yourselves_worthy_by_raiding_a_village.
mno_choice_26_3b, Text 2 : Well_done!_An_officer_will_show_you_to_your_places.


The only entry found in game_menus.csv is (you can check by yourselves):
mno_choice_26_3b|Prove yourselves worthy by raiding a village.

I let you imagine how will react the non-English player when he will be invited to raid a village instead of simply going to his quarters into the camp...

Normally, the developers should use labels that are all different into the .txt files so that we can find all of them into the .csv files. Unfortunately, this is not what they do into menus.txt. Yes, most of the labels are different, but not all of them, and because they write their mods in English and play them in English only, they do not see that in foreign languages some menu entries are totally wrong because some entries are missing into game_menus.csv.

This issue exists in ALL Warband mods, including Native. Yes, even in Native a translation cannot be complete if we are not aware of this issue. Here are all the duplicated labels in Native 1.174 that, by echo, we find in almost all the other mods: 

(click to show/hide)
And now, all the duplicated labels in Viking Conquest 2.049:

(click to show/hide)
A funny thing is that you can see that sometimes the VC devs team discovered and fixed some of the duplications that exists into Native :

mno_continuewo Tell_the_woman_to_inform_her_mistress_that_you_will_come_shortly.
mno_continuewo2 Tell_the_woman_to_inform_her_mistress_that_you_are_indisposed.


Yes, they changed the labels by adding 'wo' and 'wo2' so that the two entries exist into VC. Unfortunately they did not deal with all the duplications, so we have to finish the job.

The solution

To avoid such label duplications, there is only one solution: change the labels so that they are not anymore the same. And because the developers don't do it into their file menus.py that, once executed, generate the file menus.txt, we have to do it after the delivery by ourselves into menus.txt.

The first time that I did that, I did that by hand. It was for the French translation of ACOK 5.0 and I spend several hours to postfix the 425 duplicated labels of this mod. Once the job done, I recovered 378 entries into game_menus that did not exist before (I'm not kidding, 378 new entries because some labels had more than 80 different texts in menus.txt!). I did it once and promised myself never do it again. A short abstract from ACOK 5.0 (yes, 87 different texts for the label mno_choice_10_1, all texts being totally different):

Quote
mno_choice_10_1, Text 1 : Accept.
mno_choice_10_1, Text 2 : Allow_poaching.
mno_choice_10_1, Text 3 : Apologize_to_the_septon.
mno_choice_10_1, Text 4 : Ask_him_to_sing_'The_Rains_of_Castamere'.
mno_choice_10_1, Text 5 : Avoid_the_stag.
mno_choice_10_1, Text 6 : Buy_ale_and_roasted_boar!_(1000_coins)
[...]
mno_choice_10_1, Text 86 : The_lamb_was_delicious!
mno_choice_10_1, Text 87 : Yank_back!
87 entries mno_choice_10_1, and only one line in game_menus.csv: mno_choice_10_1|Ready your gear.

What does it mean for the player to read (in his language) 'Ready your gear' when he should read 'The lamb was delicious' or 'Buy ale and roasted boar! (1000_coins)'?

So I decided to write some code in order to do this automatically. Because I develop since 2010 a specific tool dedicated to the translation in French of M&B and Warband mods, Traduire M&B, I've added the procedure into my tool. The above abstracts are outputs from my procedure. What performs this code ? It reads menus.txt, it compiles all the labels and the number of occurences, for all labels that have at least two different texts, it postfix the labels with '_mx' so that the labels become all different, and finally it generate a modified menus.txt with no duplication (and several log files from where come the above abstracts). The result?

Before in menus.txt:
mno_choice_10_1  0  Allow_poaching. 
 mno_choice_10_1  0  Ready_your_gear.   
 mno_choice_10_1  2 2167 1 1224979098644774912 30 2 1224979098644774912 1  Yank_back!

Before in game_menus.csv:
mno_choice_10_1|Ready your gear.

After in menus.txt :
mno_choice_10_1_m2  0  Allow_poaching.
 mno_choice_10_1_m61  0  Ready_your_gear.
 mno_choice_10_1_m87  2 2167 1 1224979098644774912 30 2 1224979098644774912 1  Yank_back!

After in game-menus.csv
mno_choice_10_1_m2|Allow poaching.
 mno_choice_10_1_m61|Ready your gear.
 mno_choice_10_1_m87|Yank back!


Convinced? 86 mno_choice_10_1 labels, all different, appeared into game_menus.csv, ready to be translated!

So, and now?

I hope that all translators understood that to modify menus.txt is absolutely necessary if you want to have ALL menus entries correct into your translation.

I've passed my code on the menus.txt of VC 2.044 : 37 entries are missing in game_menus.csv.

Because we are here in the Viking Conquest forum, as soon as the final 2.049 shall be released, I will download it, modify immediatly the file menus.txt with my procedure and I will post here the link toward the modified menus.txt that I will deposit on my Google Drive.

ONLY AFTER you will replace the original menus.txt with mine without duplicated labels and use the Warband procedure to generate the 2.049 English .csv files into the new_language directory, where, hurray, there will be all the menu entries into the game_menus.csv file!

And a last and special word for Viking Conquest developers, if they had the courage to read this big message: please, please, please, modify your file menus.py to suppress all the duplicated labels (you have the list above), so that, after the next patch, the translators may have directly a complete game_menus.csv that permits to translate 100% of your mod without having to modify the file menus.txt!

Thanks everybody for reading!  :grin:

« Last Edit: April 16, 2019, 10:30:05 PM by Daneel53 »

Daneel53

  • Knight at Arms
  • *
    • View Profile
    • Le site de Daneel53
  • Faction: Neutral
  • WBVC
Re: Translators, don't forget menus.txt
« Reply #1 on: April 19, 2019, 06:10:09 PM »
Please find an archive that contains:
  • The file menus.txt, modified so that there is not anymore duplicated labels.
  • The 16 .csv files to translate, with a file game_menus.csv that fits exactly with the modified menus.txt.
Here is the link toward my Google Drive:
https://drive.google.com/open?id=1x4C0uz8_umetg-wRRW2QZF62QuY84Q4J

Here is the final list of duplicated labels into the file menus.txt of Viking Conquest 2.050 :

(click to show/hide)
If some of them are not big issues, other ones will generate weird results for the players. This one for example :

mno_leave_men, Text 1 : It_makes_me_uneasy._Forget_about_it.
mno_leave_men, Text 2 : Leave_the_men_to_their_fate._They_knew_what_was_coming.


In the first case, the player cancel an order to ambush, in the second he decides to leave some of his men be killed. If we let menus.txt as it is, we find only "Leave the men" in game_menus...

This one too :
mno_regreso_lucha, Text 1 : Victory!
mno_regreso_lucha, Text 2 : Your_worst_fears_have_come_true.
Only the second entry exists in game_menus, so this is what will be displayed instead of "Victory!". Not the same, isn't it ?

So, we, translators, must absolutely modify menus.txt in order to have all the menu entries into our translations. If not, at some moments, the behaviour of the game will seem stupid, or bugged, when it is only an issue that appear into the translations.

You can check into the game_menus.csv files that are delivered with the game, for example the entry corresponding to "mno_regreso_lucha|Victory!": it does not exist into the German translation, nor in the Spanish one, nor in the Turkish one. All the translations delivered with the game are incomplete, even the very last one, the German one. Too bad !

So if somebody wants to realize another translation of Viking Conquest, please take the modified files that I provided this afternoon.

And once again, if somebody of Brytenwalda team read this message, please fix your menus.txt so that all your foreign users may have a 100% complete translation in the future.

Thanks for reading and feel free to comment if you wish.  :smile:
« Last Edit: April 19, 2019, 11:50:36 PM by Daneel53 »

CeltiberoCaesar

  • External Developer
  • *
    • View Profile
  • Faction: Neutral
  • WBVC
Re: Translators, don't forget menus.txt
« Reply #2 on: May 29, 2019, 07:57:21 PM »
Hi Daneel53,

thank you for taking the time to make this long post for other translators :D

We are addressing this issue, expect to have it fixed as far as we can in the next patch.

regards,

Caesar

Daneel53

  • Knight at Arms
  • *
    • View Profile
    • Le site de Daneel53
  • Faction: Neutral
  • WBVC
Re: Translators, don't forget menus.txt
« Reply #3 on: May 30, 2019, 08:59:58 AM »
Thank you, it would be very nice.

Regards, and keep on the good job.  :smile:

motomataru

  • External Developer
  • *
  • Battles are best won before the fighting begins.
    • Skype - motomataru
    • Steam - motomataru
    • YouTube - motomataru
    • View Profile
  • Faction: Rhodok
  • MP nick: Motobert
  • M&BWBVC
Re: Translators, don't forget menus.txt
« Reply #4 on: July 09, 2019, 07:12:14 PM »
Addressing the issue now. Thank you, Daneel, for this significant contribution!


Daneel53

  • Knight at Arms
  • *
    • View Profile
    • Le site de Daneel53
  • Faction: Neutral
  • WBVC
Re: Translators, don't forget menus.txt
« Reply #5 on: July 13, 2019, 08:05:54 PM »
By doing that, you would be the first team ever to deliver a mod without any duplicated label in menus.txt. That would be great for all non-English players !  :grin:

motomataru

  • External Developer
  • *
  • Battles are best won before the fighting begins.
    • Skype - motomataru
    • Steam - motomataru
    • YouTube - motomataru
    • View Profile
  • Faction: Rhodok
  • MP nick: Motobert
  • M&BWBVC
Re: Translators, don't forget menus.txt
« Reply #6 on: July 14, 2019, 01:45:58 PM »
Woot!
I've made the changes. Just waiting on our local localizations (Spanish, German). Then if we have no more pending issues, we'll make a build for release.
Merci, mon ami, pour tout tu travail...
« Last Edit: July 14, 2019, 01:48:26 PM by motomataru »