Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration Localisation #284

Open
Pheotis opened this issue Jan 31, 2023 · 4 comments
Open

Configuration Localisation #284

Pheotis opened this issue Jan 31, 2023 · 4 comments
Labels
enhancement A suggested addition to the plugin. On Hold! Something is currently preventing us from working on this; we will work on it when we can! REWRITE This task/issue only applies to the rewritten version of the plugin (currently in ALPHA)

Comments

@Pheotis
Copy link

Pheotis commented Jan 31, 2023

When we get around to a full release, we will need to handle config localisation for non-english distribution channels.

The config system is currently finicky, so it will probably be a slight pain to implement.
When we get around to it, this file should help:

config_foreign_format.zip

@Pheotis Pheotis added enhancement A suggested addition to the plugin. On Hold! Something is currently preventing us from working on this; we will work on it when we can! labels Jan 31, 2023
@Pheotis Pheotis added this to the 1.0.1.0-BETA milestone Jan 31, 2023
@Pheotis Pheotis added the REWRITE This task/issue only applies to the rewritten version of the plugin (currently in ALPHA) label Mar 25, 2023
@Pheotis Pheotis removed this from the 1.0.1.0-BETA milestone Jul 14, 2023
@Pheotis Pheotis added this to the Immediate-Future (1.1.X.X) milestone Jul 14, 2023
@Thorinwasher
Copy link

Thorinwasher commented Jan 13, 2024

I probably have asked this question before, but how exactly do we know the language to be localized? Although this will be a mess, here's actually one solution:

  1. Load the language from the config
  2. Check against an internally stored property whether this language has been set already
  3. If that was not the case, load the translated configuration comments into the old config file without removing config data
  4. Store an internal property that the modified language has been set

The hard part here of course is number 3.

This is the only behavior that I can see working; the configuration will have to be English initially, as there's no good reliable way to check the localization on a server. Like the server does not have to be located in the same region as that of the server owner. I really see no other reliable way, but let me see if I can find system properties that might give something interesting

@Thorinwasher
Copy link

Thorinwasher commented Jan 13, 2024

There is apparently the

Locale.getDefault();

But I'm unsure how reliable it is. It's quite hard to know what the system owner wants from that setting. For example I myself would like the configuration to be in English, even though my locale would be Swedish. There's no way for the system to know that. Therefore I suggest not using that property

@EpicKnarvik97
Copy link
Collaborator

3. If that was not the case, load the translated configuration comments into the old config file without removing config data

The migrator has some code which ensures that the comments of the updated config.yml is used, but values are taken from the user's configuration, after the keys have been updated. It should be possible to do the same for changing the configuration language. We should be able to copy (or generalize) that code from the migrator and use the user's current configuration as the input, and the translated configuration file as the one to take comments from.

@Thorinwasher
Copy link

Thorinwasher commented Jan 14, 2024

Yeah, I suppose it's mostly copy and paste, but I'm still scared to touch that code. But what must be done, must be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A suggested addition to the plugin. On Hold! Something is currently preventing us from working on this; we will work on it when we can! REWRITE This task/issue only applies to the rewritten version of the plugin (currently in ALPHA)
Projects
Development

No branches or pull requests

3 participants