Skip to content

enr/messages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library messages

CI

Java library to manage messages in your app.

Usage

To get this project into your build:

Add the JitPack repository to your build file

<repositories>
  <repository>
      <id>jitpack.io</id>
      <url>https://jitpack.io</url>
  </repository>
</repositories>

Add the dependency

<dependency>
  <groupId>com.github.enr</groupId>
  <artifactId>messages</artifactId>
  <version>0.2.0</version>
</dependency>

Declare messages:

welcome.message=Welcome {0}!

Usage:

// create the source
ResourceBundleMessageSource source = ResourceBundleMessageSource
    .forResource(RESOURCE_BUNDLE_NAME)
    .withFallbackResource(FALLBACK_BUNDLE_NAME).build();
// create a context
Context context = new Context(Locale.ENGLISH);
// get message
String message = source.msg("welcome.message", context, "John");

Development

Build:

mvn install

Full check (test and formatting):

mvn -Pci

Repair formatting:

mvn -Pfmt

Fast build (skip any check and file generation):

mvn -Pfast

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages