RimWorld

RimWorld

Not enough ratings
Translation Tools | How to translate mods
By crtdgd
   
Award
Favorite
Favorited
Unfavorite
Description
Useful tools for RimWorld mod translators.
Tools
GetText

A tool for getting text from mods.

The tool automatically creates a folder for translation, with a filled-in About file and a modified preview.

For the script to modify the mod preview, adjust the size and add a sticker, you also need to install the ImageMagick program and create a sticker for the preview.

By default, ImageMagick is installed and updated automatically. To disable this option, you need to change the "Install ImageMagick" setting. It is installed independently of manual installation in a separate folder. To remove the program, you need to delete the “%UserProfile%\scoop” folder.

Manual installation of ImageMagick
https://imagemagick.org/script/download.php#windows

The sticker must be named sticker.png and located in the User folder. The size of the mod preview is adjusted to the size of the sticker background, the recommended background size is 640x360.

How to create a sticker
  1. Install Paint.NET
    https://www.getpaint.net/download.html

  2. Run the program, change the image size to 640x360: "Image" => "Resize"

  3. Select the "Magic Wand" tool, click on the image, press the DELETE key - the background will become transparent

  4. Find a suitable sticker, open it in a new tab in Paint.NET, reduce the size of the sticker so that it fits the image. The height of my sticker is 120 - this is a third of the image.

  5. Select the "Select area" tool, select the sticker, press "CTRL + C", paste the sticker on the image with a transparent background, place it in the right place. To accurately hit the pixels, you need to change the scale "CTRL + mouse wheel" and move the image with the arrows on the keyboard.

CreateLoads

A single translation can contain text for several mods, for example, for the original mod and for the modified version, or for the mod and its add-ons.

To specify the game which folders to load if certain mods are present, the LoadFolders.xml file is used; the text will only be loaded for those mods that are active for the user. Without using this file, the text is loaded completely, and if there is no mod for which the translation was made, yellow errors will appear in the debug log - this is not critical, but it is better to have no errors. Plus, this speeds up the game loading, since it will not load what is not needed.

CreatePack

A tool for creating a translation pack, which also uses the LoadFolders file. Supports translations created using the previous tool.

Files in the Languages folder must have a unique name for each translation; for this, you can use the EditFormat tool.

GetData

A tool for getting the volume of translated text - the number of lines and words, as well as other useful information. Brief information is displayed automatically the first time you run the program for the day.

Statistics are interesting, especially if there are a lot of translations.

GetTranslations

A tool for getting your translations from the mods folder.

Useful if you have lost your translation files and need to download them from the Workshop so that the translation folder name matches the translation name.

EditFormat

GetText creates a translation folder in the following format “{prefix} {simplified mod name - only English characters and numbers}”, creates text files in the following format “{text type}_{simplified folder name without prefix and spaces}”. If there are several files, they will be numbered.

This script creates a copy of your translations and converts them to this format.
Addon
CheckChanges

This tool compares the text of mods and the text of translations, and finds new and old strings.

CreatePreview

A tool for updating translation previews. Takes previews from mods, applies a sticker, creates folders with previews. If the translation applies to several mods, the mod that comes first in LoadAfter will be selected.

If there is no preview in the mod folder, for example, it is only in the Workshop, then you can download it and place it in the User\ModsPreview\”{mod id} - {mod name}” folder. The mod name is optional, it is added for convenience. The preview in this folder has a higher priority than the preview in the mod folder, this can also be used to override the logic of "select the mod that comes first in LoadAfter".

CreateModIcon

A tool for updating translation icons.

Upload

A tool for updating translations in the Workshop.

The official SteamCMD tool is used to upload to the Workshop. Your Steam login and password are required for use. For security, your login and password are not saved anywhere, so you need to re-enter them each time. If you have Guard active, then the first time you launch it, you will need to enter the verification code that will be sent to your email.

To update the translation description, add the file with the description "Description.txt" to the translation folder. You can add the files "Translation_PreDescription.txt" and "Translation_PostDescription.txt" to the User folder, which will add a prefix and postfix to the description, for example, the prefix can be tags, and the postfix is the author's links. You can also add the file “Translation_Description.txt” to the User folder, which will be used if the file "Description.txt" is missing, i.e. this is the default description.

The mod title and description are updated only for English, if the mod has a description in an additional language, then the description for it must be updated manually. The description in English applies to all languages - for this reason, there is no need to add additional languages, in addition, such a description cannot be removed.

This tool is not used for the initial upload to the Workshop, since in this case the mod tags will not be created. The first upload of the mod must be done through the game, if you need to update the tags, this must also be done through the game. Everything else is more convenient to do through Upload, since the tool updates all translations at once.

After using the tool, you need to log in to Steam again, since you can only be authorized in one place at a time, perhaps this only works with Guard.
Settings
If a setting can have multiple values, such as multiple folders, they must be separated by a comma.

Setting
Description
RimWorldFolder

ModsFolders

TranslationsFolder
Path to the game folder.

Path to the mod folders. [can have multiple values]

Path to the translation folder.
SourceLanguage

TargetLanguage
Language from which the translation will be made.

The language to translate into
AuthorName
Your nickname.
PrefixForTranslationName

PrefixForTranslationPackageID

PrefixForTranslationFolderName
Prefix for the translation name.

Prefix for the PackageID of translations.

Prefix for translation folders. This is needed to group translations, for example, if you moved them to the Mods folder so that they do not mix with other mods.
GameVersions

CurrentVersion

IgnoreOldVersions
Game versions that need to be specified in About.xml and LoadFolders.xml. [can be multiple values]

Path to the file with the current version of the game. You can specify the version manually.

Ignore old versions of the game when receiving text. Versions that are behind CurrentVersion in GameVersions will be ignored.
AddModsListToPackDescriptionFile

RimWorldModsFolder

CopyPacksToRimWolrdModsFolder
Add a list of mods from a pack to a file with a description of the pack.

Path to the folder with local mods.

Copy packs from the Result folder to the folder with local mods.
InstallImageMagick

TranslationPreviewBrightness
Automatic installation and update of ImageMagick.

Preview brightness multiplier.
Upload folder

OpenVisibility

UpdateTitle

UploadWithoutPreviewInFiles
Folder for translations to be updated. The Upload folder structure can be any, mods in it will be detected automatically if they have an About.xml file.

Open mod visibility.

Update mod title. You can set the mod title in the Workshop separately from the mod title in the game, in this case, disable this option so that the title is not overwritten.

Update mod without preview in mod files, the preview will be added only to the page in the Workshop, it will not be displayed in the game. This reduces the weight of the mod, the preview weighs a lot relative to the text.

Additional settings

Files that can be added to the User folder
- Translation_ModIcon.png

Files that can be added to the pack folder
- Pack_Preview.png
- Pack_ModIcon.png
- Pack_PublishedFileId.txt
- Pack_Description.txt

Project structure

The structure of the main TranslationsFolder folder can be any, the folders in it will be determined automatically according to the following rules:

If the folder contains the file \About\About.xml and if there is a folder \Languages or a folder \LoadFolders, then this is the translation folder.

If the folder contains the file \Pack_About.txt, then this is the translation pack folder.

Example structure:

TranslationsFolder
- Pack1
- - Group1
- - - Translation1
- - - Translation2
- - - Translation3
- - Group2
- - - Translation1
- - - Translation2
- - - Translation3
-Pack2
- - Translation1
- - Translation2
- - Translation3
- {any user files}
Usage
General
- create a collection with translations
- create a collection with translated mods

GetText
  1. Subscribe to the desired mods, wait until they are installed/updated

  2. Copy the mod IDs. The mod ID is the last digits in the page address.

  3. Paste the mod IDs into the “Mods ID” field. If there are several mods, they must be added separated by a space. You can only add one word "all", in which case the text will be extracted from all mods.

  4. Run the script

CreateLoads
  1. Create a LoadFolders folder in the translation folder

  2. Place the folders that need to be loaded in the LoadFolders folder if certain mods are present

  3. Create a PackageID.txt file in each folder, add the mod IDs to it. If there are several IDs, each must be specified on a separate line.

  4. Run script

  5. Copy and replace folder with LoadFolders.xml to folders with translations

CreatePack
  1. Create Pack_About.txt file in the pack folder, add the name and packageid of the pack to this file
    name {Pack name} packageid {PackageID of the pack}

  2. Place folders with translations in the pack folder. It is more convenient to add all translations to one folder and then add this folder to the pack folder.

  3. Run script

GetTranslations
  1. Subscribe to translations, wait for them to install

  2. Run script

CheckChanges
  1. Subscribe to translated mods, wait for them to install/update

  2. Run script

CreatePreview
  1. Add sticker.png to User folder

  2. Subscribe to translated mods, wait for them to install/update

  3. Run script

  4. Copy with replacement of preview folder to translation folders

CreateModIcon
  1. Add ModIcon.png to User folder

  2. Run script

  3. Copy with replacement of icon folder in folders with translations

Upload
  1. Move translations that need to be updated to the Upload folder

  2. Enter your Steam login and password in the appropriate fields

  3. Run the script
General
How to install

Discord => Open channel #translations-tools => Download and unzip the archive to a convenient location

How to update

Download the new archive, place it in the Translation Tools folder, run the program.

Features

The original program does not affect your files, all it does is copy files, get data from files, create new files based on the received data.

One of the addon scripts uses your Steam login and password, which are safe to specify in the original program.

Terms of Use

This program is documented, it is prohibited to edit and publish it.

Plan

- script for editing about.xml
- full support for definjected
- caching of the original text to track changes
- automatic check for changes on a schedule
- when extracting text, an auto-translated copy is added to it, which can be used as a hint; or used as a ready-made machine translation
- support, optimization, implementation of your ideas