Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untranslated app names in home screen #175

Closed
Edke opened this issue Nov 21, 2013 · 7 comments
Closed

Untranslated app names in home screen #175

Edke opened this issue Nov 21, 2013 · 7 comments

Comments

@Edke
Copy link

Edke commented Nov 21, 2013

While in menu there are app names translated, in home screen while listing all apps, models and actions, app names are left untranslated.

It would be nice to have both menu and home screen app names translated.

@darklow
Copy link
Owner

darklow commented Nov 21, 2013

This is strange, i just checked project where localisation is used and all apps in home screen are translated.
Also you can see by the template, that blocktrans is used - i copied this code from original django admin template.

Please test it if it is actually django suit fault, by temporary removing suit from INSTALLED_APPS
https://github.com/darklow/django-suit/blob/develop/suit/templates/admin/app_index.html#L11

Those names in home screen comes from model Meta class verbose_name_plural property, are you sure you translated it properly? While in menu, you can override name if you use label property.

If it still doesn't work, please give me a screenshot, so we know we talk about same place and also definition of you model admin class Meta tag

@Edke
Copy link
Author

Edke commented Nov 21, 2013

Names from Meta's verbose_name_plural are for models. I'm talking about appname itself. For translating, I'm putting translated string into __init__.py of app, where django-admin's makemessages finds string and includes it into locales:

checkout/__init__.py:

 from django.utils.translation import ugettext as _

_('Checkout')

app-names

This way it works for menu but not for home page with listings of all apps and modules. Guess app name is not represented as {% trans '' %} tag in template.

@darklow
Copy link
Owner

darklow commented Nov 21, 2013

It's a good thing i asked for a screenshot :)
Should be fixed. Use develop branch until stable release is out:

pip uninstall django-suit
pip install https://github.com/darklow/django-suit/tarball/develop

@Edke
Copy link
Author

Edke commented Nov 21, 2013

Sweet, hope this wont break anything to no one :-) Thank you for super quick fix, will for sure support app for usage!

@Edke
Copy link
Author

Edke commented Nov 21, 2013

Testing commit, but translation using blocktrans is not working even when you removed newline, still string not translated. On the contrary using simple {% trans app.name %} works.

@darklow darklow reopened this Nov 25, 2013
darklow added a commit that referenced this issue Nov 25, 2013
@darklow
Copy link
Owner

darklow commented Nov 25, 2013

Really strange, they should work identically. Anyways changed to {% trans app.name %}. Try now.

@Edke
Copy link
Author

Edke commented Nov 25, 2013

As you are saying, strange but this way it works. Confirmed.

@darklow darklow closed this as completed Dec 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants