Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Steamodded offers multiple ways to load strings for in-game descriptions and oth

- [Localization Files](#localization-files-recommended)
- [Adding your descriptions](#adding-your-descriptions)
- [Migrating to localization files](#migrating-to-localization-files)
- [`loc_txt`](#loc_txt)
- [`mod.process.loc_text`](#modprocessloc_text)
- [Text Formatting](#text-formatting)
Expand Down Expand Up @@ -114,8 +115,13 @@ return {
}
```

### Migrating to localization files
If you've been using `loc_txt` and wish to switch to using localization files, disable as many other mods as possible (if you have cross-mod content, you may wish to reconfigure it so it can load even with the other mod disabled), add `"dump_loc": true` to [your mod's metadata](https://github.com/Steamodded/smods/wiki/Mod-Metadata), and launch Balatro once. Steamodded will create a `dump.lua` file in your mod's localization folder, containing all modified localization entries. Remove any extraneous entries (e.g. from other mods you couldn't disable due to being dependencies) and rename this file to `en-us.lua`.

Remember to remove the `dump_loc` entry when finished!

## `loc_txt`
Alternatively, you can define a `loc_txt` table on each object to create its description. This is more limited than the above option because it does not allow creating multiple descriptions for the same object or strings that don't belong to an object at all. The effort of maintaining translations of your mod while using this method is significantly higher.
Alternatively, you can define a `loc_txt` table on each object to create its description. This is more limited than localization files because it does not allow creating multiple descriptions for the same object or strings that don't belong to an object at all. The effort of maintaining translations of your mod while using this method is significantly higher.

You can provide a single table for every language, or provide a subtable for each language. If the currently selected language isn't provided, the `default` subtable, the English (`'en_us'`) subtable, or `loc_txt` itself will be used as defaults, in that order. Refer to your object's documentation for what fields need to go in `loc_txt`.

Expand Down