Tutorial Other [Tutorial, Translation] Bannerlord Translation Tutorial and Translate M&B tool

Users who are viewing this thread

Daneel53

Sergeant Knight at Arms
Mount&Blade I and its successors Mount&Blade Warband and M&B II: Bannerlord have been designed from the start to facilitate both mod development and the translation of games and mods into any language the users may desire.

For translators, TaleWorlds provides in the distribution of Bannerlord all game texts as .xml files, which are text files that you simply translate and then drop into language-appropriate game folders so that the game is displayed in the language of your choice.

Translating .xml files seems an easy operation since they are simple text files. But in the end, the whole translation operation has enough pitfalls and questions that many beginners in translation get lost along the way or, at least, don't know how and where to start

In the same way that I've written a Warband Translation Tutorial, I decided to write a Bannerlord Translation Tutorial that is the result of the experience I gained during the hundreds of hours spent behind my keyboard, translating into French the successive versions of Mount&Blade and then Warband since 2009 and many other mods up to now, and then translating in French the Beta release of Bannerlord from October 2019 to end March 2020, and finally producing French localization for Bannerlord EA releases up to 1.6.5. Because today Bannerlord is still in early access and mods to translate merely exist and are not stable, this document will talk only of the translation of Bannerlord, even if many rules explained hereunder shall apply to translate Bannerlord mods when they will fully exist.

I’m French, so many snapshots will describe how to realize the French translation of the game. However, the whole process described here is perfectly valid for any language, being understood that each language will have to be dropped in its specific folders: cns, de, es, fr, hu, etc.
Today, August 2022, Bannerlord is delivered with a long list of translated languages (Brazil-Portugese, Chinese, French, Spanish…) since release 1.7.0. Since then the present document may seem become useless to translate Bannerlord in these languages, but it may still be useful for not yet translated languages, to fix the official localization if it has defects or is not complete, and it will be useful when the community will have to translate the big mods that will be put on line when Bannerlord, if it happen one day, will get out the early access state and will be at last stable, something moders are waiting for since more than two years.

Bannerlord is still moving, the file structure may change at any time. Recently I discovered that two additional TW modules appeared into the game in 1.8.0, BirthAndDeath and Multiplayer. There is today no file to translate into these two new modules, so no matter for the moment, but that may change one day. If needed, the Translation Tutorial will be updated.

The document is 20 pages long, so I will not try to expose its full content in this forum.
In the tutorial, you will find:
- The file structure of the game.
- Information upon the files list to translate and how to obtain the English files.
- Description of the content of these files and how to edit them.
- Description of all the variables and special syntaxes that you will find ({SETTLEMENT}, {PLAYER.NAME}, {?X.Y}Case A{?}Case B{\?}...) into the sentences to translate and how to deal with them.
- Understand the language dependent tokens: {.a}, {.d}...
- How to switch from a version translation to another version.

You can take my Bannerlord Translation Tutorial here: https://bit.ly/2W4ClT1

To help me realize all those translations, I've developed since 2010 specific tools for Warband and then Bannerlord. Today remains only one tool, Translate M&B, that can be used for both Warband .csv files and Bannerlord .xml files. This tool have an interface in both English and French. It has a complete User Manual in English that explain in details all its functionality.
This tool is not only a simple file editor. It brings many functions specifically dedicated to Warband and Bannerlord files as Automatic Initialization that will permit you to gain dozens of hours. I invite you to download it and check what this tool can do to help you to realize your translations.
The package of this tool contains:
- The tool Translate M&B, v1.3.0.0 (May 2022),
- The User Manual (May 2022),
- The Warband Translation Tutorial (May 2022),
- The Bannerlord Translation Tutorial (May 2022).

You can take the Translate M&B package here: https://bit.ly/TransMB


Who am I?
Since 2009, after M&B I and Warband, I've fully translated in French more than fifteen different mods and, for most of them, several successive versions. Some examples: ACOK, Diplomacy, L'Aigle, Nova Aetas, Perisno, Star Wars Conquest and Viking Conquest. My translations are directly integrated into the distribution of three mods: The Last Days, Prophesy of Pandor and A World Of Ice And Fire.
Since 2019, I've too fully translated in French the beta version of Bannerlord, then with two friends almost all versions of Bannerlord EA up to version 1.6.5 (official French localization is provided by TW since version 1.7.0).
Outside TW world, I've translated in French a big mod for The Witcher 2: The Farewell of The White Wolf; my translation is included into the mod.
 
Hi!

Since the release of official French translation into Bannerlord version EA 1.7.0 during december 2021, I stopped creating Bannerlord translations and so I stopped using this software to inialize the French files of new Bannerlord versions. Since then Bannerlord evolved, it was officially released in October 2022 and its content evolved too. The game now spread on 8 modules instead of 5, the translation files have now their names postfixed with the name of the language ("-fre" for French for example), and an additional mandatory file language_data.xml into each translation files folder appeared.
Beside that, mods for Bannerlord begun to appear and their files to translate do not have exactly the same structure as the officiel Bannerlord files. Notably they contain void lines and comments, which is not the case into the official files.
All this to say that I had to make my software evoluate so that it does not crash with some new files to translate and all of its functionality keeps on working properly.

So I just put in line version a new package that contains:
- The tool Translate M&B, v1.4.0 (16 February 2023),
- The User Manual (February 2023),
- The Bannerlord Translation Tutorial (February 2023),
- The Warband Translation Tutorial (May 2022).

The new release replace the previous one, link to download is unchanged: https://bit.ly/TransMB

All changes are dedicated to Bannerlord and its mods.
  • Void lines in the files to translate are kept into the translated files.
  • XML comments as "<!-- XXX -->" are kept into the translated files.
  • To take into account the header of XML files, the line number in the main panel does not anymore begins by 1 for the Bannerlord files. The line number is now the real line number as it may be displayed by Notepad++. The header lines are not displayed.
  • Even if they are not to translate, void lines and comments are displayed into the main panel with a special ID so that the user is not surprised to see the line number "jump" and some line numbers not displayed.
  • As it is the case for Bannerlord official translations from TaleWorlds, translated files are now postfixed with a language extension as "-fre" for French (may be modified with new parameters in Options screen).
  • First lines of XML files to translate are stored and written as is into translated files in order to respect the format of original files. The goal is to keep a strict equivalence between number of lines of mod files and translated files and to take into account the fact that the line with tag "base" is sometimes specific for some mods. Exception for the tag language that is still written dedending the translation language (ex: <tag language="Français" />).
  • The tag language is not present anymore into Bannerlord English files to translate since 1.0.x. If the tag is not present into the English file, the TL initialization function add the three needed lines into the translated files.
  • The mandatory file language-data.xml into language files folders is now automatically generated by the TL initialisation function into the language file folders.
  • It is now accepted by the automatic TL initialization function that Bannerlord mods may be composed of only one module and so have files to translate that are not spread among several modules (as for Warband mods).
  • It is now possible to inialize a translation without any translation source. For Bannerlord mods, this permit to create automatically the files to translate with the correct tag language, the file postfix and the mandatory file language-data.xml.
  • The special file <tl>_functions.xml (ex: fr_functions.xml) that is not to translate but must be present into the translated files of Bannerlord's module Native is now automatically copied from TL reference folder Native to TL files folder Native during TL initialisation function if it is present.
  • Fixed a crash into the Erase {***} function.
  • The software User Guide has been updated to describe the changes and new functionality.
  • The Bannerlord Translation tutorial has been updated to cope with new game files content.
For all those that were using this tool for Bannerlord, please use this new release 1.4.0 that will bring you additional functionality... and may be fix some bugs that appeared since Bannerlord is out of EA. :xf-smile:

If you have any remark, don't hesitate to contact me (links given in the Readme file that is into the archive).

Warning:
Due to all novelties into the structure of Bannerlord game and mods files, I updated all code linked to automatic initalization of translated files, but the functions linked to translation library generation do not work properly anymore for Bannerlord. So please don't try to generate a translation library for Bannerlord. This is not a problem for now because translation libraries for Bannerlord are not yet useful as I explain into the User manual. I will anyway fix the code of these functions, but because there is many code to change and I don't want to delay any further the output of version 1.4.0, I will do that later.
 
Hello guys,

I spent several days to review the generation of translation libraries for Bannerlord game and mods and to adapt the code as needed. After a lot of testing I think everything is fine now.

The package Translate M&b version 1.5.0 dated February 22, 2023 is now available with the usual link: https://bit.ly/TransMB

This release marks the end of the modifications that I had in mind to adapt the software to Bannerlord game and mods as they are today, so normally the software will not evoluate anymore soon.

If you find bugs or have any remarks, don't hesitate to contact me.

Good translation ! :xf-smile:
 
Hello!

Just put in line Translate M&B version 1.5.1 dated March 13, 2023.

I found a bug into the TL initialization function (for Warband only) that caused the two last lines of the generated files to be behind each other on the same line instead of being on two separate lines.

Please download this version and replace the previous one. :xf-wink:
 
I have a problem.

I create a new language, and will upload to steam workshop, so I create a new module folder.

My question is that the new language does not use official font file?

This is my test files, game version is v1.1.2.
Test Language Module

{module}/ModuleData/GUI/Fonts/{module name}Languages.xml
XML:
<Languages DefaultLanguage="English">
  <!-- TestLanguage -->
  <Language id="TestLanguage" DefaultFont="simkai" LineSeperatorChar="-">
    <Map From="FiraSansExtraCondensed-Light" To="simkai"/>
    <Map From="FiraSansExtraCondensed-Medium" To="simkai"/>
    <Map From="FiraSansExtraCondensed-Regular" To="simkai"/>
    <Map From="Galahad" To="simkai"/>
    <Map From="Galahad_Numbers_Bold" To="simkai"/>

    <ForbiddenStartOfLineCharacters Characters="!),.:;?]}¢·–— '&quot;• 、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、&#8288;"/>
    <ForbiddenEndOfLineCharacters Characters="([{£¥'&quot;‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏&#8288;"/>
    <NewlineDoesntRequireSpace/>
  </Language>
</Languages>
This code copy from chinese, use same offical font "simkai".

{module}/ModuleData/Languages/TEST/language_data.xml
XML:
<?xml version="1.0" encoding="utf-16"?>
<LanguageData id="TestLanguage" name="TestLanguage" subtitle_extension="zh-HANT" supported_iso="zh-HANT,zh-tw,zh-hk" under_development="false">
  <LanguageFile xml_path="TEST/SandBox/std_SandBox_View.xml" />
</LanguageData>
This code copy from chinese, use "uft-16".

{module}/ModuleData/Languages/TEST/SandBox/std_SandBox_View.xml
XML:
<?xml version="1.0" encoding="utf-16"?>
<base xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="string">
 <tags>
  <tag language="TestLanguage"/>
 </tags>
 <strings>
  <string id="171fTtIN" text="測試模式"/>
 </strings>
</base>
This code copy from chinese, use "uft-16", and change game main menu option text "Sandbox" to "測試模式".

In game main menu, the option text is changed, but show "OO", cannot display the word.

Do you know, what is my mistake?

Thank you for your read.
 
Last edited:
Hello!

There should not be a folder Sandox into the folder TEST.

The place where is your language_data.xml file is correct, it must be placed into SandBox/ModuleData/languages/TEST.
But your file std_SandBox_View.xml must be placed too into SandBox/ModuleData/languages/TEST and the path indicated into language_data.xml must be xml_path="TEST/std_SandBox_View.xml".

You must have this:
SandBox
--ModuleData
----Languages
------TEST
--------language_data.xml
--------std_SandBox_View.xml

Hope it helps! :xf-smile:
 
To translate in Czech, I'm obliged to do exactly what you can do by yourself: to use DeepL !

Anyway...

Do složky TEST by neměla být vložena složka Sandox.

Místo, kde se nachází váš soubor language_data.xml, je správné, musí být umístěn v SandBox/ModuleData/languages/TEST.
Ale váš soubor std_SandBox_View.xml musí být také umístěn do SandBox/ModuleData/languages/TEST a cesta uvedená v souboru language_data.xml musí být xml_path="TEST/std_SandBox_View.xml".

No idea if what is written above has any meaning...
 
Hello,

I recently encountered an issue while modifying the server configuration for “Mount & Blade II: Bannerlord.” Specifically, I made changes to the names and descriptions of unit skills on the server side. However, upon entering the game, I noticed that there were no visible differences. It turns out that the language displayed in the game is sourced from the players’ local files rather than the server files.

Each soldier’s skill descriptions are stored in the language folder located at Mount & Blade II Bannerlord\Modules\Native\ModuleData\Languages. The language file I modified on the server side resides in .Mount & Blade II Dedicated Server\Modules\Native\ModuleData\Languages

Is there a way to ensure that players can read the language file I modified on the server without requiring them to download any additional content?
 
Hi,

I think this question should be asked to TaleWorlds themselves, but I don't see them take into account into a server a language option that is present on the client machines and accept language files on the servers.
 
Back
Top Bottom