Sueta

Lingua Franca

1.0.7

Java Internationalisation that doesn't suck

·Plugin

Lingua-Franca is an annotation-driven internationalisation library that features semi-automated locale file(s) generation. In addition, the library supports properties, JSON and YAML files.

For more information, please see the GitHub page , example project and wiki .

Feature Comparison:


Lingua Franca 1.0.2 and above requires Java 11; prior versions require Java 10.

Java 11+ Maven Artifact:

<!-- Release Builds --> 
<repository> 
  <id>lingua-releases</id> 
  <url>https://repo.karuslabs.com/repository/lingua-franca-releases/</url> 
</repository> 

<!-- Nightly Builds --> 
<repository> 
  <id>lingua-snapshots</id> 
  <url>https://repo.karuslabs.com/repository/lingua-franca-snapshots/</url> 
</repository> 

<dependencies> 
  <dependency> 
      <groupId>com.karuslabs</groupId> 
      <artifactId>lingua-franca</artifactId> 
      <version>1.0.7</version> 
  </dependency> 
</dependencies> 

<build> 
    <!-- Optional but highly recommended --> 
    <plugin> 
        <groupId>com.karuslabs</groupId> 
        <artifactId>lingua-maven-plugin</artifactId> 
        <version>1.0.7</version> 
        <executions> 
            <execution> 
                <goals> 
                    <!-- Lints the usage of Lingua Franca annotations in the project --> 
                    <goal>lint</goal> 
                    <!-- Generates the embedded template locale file(s) at compilation --> 
                    <goal>generate</goal> 
                </goals> 
            </execution> 
        </executions> 
    </plugin> 
</build>
@Namespace  (   "messages"   )  
@ClassLoaderSources  (   {   "translations"   }   )  
 class  Foo  {  
  
    Bundler bundler  =  Bundler.  bundler   (   )   ;  
  
     void  register  (   )   {  
        bundler.  loader   (   )  .  add   (   this   )   ;   // Tells Lingua-Franca to look in the src/main/resources/translations folder  
     }  
  
     void  obtain  (   )   {  
        Bundle bundle  =  bundler.  load   (   this  ,   Locale   .  UK   )   ;   // Returns messages_en.yml in the src/main/resources/translations folder  
  
      String   value  =  bundle.  find   (   "path.to.value"   )   ;   // "value {0}"  
      String   formatted_value  =  bundle.  find   (   "path.to.value"  ,  "formatted"   )   ;   // "value formatted"  
     }  
  
 }

For more information please see the quick start .

Similar projects

Plugin →