If you put each of your app names into a file that was then processed by
makemessages (so the strings were included in the PO file) and then
translated them, I believe the translated version will show up on the
site (the app name is certainly marked as "to be translated" in the
template). So you need to write down the app names by hand.
Right now, there's no automatic extraction of application names. No
great plans to do so either (although if somebody came along with an
ideal setup, we'd certainly include it). Hacks aren't interesting -- we
need a decent, robust solution and are prepared to wait until that
appears. It's one of those cases where localisation has to compromise to
code, instead of the other way around.
Regards,
Malcolm
Any file. It doesn't matter. Some file that "makemessages" will pick up
and read, so best make it a .py file. It could be an empty file that
just contains a big docstring with the names of the applications.
> can I use
> __init__.py within my app and just put the app-names there and mark
> them as to translate?
Sounds reasonable.
>
> I already tried to translate the app-names by using a translation-file
> (django.po, django.mo), but that doesn´t work. probably because I´m
> missing that "file" you´re talking about.
Hmm ... I would have thought that would work. Maybe I'm forgetting some
obvious step. I haven't actually tested this, but I'd be surprised if it
doesn't work. If you still have no look, post back to the list and maybe
I'll find some time, or somebody else will, to try out some options.
Regards,
Malcolm
Nice summary. :-)
> 3. change app-names in index.html /// on line 18 replace {% blocktrans
> with app.name as name %}{{ name }}{% endblocktrans %} with {% trans
> app.name %}
Not sure what's going on there, but it's a bug. Blocktrans shouldn't be
behaving strangely (using "trans" isn't wrong and we could just switch
to that, but I'd like to understand what's going with "blocktrans",
too).
That's why I thought this should have just worked with marking the names
for translation in a file somewhere. Hmm ... mysterious. :-(
>
> 4. change breadcrumbs in change_list.html /// on line 25 replace
> {{ app_label|capfirst }} with {% trans app_label %}
>
> 5. change breadcrumbs in change_form.html /// on line 28 replace
> { app_label|capfirst }} with {% trans app_label %}
>
> 6. change app-names in app_index.html /// on line 11 replace {%
> blocktrans with app.name as name %}{{ name }}{% endblocktrans %} with
> {% trans app.name %}
>
> 7. change title in base_site.html /// on line 69 replace {{ title }}
> with {% trans title %}
All of those are bugs (the same bug: not marking app name for
translation). If you'd like to open a ticket and drop in a patch, it's
an more-or-less obviously correct set of changes to make.
Put it in the "internationalisation" component.
Regards,
Malcolm
Looks like the discussion for the technical fixes here (and Ramiro
Morales seems to be taking care of the bug filing) has moved to the
django-i18n list:
http://groups.google.com/group/Django-I18N/browse_thread/thread/bdcdaf433bfcd144
Regards,
Malcolm
I've opened [1]ticket 10436 for this , please test the patch attached
and/or post
feedback about it or the ticket description notes.
>
> All of those are bugs (the same bug: not marking app name for
> translation). If you'd like to open a ticket and drop in a patch, it's
> an more-or-less obviously correct set of changes to make.
>
> Put it in the "internationalisation" component.
>
I've selected django.contrib.admin instead, change it to internationalization
if you consider it more correct.
--
Ramiro Morales
http://rmorales.net