alfonsodg / demo-web2py

Apache License 2.0
0 stars 0 forks source link

String 'Welcome %s' is not translated when user is logged-in #116

Closed alfonsodg closed 10 years ago

alfonsodg commented 10 years ago

From vinicius...@gmail.com on October 22, 2010 16:21:54

What steps will reproduce the problem? 1. Create a new "myapp" application

  1. In db.py insert this before the first line: T.force('pt-br')
  2. Create the applications/myapp/languages/pt-br.py
  3. Translate 'Welcome %s' message in pt-br.py to 'blablabla %s'
  4. Register a new user and login. 'John', for example. What is the expected output? What do you see instead? Expected output: blablabla John What I see: Welcome John (at the top of the page, before 'logout' option) What version of the product are you using? On what operating system? v1.87.3 Ubuntu Please provide any additional information below. I traced back the source code and I reached /web2py/gluon/tools.py Line 1057 is as below: prefix = prefix.strip()+' ' I changed it to: prefix = T(prefix.strip())+' '

This solved the problem, but I don't know if this is the right solution.

Original issue: http://code.google.com/p/web2py/issues/detail?id=117

alfonsodg commented 10 years ago

From massimod...@gmail.com on October 25, 2010 10:35:57

I fixed adding T in navbar(prefix=T("welcome"),...) in welcome/view/layout.html.

Status: Fixed