I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 45a59f00 authored by zzz's avatar zzz
Browse files

add a common method for title formatting and translation

parent dc6d6ead
No related branches found
No related tags found
No related merge requests found
...@@ -27,13 +27,16 @@ do ...@@ -27,13 +27,16 @@ do
# translate calls must be one of the forms: # translate calls must be one of the forms:
# _("foo") # _("foo")
# cssHelper._("foo") # cssHelper._("foo")
# cssHelper.title("foo")
# handler._("foo") # handler._("foo")
# formhandler._("foo") # formhandler._("foo")
# In a jsp, you must use a helper or handler that has the context set. # In a jsp, you must use a helper or handler that has the context set.
# To start a new translation, copy the header from an old translation to the new .po file, # To start a new translation, copy the header from an old translation to the new .po file,
# then ant distclean updater. # then ant distclean updater.
find src ../jsp/WEB-INF -name *.java > $TMPFILE find src ../jsp/WEB-INF -name *.java > $TMPFILE
xgettext -f $TMPFILE -F -L java --keyword=_ --keyword=cssHelper._ --keyword=handler._ --keyword=formhandler._ -o ${i}t xgettext -f $TMPFILE -F -L java \
--keyword=_ --keyword=cssHelper._ --keyword=cssHelper.title --keyword=handler._ --keyword=formhandler._ \
-o ${i}t
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo 'Warning - xgettext failed, not updating translations' echo 'Warning - xgettext failed, not updating translations'
......
...@@ -28,4 +28,15 @@ public class CSSHelper extends HelperBase { ...@@ -28,4 +28,15 @@ public class CSSHelper extends HelperBase {
if (lang != null && lang.length() > 0) if (lang != null && lang.length() > 0)
_context.router().setConfigSetting(Messages.PROP_LANG, lang); _context.router().setConfigSetting(Messages.PROP_LANG, lang);
} }
/** translate the title and display consistently */
public String title(String s) {
StringBuilder buf = new StringBuilder(128);
buf.append("<title>")
.append(_("I2P Router Console"))
.append(" - ")
.append(_(s))
.append("</title>");
return buf.toString();
}
} }
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
<%@page pageEncoding="UTF-8"%> <%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>I2P Router Console - config update</title> <html><head>
<%@include file="css.jsp" %> <%@include file="css.jsp" %>
<%=cssHelper.title("config update")%>
</head><body> </head><body>
<%@include file="summary.jsp" %> <%@include file="summary.jsp" %>
......
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: I2P routerconsole\n" "Project-Id-Version: I2P routerconsole\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-10-19 21:30+0000\n" "POT-Creation-Date: 2009-10-20 11:55+0000\n"
"PO-Revision-Date: 2009-10-19 12:50+0000\n" "PO-Revision-Date: 2009-10-19 12:50+0000\n"
"Last-Translator: foo <foo@bar>\n" "Last-Translator: foo <foo@bar>\n"
"Language-Team: foo <foo@bar>\n" "Language-Team: foo <foo@bar>\n"
...@@ -17,19 +17,24 @@ msgstr "" ...@@ -17,19 +17,24 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: German\n" "X-Poedit-Language: German\n"
#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:332 #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:95
msgid "config update"
msgstr "config update in german test test test"
#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:334
msgid "Update policy" msgid "Update policy"
msgstr "Update policy in german foobarbaz" msgstr "Update policy in german foobarbaz"
#: src/net/i2p/router/web/ConfigUpdateHelper.java:90 #: src/net/i2p/router/web/CSSHelper.java:36
msgid "Notify only"
msgstr "Notify only in german"
#: src/net/i2p/router/web/SummaryBarRenderer.java:26 #: src/net/i2p/router/web/SummaryBarRenderer.java:26
#: src/net/i2p/router/web/SummaryBarRenderer.java:28 #: src/net/i2p/router/web/SummaryBarRenderer.java:28
msgid "I2P Router Console" msgid "I2P Router Console"
msgstr "" msgstr ""
#: src/net/i2p/router/web/ConfigUpdateHelper.java:90
msgid "Notify only"
msgstr "Notify only in german"
#: src/net/i2p/router/web/SummaryBarRenderer.java:42 #: src/net/i2p/router/web/SummaryBarRenderer.java:42
msgid "I2P Services" msgid "I2P Services"
msgstr "" msgstr ""
......
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: I2P routerconsole\n" "Project-Id-Version: I2P routerconsole\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-10-19 21:30+0000\n" "POT-Creation-Date: 2009-10-20 11:55+0000\n"
"PO-Revision-Date: 2009-10-19 12:59+0000\n" "PO-Revision-Date: 2009-10-19 12:59+0000\n"
"Last-Translator: foo <foo@bar>\n" "Last-Translator: foo <foo@bar>\n"
"Language-Team: foo <foo@par>\n" "Language-Team: foo <foo@par>\n"
...@@ -17,19 +17,24 @@ msgstr "" ...@@ -17,19 +17,24 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Language: Chinese\n" "X-Poedit-Language: Chinese\n"
#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:332 #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:95
msgid "Update policy" msgid "config update"
msgstr "" msgstr ""
#: src/net/i2p/router/web/ConfigUpdateHelper.java:90 #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:334
msgid "Notify only" msgid "Update policy"
msgstr "" msgstr ""
#: src/net/i2p/router/web/CSSHelper.java:36
#: src/net/i2p/router/web/SummaryBarRenderer.java:26 #: src/net/i2p/router/web/SummaryBarRenderer.java:26
#: src/net/i2p/router/web/SummaryBarRenderer.java:28 #: src/net/i2p/router/web/SummaryBarRenderer.java:28
msgid "I2P Router Console" msgid "I2P Router Console"
msgstr "" msgstr ""
#: src/net/i2p/router/web/ConfigUpdateHelper.java:90
msgid "Notify only"
msgstr ""
#: src/net/i2p/router/web/SummaryBarRenderer.java:42 #: src/net/i2p/router/web/SummaryBarRenderer.java:42
msgid "I2P Services" msgid "I2P Services"
msgstr "" msgstr ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment