边缘世界 RimWorld

边缘世界 RimWorld

评价数不足
Translation Tools | How to translate mods
由 its cold here 制作
   
奖励
收藏
已收藏
取消收藏
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 onto the image with a transparent background, place it in the desired location

    To accurately hit the pixels, you need to change the scale "CTRL + mouse wheel" and move the image with the arrows on the keyboard.

    If you need to place the sticker at a distance from the edge of the image or if you need to check the distance from the edge, you need to use the "Select Area" tool, select the area from the edge of the image to the edge of the sticker and see the length of the area in the panel below.

CreateLoads

One 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 indicate to the game which folders to load if certain mods are present, the LoadFolders.xml file is used, the text will be loaded only 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, then yellow errors will appear in the debug log - this is not critical, but it is better if there are no errors. Plus, this speeds up the loading of the game, because it will not load what is not needed.

CreatePack

A tool for creating a translation pack.

There are two ways to create a translation pack:

1 - combine all Languages ​​folders into one
2 - use LoadFolders

In both cases, the files in the Languages ​​folder must have a unique name for each translation, for this you can use the EditFormat tool.

When using LoadFolders, a Misc/DidNotLoadAnyContent-Skip folder will be created, which is always loaded so that there is no error in the event of missing mods for which the translation was made.

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 the program is launched per day.

Statistics are interesting, especially if there are many 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

The script creates a copy of the translations and converts them to the Translation Tools format.

The script overwrites the xml files in the Keyed and DefInjected folders so that they have UTF8 encoding and header. It also corrects indents by replacing them with tabs.
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, rename it to the PackageID of the mod and place it in the User\ModsPreview folder. 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 can be the author's links. You can also add the file "Translation_DefaultDescription.txt" to the User folder, which will be used if the "Description.txt" file is missing, i.e. this is the default description. The same can be done for the translation pack using "Pack_" at the beginning of the files.

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. I wrote to support about deleting the description, they replied that they could not help.

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.

If, when updating the mod, the local files match the files in the Workshop, the mod will not be updated, only the information on the mod page will be updated - description, preview, etc.

How to download and update mods
- First download or update tags: Via game
- Everything else: Via script
Translation Tools format
Translation name: "{prefix} {cleaned mod name}"

Translation package ID: "{prefix} {cleaned, simplified and without spaces mod name}"

Translation folder name: "{prefix} {cleaned and simplified mod name}"
XML file name: "{file type}_{cleaned, simplified and without spaces mod name}"

***
cleaned mod name - without (*),[*],{*} constructions
simplified mod name - only English characters and numbers
***
Settings
If a setting can have multiple values, such as multiple folders, they must be separated by a comma.

Some settings may be empty, in which case the setting will not perform its function. For example, an empty PrefixForTranslationName setting will not add a prefix to the translation name.

You can substitute values ​​from other settings into the setting values. To do this, add the {key of another setting} to the setting value. For example, CurrentVersion: {RimWorldFolder}\version.txt

Setting
Description
SystemLanguage

SystemLanguageCode
[readonly settings, can be used to substitute into other settings]

System language.

System language code.
RimWorldFolder

ModsFolders

TranslationsFolder
Path to the game folder.

Path to the mod folders.
[can be several values]

Path to the translation folder.
SourceLanguage

TargetLanguage

TargetLanguageCode
The language from which the translation will be made.

The language into which the translation will be made.

The code of the language to which the translation will be made.
AddCommentWithSourceFile

AddCommentWithSourceText

RemoveTextFromString

AddEmptyStringBetweenStrings

CreateDescriptionFile

CommentWithSourceFileStyle

CommentWithSourceTextStyle

ResultInfoStyle
[text extraction settings]

Add a comment with the file from which the text is taken.

Add a comment with the original text.

Remove text from the line.

Add an empty line between the lines.

Create a Description.txt file in the translation folder.

Comment style with file: one line / move the path to a separate line.

Comment style with text: brief / detailed.

Result output style: short / detailed.
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.
PackCreatingMode

AddModsListToPackDescriptionFile

ModsListTitle

RimWorldModsFolder

CopyPacksToRimWolrdModsFolder
Pack creation mode.

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

Title of the mod list.

Path to the folder with local mods.

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

TranslationPreviewBrightness
Automatic installation and update of ImageMagick.

Preview brightness multiplier. For example, 0.7 means to reduce brightness by 30%.
ApplyResultForSourceFiles
Apply the result from the Result folder to the source files. The source files will be moved to the User/Backup folder. Works for CreatePreview.
UploadFolder

UploadWithoutFiles

ModVisibility

UpdateTitle

UpdateDescription

UpdatePreview

UpdateVisibility

PostfixForTranslationTitle

PostfixForTranslationsPackTitle

CheckDescriptionFiles
Folder for translations that need to be updated. The structure of the Upload folder can be any, mods in it will be detected automatically if they contain the About.xml file.

Files that should be ignored when loading a mod. If you add a Preview.png file, it will be uploaded to the Workshop, but will not be displayed in the game, because it will be removed from the files - this significantly reduces the weight of the mod, because usually the preview weighs a lot relative to the text.

Mod visibility: Public - public, FriendsOnly - only for friends, Private - private, Unlisted - available by link.

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

Update mod description.

Update mod preview.

Update mod visibility.

Postfix for the translation name in the Workshop. For example, you can add tags so that people can find the translation.

Similar to the previous point, only this postfix is ​​added to the translation pack.

Check Description.txt files before loading mods (file presence, lines in the file).

Additional settings

Files that can be addedto 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 a translation folder.

If the folder contains the file \Pack_About.txt, then this is a 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.

Update news

Will be added to this guide. When updating, it is recommended to look at the update description, as the functionality may change.

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.

Terms of use

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

Plan

- script for editing about.xml
- caching of original text and other data for tracking changes
- 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
Updates
2025.09.15

GetText
- Reworked script

GetData
- Script display more data

EditFormat
- Script rewrites xml files

===

Removed settings
- UploadWithoutPreviewInFiles
- OpenVisibility

Added settings
- SystemLanguage
- SystemLanguageCode
- TargetLanguageCode
- AddCommentWithSourceFile
- AddCommentWithSourceText
- RemoveTextFromString
- AddEmptyStringBetweenStrings
- CreateDescriptionFile
- CommentWithSourceFileStyle
- CommentWithSourceTextStyle
- ResultInfoStyle
- PackCreatingMode
- ModsListTitle
- UpdateDescription
- UpdatePreview
- UpdateVisibility
- UploadWithoutFiles
- ModVisibility
- PostfixForTranslationTitle
- PostfixForTranslationsPackTitle
- CheckDescriptionFiles

===

Changed files names: Translation_Description.txt => Translation_DefaultDescription.txt

Changed the way Preview is overridden.

Added Misc/IgnoreError_DidNotLoadAnyContent folder when creating a pack using LoadFolders.