ModificationStation / StationAPI

A general use API for Fabric Loader mods on legacy Minecraft versions.
85 stars 19 forks source link

Translation keys v1 #105

Closed mineLdiver closed 6 months ago

mineLdiver commented 6 months ago

Current format of translation keys has serious flaws:

  1. Usage of colons for namespacing, which introduces manual escaping in lang files.
  2. It assumes that the second part of the translation key (first.second.third) is always the one that requries namespacing, making multi-level translation keys confusing.
  3. Automatic namespacing of translation keys imposes some limitations on the developer.

What this pull request changes:

  1. Colons are no longer being used in translation keys. Namespaces are instead their own parts. Example: item.namespace\:myItem.name -> item.namespace.myItem.name
  2. Automatic namespacing is now opt-in and requires specifying where the namespace is supposed to be via a placeholder. Example: item.namespace.myItem.name -> item.@.myItem.name
  3. StationAPI's own translation keys have been reformatted to be more consistent with vanilla. Example: stationapi\:achievementPage.myPage -> gui.stationapi.achievementPage.@.myPage
  4. StationAPI's own lang files are no longer loaded in an alternative way that avoids module's specific automatic namespacing, since automatic namespacing is now opt-in by default.
  5. Keybinds saving workaround is now removed, since colons are no longer used in translation keys and can no longer mess with Minecraft's options.txt parser.