Re: I18N not working

2008-11-25 Thread Alex Jonsson

Woohoo! Looks like I solved it.

The error I had made was that inside my locale folders I had named
Swedish "sv_se" which wasn't right. I looked into the django/conf/
locale folder and saw that there they referred to Swedish as "sv". So
by changing the folder names Django finally found them.

Oh, and I can concur that the LocaleMiddleware is not needed to
translate per-app.

Thank you everyone for your help!

On Nov 25, 12:37 pm, Alex Jonsson <[EMAIL PROTECTED]> wrote:
> I did just check the permissions, and even tried change them to a=rwx.
> Still not working.
>
> I tried a couple of other things as well - I made a symlink in one of
> my folders on my PYTHONPATH pointing to my project (it required me to
> do that in order to run the django-admin.py makemessages command) and
> then made and compiled a project-wide translation. Still not working!
>
> Could it have something to do with gettext or such? I use the
> ugettext_lazy and my server runs Python 2.3.
>
> On Nov 25, 12:03 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > On Tue, 2008-11-25 at 03:01 -0800, Alex Jonsson wrote:
> > > Thank you everyone for your feedback.
>
> > > I forgot to mention that I read that paragraph in the docs as well and
> > > already installed the LocaleMiddleware. This makes the translation of
> > > the built-in modules work, but not my per-app translations. This was
> > > why I was thinking that maybe it had something to do with my
> > > PYTHONPATH. I've even tried to change it to include all the apps
> > > directories, but that was to no avail either.
>
> > > Any ideas?
>
> > Have you checked permissions? Does the webserver have permission to read
> > the files in question (including permission to access the directories
> > all the way the down to the files)?
>
> > Malcolm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18N not working

2008-11-25 Thread Alex Jonsson

I did just check the permissions, and even tried change them to a=rwx.
Still not working.

I tried a couple of other things as well - I made a symlink in one of
my folders on my PYTHONPATH pointing to my project (it required me to
do that in order to run the django-admin.py makemessages command) and
then made and compiled a project-wide translation. Still not working!

Could it have something to do with gettext or such? I use the
ugettext_lazy and my server runs Python 2.3.

On Nov 25, 12:03 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-11-25 at 03:01 -0800, Alex Jonsson wrote:
> > Thank you everyone for your feedback.
>
> > I forgot to mention that I read that paragraph in the docs as well and
> > already installed the LocaleMiddleware. This makes the translation of
> > the built-in modules work, but not my per-app translations. This was
> > why I was thinking that maybe it had something to do with my
> > PYTHONPATH. I've even tried to change it to include all the apps
> > directories, but that was to no avail either.
>
> > Any ideas?
>
> Have you checked permissions? Does the webserver have permission to read
> the files in question (including permission to access the directories
> all the way the down to the files)?
>
> Malcolm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18N not working

2008-11-25 Thread Malcolm Tredinnick


On Tue, 2008-11-25 at 03:01 -0800, Alex Jonsson wrote:
> Thank you everyone for your feedback.
> 
> I forgot to mention that I read that paragraph in the docs as well and
> already installed the LocaleMiddleware. This makes the translation of
> the built-in modules work, but not my per-app translations. This was
> why I was thinking that maybe it had something to do with my
> PYTHONPATH. I've even tried to change it to include all the apps
> directories, but that was to no avail either.
> 
> Any ideas?

Have you checked permissions? Does the webserver have permission to read
the files in question (including permission to access the directories
all the way the down to the files)?

Malcolm



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18N not working

2008-11-25 Thread Alex Jonsson

Oh, and another note.

I have checked my browser language, it's set to Swedish. That works
locally as well with LocaleMiddleware.

On Nov 25, 12:01 pm, Alex Jonsson <[EMAIL PROTECTED]> wrote:
> Thank you everyone for your feedback.
>
> I forgot to mention that I read that paragraph in the docs as well and
> already installed the LocaleMiddleware. This makes the translation of
> the built-in modules work, but not my per-app translations. This was
> why I was thinking that maybe it had something to do with my
> PYTHONPATH. I've even tried to change it to include all the apps
> directories, but that was to no avail either.
>
> Any ideas?
>
> On Nov 25, 11:47 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > On Tue, 2008-11-25 at 11:39 +0100, Jarek Zgoda wrote:
> > > Wiadomość napisana w dniu 2008-11-25, o godz. 11:17, przez Thomas  
> > > Guettler:
>
> > > > The last days I did my first i18n application and befor I read this:
> > > >http://docs.djangoproject.com/en/dev/topics/i18n/
> > > > {{{
> > > > Application message files are a bit complicated to discover -- they  
> > > > need
> > > > the LocaleMiddleware.
> > > > If you don't use the middleware, only the Django message files and
> > > > project message files will be processed.
>
> > > > }}}
>
> > > > I don't know if it is really need. But the documentation says so. Or I
> > > > read it to quickly and overlooked
>
> > > I thing something is wrong with docs then, because I'm speaking from  
> > > my practice.
>
> > That quoted section does seem to be inaccurate. The code that fetches
> > the translations is in django.util.translation.trans_real.translation()
> > and it always runs through settings.INSTALLED_APPS looking for locale
> > files.
>
> > I'm rewriting the i18n documentation at the moment, so I've made a note
> > to fix that confusion (that whole section is already basically just a
> > big FIXME at the moment anyway).
>
> > Regards,
> > Malcolm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18N not working

2008-11-25 Thread Alex Jonsson

Thank you everyone for your feedback.

I forgot to mention that I read that paragraph in the docs as well and
already installed the LocaleMiddleware. This makes the translation of
the built-in modules work, but not my per-app translations. This was
why I was thinking that maybe it had something to do with my
PYTHONPATH. I've even tried to change it to include all the apps
directories, but that was to no avail either.

Any ideas?

On Nov 25, 11:47 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-11-25 at 11:39 +0100, Jarek Zgoda wrote:
> > Wiadomość napisana w dniu 2008-11-25, o godz. 11:17, przez Thomas  
> > Guettler:
>
> > > The last days I did my first i18n application and befor I read this:
> > >http://docs.djangoproject.com/en/dev/topics/i18n/
> > > {{{
> > > Application message files are a bit complicated to discover -- they  
> > > need
> > > the LocaleMiddleware.
> > > If you don't use the middleware, only the Django message files and
> > > project message files will be processed.
>
> > > }}}
>
> > > I don't know if it is really need. But the documentation says so. Or I
> > > read it to quickly and overlooked
>
> > I thing something is wrong with docs then, because I'm speaking from  
> > my practice.
>
> That quoted section does seem to be inaccurate. The code that fetches
> the translations is in django.util.translation.trans_real.translation()
> and it always runs through settings.INSTALLED_APPS looking for locale
> files.
>
> I'm rewriting the i18n documentation at the moment, so I've made a note
> to fix that confusion (that whole section is already basically just a
> big FIXME at the moment anyway).
>
> Regards,
> Malcolm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18N not working

2008-11-25 Thread Malcolm Tredinnick


On Tue, 2008-11-25 at 11:39 +0100, Jarek Zgoda wrote:
> Wiadomość napisana w dniu 2008-11-25, o godz. 11:17, przez Thomas  
> Guettler:
> 
> > The last days I did my first i18n application and befor I read this:
> > http://docs.djangoproject.com/en/dev/topics/i18n/
> > {{{
> > Application message files are a bit complicated to discover -- they  
> > need
> > the LocaleMiddleware.
> > If you don't use the middleware, only the Django message files and
> > project message files will be processed.
> >
> > }}}
> >
> > I don't know if it is really need. But the documentation says so. Or I
> > read it to quickly and overlooked
> 
> 
> I thing something is wrong with docs then, because I'm speaking from  
> my practice. 

That quoted section does seem to be inaccurate. The code that fetches
the translations is in django.util.translation.trans_real.translation()
and it always runs through settings.INSTALLED_APPS looking for locale
files.

I'm rewriting the i18n documentation at the moment, so I've made a note
to fix that confusion (that whole section is already basically just a
big FIXME at the moment anyway).

Regards,
Malcolm



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18N not working

2008-11-25 Thread Jarek Zgoda

Wiadomość napisana w dniu 2008-11-25, o godz. 11:17, przez Thomas  
Guettler:

> The last days I did my first i18n application and befor I read this:
> http://docs.djangoproject.com/en/dev/topics/i18n/
> {{{
> Application message files are a bit complicated to discover -- they  
> need
> the LocaleMiddleware.
> If you don't use the middleware, only the Django message files and
> project message files will be processed.
>
> }}}
>
> I don't know if it is really need. But the documentation says so. Or I
> read it to quickly and overlooked


I thing something is wrong with docs then, because I'm speaking from  
my practice. On my site I have few apps with per-app translations  
(django-registration, django-confirmation and so on) and I have some  
sitewide translations for my own code. The translation keys from 3rd  
party apps appear in my own catalog but I left them untranslated there  
(as they are already translated). If the things would work as  
described, the strings from registration app would appear untranslated  
because I do not have LocaleMiddleware installed. Of course, they  
appear in Polish, as I expected.

-- 
We read Knuth so you don't have to. - Tim Peters

Jarek Zgoda, R&D, Redefine
[EMAIL PROTECTED]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18N not working

2008-11-25 Thread Thomas Guettler

The last days I did my first i18n application and befor I read this:
http://docs.djangoproject.com/en/dev/topics/i18n/
{{{
Application message files are a bit complicated to discover -- they need
the LocaleMiddleware.
If you don't use the middleware, only the Django message files and
project message files will be processed.

}}}

I don't know if it is really need. But the documentation says so. Or I
read it to quickly and overlooked

something.

  Thomas

Jarek Zgoda schrieb:
> I know the per-app translations work without this. Mine works equally
> with LANGUAGE_CODE and USE_I18N only on systems with "C" and "pl_PL".  
> There is no need to use LocaleMiddleware if you do not want to change  
> translations (eg. depending on browser settings).
>
>   


-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18N not working

2008-11-25 Thread Jarek Zgoda

Wiadomość napisana w dniu 2008-11-25, o godz. 09:23, przez Thomas  
Guettler:

>> I have some problems with the translations of my website. Locally, it
>> works flawlessly. But as soon as I run the project on my server, it
>> won't translate. I've translated the project per app.
> Translation per app only works if you have the LocaleMiddleware  
> installed.
> Maybe this setting is different on your server?


I know the per-app translations work without this. Mine works equally  
with LANGUAGE_CODE and USE_I18N only on systems with "C" and "pl_PL".  
There is no need to use LocaleMiddleware if you do not want to change  
translations (eg. depending on browser settings).

-- 
We read Knuth so you don't have to. - Tim Peters

Jarek Zgoda, R&D, Redefine
[EMAIL PROTECTED]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: I18N not working

2008-11-25 Thread Thomas Guettler

Alex Jonsson schrieb:
> Hey guys,
>
> I have some problems with the translations of my website. Locally, it
> works flawlessly. But as soon as I run the project on my server, it
> won't translate. I've translated the project per app.
Translation per app only works if you have the LocaleMiddleware installed.
Maybe this setting is different on your server?

 Thomas

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



I18N not working

2008-11-24 Thread Alex Jonsson

Hey guys,

I have some problems with the translations of my website. Locally, it
works flawlessly. But as soon as I run the project on my server, it
won't translate. I've translated the project per app, and I'm
wondering if it could have something to do with my PYTHONPATH? As of
now, my .htaccess file looks like this:

ServerName domain.com
DocumentRoot /home/user/django/mysite

SetEnv DJANGO_SETTINGS_MODULE mysite.settings
SetHandler mod_python
PythonHandler django.core.handlers.modpython
PythonPath "['/home/user/django/', '/home/user/django/mysite/'] +
sys.path"
PythonDebug On

I'm completely clueless on this one. Like I said - it works flawlessly
locally and it's the same code. I should add that everything else
works just fine - custom template tags, import of models, you name it.
I've tried to recompile the language files on the server as well, but
to no avail.

Any suggestions on what I should look for?

Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---



I18n not working

2007-03-12 Thread Christian Hoeppner

Hi there,

Actually, it's plainly that. It's just not working, and I don't really
know where to look for a flaw. It's just a blind guess, but maybe django
is not correctly locating my .mo files? I've triple-checked their
location and tried in every place stated in the documentation or the
django book (beta). Still, it just won't translate anything but the
admin.

Right now, the django.(mo|po) files are in
$PROJECTPATH/locale/es/LC_MESSAGES/

And also, I've tried some variants on the locale name (es, es-es,
es_ES...), although I'm setting the django_language session variable
using the LocaleMiddleware to exactly the same string I'm using for the
locale name on the filesystem.

You know, just to discard any stupid mistakes ;)

Anyone up with an idea?

-- 
Chris M. Hoeppner
Web design & consultancy.
Passionate about experience. Faithfull about copy.
 [EMAIL PROTECTED]
 www.chrishoeppner.com / www.pixware.org


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~--~~~~--~~--~--~---