GitXplorerGitXplorer
P

Lingua-Franca

public
9 stars
1 forks
1 issues

Commits

List of commits on branch master.
Verified
ac28f9cfebb2f7518b4663be250a8078127ac736

Merge pull request #207 from Pante/dependabot/maven/org.mockito-mockito-core-3.6.0

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

Merge pull request #206 from Pante/dependabot/maven/org.mockito-mockito-junit-jupiter-3.6.0

ddependabot-preview[bot] committed 4 years ago
Verified
6e9e76d5aac3517420fd186328bb786a1892a6cc

Bump mockito-core from 3.5.15 to 3.6.0

ddependabot-preview[bot] committed 4 years ago
Verified
6cf12c6a796c8217a4c8021c76612492156f183d

Bump mockito-junit-jupiter from 3.5.15 to 3.6.0

ddependabot-preview[bot] committed 4 years ago
Verified
72b5100cdec62ccc7dfd0097299fd629541a85a0

Merge pull request #205 from Pante/dependabot/maven/org.mockito-mockito-junit-jupiter-3.5.15

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

Merge pull request #204 from Pante/dependabot/maven/org.mockito-mockito-core-3.5.15

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.