foundryvtt / dnd5e

An implementation of the 5th Edition game system for Foundry Virtual Tabletop (http://foundryvtt.com).
MIT License
312 stars 212 forks source link

Allow custom enrichers to accept localized parameters #2641

Open BrotherSharper opened 10 months ago

BrotherSharper commented 10 months ago

Thank you for the new custom enrichers! I would like to request making it so a user can set custom enrichers in their own language.

For example, [[/save dexterity 17]] does translate properly once saved, it would be amazing also have the actual formula be writable in the localized language. i.e. [[/save 敏捷力 17]] (which is dexterity in Japanese)

It would help a lot if a user is not required to know the corresponding word in English to use custom enrichers.

Fyorl commented 9 months ago

The enrichers are designed to accept the 'config' keys (e.g. the Perception skill's config key is 'prc'), and the ability to use the 'full' English name was added a bit later because those config keys can be hard to remember (and discover). Admittedly, the config keys are also based on the English names, but they are technically language-agnostic.

The issue with accepting localised names in these enrichers is that they are not portable. If it's used in an Actor's biography, for example, and that Actor is then imported into a World that does not have the language loaded, the enrichment will fail when it shouldn't, since it's referencing a language-agnostic game rule.

What we probably need to do is allow for writing the enricher in a different language, and then convert it to the config key when saved. For example, when writing the full English 'dexterity', it gets converted to 'dex' when saved. Language packs could then add their own mappings when loaded.