--- title: "Providing translations: Content Packs" tags: project-fluent --- # Providing translations: Content Packs The easiest way to add a custom translation to an arbitrary mod is via Project Fluent content packs. ## Create the content pack 1. Install [SMAPI](https://www.nexusmods.com/stardewvalley/mods/2400) and [Project Fluent](https://www.nexusmods.com/stardewvalley/mods/12638). 2. Create an empty folder in your `Mods` folder. The name does not matter, but a good practice is to include the `[Fluent]` prefix, a language code prefix, and the translated mod name in the folder name. For example, `[Fluent][PL] Automate` would be a good name for a Polish translation for the Automate mod. 3. Create a `manifest.json` file with this content: ```json { "Name": "Your Mod Name", "Author": "Your Name", "Version": "1.0.0", "Description": "One or two sentences about the mod.", "UniqueID": "YourName.YourModName", "UpdateKeys": [], // when you release the mod, see https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Update_checks "ContentPackFor": { "UniqueID": "Shockah.ProjectFluent" } } ``` 4. Change the `Name`, `Author`, `Description`, and `UniqueID` values to describe your mod. (Don't change the `UniqueID` under `ContentPackFor`!) 5. Create a `content.json` file with this content: ```json { "Format": "1.1.0", // your localization information will go here } ``` That's it! You now have a working Project Fluent pack, though it doesn't do anything yet. ### Format version The `Format` field is the version of Project Fluent for which you designed the content pack. This is used to keep your content pack compatible with future versions. You should always use the latest format version (currently 1.1.0) to enable the latest features, avoid obsolete behavior, and reduce startup time. ## Example mod In this example we want to translate the Automate mod to the Polish language. The `1.25.3` version of the mod does in fact support translations, and they are i18n-based translations. Because Automate uses i18n-based translations, we will be using the `AdditionalI18nPaths` key. If Automate used Fluent-based translations, we would be using the `AdditionalFluentPaths` key instead. To see more information about those and other keys, see [the Content Pack model page](https://hackmd.io/@Shockah/By3QmzXq5). Create a `content.json` file with this content: ```json { "Format": "1.1.0", "AdditionalI18nPaths": [ { "LocalizedMod": "Pathoschild.Automate" } ] } ``` The `LocalizedMod` is the unique mod ID of the mod you are trying to add translations for. You can find this ID in the mod's `manifest.json`. You should also modify your `manifest.json` to say your mod depends on Automate to be installed: ```json { // ... "Dependencies": [ { "UniqueID": "Pathoschild.Automate" } ] } ``` This is enough for Project Fluent to figure out that the mod you created is providing translations for the Automate mod. The last step is to just create an `i18n` folder in your mod's folder, and start adding translations there. Note that your translations have to be the same type (i18n or Fluent based) as the translation system used by the translated mod -- you can't mix and match. To finish this example, we will create the `i18n` folder, and then a `pl.json` file inside of it, with our translations: ```json { "config.title.main-options": "Główne opcje", // ... } ```