trans tag working wrong

10 views
Skip to first unread message

TX

unread,
Oct 27, 2016, 11:50:54 PM10/27/16
to erlydtl-users
Hi,

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
NoTrans.png
Trans.png

Andreas Stenius

unread,
Nov 7, 2016, 4:12:59 AM11/7/16
to ErlyDTL Users, 23161...@qq.com
I'm glad you solved it. (found your thread on the chicagoboss mailing list).

Cheers,
Andreas

TX

unread,
Nov 7, 2016, 7:05:26 AM11/7/16
to erlydtl-users
Yes, it is because of vim encoding on windows xp


------------------ 原始邮件 ------------------
发件人: "Andreas Stenius";<g...@astekk.se>;
发送时间: 2016年11月7日(星期一) 下午5:12
收件人: "ErlyDTL Users"<erlydt...@googlegroups.com>;
抄送: "TX"<23161...@qq.com>;
主题: Re: trans tag working wrong
--
You received this message because you are subscribed to the Google Groups "ErlyDTL Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erlydtl-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nuku Ameyibor

unread,
Nov 7, 2016, 9:44:35 AM11/7/16
to erlydt...@googlegroups.com
Dude !! .
windows XP .
Wow .
But once it gets the job done . 👍.

From: TX
Sent: ‎11/‎7/‎2016 12:05 PM
To: erlydtl-users
Subject: 回复: trans tag working wrong

Reply all
Reply to author
Forward
0 new messages