AmmoniumX / AdminShop

Admin Shop Minecraft Mod
GNU Lesser General Public License v2.1
4 stars 4 forks source link

Support alternative currency formats (e.g. 1 € or 1円) #39

Closed James103 closed 2 months ago

James103 commented 2 months ago

The AdminShop mod already supports changing the currency symbol by modifying the translated string for gui.money_message: https://github.com/AmmoniumX/AdminShop/blob/95a475aee5ec7d07ff952b9a196c573e0142adbb/src/main/resources/assets/adminshop/lang/en_us.json#L6

However, the result only makes sense for currencies and languages where the currency symbol should precede the number, which is a subset of all currencies and languages. In some European languages, the euro symbol (€) comes after the number with an intervening space: "123 €" instead of "€123." Would it be possible to refactor the way monetary amounts are formatted to support this?

Another example: Suppose I want to translate the balance display in the top left into Japanese and use Japanese yen instead of dollars. If I do so as far as I can, I will end with the following, which is incorrect:

Balance: 円13500

I expect the following:

残高:13500円

(the word "Balance" not being translated is a separate issue.)

AmmoniumX commented 2 months ago

Added