Most objects have a way of giving them a "label" attribute, or even a
"short_description" attribute. So, if you didn't want to go to the trouble
of internationalizing (i17ning?) your application, just use those idioms to
create visible names for your custom-created models and forms, etc.
To change the django-supplied names, then that should just be a matter of
switching the language in the settings.
If you want to change the "Django Administration" name to something app
specific, then I would supply a new admin/base_site.html template (copy the
one from django-source/contrib/admin/templates/admin, modify it, and put it
into a templates/admin folder in your own app)
On Tuesday, December 4, 2012 8:58:38 PM UTC-8, Pedro J. Aramburu wrote:
>
> I hope someone could help me. My main language is Spanish but when I write
> code I like it to be en english. Being that way it will be easier to open
> source something in the future. The main problem is the app name in the
> Admin Site.
> For example, I'm writing a kind of eCommerce site without the ability to
> make transactions (or buy) online. So it's more like a product
> catalog/catalogue. For that reason I created a catalog app with the desired
> modules, etc. When I configure the admin site then, I have the Catalog
> section with the CRUD for the models but, as my main language is Spanish,
> my clients also read Spanish so instead of "Catalog" it should say
> "Catálogo".
> I've read the documentation and googled a lot and find some "solutions"
> but they were pretty old. The most promising was to modify the admin site
> templates and put something like the following on the __init__.py file:
>
> from django.utils.translation import ugettext_noop as _
>
> _('Catalog')
>
>
> That way the makemessages would pick the string and then I could translate
> it. Well, it didn't work.
>
> I found that the templates have some translation applied to them but I
> then realized that the app.name isn't translated but the surroundings are
> (
> https://github.com/django/django/blob/master/django/contrib/admin/templates/admin/index.html).
>
> The app.name is just a string interpolation.
>
> Have been any progress regarding this subject? Have anyone had to deal
> with something like this? Can I change the app name in some way or the
> app_label? What's the difference? How should approach it? Isn't somewhere a
> verbose_name for apps or something? Even if it's hard coded, with no
> translation.
>
> Thank you in advance for your time.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/4dqYdzMlW-sJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.