Re: internationalization makemessage don't work

2012-02-26 Thread Diego Schulz
On Sun, Feb 26, 2012 at 2:22 PM, nicolas HERSOG  wrote:
> Hi folks !
>
> I'm trying for hours to internationalize my django website.
>
> I added to my settings.py this few lines :
>
> TIME_ZONE = 'Europe/Paris'
> LANGUAGE_CODE = 'fr-FR'
>
> I added to all templates i want to translate the tag trans for the sentence
> I want to  internationalize exemple :
>
> {% trans "article écrit :"%}
> {% trans "Nom :"%}
>
> And then at my root project i run django-admin.py makemessages -l en
>
> This command created a django.po file which contains the translations key
> for django debug tool bar, but none key of my webapp.
>
> Did I do something wrong, or miss something ?
>

{% load i18n %}

at the top of your template file?



> Thank you :)
>
> Nicolas
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: internationalization makemessage don't work

2012-02-27 Thread Diego Schulz
On Mon, Feb 27, 2012 at 5:45 AM, nicolas HERSOG  wrote:
> Hi everyone,
> Very thanks for yours answers!
>
> I added to the top of all my html files {% load i18n %} and typed in my root
> directory :
>
> django-admin.py makemessages -l en
>
> Or :
>
> python manage.py makemessages -l en
>
> I tried both commands, first in my root directory and in my app but none of
> this command work :/
>
> Any more tips or advices ?
>
> Very  thanks for your help :)
>
> Nicolas
>
>
> On Mon, Feb 27, 2012 at 8:24 AM, Ian Clelland  wrote:
>>
>>
>>
>> On Sunday, February 26, 2012, nicolas HERSOG wrote:
>>>
>>> Hi folks !
>>>
>>> I'm trying for hours to internationalize my django website.
>>>
>>> I added to my settings.py this few lines :
>>>
>>> TIME_ZONE = 'Europe/Paris'
>>> LANGUAGE_CODE = 'fr-FR'
>>>
>>> I added to all templates i want to translate the tag trans for the
>>> sentence I want to  internationalize exemple :
>>>
>>> {% trans "article écrit :"%}
>>> {% trans "Nom :"%}
>>>
>>> And then at my root project i run django-admin.py makemessages -l en
>>
>>
>> Why are you running django-admin.py, rather than manage.py? manage.py
>> knows how to fund your settings files, and import all of your apps and check
>> all of your template dirs.
>>
>> Try first running "manage.py makemessages -l fr" (since I suspect that
>> your site is already in French, you won't have to actually do anything with
>> that po file right now, but it's good to have)
>>
>> Ian
>>
>>>
>>> This command created a django.po file which contains the translations key
>>> for django debug tool bar, but none key of my webapp.
>>>
>>> Did I do something wrong, or miss something ?
>>>

Do you already have a conf/locale/ directory in your project directory
where .mo and .po files
are located in their own directory? Example:

conf/locale/en/LC_MESSAGES/django.mo
conf/locale/en/LC_MESSAGES/django.po
conf/locale/en-us/LC_MESSAGES/django.mo
conf/locale/en-us/LC_MESSAGES/django.po
conf/locale/es/LC_MESSAGES/django.mo
conf/locale/es/LC_MESSAGES/django.po
conf/locale/es-py/LC_MESSAGES/django.mo
conf/locale/es-py/LC_MESSAGES/django.po
...

Can you run manage.py makemessages and manage.py compilemessages
without getting errors?

Did you set the LOCALE_PATHS variable in the settings.py file?

#SNIP
LOCALE_PATHS = (
   '/somewhere/in/your/filesystem/YourProject/conf/locale',
)
#


diego

>>> Thank you :)
>>>
>>> Nicolas

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: internationalization makemessage don't work

2012-02-27 Thread Diego Schulz
On Mon, Feb 27, 2012 at 7:19 PM, Denis Darii  wrote:
> Of course, from the django
> documentation(https://docs.djangoproject.com/en/dev/topics/i18n/translation/#message-files):
>>
>> The script should be run from one of two places:
>>
>> The root directory of your Django project.
>> The root directory of your Django app.
>>
>> The script runs over your project source tree or your application source
>> tree and pulls out all strings marked for translation.
>
>
> So "The script runs over your project source tree or your application source
> tree"...
>
>
> On Mon, Feb 27, 2012 at 11:03 PM, nicolas HERSOG  wrote:
>>
>> I've already tried this, django created LC_MESSAGE folder in locale, but
>> this folder is empty (no django.po file is generated :/)
>>
>> I'm guessing if the problem is not the way i tagged the things to
>> translate ...
>> I added to all the html files i wanted to translate the tag {% load i18n
>> %} and all the strings i wanted to translate are between {%trans
>> "myStringToTranslate" %}
>>
>> Is the fact that my /template folder is not in the same path than m apps
>> may be a problem ?
>>
>>
>> On Mon, Feb 27, 2012 at 10:58 PM, Denis Darii 
>> wrote:
>>>
>>> Hi Nicolas.
>>> Try to run makemessages script from the root directory of your Django
>>> app, so:
>>>
>>> $ cd /your/app/path/
>>> $ mkdir locale
>>> $ django-admin.py makemessages -l en
>>>
>>>
>>>
>>> On Mon, Feb 27, 2012 at 10:54 PM, nicolas HERSOG 
>>> wrote:

 Yes, I have my app in INSTALLED_APPS and I also have added this key in
 my settings :

 USE_I18N = True
 USE_L10N = True

 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'debug_toolbar.middleware.DebugToolbarMiddleware',
 )

I'm not completely sure about this, but I think you should try adding
'django.middleware.locale.LocaleMiddleware' to your MIDDLEWARE_CLASSES.
You should pay attention to the order, though.
LocaleMiddleware should be put after SessionMiddleware and before
CommonMiddleware.

Here's a snippet from a working example:

MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)


diego

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: ANNOUNCE: Django 1.4 release candidate available

2012-03-05 Thread Diego Schulz
On Mon, Mar 5, 2012 at 2:49 PM, James Bennett  wrote:
> We're nearly there!
>
> The Django 1.4 release candidate package is now available, and you can
> read all about it on the blog:
>
> https://www.djangoproject.com/weblog/2012/mar/05/14-rc-1/
>

Hi James,

Glad to read that!

Just FYI: there's a minor issue while building html docs since this commit:

Fixes #17327 -- Add --database option to createsuperuser and
change password management commands
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17665
bcc190cf-cafb-0310-a4f2-bffc1f526a37

Here's a snip from the sphinx output:

...
/home/dschulz/django/docs/ref/django-admin.txt:3: SEVERE: Duplicate
ID: "django-admin-option---database".
/home/dschulz/django/docs/ref/django-admin.txt:3: SEVERE: Duplicate
ID: "django-admin-option---database".
...
build succeeded, 2 warnings.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problems getting started

2012-03-08 Thread Diego Schulz
On Wed, Mar 7, 2012 at 11:36 AM, Clark  wrote:
> After installing Django I am attempting to start a new project.  After
> creating a directory for this, I tried using the command: "django-
> admin.py startproject mysite".
>
> but I'm getting the message "-bash: django-admin.py: command not found
> ".
>
> So, I've tried running this:
>
> "sudo ln -s library/python/2.6/site-packages/django/bin/django-
   
> admin.py /usr/local/bin/django-admin.py" in which i get "file exists"
> and I still get the same problem when running the startproject.
>

You should use the absolute (full) path to django-admin.py, not a relative path.

> Only other piece of info is that during installation I had a "error: /
> usr/local/bin/django-admin.py: No such file or directory".  But I can
> cd into that directory and see the django-admin.py file.
>
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Difficult setup on Suse Linux

2012-04-04 Thread Diego Schulz
On Wed, Apr 4, 2012 at 3:47 PM, Martin Sommer  wrote:
> I have Python and Django properly installed, but am not getting the
> first project to work. When I do this:
>
> python manage.py runserver
>
> ... I get this:
>
> Traceback (most recent call last):
>  File "manage.py", line 14, in ?
>    execute_manager(settings)
>  File "/usr/lib/python2.4/site-packages/django/core/management/
> __init__.py", line 438, in execute_manager
>    utility.execute()
>  File "/usr/lib/python2.4/site-packages/django/core/management/
> __init__.py", line 379, in execute
>    self.fetch_command(subcommand).run_from_argv(self.argv)
>  File "/usr/lib/python2.4/site-packages/django/core/management/
> base.py", line 191, in run_from_argv
>    self.execute(*args, **options.__dict__)
>  File "/usr/lib/python2.4/site-packages/django/core/management/
> base.py", line 209, in execute
>    translation.activate('en-us')
>  File "/usr/lib/python2.4/site-packages/django/utils/translation/
> __init__.py", line 100, in activate
>    return _trans.activate(language)
>  File "/usr/lib/python2.4/site-packages/django/utils/translation/
> __init__.py", line 43, in __getattr__
>    if settings.USE_I18N:
>  File "/usr/lib/python2.4/site-packages/django/utils/functional.py",
> line 276, in __getattr__
>    self._setup()
>  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
> line 42, in _setup
>    self._wrapped = Settings(settings_module)
>  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
> line 139, in __init__
>    logging_config_func(self.LOGGING)
>  File "/usr/lib/python2.4/site-packages/django/utils/dictconfig.py",
> line 553, in dictConfig
>    dictConfigClass(config).configure()
>  File "/usr/lib/python2.4/site-packages/django/utils/dictconfig.py",
> line 321, in configure
>    del logging._handlerList[:]
> AttributeError: 'module' object has no attribute '_handlerList'
>
> Any ideas?

Is this a Django 1.4 installation? I ask that because it looks like
you have Python 2.4,
and Django 1.4 will NOT work with Python 2.4, requires at least Python 2.5.

Diego

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.