Browse files

Internationalized and translated all strings in scala codes.

  • Loading branch information...
1 parent 1b215cc commit 1a34504c570e86a06fcb24b3f6d3858ed4c1765d @iron9light iron9light committed Jun 25, 2012
View
23 src/main/resources/i18n/trans_zh_CN.properties
@@ -0,0 +1,23 @@
+# Index
+Home = \u9996\u9875
+Lazy\ Loading = \u5EF6\u8FDF\u52A0\u8F7D
+Parallel\ Rendering = \u5E76\u884C\u6E32\u67D3
+# Wiring =
+Designer\ Friendly\ Templates = \u8BBE\u8BA1\u53CB\u597D\u7684\u6A21\u677F\u7CFB\u7EDF
+Wizard = \u5411\u5BFC\u7EC4\u4EF6
+Security = \u5B89\u5168\u6027
+
+# Chat
+Welcome = \u6B22\u8FCE
+
+# Wizard
+First\ Name = \u59D3\u540D
+Name\ Too\ Short = \u540D\u5B57\u592A\u77ED\u4E86
+Name\ Too\ Long = \u540D\u5B57\u592A\u957F\u4E86
+Age = \u5E74\u9F84
+Too\ young = \u5E74\u9F84\u592A\u5C0F\u4E86
+You\ should\ be\ dead = \u4F60\u662F\u795E\u4ED9\u5417
+Mom\ or\ Dad's\ name = \u5988\u5988\u6216\u7238\u7238\u7684\u540D\u5B57
+Pet's\ name = \u5BA0\u7269\u7684\u540D\u5B57
+Thank\ you\ for\ registering\ your\ pet = \u611F\u8C22\u60A8\u6CE8\u518C\u60A8\u7684\u5BA0\u7269
+your\ age = \u60A8\u7684\u5E74\u9F84
View
17 src/main/scala/bootstrap/liftweb/Boot.scala
@@ -22,13 +22,13 @@ class Boot {
// Build SiteMap
def sitemap = SiteMap(
Menu.i("Home") / "index",
- Menu("lazy", "Lazy Loading") / "lazy",
- Menu("parallel", "Parallel Rendering") / "parallel",
- Menu("comet", "Comet & Ajax") / "comet",
- Menu("wiring", "Wiring") / "wiring",
- Menu("templates", "Designer Friendly Templates") / "templates",
- Menu("wizard", "Wizard") / "wizard",
- Menu("security", "Security") / "security")
+ Menu("lazy", S ? "Lazy Loading") / "lazy",
+ Menu("parallel", S ? "Parallel Rendering") / "parallel",
+ Menu("comet", S ? "Comet & Ajax") / "comet",
+ Menu("wiring", S ? "Wiring") / "wiring",
+ Menu("templates", S ? "Designer Friendly Templates") / "templates",
+ Menu("wizard", S ? "Wizard") / "wizard",
+ Menu("security", S ? "Security") / "security")
// set the sitemap. Note if you don't want access control for
// each page, just comment this line out.
@@ -47,7 +47,8 @@ class Boot {
// Use HTML5 for rendering
LiftRules.htmlProperties.default.set((r: Req) =>
- new Html5Properties(r.userAgent))
+ new Html5Properties(r.userAgent))
+ LiftRules.resourceNames ::= "i18n/trans"
}
}
View
2 src/main/scala/net/liftweb/seventhings/comet/Chat.scala
@@ -31,7 +31,7 @@ class Chat extends CometActor with CometListener {
* The chat server
*/
object ChatServer extends LiftActor with ListenerManager {
- private var msgs = Vector("Welcome") // the private data
+ private var msgs = Vector(S ? "Welcome") // the private data
// what we send to listeners on update
def createUpdate = msgs
View
4 src/main/scala/net/liftweb/seventhings/snippet/MyWizard.scala
@@ -44,9 +44,9 @@ object MyWizard extends Wizard {
// what to do on completion of the wizard
def finish() {
- S.notice("Thank you for registering your pet: "+
+ S.notice(S ? "Thank you for registering your pet" + ": "+
favoritePet.petName+
- " your age * 3: "+nameAndAge.age * 3)
+ " " + S ? "your age" + "* 3: "+nameAndAge.age * 3)
}
}

0 comments on commit 1a34504

Please sign in to comment.