-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lance Gatlin
committed
May 1, 2016
1 parent
dd75569
commit 2a9c988
Showing
4 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
m_test=c''est un format de message de test qui accepte deux arguments {0} et {1} | ||
m_true=vrai | ||
m_false=faux | ||
fmt_choice_key=Il {0,choice,0#n''y a pas de pommes|1#y a une pomme|1<y a {0,number,integer} pommes}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package s_mach.i18n.example | ||
|
||
object ExampleUsageFR { | ||
|
||
import java.util.Locale | ||
import s_mach.i18n._ | ||
import s_mach.i18n.messages._ | ||
|
||
// Uses UTF8Messages by default | ||
implicit val i18ncfg = I18NConfig(Locale.FRENCH) | ||
|
||
// Create a message with the key m_test that accepts 2 arguments, an Int and an I18NString | ||
val m_test = 'm_test.m[Int,I18NString] | ||
|
||
// Using i18ncfg, resolve the message key to a message format and interpolate the arguments | ||
// Note: the Int argument is automatically converted to I18NString by invoking the | ||
// I18N[Int] type-class | ||
val test_message_lookup = m_test(1,"test".asI18N) | ||
|
||
// Note: the Double argument is automatically converted to I18NString by invoking the | ||
// I18N[Double] type-class | ||
val test_i18n_str = i18n"nous allons interpoler certains arguments $test_message_lookup ${25.0}" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters