About this mod
Easily convert your old mods to the i18n format! (Also helpful for updating translations of older mods if newer versions have been migrated to i18n).
Легко конвертируйте ваши старые моды в формат i18n! (Также полезно для обновления переводов старых модов)
- Requirements
- Permissions and credits
- Donations
Also check SV i18n Translation Merger
Also check XNB to CP Converter (For Dialogs mods)
NEW
Guide for SV i18n Converter Tools + SV i18n Translation Merger. (CP to i18n)
This guide will walk you through the process of updating translations for mods that have transitioned to the i18n format, even if your existing translation is not in i18n.
1) Gather the Files:
- Download the older version of the translation you want to update.
- Download the older version of the mod that uses the non-i18n translation.
- Download the newer version of the mod that has been converted to the i18n format.

2) Prepare Your Workspace:
- Create a folder for this process.
- Extract the contents of all downloaded archives (mods and translation) into this folder.
- Place the following executables in the same folder:
transtar.exe
SV i18n Translation Merger.exe
SV i18n Converter Tools.exe

3) Extract Content with Transtar:
- Launch Transtar.exe.
- Select the folder containing the older version of the mod (the one with content.json).
- Click "Extract". This will generate a CP.json file.
- Repeat the same process for the older version of the translation.

3.5) Troubleshooting Transtar Errors:
- Sometimes, due to JSON formatting errors, Transtar might not be able to process the files completely.
- If you encounter errors:
- Note the "Line" number where the error occurred.
- Click "Open File".
- Locate the specified line and identify the problem (e.g., incorrect spacing, extra comma).
- You can use a website like https://jsonlint.com/ to validate the entire file for errors, but you'll need to remove all comments (//) from the file first.
- Once you've fixed the errors, save the file.
- Repeat step 3. The errors should be resolved (at least for that line and file).

4) Compare the Extracted CP.json Files:
- Open the CP.json files you extracted from both the older mod and the older translation.
- Compare the num values and the corresponding key values.
- Ideal Scenario: If the num values and key values match perfectly, the translation is likely well-structured. Proceed to step 5.
- Mismatch Scenario: If there are mismatches, it indicates potential errors in the translation. Proceed to step 4.5.

4.5) Use JSON Merger and Sorter:
- Launch SV i18n Converter Tools.exe.
- Click on the "Launch JSON Merger and Sorter" button.
- Select both CP.json files (from the older mod and translation).
- Click "Process Files".
- This will generate new CP.json files with perfectly matching num and key values. (JSON Merger and Sorter will overwrite the original CP.json files.)


5) Prepare the Old Translation for i18n:
- Move the updated CP.json file (from the older translation) to your workspace folder.
- In SV i18n Converter Tools.exe, click "Combine Source Files". This will create an i18n file for your older translation.
- Delete the unnecessary files and rename the generated default.json file to something descriptive (e.g., old_translation_default.json).
- Repeat the same process for the CP.json file of the older mod, creating a default.json for the original English text.
- Finally, copy the i18n file (likely default.json) from the new version of the mod into your workspace folder.

6) Transfer Translations with SV i18n Translation Merger:
- Launch SV i18n Translation Merger.exe.
- Select the following files:
- NEW MOD: The i18n file (default.json) from the new version of the mod.
- OLD MOD: The default.json file you created from the older version of the mod.
- OLD TRANSLATION: The default.json file you created from the older version of the translation.
- Check the box for "Compare by text only" (as the i18n keys in the old and new mods might not match).
- Click "Translate!".
- Once the process reaches 100%, save the output file as YourLanguage.json (e.g., ru.json for Russian).

7) Verify the Translation:
- Open the default.json file (from the new mod) and your newly created YourLanguage.json file.
- Compare the files to see how many strings have been successfully translated.
Complete Guide to Using the SV i18n Converter Tools
This SV i18n Converter Tools provides a graphical user interface (GUI) for managing JSON files related to Stardew Valley mod translations. It features several functions, grouped for easier understanding, each represented by a button in the interface.(Need Transtar)

Button Functions
Prepare Files for Translation
- Extract Key-Original Pairs:
- Purpose: Extracts the original English text from the base mod's JSON files (CP.json, i18n.json, STF.json, mail.json, JA.json) and creates new files with the "_key_original.json" suffix. These new files contain a dictionary where the keys are the original English text strings and the values are the corresponding in-game keys.
- Input: The script looks for the base JSON files in the same directory where it's located.
- Output: Files named like "CP_key_original.json", "i18n_key_original.json", etc.
- Extract Original Text:
- Purpose: Extracts only the original English text from the "_key_original.json" files created in the previous step. This creates files with the "_NeedTranslate.json" suffix, which contain lists of the original English text strings, ready for translation.
- Input: The script looks for files like "CP_key_original.json", "i18n_key_original.json", etc.
- Output: Files named like "CP_NeedTranslate.json", "i18n_NeedTranslate.json", etc.
Process Translations
- Merge Translated Text
- Purpose: Combines translated text from files named like "CP_key_YourTranslated.json" with the original English keys and structure from the corresponding "_key_original.json" files. This creates complete translated JSON files ready for use in the mod.
- Input: The script looks for pairs of files like "CP_key_original.json" and "CP_key_YourTranslated.json".
- Output: Files named like "CP_YourTranslated.json", containing the full translated content.
- Prepare for Transtar
- Purpose: Takes the translated text from the "_key_YourTranslated.json" files and inserts it into the original mod's JSON structure. This prepares the files for use with the Transtar translation tool.
- Input: The script looks for pairs of files like "CP.json" and "CP_key_YourTranslated.json".
- Output: Files named like "CP_ForTranstar_YourTranslated.json", ready for use with Transtar.
Create i18n Files
- Combine Source Files:
- Purpose: Combines the original English text from specific JSON files (CP.json, STF.json, mail.json, JA.json) into two output files:
- "CP_i18n.json", "STF_i18n.json", etc.: These files contain the original data from each input file, but with the "translation" field replaced with an i18n code, e.g., "{{i18n:CP_key_1}}".
- "default.json": This file contains a dictionary where the keys are the i18n codes (e.g., "CP_key_1") and the values are the corresponding original English text strings.
- Input: The script looks for files like "CP.json", "STF.json", etc.
- Output: Files named "CP_i18n.json", "STF_i18n.json", etc., and a "default.json" file.
- Purpose: Combines the original English text from specific JSON files (CP.json, STF.json, mail.json, JA.json) into two output files:
- Combine Translated Files:
- Purpose: Similar to "Combine Source Files", but it uses the translated files generated by "Transfer to Transtar" (like "CP_ForTranstar_YourTranslated.json"). It outputs files with the "_YourTranslated" suffix.
- Input: The script looks for files like "CP_ForTranstar_YourTranslated.json", "STF_ForTranstar_YourTranslated.json", etc.
- Output: Files named "CP_i18n_YourTranslated.json", "STF_i18n_YourTranslated.json", etc., and a "default_YourTranslated.json" file.
Replace i18n Codes
- Replace i18n Codes (Original)
- Purpose: Takes the i18n codes from the "_i18n.json" files (generated by "Combine Source Files") and replaces them with the corresponding English text from the "default.json" file.
- Input: The script looks for pairs of files like "CP_i18n.json" and "default.json".
- Output: Files named like "CP_i18n_Return.json", with the i18n codes replaced with the original English text.
- Replace i18n Codes (YourTranslated)
- Purpose: Similar to "Replace i18n Codes", but it uses the "_i18n_YourTranslated.json" files (generated by "Combine Translated Files") and the "default_YourTranslated.json" file.
- Input: The script looks for pairs of files like "CP_i18n_YourTranslated.json" and "default_YourTranslated.json".
- Output: Files named like "CP_i18n_YourTranslated_Return.json", with the i18n codes replaced with the translated text.
Additional Tool
JSON Merger and Sorter:

This tool helps ensure that your English and translated JSON files (like the extracted CP files) have the same number of entries and are correctly aligned. This is crucial for seamless translation updates. Sometimes, due to errors by mod authors or translators, the number of extracted strings might differ between the English and translated files. If you plan to update your translation to a newer mod version, using the "JSON Merger and Sorter" is highly recommended. It will:
- Identify matching entries: The tool compares the "key" field in both files to find matching translation pairs.
- Merge matching entries: It combines the matching pairs, ensuring that the English and translated text are correctly aligned.
- Remove unmatched entries: Any entries that don't have a match in the other file are removed, preventing misalignment and potential errors during translation updates.
- Sort entries: The tool sorts the merged entries based on the "num" field, creating a consistent order in both files.
Notes
- JSON Merger and Sorter assumes that all relevant JSON files are located in the same directory as the script itself.
- Make sure to follow the correct order of operations for translating your mod. Generally, you would use the "Prepare Files for Translation" buttons to prepare files, translate the English text in the "_NeedTranslate.json" files, then use the "Create i18n Files" and "Replace i18n Codes" buttons to generate the final translated mod files.
- This guide provides a basic overview. You may need to adapt the process or file names slightly depending on the specific requirements of your mod.