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.
data/i18n/<your-language>.json 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.
lang/<your-language>.json contains UI strings and formatting patterns.
This includes things like:
- Buttons
- Labels
- Notifications
- Dialog text
- Summary text
-
NamePatternsused to assemble generated item names
NamePatterns are the templates used to build generated item names.
These are defined in lang/<your-language>.json.
Example:
{
"NamePatterns": {
"Material": "{detail} {origin} {nature}",
"Ingredient": "{taste} {origin} {nature}",
"Weapon": "{accuracyUp} {quality} {damageUp} {element} {type}",
"Armor": "{quality} {type}",
"Shield": "{quality} {type}",
"Accessory": "{quality} {type}"
}
}The point of NamePatterns is to let localizers rearrange generated words so they sound natural in their own language.
For example, English might use:
"Weapon": "{accuracyUp} {quality} {damageUp} {element} {type}"
But another language might read more naturally as:
"Weapon": "{type} {element} {damageUp} {quality} {accuracyUp}"
Or even:
"Weapon": "{type} {element} {quality}"
Lookfar automatically cleans up extra spaces after assembling the name, so shorter or reordered patterns are safe.
Many of the placeholders used in NamePatterns pull their values from data/i18n/<your-language>.json. Such as:
-
typefromequipment -
qualityfromqualities -
detail,origin,nature, andtastefromkeywords -
accuracyUp,damageUp, andelementare weapon exclusive, and denotes words for additional properties of a generated weapon.
This means the final generated result depends on both files working together:
-
data/i18nsupplies the translated word pieces -
langdecides how those pieces are assembled into readable names
Do Not Change IDs or Placeholder Names
You may translate visible text, but do not change the internal IDs or placeholder tokens used by the code.
These are used for code lookups and data matching. Changing them will break localization loading or the generated output.
When localizing Lookfar using NamePatterns, prioritize natural grammar and readable results over word-for-word matching with English.
Good localization often means:
- Reordering placeholders to fit natural grammar
- Using different quality words per item type
- Adjusting summaries and prefixes where needed
- Choosing names that sound right in your language rather than preserving English structure
For example, if English generates:
+1 Thin Fire Staff
another language might read more naturally as:
Staff Fire Thin +1
The mechanic is the same. Only the grammar changes.
That is exactly what this system is built to support.
Equipment names are localized by type and id.
Example:
{
"equipment": {
"weapon": {
"staff": "Staff",
"tome": "Tome"
},
"armor": {
"silk-shirt": "Shirt"
}
}
}Equipment names are used when generating equipment item names using {type} which can be re-ordered using name patterns.
Qualities are localized by group and id, and can use different displayed names depending on item type.
Example:
{
"qualities": {
"basic": {
"anti-slow": {
"Weapon": "Thin",
"Armor": "Light",
"Shield": "Zephyrite",
"Accessory": "Swift",
"Description": "Grants immunity to the slow status."
}
}
}
}Quality display names are primarily flavor text. This means they do not need to preserve the exact English word if a different phrasing works better in your language. You may choose to use the same displayed name for every item type, give each item type its own unique flavor name, or rename qualities so they sound more natural or meaningful in translation.
For example, if a flavor word like Bloodstone or Mythril does not read well in your language, you are free to replace it with a different localized name that better matches the tone and feel of the item.
What matters most is that the final item name feels good to read.
The names here are stored in {quality} for the purposes of generated item names and can be re-ordered using Name Patterns!
Materials are usually generated from localized keyword pools rather than translated as one fixed item name.
A material name is built from:
detailoriginnature
These values are typically stored in data/i18n/<your-language>.json, and then assembled using the Material entry in NamePatterns.
Example:
{
"keywords": {
"detail": ["Rough", "Polished", "Ancient"],
"origin": ["Glacial", "Aerial", "Mechanical"],
"nature": ["Ore", "Crystal", "Wood"]
}
}With a NamePatterns entry like:
{
"NamePatterns": {
"Material": "{detail} {origin} {nature}"
}
}This could generate names such as:
Rough Glacial OrePolished Aerial CrystalAncient Mechanical Wood
The exact word order does not need to match English. You can reorder the placeholders in NamePatterns so the final material names read naturally in your language.
Ingredients are usually generated from localized keyword pools rather than translated as one fixed item name.
An ingredient name is built from:
tasteoriginnature
These values are typically stored in data/i18n/<your-language>.json, and then assembled using the Ingredient entry in NamePatterns.
Example:
{
"keywords": {
"taste": ["Sugary", "Bitter", "Savory"],
"origin": ["Striped", "Mountain", "Deepsea"],
"nature": ["Meat", "Herb", "Fruit"]
}
}With an NamePatterns entry like:
{
"NamePatterns": {
"Ingredient": "{taste} {origin} {nature}"
}
}This could generate names such as:
Sugary Striped MeatBitter Mountain HerbSavory Deepsea Fruit
The exact word order does not need to match English. You can reorder the placeholders in NamePatterns so the final ingredient names read naturally in your language.
Keywords are now stored in the new data/i18n/<lang>.json and arrays instead of forcing a strict one-to-one English translation. This was also applied to Discovery effects, sources, and other generated word pools.
We wanted to give translators more freedom to add or remove words and phrases that don't relatively apply to that specific language, so you do not need to mirror English exactly.
You can add more words if your language benefits from extra variety, use fewer words if several English terms would naturally translate the same way, or choose options that make generated results sound more natural.
The goal is not to preserve English structure. The goal is to create output that reads well in your language.