fantasycalendar / FoundryVTT-ItemPiles

Other
33 stars 54 forks source link

[REQUEST] Allow currency abbreviations to be translated #641

Open mkahvi opened 3 weeks ago

mkahvi commented 3 weeks ago

Is your feature request related to a problem? Please describe. Abbreviated currency disregards localization by being hardcoded.

Describe the solution you'd like Ability to define string and key for use in game.i18n.localize() instead of hardcoded string with string replacement shim.

For example

abbreviation: {
  i18n: "PF1.Currency.Abbr.gp"
  key: "gp"
}

Which then is called as

game.i18n.format(abbreviation.i18n, { [abbreviation.key]: 500 })

Or something to that effect. Should be flexible enough

Though I presume not all systems have currencies like that, so maybe just allow it to be a function?

Describe alternatives you've considered Ignoring i18n problem is the only alternative.

Haxxer commented 2 weeks ago

How would this work with the currency UI?

image

mkahvi commented 2 weeks ago

Would need separate handling for that I would think. Treat input in that UI as override to what's provided via the API.