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

Fallback does not work when there is at least one non-fallback method declared #4

Closed rodionmoiseev closed 12 years ago

rodionmoiseev commented 12 years ago

For example if @En is declared as fallback of @Ja:

void configure(){
  install(new DefaultC10NAnnotations());
  bindAnnotation(En.class); //define @En as fallback
}

Then with Locale set to "jp_ja", the following method greeting() will produce "Hello" (correct behaviour)

interface Greeting{
  @En("Hello")
  String greeting();
}

where as, in the following case it will output the internal fallback message "Greeting.greeting":

interface Greeting{
  @En("other")
  @Ja("other")
  String other();

  @En("Hello")
  String greeting();
}
fjakop commented 12 years ago

I'm getting exactly this issue with c10n-core-1.0, is the fix already released?

rodionmoiseev commented 12 years ago

It's currently in 1.1-SNAPSHOT only. If you are in a rush, you can use it by pointing your maven/gradle to the following:

maven repo url: https://raw.github.com/rodionmoiseev/c10n/master/c10n-mvn-repo/snapshots version: 1.1-SNAPSHOT

I will make the current 1.1 snapshot an official release some time soon, as I am pretty happy with its current state. It would be great if you could try out the 1.1 snapshot to confirm that everything works for you.

Thanks!

fjakop commented 12 years ago

Yes, I figured out this snapshot repo in the meantime, the issue adressed is no longer present and partial translations work. Thanks a lot.

rodionmoiseev commented 12 years ago

Glad that helps.

Regards.