Closed Ruin0x11 closed 3 years ago
I think instead of _
we will just have one namespace per mod. base
can be elided when passing in a locale key to I18N.get()
and similar, and the rest will be prefixed with a colon.
I18N.get("ui.inv.common.inventory_is_full")
I18N.get("base:ui.inv.common.inventory_is_full") -- equivalent to the above
I18N.get("elona:nefia._.elona.dungeon.name")
If a mod wants to add new things under a namespace for the purpose of localizing the new data entries they add, they will create a folder under locale
named with the namespace and put the localizations there.
This is similar to what Minecraft does: have a default namespace of
base
, and let each mod have its own localization namespace separate from it. Therefore, this code:becomes this code:
Since
base
will be so commonly used, we would also have the option to omitbase:
when looking up a localized string/function/list, as before.Also, we should change the format of
locale/
to reflect these namespaces. This is so mods that want to add to a different mod's namespace can organize themselves better.Before:
After:
I am currently thinking that, in relation to #8, there should be a special namespace separate from
base
where the localizations of entries indata
should live. (Here it is named_
.) If this isn't a good idea, we could just reusebase
.