RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
790 stars 258 forks source link

Translation support for macros/frameworks #914

Open Azhrei opened 4 years ago

Azhrei commented 4 years ago

Is your feature request related to a problem? Please describe. Its currently not easy for frameworks to support multiple translations. It could be done with tables, for example, but that’s a bulky interface and requires numeric codes for each message that might be displayed.

Describe the solution you'd like I’d like to see localization support for macros in the form of functions that can access a framework-specific translation file. It needs to be as simple as possible with very short macro function names so as to make it more likely to be used. The translation file should not be stored in the campaign file but then how would it be distributed (given that most frameworks are distributed as campaign files so that GMs/users can just open-and-go)?

Describe alternatives you've considered It would be possible to use the REST functions if a global repository of frameworks and translation files existed. Perhaps a separate GH project where people can store their frameworks?

One possibility that would work right now is for the framework to store its messages as properties on a Lib token. If a framework had one token per language, it would be possible to decide which Lib token to use onCampaignLoad based on current locale settings. This is a good approach, except that updating the language files might get cumbersome. (Downloading Lib tokens and adding them to the campaign is easy, but error prone. If frameworks had a repo like art packs do, maybe an “Update” button would be sufficient? But that’s a separate feature request, I think.)

Additional context I started a discussion on the #general-dev channel of the Discord server as well, but putting comments here preserves them and makes them Google-searchable.

bubblobill commented 10 months ago

With the advent of add-ons, language files can be .properties files as used in MT. All we need are some functions to make it go that will work off an add-on URI