rodionmoiseev / c10n

A Java library, focused on making internationalisation more modular, easier to evolve and maintain, robust-to-change and IDE-friendly without excess of external tools.
Apache License 2.0
67 stars 10 forks source link

Support special `C10NMessage` return type containing all translation mapping #29

Closed rodionmoiseev closed 9 years ago

rodionmoiseev commented 9 years ago

Idea taken from commit by @Bartl Ákos to the akysoft fork.

The idea is to allow the user to retrieve translations for all locales, instead of just the value for the current locale. This can be done by declaring the method in the @C10NMessages interface with a special C10NMessage type (instead of a more typical String), as in the example below:

@C10NMessages
public interface Messages{
  @En("English")
  @Ja("Japanese")
  C10NMessage myMessage();
}

The appropriate information on available translations will be available in the C10NMessage class.

rodionmoiseev commented 9 years ago

Link to the commit in the description akysoft/c10n@afe1c55927ecd2552dbb98bc8fb19a4f1a4cc4cf