• Welcome to AtomicTorch Studio Forums.
 

VoidExpanse Language Tools

Started by csanchez, November 22, 2023, 01:17:30 PM

csanchez

AtomicTorch_ModsLocalizationUtility is a functional tool, but it has some drawbacks that can make it difficult to translate VoidExpanse language files:

  • The program's resolution is too large and does not scale correctly in full screen.
    This can be a problem for users with low-resolution monitors.
  • Language files are displayed in 4 general categories.
    This can make it difficult to track files and keep files up-to-date.
  • The tool lacks additional information that can be useful when making a translation.

That's why I present VoidTranslator
A tool designed to make the translation of the game language files faster and more comfortable.


VoidTranslator Features:

  • Smooth file navigation: Switch between translation files quickly and easily, even if you have a lot of files open.
  • Small initial window: VoidTranslator starts with a small window, perfect for working on laptops or computers with limited screen space.
  • Full screen window: The full screen window adapts perfectly.
  • Find text in all files: Quickly find the text you need in all translation files.
  • Highlight matches: VoidTranslator highlights the cells that match your search query, so you can see them at a glance.
  • Number of lines: Get information about the number of lines in each translation file.
  • Number of changes: Check the number of lines that have been modified in each file.
  • Separate change saving: VoidTranslator saves changes to each language file separately, making collaborative work easier.
  • Compatible with any system: VoidTranslator works on any system running Python / PyQt5, including Windows, macOS, Linux and Haiku.

Missing features of VoidTranslator:
  • You cannot create language MODs.
    You can add the language directly in the game language folder (VoidExpanse\Core\data\languages).
    In case you want to create the MOD, you can use AtomicTorch_ModsLocalizationUtility anyway.
  • Display multiple language files/columns simultaneously.
    I think it is not really necessary when you only want to translate from English to any language (usually).
  • Import/Export CSV
    You don't need to edit any CSV file having VoidTranslator.

In addition to VoidTranslator, there are two simple tools that I recommend using first, VoidFilter and VoidRenamer.

VoidFilter is used to filter all the language files in a folder, deleting the rest of the files.


VoidRenamer is used to rename all language files, e.g. change all "en_us" files to "es_es".


Downloads:
VoidFilter, VoidRenamer and VoidTranslator Python scripts.
Requires Python and PyQt5 to run, install with "pip install PyQt5".
VoidExpanse Language Tools (https://www.mediafire.com/file/fnpsnzmirsxtjw5/VoidExpanse_Language_Tools.zip/file)

Windows binaries, do not require Python installed.
VoidTranslator (https://www.mediafire.com/file/dfiumwxw5x2t7ab/VoidTranslator.exe/file)

csanchez

#1
How to start translating the game

1. Go to the VoidExpanse installation folder, you will find a folder "Core" and inside it a "core.cpk" file.
This "core.cpk" file contains the files needed to start the game (graphics, sound, music, text, etc).
It is basically a compressed *.zip file.


2. Extract the core.cpk archive with any tool such as 7-Zip or WinRAR.
Rename the "core.cpk" file to anything else, e.g. "core-original" or move the file to another folder outside the "Core" folder.
Rename the "core" extracted folder to "core.cpk".
This will allow you to test the translation or modify any aspect of the game without repacking the core.cpk file.
A really great option from AtomicTorch ;D


3. Open the extracted "Core" folder and make a copy of the "data" folder in another location.


4. Run the VoidFilter tool, select the data folder you just copied and press Start.
All files will be deleted, except those that are "en_us" (or the language you select).
VoidExpanse is officially translated into English (en_us) and Russian (ru_ru).
You can close VoidFilter.


5. Start VoidRenamer and select the "data" folder again.
Now select with which language code you want to rename the files and press Start.
The language code of all files inside the selected folder will be renamed to the selected one.
You can close VoidRenamer.

Note, VoidRenamer currently has 8 language codes, which are en_us, es_es, fr_fr, de_de, it_it, pt_pt, ru_ru and zh_ch.
In case you need another one, you can modify the VoidRenamer.py script and add the one you need without any problem.



6. Edit the language.xx_xx.xml file
Modify the <id> and <title> lines with the corresponding language..
You can edit the file with any text/code editor (I recommend Notepad++).


7. Start VoidTranslator and select the data folder.
You can start translating the text files of the game ;D
Remember to always save changes!

How to test in-game translation
* Copy the "data" folder containing the translation files back to the "core.cpk" FOLDER, in the VoidExpanse installation folder.

If you have done everything correctly, the language should appear in the game options menu and be applied when you select it.

ai_enabled

Hello!
Great work! Thank you so much for sharing this project with the community.
I wanted to suggest uploading the source code to Github. In my experience, links to file sharing services can become outdated pretty fast. Plus, by putting it on Github, there's a chance that someone might come along and make improvements to your tool.

Regards!

csanchez

Hi @ai_enabled, thank you very much ;D
You are absolutely right, I also considered uploading it to github, but I really don't know how to do it, I will do some research about it.

Also, If you like, you can upload the tools to the wiki :)
https://wiki.atomictorch.com/VoidExpanse/localization
Maybe with a guide, like the one I wrote here, heh

I just noticed that in the wiki there were many more language codes, so I have modified VoidRenamer and VoidFilter to show all the languages in this list (43 in total), also now it shows the language code and the language name :)
(link updated)

If you have any idea, suggestion or find any detail in the tools, do not hesitate to comment it  :)

By the way, I have a couple of questions.
1. How is the language mods folder structured?
If it is not too complex, perhaps you could have the tool create the mods as well.

2. I am making a Spanish translation for the game, based on the English files, which are 121 files in total (counting language.es_es.xml).
However, if I filter the list of files by Russian (ru_ru) it gives a total of 518 files.
This makes me wonder, does the English translation contain all the texts of the game?

And well, I think that's all for now, cheers!

ai_enabled

Hello!

Using Github is straightforward once you register there. The developers have created plenty of good tutorials to help you get started.

We can definitely add a link to your localization toolkit on our Wiki page, but only when you are certain that the toolkit is finished.

Quote1. How is the language mods folder structured?
If it is not too complex, perhaps you could have the tool create the mods as well.
It's fairly easy. The mod (*.mpk) is a regular ZIP archive (without compression) containing only the files necessary for the localization ("language.***.xml" file plus all the TXT files for this language). The directory structure (file tree) must match the original Core.cpk.
As an example please check any VoidExpanse localization mod available in Steam Workshop.
A proper "header.xml" file must be placed in the root folder of the mod. The "modtype" entry value must be 4 (translation).

Quote2. I am making a Spanish translation for the game, based on the English files, which are 121 files in total (counting language.es_es.xml).
However, if I filter the list of files by Russian (ru_ru) it gives a total of 518 files.
This makes me wonder, does the English translation contain all the texts of the game?
Yes, you're right. I totally forgot about this!
The English TXT files are present only for the extracted text from the JavaScript files (as they don't contain the actual English text and always it from the TXT files, either English or any other translation which is available).
E.g. if you navigate to "core\data\crates\localization" you will not find the TXT localization files for English as the XML files already contain the English text.
Our official localization tool is not only loading the available TXT files but also parsing the XML files. The XML files directly contain the English text so it was never extracted to TXT files (unlike JavaScript files). For us there was no point in extracting the English text from XML as this will only cause text duplication. We kept things as simple as possible, but it's a problem when you want to create a localization for the game without using our localization tool.

Regards!

csanchez

Quote from: ai_enabled on November 26, 2023, 12:39:51 PM
Yes, you're right. I totally forgot about this!
The English TXT files are present only for the extracted text from the JavaScript files (as they don't contain the actual English text and always it from the TXT files, either English or any other translation which is available).
E.g. if you navigate to "core\data\crates\localization" you will not find the TXT localization files for English as the XML files already contain the English text.
Our official localization tool is not only loading the available TXT files but also parsing the XML files. The XML files directly contain the English text so it was never extracted to TXT files (unlike JavaScript files). For us there was no point in extracting the English text from XML as this will only cause text duplication. We kept things as simple as possible, but it's a problem when you want to create a localization for the game without using our localization tool.

Gee, this intimidated me a bit, although it doesn't seem too complicated heh.
I made a little tool that reads all the XML files and copies the folder structure from the "data" folder.

It copies the strings where it finds "<title>" and "<description>" creating a TXT with the data from these keys into the corresponding "localization" folder.

If a key "<title>" or "<description>" contains at the beginning a "$" character, it ignores and does not process this .XML file.
From what I saw these files are reference to translation files that are outside the XML (JavaScript files?).

I think it would be best to provide a folder with all the translation files in English.

This would greatly simplify all the work involved in starting a translation of the game.
Having only to modify the name of the files with the language code with VoidRenamer and the language name in the language.xx_xx.xml file.

Because although AtomicTorch_ModsLocalizationUtility covers most aspects, it fails a lot.
While VoidTranslator solves most of the problems it still leaves the user several technical steps before he can start.
It could all be solved by just giving a ZIP with all the translation files.

This zip contains all English text files (I haven't really tried it yet, but it should work, or so I hope heh)
https://www.mediafire.com/file/wkelj6gfnd6u93u/VoidExpanse_Language_en-us.zip/file

Soon I hope to be able to share everything on Github.

I also see that there are many "(Unused)" lines.
I thought about ignoring these as well, but I'm not sure.

Sorry for the long and somewhat poorly written message, I wanted to answer what I have so far.

ai_enabled

Hello!
Hmm...apparently for the trivial cases of XML localization (e.g. only when <root><header><title> or <description> are present) there is no extracted English TXT file as these are, well, trivial cases.
But for anything more complicated you will see "$ConstantName" constants in XMLΓÇömeaning these strings were extracted to the corresponding English TXT file. So all such lines are already extracted to the TXT files.

I guess you've pretty much finished everything!

QuoteI also see that there are many "(Unused)" lines.
I thought about ignoring these as well, but I'm not sure.
Yes, these should be ignored. For reference you can always check whether there is a translation in the corresponding Russian TXT file.

Regards!