Let me sing you the song of my people.
I know we've been down this path before, and I've searched, but it just feels like the parable of the blind men feeling various bits of an elephant and drawing dubious conclusions on the nature of elephants.
What I want to do: I am processing recipes. If a recipe meets a certain criterion, then I want to add a line to its localised description, if it has one; if it doesn't have one then I just set the line. Basically I want to provide extra info about that recipe but I don't want to obliterate useful info provided by vanilla or that I have personally painstakingly typed out myself into the locale config.
The problem is, finding out whether it "has" a description or not is a nightmare, because when the recipe description doesn't explicitly specify a description, it will inherit the item description if it has one, and if the item doesn't have one then it will inherit one from the entity. Even worse, neither recipe, item nor entity prototype have to set an explicit string: if a matching entry exists in whatever locale the player is using, it's displayed. So there seems to be no way of knowing what the player sees. It is Schrodinger's Description. You can make guesses based on whether the strings are set and whether the root item has a place result but you just don't know.
So I can either override the recipe description blindly, or I can make a best guess at what locale string is most relevant - recipe-description, item-description or entity-description - and embed it in a locale string like { "recipe-description.whatever", {"entity-description.whatever"}}. Sounds clever but actually, it fails about 75% of the time, because you get missing keys for the many vanilla items which have none of those three. So I can either document every vanilla item as well, or just give up.
Did anyone beat this yet?
Localised descriptions, again
Place to get help with not working mods / modding interface.
- Deadlock989
- Smart Inserter

- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Jump to
- General
- ↳ Releases
- ↳ News
- ↳ General discussion
- ↳ Multiplayer
- ↳ Find Servers / Tools / Guides
- ↳ Show your Creations
- ↳ Videos
- ↳ Combinator Creations
- ↳ Mechanical Throughput Magic (circuit-free)
- ↳ Railway Setups
- ↳ Energy Production
- ↳ Medium/Big/Gigantic Sized Structures
- ↳ Fan Art
- ↳ Gameplay Help
- ↳ Spread the Word
- ↳ Off topic
- ↳ This Forum
- ↳ Celebration Party
- Support
- ↳ Gameplay Help
- ↳ Discover Factorio Wiki
- ↳ Discover Others Creations
- ↳ Discover Mods
- ↳ Discover Tools Around Factorio
- ↳ Technical Help
- ↳ Bug Reports
- ↳ Resolved for the next release
- ↳ Assigned
- ↳ Not a bug
- ↳ Pending
- ↳ 1 / 0 magic
- ↳ Duplicates
- ↳ Minor issues
- ↳ Desyncs with mods
- ↳ Won't fix.
- ↳ Resolved Problems and Bugs
- ↳ Fixed for 2.1
- Factorio Direction
- ↳ Ideas and Suggestions
- ↳ Outdated/Not implemented
- ↳ Frequently Suggested / Link Collections
- ↳ Implemented Suggestions
- ↳ Development Proposals
- ↳ Balancing
- Contributions
- ↳ Mods
- ↳ Download mods
- ↳ Mod portal Discussion
- ↳ Mods
- ↳ Mod Packs / Libs / Special Interest
- ↳ 5dim's mod
- ↳ Angels Mods
- ↳ Atomic Power
- ↳ Bob's mods
- ↳ DyWorld
- ↳ F.A.R.L
- ↳ Fentus Challenge & Tool Mods
- ↳ Logistic Train Network
- ↳ MoMods
- ↳ Reika's Mods
- ↳ Resource Spawner Overhaul
- ↳ Yuoki Industries
- ↳ PyMods
- ↳ Questions, reviews and ratings
- ↳ Modding Discussions
- ↳ Modding discussion
- ↳ Modding help
- ↳ Ideas and Requests For Mods
- ↳ Modding interface requests
- ↳ Implemented mod requests
- ↳ Already exists
- ↳ Won't implement
- ↳ Documentation Improvement Requests
- ↳ Resolved Requests
- ↳ Development tools
- ↳ Tools
- ↳ Mod and installation managers
- ↳ Cheatsheets / Calculators / Viewers
- ↳ Development tools
- ↳ Special interest mods and libraries
- ↳ Modding Development
- ↳ Multiplayer / Dedicated Server
- ↳ Multiplayer Board
- ↳ Archive
- ↳ Maps and Scenarios
- ↳ Translations
- ↳ Texture Packs
- ↳ Fan Art
- ↳ Wiki Talk
- ↳ To be sorted
- ↳ Campaign / Scenario suggestions