TX
unread,Oct 29, 2016, 2:32:33 AM10/29/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to chicagoboss
Hi,
I sent below mail to erlydtl group but no one answered, can anyone here help?
I almost finished coding my program and wanted to make multi lingual UI, originally the log in screen is as attached NoTrans.png. Then I add trans tag as:
<h3><font color="red">{% trans "Log in" %}</font></h3>
<hr>
{% if errors %}
<ul>
{% for error in errors %}
<li><font color=red>{{ error }}</font></li>
{% endfor %}
</ul>
{% endif %}
{% if error %}
<font color=red>{{ error }}</font>
{% endif %}
<label>{% trans "E-mail as username" %}
<input type="email" name="username" required/>
<span class="form-error">
An valid e-mail address is required.
</span>
</label>
<label>{% trans "Password" %}
<input type="password" name="password" required/>
<span class="form-error">
password is required!
</span>
</label>
<button class="button" type="submit" value="submit">{% trans "Log in" %}</button>
In my strings.zh-cn.po, I have these:
msgid "Log in"
msgstr "登录"
msgid "Password"
msgstr "密码"
msgid "E-mail as username"
msgstr "E-mail作为用户名"
msgid "Kindly note!"
msgstr "请注意!"
When visit the page, I got attached Trans.png screen. only the two "Log in" were translated, with all strings in, those "E-mail as username" and "Password" were not translated.
This seems to be quite tricky, the msgid's in the PO file were copied and should be correct. What mistake did I make?
Thanks