Permalink
Browse files

Translate views. Closes #3.

  • Loading branch information...
Frogurth committed May 14, 2012
1 parent c84d2f5 commit 38242aee88f46cd754b3efa7c2440b0f35fedf3a
@@ -1,10 +1,15 @@
@(elements: helper.FieldElements)
<div class="control-group @if(elements.hasErrors) {error}">
- <label class="control-label" for="@elements.id">@elements.label</label>
+ <label class="control-label" for="@elements.id">
+ @if(elements.infos.contains("Required")) {
+ *
+ }
+ @elements.label
+ </label>
<div class="controls">
@elements.input
<span class="help-inline">@elements.errors.mkString(", ")</span>
- <span class="help-block">@elements.infos.mkString(", ")</span>
+ <span class="help-block">@elements.infos.filter(_!="Required").mkString(", ")</span>
</div>
</div>
@@ -1,5 +1,6 @@
@(implicit flash: Flash, session: Session)
@import play.api.Play.current
+@import play.api.i18n.Messages
@main() {
<!-- Main hero unit for a primary marketing message or call to action -->
<div class="hero-unit">
@@ -20,17 +21,17 @@ <h2>Alleine... zu zweit?!</h2>
<h2>Simple and anonym</h2>
<p>The only thing you need to sign up is a invite key.<br />
We don't log anything and you can delete your profile and all associatet data with a simple mouse click.</p>
- <p><a class="btn" href="/users/new">Sign Up Now &raquo;</a></p>
+ <p><a class="btn" href="/users/new">@Messages("sign_up_now") &raquo;</a></p>
</div>
<div class="span4">
<h2>Closed Community</h2>
<p>All potential new members need an invite key to avoid undesirables.</p>
- <p><a class="btn" href="/users/new">Sign Up Now &raquo;</a></p>
+ <p><a class="btn" href="/users/new">@Messages("sign_up_now") &raquo;</a></p>
</div>
<div class="span4">
<h2>Open Source</h2>
<p>Everyone can contribute new ideas, features or bugfixes to the underlying software.</p>
- <p><a class="btn" href="/users/new">Sign Up Now &raquo;</a></p>
+ <p><a class="btn" href="/users/new">@Messages("sign_up_now") &raquo;</a></p>
</div>
</div>
}
@@ -1,6 +1,7 @@
@(loginForm: Form[(String, String)])(implicit flash: Flash, session: Session)
@import helper._
@import etc.Constructors._
+@import play.api.i18n.Messages
@main() {
@form(routes.Application.auth) {
@@ -11,15 +12,14 @@
}
@inputText(
loginForm("username"),
- '_label -> "Username: ",
- '_help -> "Choose a valid username",
+ '_label -> Messages("username") ,
'class -> "input-xlarge"
)
@inputPassword(
loginForm("password"),
- '_label -> "Password: ",
+ '_label -> Messages("password") ,
'class -> "input-xlarge"
)
- <button type="submit" class="btn btn-primary">Login</button>
+ <button type="submit" class="btn btn-primary">@Messages("login")</button>
}
}
@@ -1,6 +1,7 @@
@(user: models.User)(implicit flash: Flash, session: Session)
@import helper._
@import etc._
+@import play.api.i18n.Messages
@main() {
@userInfo(user)
@@ -11,21 +12,21 @@
@form(routes.Private.unmark(user.id)) {
<button class="btn btn-inverse btn-small" type="submit">
<i class="icon-star icon-white"></i>
- unmark
+ @Messages("not_follow")
</button>
}
} else {
@form(routes.Private.mark(user.id)) {
<button class="btn btn-inverse btn-small" type="submit">
<i class="icon-star icon-white-empty"></i>
- mark
+ @Messages("follow")
</button>
}
}
<a class="btn btn-success btn-small" href="/users/@user.username/pmessages/new">
<i class="icon-envelope icon-white"></i>
- Write message
+ @Messages("write_message")
</a>
}
}
@@ -1,34 +1,34 @@
@(signUpForm: Form[(String, (String, String), String)])(implicit flash: Flash, session: Session)
@import helper._
@import etc.Constructors._
+@import play.api.i18n.Messages
@main() {
@form(routes.Application.newUser) {
@inputText(
signUpForm("username"),
- '_label -> "Username: ",
- '_help -> "Choose a valid username.",
+ '_label -> Messages("username"),
+ '_help -> Messages("username.desc"),
'_error -> signUpForm.error("username"),
'class -> "input-xlarge"
)
@inputPassword(
signUpForm("password.main"),
- '_label -> "Password: ",
+ '_label -> Messages("password"),
'class -> "input-xlarge"
)
@inputPassword(
signUpForm("password.confirm"),
- '_label -> "Repeat password",
- '_help -> "Please repeat your password again.",
+ '_label -> Messages("password.repead"),
'_error -> signUpForm.error("password"),'class -> "input-xlarge"
)
@inputText(
signUpForm("registrationkey"),
- '_label -> "Registration key: ",
+ '_label -> Messages("reg.key"),
'_error -> signUpForm.error("registrationkey"),'class -> "input-xlarge"
)
- <button type="submit" class="btn btn-primary">Sign Up</button>
+ <button type="submit" class="btn btn-primary">@Messages("sign_up")</button>
}
}
@@ -1,45 +1,49 @@
@(userForm: Form[((String, String, String), String, java.util.Date, String, Boolean, Boolean)], user: models.User)(implicit flash: Flash, session: Session)
@import helper._
@import etc.Constructors._
-
+@import play.api.i18n.Messages
@main() {
@form(routes.Private.saveUser()){
- <h1>Editing @user.username</h1>
+ <h1>@Messages("editing", user.username)</h1>
<input type="hidden" name="user.username" value="@user.username" />
@inputPassword(
userForm("user.new"),
- '_label -> "New Password: ",'class -> "input-xlarge"
+ '_label -> Messages("new_password"),
+ 'class -> "input-xlarge"
)
@inputPassword(
userForm("user.old"),
- '_label -> "Old Password: ",
- '_help -> "Only needed when changing passwords.",
- '_error -> userForm.error("user"),'class -> "input-xlarge"
+ '_label -> Messages("old_password"),
+ '_help -> Messages("old_password.desc"),
+ '_error -> userForm.error("user"),
+ 'class -> "input-xlarge"
)
@inputRadioGroup(
userForm("gender"),
- options = options("m"->"Male","f"->"Female", "q" -> "Queer", "n" -> "N/A"),
- '_label -> "Gender"
+ options = options("m"->Messages("male"),"f"->Messages("female"), "q" -> Messages("queer"),
+ "n" -> Messages("gender.na")),
+ '_label -> Messages("gender")
)
@inputDate(
userForm("bday"),
- '_label -> "Date of Birth: ",'class -> "input-xlarge"
+ '_label -> Messages("date_of_birth"),
+ 'class -> "input-xlarge"
)
@textarea(
userForm("about"),
- '_label -> "About you: ",
+ '_label -> Messages("about"),
'rows -> 10,'class -> "input-xlarge"
)
@checkbox(
userForm("anonym"),
- '_label -> "Anonym?",
+ '_label -> Messages("anonym"),
'_help -> "",'class -> "input-xlarge"
)
- <button type="submit" class="btn btn-primary">Save</button>
+ <button type="submit" class="btn btn-primary">@Messages("save")</button>
}
}
@@ -1,5 +1,6 @@
@(pms: Long)(implicit request: play.api.mvc.Request[AnyContent], flash: Flash, session: Session)
@import play.api.Play.current
+@import play.api.i18n.Messages
@main() {
<script>
ready.push('refreshMessagelist');
@@ -13,9 +14,9 @@ <h3>Hello @request.session.get("user").get</h3>
<div class="row">
<div class="span4" id="pms">
- <h2>Private Messages</h2>
+ <h2>@Messages("private_messages")</h2>
<ul></ul>
- <p><a class="btn" href="/users/pmessages/new">Write one &raquo;</a></p>
+ <p><a class="btn" href="/users/pmessages/new">@Messages("write_one") &raquo;</a></p>
</div>
</div>
}
@@ -1,9 +1,10 @@
@(messages: List[models.PrivateMessage])(implicit request: play.api.mvc.Request[AnyContent], flash: Flash, session: Session)
@import etc._
+@import play.api.i18n.Messages
@main(){
@for(m <- messages) {
<div>
- <a href="/users/me/pmessages/@m.id">@m.title</a> from
+ <a href="/users/me/pmessages/@m.id">@m.title</a> @Messages("from")
@if(m.authorID.?) {
<a href="/users/@(models.User.findBy("id" -> m.authorID.toString))">@(models.User.findBy("id" -> m.authorID.toString).head.username)</a>
} else {
@@ -1,21 +1,22 @@
@(messageForm: Form[(String, String)], to: Long)(implicit flash: Flash, session: Session)
@import helper._
@import etc.Constructors._
-
+@import play.api.i18n.Messages
@main() {
@form(routes.Private.writeMessage(to)) {
@inputText(
messageForm("title"),
- '_label -> "Title: ",
- '_help -> "May be empty.",'class -> "input-xlarge"
+ '_label -> Messages("title"),
+ 'class -> "input-xlarge"
)
@textarea(
messageForm("content"),
'rows -> 10,
- '_label -> "Message: ",
- '_error -> messageForm.error("content"),'class -> "input-xlarge"
+ '_label -> Messages("message"),
+ '_error -> messageForm.error("content"),
+ 'class -> "input-xlarge"
)
- <button type="submit" class="btn btn-primary">Send</button>
+ <button type="submit" class="btn btn-primary">@Messages("send")</button>
}
}
@@ -1,27 +1,28 @@
@(messageForm: Form[(String, String, String)])(implicit flash: Flash, session: Session)
@import helper._
@import etc.Constructors._
-
+@import play.api.i18n.Messages
@main() {
@form(routes.Private.writeMessage(0)) {
@inputText(
messageForm("receiver"),
- '_label -> "To: ",
+ '_label -> Messages("to"),
'_error -> messageForm.error("to"),
'class -> "input-xlarge"
)
@inputText(
messageForm("title"),
- '_label -> "Title: ",
- '_help -> "May be empty.",'class -> "input-xlarge"
+ '_label -> Messages("title"),
+ 'class -> "input-xlarge"
)
@textarea(
messageForm("content"),
'rows -> 10,
- '_label -> "Message: ",
- '_error -> messageForm.error("content"),'class -> "input-xlarge"
+ '_label -> Messages("message"),
+ '_error -> messageForm.error("content"),
+ 'class -> "input-xlarge"
)
- <button type="submit" class="btn btn-primary">Send</button>
+ <button type="submit" class="btn btn-primary">@Messages("send")</button>
}
}
@@ -2,23 +2,24 @@
@import controllers.BBCodeParser._
@import etc._
@import helper._
+@import play.api.i18n.Messages
@main(){
<h4>@message.title</h4>
- from
+ @Messages("from")
@if(message.authorID > 0) {
@if(message.authorID.?) {
<a href="/users/@(models.User.findBy("id" -> message.authorID.toString).head.username)">@(models.User.findBy("id" -> message.authorID.toString).head.username)</a>
} else {
NA
}
- } on @message.writtenAt.normalize
+ } @Messages("on") @message.writtenAt.normalize
<div class="well" style="margin-top:2%;">
@Html(message.content.escape)
</div>
@if(message.authorID.?) {
<a class="btn btn-success" href="/users/me/pmessages/reply/@message.id">
<i class="icon-arrow-left icon-white"></i>
- Reply
+ @Messages("reply")
</a>
}
}
@@ -1,5 +1,6 @@
@(user: models.User, keys: List[models.InvitationKey])(implicit session:Session, flash: Flash)
@import etc._
+@import play.api.i18n.Messages
@main() {
@userInfo(user)
@for(key <- keys) {
@@ -8,19 +9,19 @@
@if(keys.length < 3) {
@helper.form(routes.Private.createKey()){<button class="btn btn-mini btn-inverse" type="submit" style="margin-top:2%;">
<i class="icon-lock icon-white"></i>
- Generate key
+ @Messages("form.new_key")
</button>}
}
<a class="btn btn-primary btn-small" href="/users/me/edit">
<i class="icon-edit icon-white"></i>
- Edit profile
+ @Messages("edit_profile")
</a>
<div style="margin-top:3%;">
@helper.form(routes.Private.deleteProfile()){
<button class="btn btn-mini btn-danger" type="submit" style="margin-top:2%;">
<i class="icon-ban-circle icon-white"></i>
- Delete profile
+ @Messages("delete")
</button>
}
</div>
Oops, something went wrong.

0 comments on commit 38242ae

Please sign in to comment.