How to translate AVSB in other languages

Thank you for offering to help translating my game in your language!

I don’t have an editor yet, so all changes must be done in some special script files. You can download the latest version of the game and look into the \Data\WFH\modules\language\ folder.

"0_en-INTL" folder contains the official translation in English and it should always be there. Additionally you may find other translations there, such as "es-AG" or "de-DE". I would suggest that you start form the English translation as this is the "original" language of the game, but you can start whichever other language you prefer.

Copy the “0_en-INTL” folder and paste it at your location of choice.
Rename it according to your language, for example "fr-Fr" (for French/France), "es-ES" (for Spanish/Spain), "es-AR" (for Spanish/Argentine).

Note!
The name of the English folder may look a bit strange with that "0_" prefix but this is needed in order to ensure the English version is displayed on  top of the list. All other languages are listed alphabetically. Please do not add such prefixes to your languages.

Note!
If you do not know the international codes for your language/country, please let me know and I’ll look them up.




Important note!

The game should be able to handle all letters and signs used in European languages, including Bulgarian and Greek (let me know if it doesn’t), but I can not handle all alphabets in the world. As a consequence, my game won’t be able to display symbols in alphabets such as Chinese, Arabic, Thai, Hebrew. Also, it may not be able to display Russian glyphs (I am not sure about that as it can handle Bulgarian, if you are translating this game in Russian, please let me know).

Once you have unpacked the zip and renamed your folder, you can start editing the files. You can use an editor like Notepad++, MS Code, Sublime or Atom. Here, you can set the syntax to something that highlights the c-cup strings. From my experiments, “D” language works best, but you may also try syntaxes for C, C++, C# or JavaScript.

Here is a screenshot from Notepad++ with D syntax:


Note: To change the syntax in Notepad++, go to Languages → D → D.

In the screen above, texts with green are just comments. You don’t have to translate these.
The only texts that are meant for translation are the ones with gray.

As you can see, the texts are structured like this:
string _languageItem_Title = "English - International";

You should only translate what is bordered by commas (grayed texts in D language).

Sometimes this text is longer than one line, such as:
string _info_Text = "This is a version of English that should be understood by anyone.
Translated by: Grabiobot
Maintained by: Grabiobot
For corrections and feedback, please leave a comment on:http://grabiobot.blogspot.com/languages-en-intl";

In this case you should preserve the empty lines (these contain some space characters, needed by the game engine).





Special cases and exceptions




Accolades


Sometimes the text contains accolades. 
Please do not change the texts inside accolades!
string _LargeTextTemplateAbout= "A Very Small Business (AVSB)
Game version: {0}Date: {1}

Content installed:* A Very Small Business main content
                   Content version: {0} 
                   Date: {1}";
In the example above, please do not remove or change the “{0}” and “{1}” parts.



Paths


Also, these files may sometimes contain references to path or name-codes that are somehow linked to translations. These should not be changed. I’ll try to move all these in a different location for future releases.
string _File_Credits = "WFH/modules/language/" + _language_ + "/credits.txt";
Do not edit this path unless you have a good reason to rename or relocate the credits.txt file.





Testing your translation




You can test your translations but, depending on what you are translating, you may need a different setup. 



Translating a released version



If you are translated a currently released version, you can just copy/paste your language folder inside the "language" folder of AVSB. Full path may be something like this:
c:\Program Files (x86)\AVSB\Data\WFH\modules\language


In the screen above you can see "es-AR" pasted inside the "language" folder.



Translating a preview version


In order to test a translation for a version of AVSB that isn't yet released, you will need the preview version of AVSB. This version is not ready for publishing and may be buggy! Please contact me if you intent to translate a preview version.

Although translating a preview version is a bit more challenging, because of the possible bugs and because there may still be some minor changes before the game is publicly released, there is also an important advantage: translations completed before the game is published are included in the release.



How to test


When you start the game it should detect the new language and offers the possibility to use it. Then just play the game and you will see if your translation is ok in game-world context.




Bugs and limitations




Already learned texts

Support for multiple languages is still at the beginning. As a consequence, you may encounter a few problems. For example, if you save the game with one language and then re-load it under a different language, the results may be a bit bizarre (some texts are from the original language, some other text are from the new language).


I don't have a fix for this yet. Currently the game remembers the content of all language file is read, so when you load a game he will remember all old texts, even if you already changed the language files!



Random events

There are some random (semi-random) events in AVSB. For example, the line that Hannah will use when you "small talk" to her. Testing these translations may be difficult, as you will need many attempts before Hannah will say the line you are looking for.

The only advice I can give you here is to pay extra attention when translating these lines. 



Error handling


The game has little tolerance to error in language files. Please make sure you don't accidentally remove any important content of the files you are translated. Pay special attention to closing " (commas), ending ; (semicolon) and remember not to alter the content of {} (accolades). 
Also, make sure you don't accidentally type any additional character outside comas.
Something like this may break the game:
string _languageItem_Title = "English - International";.

Did you notice the extra "." (dot) after the ";" (semicolon)?

Anyway, as long as you pay some attention to what you are doing and you follow these rules, you should be safe from any major error. 




Sending translations




Once you have translated all files pack them all files in a zip. 
If this is a translation for a preview version, then send me that zip and I'll include it in the next release.
If this is a translation for an already released version, you can send it to me and I'll upload it on my blog. Also, if you would like to be contacted when a new preview version is prepared, please let me know.




That's all!




Once again, thank you very much for your help!

Grabiobot




No comments:

Post a Comment