GitXplorerGitXplorer
P

Lingua-Franca

public
9 stars
1 forks
1 issues

Commits

List of commits on branch master.
Verified
c52db9cfafbf1935b4935000dbfc2eecd63c4a6d

Bump mockito-junit-jupiter from 3.5.13 to 3.5.15

ddependabot-preview[bot] committed 4 years ago
Verified
e4e61f18accfa6c1cf9e92ca80b57320a6913bc3

Bump mockito-core from 3.5.13 to 3.5.15

ddependabot-preview[bot] committed 4 years ago
Verified
b60c21bda0acac1c2a41eb7794a75479ab55e01f

Merge pull request #203 from Pante/dependabot/maven/org.checkerframework-checker-qual-3.7.0

ddependabot-preview[bot] committed 4 years ago
Verified
50161f4f764a9bddd430e664c5c368d3a47b0828

Merge pull request #202 from Pante/dependabot/maven/com.fasterxml.jackson.dataformat-jackson-dataformat-yaml-2.11.3

ddependabot-preview[bot] committed 4 years ago
Verified
9194aacf94e6fef69666cae7a2ce13a7c7934a22

Merge pull request #201 from Pante/dependabot/maven/com.fasterxml.jackson.dataformat-jackson-dataformat-properties-2.11.3

ddependabot-preview[bot] committed 4 years ago
Verified
cfc1e301681c615f05953c491e08bac88332801c

Bump checker-qual from 3.6.1 to 3.7.0

ddependabot-preview[bot] committed 4 years ago

README

The README file for this repository.

Travis-CI Funding Maintainability Coverage Stable Branch releases-maven snapshots-maven javadoc Discord

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.

The master branch contains the bleeding edge, unreleased version of the project. Please view the stable branch for the latest stable release. For more information, please see the example project and wiki.


Feature Comparison:

Plain Java Lingua Franca
Annotations
Formatted Messages
Optional Messages
Embedded Resources
Runtime Resources
Locale File Generation
Locale File (properties)
Locale File (JSON)
Locale File (YAML)

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-nightly/</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>

Getting Started

@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.


Contributing

Please perform changes and submit pull requests from the master branch. Please adhere to the apparent style of the code you are editing.