oωo (owo-lib)

oωo (owo-lib)

17M Downloads

[Feature Request] Translation Setting Extendability for Nested Class in Config Model

c0nstexpr opened this issue · 0 comments

commented

Currently, providing translations for multiple nested objects need to be done one by one. But there are cases the nested object can provide uniform translation. For example:

public class MyConfig {

    public MyNested uiScale1 = new MyNested();
    public MyNested uiScale2 = new MyNested();

    public static class MyNested {
        public int Length;
        public int Width;
    }

    // uiScale3, uiScale4, ...
}

The class MyNested provide similar functionality for each config options in this case. Apply same translation would be intuitive.
Here are the possible solutions:

  1. add setter for translationKey in Option
  2. add class serves like OptionComponentFactory to resolve translation key
  3. add attribute in config model to resolve translation key
  4. add translation key candidate "text.config.{config name}.{nested class name}.{prop name}", behaves like enum "text.config.{config name}.{enum name}.{value name}"