Repository navigation
Localization
Lookfar’s localization system is designed to separate data sets from ui elements. This makes translations cleaner, easier to maintain, and much more flexible for languages that do not map neatly to English word order.
When localizing Lookfar, you will work with two different files:
data/i18n/<your-language>.jsonlang/<your-language>.json
These two files serve different purposes.
This file contains localized data used by generated content.
This includes things like:
- Equipment names
- Quality names
- Quality descriptions
- Keyword lists
- Discovery effects and sources
- Other generated word pools
This file is used when the module needs localized words to build treasure names, quality labels, keyword prompts, and similar generated output.
This file contains UI strings and formatting patterns.
This includes things like:
- Buttons
- Labels
- Notifications
- Dialog text
- Summary text
-
NamePatternsused to assemble generated item names
In short:
- Use
data/i18nfor the words and localized data - Use
langfor the interface text and formatting rules
Lookfar now handles raw rule values the code needs in the equipment.json and qualities.json. Additional data added to the module, will be found here - and will not need to be localized.
Our dataLoader.js now reads localized equipment names, qualities, keywords, and related generated data from data/i18n/<lang>.json. This is so translators are no longer expected to edit mechanic files that aren't hard-coded into the scripts themselves, and can focus strictly on visible text.
Equipment names are localized by type and id.
Example:
{
"equipment": {
"weapon": {
"staff": "Staff",
"tome": "Tome"
},
"armor": {
"silk-shirt": "Shirt"
}
}
}