Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ybiquitous/messages
Simple Message Library
https://github.com/ybiquitous/messages
Last synced: 15 days ago
JSON representation
Simple Message Library
- Host: GitHub
- URL: https://github.com/ybiquitous/messages
- Owner: ybiquitous
- License: apache-2.0
- Created: 2012-04-05T10:17:37.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-08-16T03:38:45.000Z (over 12 years ago)
- Last Synced: 2024-11-13T13:58:14.434Z (about 2 months ago)
- Language: Java
- Homepage:
- Size: 707 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Example
=======messages.properties (on classpath root, UTF-8 encoded)
```
test.key = {0} & {1}
```messages_en.properties (on classpath root, UTF-8 encoded)
```
test.key = {0} and {1}
```Java
```java
import java.util.Locale;
import org.ybiquitous.messages.MessageKey;
import org.ybiquitous.messages.MessageLocaleHolder;Locale.setDefault(Locale.FRENCH);
// default locale
MessageKey.of("test.key").get(1, "abc"); //=> 1 & abc
MessageKey.of("test.key", "messages").get(1, "abc"); //=> 1 & abc// specify locale
MessageKey.of("test.key").get(Locale.ENGLISH, 1, "abc"); //=> 1 and abc// use locale saved on thread-local
ThreadLocalLocaleHolder.set(Locale.ENGLISH);
MessageKey.of("test.key").get(1, "abc"); //=> 1 and abc
```Scala
```scala
import org.ybiquitous.messages.scala.MessageKeyMessageKey("test.key").get(1, "abc") //=> 1 and abc
MessageKey("test.key", "messages").get(1, "abc") //=> 1 and abc
```See [Sample Project](https://github.com/ybiquitous/messages/tree/master/messages-sample).
Required
========- Java 1.6+
- Scala 2.9+Homepage
========http://ybiquitous.github.com/messages/
API
===- [Java](http://ybiquitous.github.com/messages/apidocs/)
- [Scala](http://ybiquitous.github.com/messages/messages-scala/scaladocs/)License
=======[The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt)