Is starting a i18n project to translate only the dates ?

2022-09-12 Thread Laurent Lyaudet
Hello,

Django defines some strings to translate even before any code is added in a 
django app.
Is there a default .po for these strings in various languages ?

I looked at the source code for date formating in Django on Github.
And it uses gettext to translate months for example :
https://github.com/django/django/blob/4d4bf55e0ea849476f7e3abfeb018c338f18a9b4/django/utils/dates.py#L24
It seems thus that a .po file is mandatory to have it in another language 
than English

Until now we formatted dates using python (and probably python uses system 
locales).
I wanted to use Django features instead but it seems to be quite cumbersome 
to start an i18n project just for dates translations.

Thanks, best regards,
 Laurent Lyaudet


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/159f660c-49c2-443a-b496-d3aca4c6e6c7n%40googlegroups.com.


i18n: Miscellaneous as dropdown-menu

2020-04-29 Thread René Labounek
Dear django user,

could you please help to the webpage newbie with BFU html skills? :-)

I am building a multi-lingual webpage. I have read the documentation, have 
seen severel youtube videos and was able to setup the language change, 
including the "Misscellaneous 
<https://docs.djangoproject.com/en/3.0/topics/i18n/translation/>" language 
changing button. 

{% load i18n %}

{% csrf_token %}


{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}

{{ language.name_local }} ({{ language.code }})

{% endfor %}





This works fine and I have not identified any error with the above 
mentioned code. Nevertheles, I would prefer implement it as working 
dropdown-menu at my webpage for the language change (to have it more 
consistent with other dropdown menus in my bar).

As I mentioned, I am a newbie and I have tried something like:
 
{% load i18n %}

{% csrf_token %}

Language


{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}

{{ language.name_local }} ({{ language.code }})

{% endfor %}



It draw the dropdown menu. In the list, there are written languages which I 
expect with  the appearance which I expect. But it do nothing, any webpage 
change or any error that the webpage is broken.

Could you please try to help me to identify what is wrong and how to make 
it work? It started to be behing my imaginary... :-(

Most ideal would be, if the text "Language" at line 5 would be changed as 
default at the actual set language code.

If it would be helpful, here is my project urls.py:

from django.contrib import admin
from django.urls import path
from django.conf.urls import include
from django.conf.urls.i18n import i18n_patterns

urlpatterns = [
path('i18n/', include('django.conf.urls.i18n')),
]

urlpatterns += i18n_patterns(
path('admin/', admin.site.urls),
path('',include('mainapp.urls')),
)

And here is my related settings.py:

ANGUAGE_CODE = 'en-us'

TIME_ZONE = 'US/Central'

USE_I18N = True

USE_L10N = True

USE_TZ = True

LANGUAGES = [
('en', 'English'),
('cs', 'Czech'),
('es', 'Spanish')
]

LOCALE_PATHS = (
os.path.join(BASE_DIR, "locale"),
os.path.join(BASE_DIR, "mainapp/locale"),
)

Many thanks for any feedback,
Rene

PS: I have also found two different threads about it at the 
https://stackoverflow.com/, but it seems to me they are not using i18n 
settings recommended by basic django documentation.
https://stackoverflow.com/questions/42745198/django-url-change-language-code/42745233#42745233
https://stackoverflow.com/questions/47874530/django-language-selection-from-dropdown-links-and-images

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/db7cb025-21c7-42cc-8f97-3c1dc17a4e34%40googlegroups.com.


Help with i18n language translation in template - strange behavior between Django 2.2.12 and 3.0+

2020-04-08 Thread Александър Попов
Hello guys, 
I hope you are doing well :)

I have the following problem in my project:
I have a simple PasswordChangeForm, which I want to translate in German for 
example... Everything is fine and works correctly in Django 2.2.12:
See: 1.png
If I upgrade my Django to v 3.0+ same labels are partially translated! And 
this behavior is only for some languages: de,ru,bg.
For example in 'fr' everything is fine and all labels and error messages 
are translated.
See: 2.png and 3.png

The code that I use is same. Only Django version is different.

My code in templates/passsword.html:
 
{% csrf_token %}

Password change
{% load i18n %}
{% language 'de' %}
{{ p_form|crispy }}
{% endlanguage %}


Save

 


Have you faced with issue liked this? Do you have any idea, what is wrong?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d05bc41b-2657-49ee-859a-b988232ed350%40googlegroups.com.


Re: Issue i18n django_language in session

2019-07-17 Thread Yoo
I'm not sure, either. Usually, whenever I'm testing, I open a 
private/incognito browser in case there is caching or cookies are being 
saved (cookies could be related to session authentication and other stuff). 
What I would try first is clearing your cookies if you've been using a 
regular browser tab. Otherwise, I'll also look into it.
Cheers!

On Wednesday, July 17, 2019 at 12:44:57 PM UTC-4, Oscar Rovira wrote:
>
> Hi there,
> I have a Django site with multi-language support through i18n. 
> The default user's language is set based on the browser headers but users 
> can change it via the regular set_language view. 
> Recently I noticed that the UI is shown in a different language than the 
> one my user is supposed to have set and this happens, apparently, without 
> changing my browser language preferences or calling the set_language view.
> I've been looking around the code, checking every statement that makes 
> reference to the language setting of the user in session with no luck on 
> anything that could be causing the issue. I have no clue about what is 
> going on.
> Does the issue rings the bell to someone? Something I could review at?
>
> I appreciate any help or advice. Thanks!
> Oscar
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c3206781-380a-4a70-a9fa-e896fd997e44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Issue i18n django_language in session

2019-07-17 Thread Oscar Rovira
Hi there,
I have a Django site with multi-language support through i18n. 
The default user's language is set based on the browser headers but users 
can change it via the regular set_language view. 
Recently I noticed that the UI is shown in a different language than the 
one my user is supposed to have set and this happens, apparently, without 
changing my browser language preferences or calling the set_language view.
I've been looking around the code, checking every statement that makes 
reference to the language setting of the user in session with no luck on 
anything that could be causing the issue. I have no clue about what is 
going on.
Does the issue rings the bell to someone? Something I could review at?

I appreciate any help or advice. Thanks!
Oscar

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/568c90ea-73d6-47fb-a644-174345d3bbc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to fix i18n fallback , from variant xx-YY to xx and from xx to en the translatino is not available.

2017-05-09 Thread Melvyn Sopacua
On Monday 08 May 2017 09:27:52 Abdullah Sh. wrote:
> Well as far I can test, Django i18n does supports fall-back 'xx-YY' to
> 'xx' then to default ('en' in my case) but only for 'Accept-Language'
> user agent header. It does not do same for URL language switch.

Could you please report this as a bug (maybe feature request)? I've 
dealt with this too but didn't chase it down, so thanks a bunch for that.

>From end-user perspective, there are not that many that are aware of 
the language setting of their browser. If one wants to switch language 
and you have one of those language switchers in your site it should 
always be prefered over Accept-Language header in my opinion.
-- 
Melvyn Sopacua

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8316648.AB8DOu0f3c%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: How to fix i18n fallback , from variant xx-YY to xx and from xx to en the translatino is not available.

2017-05-08 Thread Abdullah Sh.
 

Well as far I can test, Django i18n does supports fall-back 'xx-YY' to 'xx' 
then to default ('en' in my case) but only for 'Accept-Language' user agent 
header. It does not do same for URL language switch.


Here is the solution I could come up with:


from django.views.generic import RedirectViewfrom django.conf import settings...
urlpatterns += patterns('',
  url(r'^(?P[a-z]{2})-[A-Za-z]{2}/(?P.*)$', 
RedirectView.as_view(url='/%(lang)s/%(path)s',query_string=True)),
  url(r'^[a-z]{2}/(?P.*)$', 
RedirectView.as_view(url='/{}/%(path)s'.format(settings.LANGUAGE_CODE),query_string=True)),)


   - Any xx-YY not handled by i18n pattern redirected to xx
   - Any xx not handled by i18n pattern redirected to default language set 
   using LANGUAGE_CODE.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a14b0173-f665-401c-a665-e25ef9ddf976%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to fix i18n fallback , from variant xx-YY to xx and from xx to en the translatino is not available.

2017-05-06 Thread Abdullah Sh.


Well, official documentation says clearly it should fall-back (ex: fr-fr to 
fr then to en) but my case raises 404 error.

Source: https://django.readthedocs.io/en/1.5.x/topics/i18n/translation.html

If a base language is available but the sublanguage specified is not, 
> Django uses the base language. For example, if a user specifies de-at 
> (Austrian German) but Django only has de available, Django uses de.
>
> ...
>
> LANGUAGES = ( ('de', _('German')), ('en', _('English')), )
>
> This example restricts languages that are available for automatic 
> selection to German and English (and any sublanguage, like de-ch or en-us).
>
Here are related code portions:


*settings.py*


# Language code for this installation. All choices can be found here:# 
http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en'

LANGUAGES = (
  ( 'ar', "Arabic" ),
  ( 'en', "English" ),
  ( 'fr', "French" ),
  ( 'id', "Indonesian" ),
  ( 'ja', "Japanese"),
  ( 'ku', "Kurdish" ),
  #( 'ur', "Urdu" ),
  ( 'ms', "Malay" ),
  ( 'ml', "Malayalam" ),
  #( 'tr', "Turkish" ),
  ( 'es', "Spanish" ),
  ( 'pt', "Portuguese"),
  #( 'sv', "swedish" ))
# These are languages not supported by Django core. We have to provide# their 
info here so we can use them in our templates. This is mainly# used in 
`wui.templatetags.languages`.
EXTRA_LANGUAGES = {
  'ku': {
'code': 'ku',
'name': 'Kurdish',
'bidi': True,
'name_local': 'Kurdish'
  },
  'ms': {
'code': 'ms',
'name': 'Malay',
'bidi': False,
'name_local': 'Malay'
  },}


SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not# to 
load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and# 
calendars according to the current locale
USE_L10N = True

*urls.py*


from django.conf.urls import patterns, include, urlfrom django.conf.urls.i18n 
import i18n_patterns
# Uncomment the next two lines to enable the admin:# from django.contrib import 
admin# admin.autodiscover()

urlpatterns = patterns( '',
  url( r'^jos2', 'wui.views.jos2' ),
  url(r'^r', 'wui.views.one_aya_page'),
  url(r'^$', 'wui.views.results'),
  # url( r'^admin/', include( admin.site.urls ) ),)
# These URLs accept the language prefix.
urlpatterns += i18n_patterns('',
  url(r'^$', 'wui.views.results'),
  url(r'^(?P\w{3,15})/', 'wui.views.results'),)
# 404 not found handler

handler404 = 'wui.views.custom_404'

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3151fd14-9910-48f1-803e-be038afd9769%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Javascript i18n - makemessages doesnt create a djangojs file.

2016-12-03 Thread Laurent Dumont
Hey guys,

/opt/venv/bin/python ../manage.py makemessages -d djangojs -l en -l fr



Looking into debugging this further, I want to translate a few JS files but 
the makemessages commands fails to create the Djanjojs files. I'm using 
something like this : 

url(r'^jsi18n/$',
JavaScriptCatalog.as_view(packages=['lanets.apps.accounts',
'lanets.apps.administration',
'lanets.apps.main',
'lanets.apps.news',
'lanets.apps.store',
'lanets.apps.tickets',
'lanets.apps.tournaments',
'lanets.apps.faq',
'lanets.apps.executiveteam',
'lanets.apps.forums',
'lanets.apps.polls', ]),
name='javascript-catalog'),

And the JS script with the following strings: 

customText: {
headerText: gettext('How can we help?'),
inputPlaceholder: gettext('Type a message...'),
sendButtonText: gettext('Send'),
},

I do get 

processing locale en
processing locale fr

But no djangojs files anywhere.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/69c890e7-6919-40d5-a06c-5732655a62b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django i18n design rationale

2016-01-02 Thread Raphael Michel
Hi,

Am Fri, 1 Jan 2016 15:29:16 -0800 (PST)
schrieb Jure Erznožnik :
> 1. Expressions gathering vs declaring: Django has utilities to gather 
> expressions from sources, txt files and also javascript files. While
> that by itself is a design choice, it also presents us with problems
> such as (possibly very) long expression keys, random .po file layout,
> etc. Are there any serious advantages that favor this approach vs
> declarative one?
> 
> 2. What's the point of .po / .mo files? Their structure is not really
> far from standard Python code, so why all the work with compilation?

I wasn't around Django at that time, but to mee it seems pretty
clear that those two aren't explicit design decisions made by Django but
instead Django just decided to use gettext[1], the de-facto standard for
internationalization in the Unix world instead of implementing an own
system and both the gathering and the .mo files are old design
decisions of gettext.

Cheers
Raphael

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20160102181247.169dd19e%40kvothe.
For more options, visit https://groups.google.com/d/optout.


pgpRZpypRzTUK.pgp
Description: Digitale Signatur von OpenPGP


Django i18n design rationale

2016-01-01 Thread Jure Erznožnik
I've worked with Django for the past few months. While this - I realize - 
is not much, so far it has been an extremely pleasant experience. 
Everything seems to be designed just right and works really nicely out of 
the box.

So I was that much more surprised when I had to prepare my first app for 
localization. It's not like anything didn't work - it did - it just didn't 
FEEL right to me. So in light of everythin else being just right, I'd like 
to ask the community to set me straight on a few points that I'm having 
issues with:

1. Expressions gathering vs declaring: Django has utilities to gather 
expressions from sources, txt files and also javascript files. While that 
by itself is a design choice, it also presents us with problems such as 
(possibly very) long expression keys, random .po file layout, etc. Are 
there any serious advantages that favor this approach vs declarative one?

2. What's the point of .po / .mo files? Their structure is not really far 
from standard Python code, so why all the work with compilation?

3. Why (except for reducing expression count) does javascript code have to 
be gathered in a special domain? Shouldn't that be up to me to decide 
whether to stick all expressions into one big file or split them up?

LP,
Jure

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/159a7905-149b-42da-930b-83371dc62988%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django i18n in JS templates

2014-11-10 Thread Alex Isayko


We actively use django-pipeline package and its builtin solution for 
javascript templates 
<https://django-pipeline.readthedocs.org/en/latest/templates.html>

The problems begins when we needed to use i18n in this templates, for ex.:


<%= gettext('To translate') %>

Standart django makemessages misinterprets this type of files:

python manage.py makemessages --domain=djangojs --all --extension=js,jst 

Translations not appeared in .po and command output:

./static/js/templates/events.jst.c:14: warning: unterminated string literal

So the questions:

   - Does anybody know a clean solution for this?
   - Do we need to write custom processor for makemessages to handle this 
   type of files (.jst)?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c7d65788-b2f1-4dbd-aeac-f767be2a73ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: i18n and overriding django.auth translations

2014-09-03 Thread paul . connell
Well, it's a real situation - I removed the django.admin app from 
settings.py and then my translations worked - it's a basic occlusion - the 
django.admin translations seem to be used before my own translations when 
django.admin is enabled and my application has strings like 'Password' in 
them.

For now, as I'm not using the admin interface I've disabled it and it is 
now all my own translations, but some form of 'override' so that my app 
translations come before the django.admin builtin translations would be 
useful for future use.

On Tuesday, September 2, 2014 3:07:13 PM UTC+1, Avraham Serour wrote:
>
> is this a theoretical question or did you try and it is not working?
>
>
> On Tue, Sep 2, 2014 at 1:26 PM,  
> wrote:
>
>> I've got some basic translations working in de_de (German), but it seems 
>> that django has brought it's own translations along for the ride after I 
>> compile.  I has not translated 'Password' in my locale files but DJango is 
>> doing it automatically (I assume from the django.admin module?).  That's 
>> fine, but is there a way to override this so that my translations in my 
>> locale files take precedence?
>>
>> So if my /locale/de_de/LC_MESSAGES/django.po file contains a translation, 
>> it overrides the default 'Passwort' that django is putting in?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f5ba28a5-42ef-4cfa-a43b-19977440574b%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e9d2515c-2385-4c1b-8a0d-4be7e246ee7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: i18n and overriding django.auth translations

2014-09-02 Thread Avraham Serour
is this a theoretical question or did you try and it is not working?


On Tue, Sep 2, 2014 at 1:26 PM,  wrote:

> I've got some basic translations working in de_de (German), but it seems
> that django has brought it's own translations along for the ride after I
> compile.  I has not translated 'Password' in my locale files but DJango is
> doing it automatically (I assume from the django.admin module?).  That's
> fine, but is there a way to override this so that my translations in my
> locale files take precedence?
>
> So if my /locale/de_de/LC_MESSAGES/django.po file contains a translation,
> it overrides the default 'Passwort' that django is putting in?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f5ba28a5-42ef-4cfa-a43b-19977440574b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6tJy%2BF2w7OXAsmUqY_hab7ssFD4UD2WEpVHHbR4E%2BAN1%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


i18n and overriding django.auth translations

2014-09-02 Thread paul . connell
I've got some basic translations working in de_de (German), but it seems 
that django has brought it's own translations along for the ride after I 
compile.  I has not translated 'Password' in my locale files but DJango is 
doing it automatically (I assume from the django.admin module?).  That's 
fine, but is there a way to override this so that my translations in my 
locale files take precedence?

So if my /locale/de_de/LC_MESSAGES/django.po file contains a translation, 
it overrides the default 'Passwort' that django is putting in?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f5ba28a5-42ef-4cfa-a43b-19977440574b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: internationalization (i18n)

2014-07-30 Thread marc
Here's a list of locales in Django: 
https://github.com/django/django/tree/master/django/conf/locale

Am Mittwoch, 30. Juli 2014 14:47:03 UTC+2 schrieb ma...@tubeards.com:
>
> Hi,
>
> have a look at: http://www.i18nguy.com/unicode/language-identifiers.html
>
> The localization in django is based on region and language codes, some of 
> them are the same (like 'de') and some split (like 'en-us'). For 'mr' 
> you'll need to add the area code of india iirc.
>
> Cheers
>
> Am Mittwoch, 30. Juli 2014 14:31:37 UTC+2 schrieb Supriya Sawant:
>>
>>
>> Hello,
>>
>>   I am using internationalization feature in djnago framework.
>>
>>   In my setting.py I have following languages set:
>>
>> LANGUAGES = (
>> ('de', ugettext('German')),('en', ugettext('English')),('mr', 
>> ugettext('Marathi')),('mwr', ugettext('Marwari')),('mun', ugettext\
>> ('Munda')),('ne', ugettext('Nepali')),('ori', ugettext('Oriya')),('pi', 
>> ugettext('Pali')),('pa', ugettext('Panjabi')),('raj', ugette\
>> xt('Rajasthani')),('sa', ugettext('Sanskrit')),('sat', 
>> ugettext('Santali')),('sd', ugettext('Sindhi')),('ta', 
>> ugettext('Tamil')),('t\
>> e', ugettext('Telugu')),('ur', ugettext('Urdu')),('as', 
>> ugettext('Assamese')),('awa', ugettext('Awadhi')),('ber', 
>> ugettext('Bengali'\
>> )),('bho', ugettext('Bhojpuri')),('bh', ugettext('Bihari')),('bra', 
>> ugettext('Braj')),('gon', ugettext('Gondi')),('dra', ugettext('D\
>> ravidian')),('gu', ugettext('Gujarati')),('en', 
>> ugettext('English')),('him', ugettext('Himachali')),('hi', 
>> ugettext('Hindi')),('kn',\
>>  ugettext('Kannada')),('ks', ugettext('Kashmiri')),('kha', 
>> ugettext('Khasi')),('kok', ugettext('konkani')),('kru', ugettext('Kurukh'\
>> )),('lah', ugettext('Lahnda')),('lus', ugettext('Lushai')),('mag', 
>> ugettext('Magahi')),('mai', ugettext('Maithili')),('mi', ugettext\
>> ('Malayalam')),('mni', ugettext('Manipuri')),('fr', 
>> ugettext('French')),('ja', ugettext('Japanese')),('da', 
>> ugettext('Danish')),('es\
>> ', ugettext('Spanish')),('it', ugettext('Italian')),('ru', 
>> ugettext('Russian')),
>>
>> I  have created th po file .
>>
>> but while runserver I am getting following error:
>>
>> raise KeyError("Unknown language code %s." % lang_code)
>> KeyError: u'Unknown language code mr.'
>>
>> what would be the reason.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20a3ac7f-3976-4e1a-b2a9-8377440794b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: internationalization (i18n)

2014-07-30 Thread marc
Hi,

have a look at: http://www.i18nguy.com/unicode/language-identifiers.html

The localization in django is based on region and language codes, some of 
them are the same (like 'de') and some split (like 'en-us'). For 'mr' 
you'll need to add the area code of india iirc.

Cheers

Am Mittwoch, 30. Juli 2014 14:31:37 UTC+2 schrieb Supriya Sawant:
>
>
> Hello,
>
>   I am using internationalization feature in djnago framework.
>
>   In my setting.py I have following languages set:
>
> LANGUAGES = (
> ('de', ugettext('German')),('en', ugettext('English')),('mr', 
> ugettext('Marathi')),('mwr', ugettext('Marwari')),('mun', ugettext\
> ('Munda')),('ne', ugettext('Nepali')),('ori', ugettext('Oriya')),('pi', 
> ugettext('Pali')),('pa', ugettext('Panjabi')),('raj', ugette\
> xt('Rajasthani')),('sa', ugettext('Sanskrit')),('sat', 
> ugettext('Santali')),('sd', ugettext('Sindhi')),('ta', 
> ugettext('Tamil')),('t\
> e', ugettext('Telugu')),('ur', ugettext('Urdu')),('as', 
> ugettext('Assamese')),('awa', ugettext('Awadhi')),('ber', 
> ugettext('Bengali'\
> )),('bho', ugettext('Bhojpuri')),('bh', ugettext('Bihari')),('bra', 
> ugettext('Braj')),('gon', ugettext('Gondi')),('dra', ugettext('D\
> ravidian')),('gu', ugettext('Gujarati')),('en', 
> ugettext('English')),('him', ugettext('Himachali')),('hi', 
> ugettext('Hindi')),('kn',\
>  ugettext('Kannada')),('ks', ugettext('Kashmiri')),('kha', 
> ugettext('Khasi')),('kok', ugettext('konkani')),('kru', ugettext('Kurukh'\
> )),('lah', ugettext('Lahnda')),('lus', ugettext('Lushai')),('mag', 
> ugettext('Magahi')),('mai', ugettext('Maithili')),('mi', ugettext\
> ('Malayalam')),('mni', ugettext('Manipuri')),('fr', 
> ugettext('French')),('ja', ugettext('Japanese')),('da', 
> ugettext('Danish')),('es\
> ', ugettext('Spanish')),('it', ugettext('Italian')),('ru', 
> ugettext('Russian')),
>
> I  have created th po file .
>
> but while runserver I am getting following error:
>
> raise KeyError("Unknown language code %s." % lang_code)
> KeyError: u'Unknown language code mr.'
>
> what would be the reason.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/56de9898-9119-45fc-8abe-dd2f0ed91bfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


internationalization (i18n)

2014-07-30 Thread Supriya Sawant

Hello,

  I am using internationalization feature in djnago framework.
   
  In my setting.py I have following languages set:

LANGUAGES = (
('de', ugettext('German')),('en', ugettext('English')),('mr', 
ugettext('Marathi')),('mwr', ugettext('Marwari')),('mun', ugettext\
('Munda')),('ne', ugettext('Nepali')),('ori', ugettext('Oriya')),('pi', 
ugettext('Pali')),('pa', ugettext('Panjabi')),('raj', ugette\
xt('Rajasthani')),('sa', ugettext('Sanskrit')),('sat', 
ugettext('Santali')),('sd', ugettext('Sindhi')),('ta', 
ugettext('Tamil')),('t\
e', ugettext('Telugu')),('ur', ugettext('Urdu')),('as', 
ugettext('Assamese')),('awa', ugettext('Awadhi')),('ber', 
ugettext('Bengali'\
)),('bho', ugettext('Bhojpuri')),('bh', ugettext('Bihari')),('bra', 
ugettext('Braj')),('gon', ugettext('Gondi')),('dra', ugettext('D\
ravidian')),('gu', ugettext('Gujarati')),('en', 
ugettext('English')),('him', ugettext('Himachali')),('hi', 
ugettext('Hindi')),('kn',\
 ugettext('Kannada')),('ks', ugettext('Kashmiri')),('kha', 
ugettext('Khasi')),('kok', ugettext('konkani')),('kru', ugettext('Kurukh'\
)),('lah', ugettext('Lahnda')),('lus', ugettext('Lushai')),('mag', 
ugettext('Magahi')),('mai', ugettext('Maithili')),('mi', ugettext\
('Malayalam')),('mni', ugettext('Manipuri')),('fr', 
ugettext('French')),('ja', ugettext('Japanese')),('da', 
ugettext('Danish')),('es\
', ugettext('Spanish')),('it', ugettext('Italian')),('ru', 
ugettext('Russian')),

I  have created th po file .

but while runserver I am getting following error:

raise KeyError("Unknown language code %s." % lang_code)
KeyError: u'Unknown language code mr.'

what would be the reason.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/aa7ef0b3-4702-4d41-aa24-04fffa7bfba5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't get i18n/setLang to match any urls

2014-05-17 Thread Shawn H
G.  I read the docs, and I SWEAR it had the "l" as a capital.  It's 
always the simplest things.  Thank you!

On Saturday, May 17, 2014 1:04:45 AM UTC-5, WongoBongo wrote:
>
> The L in setLang should be setlang as in the L is lowercase
>
> From my Django log "POST /i18n/setlang/ HTTP/1.1" 302 0
>
> K
>
>
>
> On Wednesday, May 14, 2014 2:45:43 PM UTC-7, Shawn H wrote:
>>
>> I'm beginning the process of adding some translations to one public page, 
>> and I can't get my setLang url to match, getting a 404 instead. I've got 
>> USE_I18N = True in my settings.  I've got 
>> 'django.core.context_processors.i18n', in my TEMPLATE_CONTEXT_PROCESSORS. 
>>  Copied the directly from the docs, version 1.6
>>
>> My urls.py
>>
>> from django.conf.urls import patterns, include, url
>> from sdcgis import settings
>>
>> urlpatterns = patterns('',
>> 
>> #index
>> url('^sdc/home/',include('sdc_home.urls', namespace='sdc_home')),
>> 
>> #user language
>> (r'^i18n/', include('django.conf.urls.i18n')),
>>
>>  #I tried url(r'^i18n/', include('django.conf.urls.i18n')), too, with no 
>> luck
>>
>>  ...
>>
>>
>>  I'm making an jQuery post:
>>
>> var data = {'name':'language', 'value':'en-us'};
>>
>>  
>>
>> $.post('/i18n/setLang/', data, function() {
>>
>> });
>>
>> My browser says I'm requesting via POST http://localhost/i18n/setLang/, 
>> with form data of name: language and value:en-us.  I get 404.  What am I 
>> missing?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/60c9a958-558b-4458-911b-38c12d6eb667%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't get i18n/setLang to match any urls

2014-05-17 Thread Kelvin Wong
The L in setLang should be setlang as in the L is lowercase

>From my Django log "POST /i18n/setlang/ HTTP/1.1" 302 0

K



On Wednesday, May 14, 2014 2:45:43 PM UTC-7, Shawn H wrote:
>
> I'm beginning the process of adding some translations to one public page, 
> and I can't get my setLang url to match, getting a 404 instead. I've got 
> USE_I18N = True in my settings.  I've got 
> 'django.core.context_processors.i18n', in my TEMPLATE_CONTEXT_PROCESSORS. 
>  Copied the directly from the docs, version 1.6
>
> My urls.py
>
> from django.conf.urls import patterns, include, url
> from sdcgis import settings
>
> urlpatterns = patterns('',
> 
> #index
> url('^sdc/home/',include('sdc_home.urls', namespace='sdc_home')),
> 
> #user language
>     (r'^i18n/', include('django.conf.urls.i18n')),
>
>  #I tried url(r'^i18n/', include('django.conf.urls.i18n')), too, with no 
> luck
>
>  ...
>
>
>  I'm making an jQuery post:
>
> var data = {'name':'language', 'value':'en-us'};
>
>  
>
> $.post('/i18n/setLang/', data, function() {
>
> });
>
> My browser says I'm requesting via POST http://localhost/i18n/setLang/, 
> with form data of name: language and value:en-us.  I get 404.  What am I 
> missing?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d14f8b3a-3bc9-4c2a-bd41-5fdcbcb6bc39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can't get i18n/setLang to match any urls

2014-05-14 Thread Shawn H
I'm beginning the process of adding some translations to one public page, 
and I can't get my setLang url to match, getting a 404 instead. I've got 
USE_I18N = True in my settings.  I've got 
'django.core.context_processors.i18n', in my TEMPLATE_CONTEXT_PROCESSORS. 
 Copied the directly from the docs, version 1.6

My urls.py

from django.conf.urls import patterns, include, url
from sdcgis import settings

urlpatterns = patterns('',

#index
url('^sdc/home/',include('sdc_home.urls', namespace='sdc_home')),

#user language
(r'^i18n/', include('django.conf.urls.i18n')),

 #I tried url(r'^i18n/', include('django.conf.urls.i18n')), too, with no 
luck

 ...


 I'm making an jQuery post:

var data = {'name':'language', 'value':'en-us'};

 

$.post('/i18n/setLang/', data, function() {

});

My browser says I'm requesting via POST http://localhost/i18n/setLang/, 
with form data of name: language and value:en-us.  I get 404.  What am I 
missing?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3b337b77-d909-41f1-9cdb-b12dde6b703d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django i18n questions

2014-04-11 Thread Andrew Pashkin

Indeed
On 11.04.2014 12:45, Daniel Roseman wrote:


On Friday, 11 April 2014 06:55:12 UTC+1, Andrew Pashkin wrote:

Documentation says

<https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-discovers-language-preference>,
that:

...it looks for a django_language key in the current user's session

This is the latest commit

<https://github.com/django/django/blob/126d9e1b499663e72cc795906bdbcd333aceaf0a/django/middleware/locale.py>
if 1.4x branch of Django, but I can't even find word "session" in
code with middleware.


I'm not sure why you think the reference to the session has to be in 
that particular file. In fact what happens is that the process_request 
method of that middleware calls translation.get_language_from_request, 
which ends up 
here: https://github.com/django/django/blob/126d9e1b499663e72cc795906bdbcd333aceaf0a/django/utils/translation/trans_real.py#L366

which does indeed look up the session from the request.
--
DR.
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16094d74-d20b-4cfc-8ac4-730d477bc8e1%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/16094d74-d20b-4cfc-8ac4-730d477bc8e1%40googlegroups.com?utm_medium=email_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
? ?? ???, ?? ??.
?.? - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - andrew.pash...@gmx.co.uk

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5348144D.2000809%40gmx.co.uk.
For more options, visit https://groups.google.com/d/optout.


Re: Django i18n questions

2014-04-11 Thread Daniel Roseman

On Friday, 11 April 2014 06:55:12 UTC+1, Andrew Pashkin wrote:
>
>  Documentation 
> says<https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-discovers-language-preference>,
>  
> that:
>
> ...it looks for a django_language key in the current user’s session
>
> This is the latest 
> commit<https://github.com/django/django/blob/126d9e1b499663e72cc795906bdbcd333aceaf0a/django/middleware/locale.py>if
>  1.4x branch of Django, but I can't even find word "session" in code with 
> middleware.
>

I'm not sure why you think the reference to the session has to be in that 
particular file. In fact what happens is that the process_request method of 
that middleware calls translation.get_language_from_request, which ends up 
here: 
https://github.com/django/django/blob/126d9e1b499663e72cc795906bdbcd333aceaf0a/django/utils/translation/trans_real.py#L366
which does indeed look up the session from the request.
-- 
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/16094d74-d20b-4cfc-8ac4-730d477bc8e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django i18n questions

2014-04-11 Thread Andrew Pashkin
I ended up using this snippet 
<https://djangosnippets.org/snippets/2875/> for switching languages. It 
simply reverses url with given language code.

On 11.04.2014 09:55, Andrew Pashkin wrote:
Documentation says 
<https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-discovers-language-preference>, 
that:

...it looks for a django_language key in the current user's session
This is the latest commit 
<https://github.com/django/django/blob/126d9e1b499663e72cc795906bdbcd333aceaf0a/django/middleware/locale.py> 
if 1.4x branch of Django, but I can't even find word "session" in code 
with middleware. And It not working for me - I use it in combination 
with set_language view, and I checked it by debugger - while 
set_language switches language to needed one and puts it to 
"django_language" key, LocaleMiddleware ignores it. I'm not using 18n 
url patterns.


I also have tried to use prefixes, but in that case, by POST request, 
set_language 
<https://github.com/django/django/blob/126d9e1b499663e72cc795906bdbcd333aceaf0a/django/views/i18n.py#L12> 
uses next parameter to redirect user, which is might be "/en/", and 
even if language switches correctly to another one, response always 
will always be redirect to url with same language prefix as before - 
"/en/", so user will not see any effect.


Am I missing something?

--
? ?? ???, ?? ??.
?.? - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail -andrew.pash...@gmx.co.uk
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto:django-users@googlegroups.com>.

Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/534783C0.9070406%40gmx.co.uk 
<https://groups.google.com/d/msgid/django-users/534783C0.9070406%40gmx.co.uk?utm_medium=email_source=footer>.

For more options, visit https://groups.google.com/d/optout.


--
? ?? ???, ?? ??.
?.? - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - andrew.pash...@gmx.co.uk

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/534785D6.1060500%40gmx.co.uk.
For more options, visit https://groups.google.com/d/optout.


Django i18n questions

2014-04-10 Thread Andrew Pashkin
Documentation says 
<https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-discovers-language-preference>, 
that:

...it looks for a django_language key in the current user's session
This is the latest commit 
<https://github.com/django/django/blob/126d9e1b499663e72cc795906bdbcd333aceaf0a/django/middleware/locale.py> 
if 1.4x branch of Django, but I can't even find word "session" in code 
with middleware. And It not working for me - I use it in combination 
with set_language view, and I checked it by debugger - while 
set_language switches language to needed one and puts it to 
"django_language" key, LocaleMiddleware ignores it. I'm not using 18n 
url patterns.


I also have tried to use prefixes, but in that case, by POST request, 
set_language 
<https://github.com/django/django/blob/126d9e1b499663e72cc795906bdbcd333aceaf0a/django/views/i18n.py#L12> 
uses next parameter to redirect user, which is might be "/en/", and even 
if language switches correctly to another one, response always will 
always be redirect to url with same language prefix as before - "/en/", 
so user will not see any effect.


Am I missing something?

--
? ?? ???, ?? ??.
?.? - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - andrew.pash...@gmx.co.uk

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/534783C0.9070406%40gmx.co.uk.
For more options, visit https://groups.google.com/d/optout.


Re: Django i18n url is not working with en-us sublanguage

2014-02-27 Thread Eliecer Daza
Hi, I just have the same error
could you solved it!!
thanks

On Monday, May 7, 2012 4:57:52 AM UTC-5, Suteepat Damrongyingsupab wrote:
>
> My django app's using i18n_patterns in urls.py and when I go to my app 
> with the url like: 
>
> myapp.com/en/
>
> myapp.com/de/
>
> myapp.com/en-gb/
>
> The urls above works fine but the url *myapp.com/en-us/ 
> <http://myapp.com/en-us/>* gave me an 404 error.
>
> I think the problem is that (
> https://code.djangoproject.com/browser/django/trunk/django/conf/global_settings.py)
>  
> Django's default LANGUAGE_CODE is 'en-us' but there is no 'en-us' in the 
> default LANGUAGES setting. That's why I got 404 page.
>
> Should I just change the LANGUAGE_CODE to 'en' or add 'en-us' to the 
> LANGUAGES setting?
>
> Is the default 'en-us' LANGUAGE_CDE setting useless when using with i18n 
> URL?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0ce9023-f9dd-4e55-890b-42c7490fc904%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


For those that do i18n and L10n

2013-08-04 Thread Lachlan Musicman
Here is an interesting paper on the use of FOSS in translation (in
English, about Spanish)

http://www.trans-int.org/index.php/transint/article/view/205/127



cheers
L.
-- 
We are like a drunk blundering through a crowd of pickpockets. That we
are not poor and naked already is a testament to either the goodness
of humanity or the ineptitude of the criminal class.

http://techcrunch.com/2013/06/08/we-asked-for-this/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: models i18n

2013-03-07 Thread Roberto López López

Yes, I meant that. It works great, and fits perfectly my needs. I give
it an AAA+

Thanks again.




On 03/07/2013 02:58 PM, Johan ter Beest wrote:
> 
> On Mar 6, 2013, at 4:20 PM, Roberto López López <roberto.lo...@uni.no> wrote:
> 
>>
>> Thanks for your suggestion Johan.
>>
>> Just another question, which I've not seen answered in the
>> documentation: is there any custom filter/tag to access those translated
>> fields from a template? Thanks
> 
> If you do {% load i18n %} somewhere in your template then you can use the {{ 
> employee.position }} tag for the translated one based on the user's language 
> setting or you could specifically use {{ employee.position_en }} to target 
> the English translation if you so desire. 
> 
> Is this what you meant?
> 
> Johan
> 
>>
>> Best,
>>
>> Roberto
>>
>> On 03/05/2013 10:39 PM, Johan ter Beest wrote:
>>>
>>> On Mar 5, 2013, at 10:31 PM, Roberto López López <roberto.lo...@uni.no
>>> <mailto:roberto.lo...@uni.no>> wrote:
>>>
>>>> Hi guys,
>>>>
>>>> I am developing a django application and between my requirements there
>>>> is being able to set the model fields into different languages.
>>>>
>>>> For example:
>>>>
>>>> class Employee(models.Model):
>>>>   position = models.CharField()
>>>>   # etc.
>>>>
>>>> The employee position won't be the same in English and Spanish. Ideally,
>>>> when an user fills in the data for an employee using the admin, there
>>>> will be one tab for each language defined in the settings file.
>>>>
>>>> Do you have any suggestion about how to deal with this issue?
>>>
>>> Django-modeltranslation: https://github.com/deschler/django-modeltranslation
>>>
>>> Very nice and easy, I use it all the time, works like a charm. You can
>>> do the tabs with some custom CSS and JS in the Admin through a Media
>>> class like this:
>>>
>>> class Media:
>>>js = (
>>>'modeltranslation/js/force_jquery.js',
>>>
>>> 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js',
>>>'modeltranslation/js/tabbed_translation_fields.js',
>>>)
>>>css = {
>>>'screen':
>>> ('modeltranslation/css/tabbed_translation_fields.css',),
>>>}
>>>
>>> Johan
>>>
>>>>
>>>> Thanks!
>>>>
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com
>>>> <mailto:django-users+unsubscr...@googlegroups.com>.
>>>> To post to this group, send email to django-users@googlegroups.com
>>>> <mailto:django-users@googlegroups.com>.
>>>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
> 


-- 
Kind regards,

Roberto López López


System Developer
Parallab, Uni Computing
Høyteknologisenteret, Thormøhlensgate 55
N-5008 Bergen, Norway
Tel:(+47) 555 84091

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: models i18n

2013-03-07 Thread Johan ter Beest

On Mar 6, 2013, at 4:20 PM, Roberto López López <roberto.lo...@uni.no> wrote:

> 
> Thanks for your suggestion Johan.
> 
> Just another question, which I've not seen answered in the
> documentation: is there any custom filter/tag to access those translated
> fields from a template? Thanks

If you do {% load i18n %} somewhere in your template then you can use the {{ 
employee.position }} tag for the translated one based on the user's language 
setting or you could specifically use {{ employee.position_en }} to target the 
English translation if you so desire. 

Is this what you meant?

Johan

> 
> Best,
> 
> Roberto
> 
> On 03/05/2013 10:39 PM, Johan ter Beest wrote:
>> 
>> On Mar 5, 2013, at 10:31 PM, Roberto López López <roberto.lo...@uni.no
>> <mailto:roberto.lo...@uni.no>> wrote:
>> 
>>> Hi guys,
>>> 
>>> I am developing a django application and between my requirements there
>>> is being able to set the model fields into different languages.
>>> 
>>> For example:
>>> 
>>> class Employee(models.Model):
>>>   position = models.CharField()
>>>   # etc.
>>> 
>>> The employee position won't be the same in English and Spanish. Ideally,
>>> when an user fills in the data for an employee using the admin, there
>>> will be one tab for each language defined in the settings file.
>>> 
>>> Do you have any suggestion about how to deal with this issue?
>> 
>> Django-modeltranslation: https://github.com/deschler/django-modeltranslation
>> 
>> Very nice and easy, I use it all the time, works like a charm. You can
>> do the tabs with some custom CSS and JS in the Admin through a Media
>> class like this:
>> 
>> class Media:
>>js = (
>>'modeltranslation/js/force_jquery.js',
>> 
>> 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js',
>>'modeltranslation/js/tabbed_translation_fields.js',
>>)
>>css = {
>>'screen':
>> ('modeltranslation/css/tabbed_translation_fields.css',),
>>}
>> 
>> Johan
>> 
>>> 
>>> Thanks!
>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com
>>> <mailto:django-users+unsubscr...@googlegroups.com>.
>>> To post to this group, send email to django-users@googlegroups.com
>>> <mailto:django-users@googlegroups.com>.
>>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>> 
>>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>> 
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: models i18n

2013-03-06 Thread Roberto López López

Thanks for your suggestion Johan.

Just another question, which I've not seen answered in the
documentation: is there any custom filter/tag to access those translated
fields from a template? Thanks

Best,

Roberto

On 03/05/2013 10:39 PM, Johan ter Beest wrote:
> 
> On Mar 5, 2013, at 10:31 PM, Roberto López López  > wrote:
> 
>> Hi guys,
>>
>> I am developing a django application and between my requirements there
>> is being able to set the model fields into different languages.
>>
>> For example:
>>
>> class Employee(models.Model):
>>position = models.CharField()
>># etc.
>>
>> The employee position won't be the same in English and Spanish. Ideally,
>> when an user fills in the data for an employee using the admin, there
>> will be one tab for each language defined in the settings file.
>>
>> Do you have any suggestion about how to deal with this issue?
> 
> Django-modeltranslation: https://github.com/deschler/django-modeltranslation
> 
> Very nice and easy, I use it all the time, works like a charm. You can
> do the tabs with some custom CSS and JS in the Admin through a Media
> class like this:
> 
> class Media:
> js = (
> 'modeltranslation/js/force_jquery.js',
>
> 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js',
> 'modeltranslation/js/tabbed_translation_fields.js',
> )
> css = {
> 'screen':
> ('modeltranslation/css/tabbed_translation_fields.css',),
> }
> 
> Johan
> 
>>
>> Thanks!
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to django-users+unsubscr...@googlegroups.com
>> .
>> To post to this group, send email to django-users@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




i18n

2013-03-06 Thread Roberto López López

Hi,

I am setting up i18n in my django app. I have added the following to my
settings.py:

PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))

LOCALE_PATHS = (
os.path.join(PROJECT_PATH, 'locale'),
)

LANGUAGES = [
('en', _('English')),
('nb', _('Norwegian')),
]

And created a locale/ directory into my project root.

Then I've run the command:

django-admin.py makemessages --all

...without any error, but it doesn't generate anything into locale/. I
know I've created locale/ in the correct location, as I got some errors
running the command until I created it there.

myprojectroot$ find . -iname '*.po'
myprojectroot$  ### NONE!!!

Any suggestions please? Thanks :-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: models i18n

2013-03-05 Thread Johan ter Beest

On Mar 5, 2013, at 10:31 PM, Roberto López López  wrote:

> Hi guys,
> 
> I am developing a django application and between my requirements there
> is being able to set the model fields into different languages.
> 
> For example:
> 
> class Employee(models.Model):
>position = models.CharField()
># etc.
> 
> The employee position won't be the same in English and Spanish. Ideally,
> when an user fills in the data for an employee using the admin, there
> will be one tab for each language defined in the settings file.
> 
> Do you have any suggestion about how to deal with this issue?

Django-modeltranslation: https://github.com/deschler/django-modeltranslation

Very nice and easy, I use it all the time, works like a charm. You can do the 
tabs with some custom CSS and JS in the Admin through a Media class like this:

class Media:
js = (
'modeltranslation/js/force_jquery.js',

'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js',
'modeltranslation/js/tabbed_translation_fields.js',
)
css = {
'screen': ('modeltranslation/css/tabbed_translation_fields.css',),
}

Johan

> 
> Thanks!
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




models i18n

2013-03-05 Thread Roberto López López
Hi guys,

I am developing a django application and between my requirements there
is being able to set the model fields into different languages.

For example:

class Employee(models.Model):
position = models.CharField()
# etc.

The employee position won't be the same in English and Spanish. Ideally,
when an user fills in the data for an employee using the admin, there
will be one tab for each language defined in the settings file.

Do you have any suggestion about how to deal with this issue?

Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: I18N URL patterns and wsgi

2013-03-04 Thread Sebastian Wiesinger
My urls.py looks like this:

from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf.urls.i18n import i18n_patterns
import settings

urlpatterns = i18n_patterns('',
url(r'^request/?$', 'custrequest.views.request'),
url(r'^request/(?P\d+)$', 'custrequest.views.request'),
)

urlpatterns += patterns('',
url(r'^utils.js$', 'custrequest.views.utilsjs'),
url(r'^request.css$', 'custrequest.views.requestcss'),
)

urlpatterns += patterns('',
url(r'^captcha/', include('captcha.urls')),
)

if settings.DEBUG:
urlpatterns += patterns('',
(r'^500/$', 'django.views.defaults.server_error'),
(r'^404/$', 'django.views.generic.simple.direct_to_template', 
{'template': '404.html'}),
)


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




I18N URL patterns and wsgi

2013-03-04 Thread Sebastian Wiesinger
Hello,

I have a Django project (Django 1.4.5) at an URL like this:

http://host/subdir/django-app

This is implemented with apache + WSGI and is configured in the apache 
configuration:

WSGIScriptAlias /subdir /some/path/to/django-app.wsgi

Now I implemented I18N and tried it on the webserver. It changed the URLs 
to:

http://host//subdir/django-app

Which of course does not work. I expected it to do something like:

http://host/subdir//django-app

Am I doing something wrong? I can't find out how to change that behaviour.

Regards

Sebastian

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




bug in use of mark_safe and i18n _ ?

2012-10-15 Thread Federico Marani
Hi,

I am using a form which defines this field:

terms = forms.BooleanField(
error_messages={'required': _('You must accept the terms and 
conditions')},
label="",
help_text=_(mark_safe("I understand and accept the terms of use and privacy policy of this site."))
)

unfortunately running "./manage.py makemessages --all" does not seem to 
pickup the help_text named argument.

---

If i change this to:

terms = forms.BooleanField(
error_messages={'required': _('You must accept the terms and 
conditions')},
label="",
help_text=mark_safe(_("I understand and accept the terms of use and privacy policy of this site."))
)

the message in the html is left untranslated.

---

any advice?

-- 
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/-/W5p21l-sTb0J.
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: i18n - local translation does not show up - bug

2012-05-07 Thread kenneth gonsalves
On Mon, 2012-05-07 at 11:44 +0530, kenneth gonsalves wrote:
> > It'd be strange, but certainly possible, it is broken. We have
> > a test case checking that such feature works:
> > 
> >
> https://github.com/django/django/blob/master/tests/regressiontests/views/tests/i18n.py#L140
> > 
> > Could you reduce your failing case to the simplest form
> > and share it so we can do more research?. 
> 
> I was away - will do that now 

weird - I made a simple app with one model that has one field. Trunk
picks up the local translation - if LOCALE_PATHS is commented out, it
fails as expected. But in none of my older apps (one running for over 5
years) is this happening. Settings are identical in all the apps.
-- 
regards
Kenneth Gonsalves

-- 
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.



Django i18n url is not working with en-us sublanguage

2012-05-07 Thread Suteepat Damrongyingsupab
 

My django app's using i18n_patterns in urls.py and when I go to my app with 
the url like: 

myapp.com/en/

myapp.com/de/

myapp.com/en-gb/

The urls above works fine but the url *myapp.com/en-us/* gave me an 404 
error.

I think the problem is that (
https://code.djangoproject.com/browser/django/trunk/django/conf/global_settings.py)
 
Django's default LANGUAGE_CODE is 'en-us' but there is no 'en-us' in the 
default LANGUAGES setting. That's why I got 404 page.

Should I just change the LANGUAGE_CODE to 'en' or add 'en-us' to the 
LANGUAGES setting?

Is the default 'en-us' LANGUAGE_CDE setting useless when using with i18n 
URL?

-- 
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/-/1-iNN0u3SloJ.
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: i18n - local translation does not show up - bug

2012-05-07 Thread kenneth gonsalves
On Thu, 2012-05-03 at 10:29 -0300, Ramiro Morales wrote:
> >
> > I had gone through the docs and added the LOCALE_PATHS setting - but
> it
> > just does not work - have tried on fedora, debian, ubuntu ...
> 
> Good to know that, I couldn't infer that from your initial email.
> 
> It'd be strange, but certainly possible, it is broken. We have
> a test case checking that such feature works:
> 
> https://github.com/django/django/blob/master/tests/regressiontests/views/tests/i18n.py#L140
> 
> Could you reduce your failing case to the simplest form
> and share it so we can do more research?. 

I was away - will do that now
-- 
regards
Kenneth Gonsalves

-- 
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: i18n - local translation does not show up - bug

2012-05-03 Thread Ramiro Morales
On Thu, May 3, 2012 at 9:17 AM, kenneth gonsalves
 wrote:
>
> I had gone through the docs and added the LOCALE_PATHS setting - but it
> just does not work - have tried on fedora, debian, ubuntu ...

Good to know that, I couldn't infer that from your initial email.

It'd be strange, but certainly possible, it is broken. We have
a test case checking that such feature works:

https://github.com/django/django/blob/master/tests/regressiontests/views/tests/i18n.py#L140

Could you reduce your failing case to the simplest form
and share it so we can do more research?.

-- 
Ramiro Morales

-- 
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: i18n - local translation does not show up - bug

2012-05-03 Thread kenneth gonsalves
On Wed, 2012-05-02 at 10:53 -0300, Ramiro Morales wrote:
> > I want two languages in my project - en and ta. I have set this up
> in
> > many projects over the years and this is the first time I am seeing
> > failure. The problem is that on switching to tamil, the django
> strings
> > are getting translated, but not the local strings. Django is
> obviously
> > not finding my local .mo file. Makemessages and compilemessages work
> > fine. My locale directory is at the same level as manage.py. Even if
> I
> > put it at the same level as settings.py, it still does not work.
> >
> > django version - latest trunk
> >
> > later: on checking, this works upto revision 17860 and breaks from
> 17861
> 
> Well if you are using the development version it is assumed you are
> closely
> following the development activity (so this kind of changes don't take
> you by
> surprise) and/or can read the Fine Manual where the decprecation
> and the steps you need to take are (and have been since Django 1.3 Apr
> 2011)
> documented.
> 
> Two hints: The Django 1.3 release notes and the LOCALE_PATHS setting.
> 
> 

I had gone through the docs and added the LOCALE_PATHS setting - but it
just does not work - have tried on fedora, debian, ubuntu ...
-- 
regards
Kenneth Gonsalves

-- 
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: i18n - local translation does not show up - bug

2012-05-02 Thread Ramiro Morales
On Wed, May 2, 2012 at 4:13 AM, kenneth gonsalves
 wrote:
> hi,
>
> I want two languages in my project - en and ta. I have set this up in
> many projects over the years and this is the first time I am seeing
> failure. The problem is that on switching to tamil, the django strings
> are getting translated, but not the local strings. Django is obviously
> not finding my local .mo file. Makemessages and compilemessages work
> fine. My locale directory is at the same level as manage.py. Even if I
> put it at the same level as settings.py, it still does not work.
>
> django version - latest trunk
>
> later: on checking, this works upto revision 17860 and breaks from 17861

Well if you are using the development version it is assumed you are closely
following the development activity (so this kind of changes don't take you by
surprise) and/or can read the Fine Manual where the decprecation
and the steps you need to take are (and have been since Django 1.3 Apr 2011)
documented.

Two hints: The Django 1.3 release notes and the LOCALE_PATHS setting.

-- 
Ramiro Morales

-- 
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.



i18n - local translation does not show up - bug

2012-05-02 Thread kenneth gonsalves
hi,

I want two languages in my project - en and ta. I have set this up in
many projects over the years and this is the first time I am seeing
failure. The problem is that on switching to tamil, the django strings
are getting translated, but not the local strings. Django is obviously
not finding my local .mo file. Makemessages and compilemessages work
fine. My locale directory is at the same level as manage.py. Even if I
put it at the same level as settings.py, it still does not work. 

django version - latest trunk

later: on checking, this works upto revision 17860 and breaks from 17861
-- 
regards
Kenneth Gonsalves

-- 
regards
Kenneth Gonsalves

-- 
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: How to format string on I18n

2012-01-04 Thread Krator Ado
msgid u"邀請已送到%(email)s"
and add "# coding=utf-8" at the first line of your .py file.

2012/1/4 李 强 

> Lack of a full stop,maybe.
>
> 在 2011-12-5,下午2:07, Tsung-Hsien 写道:
>
> > Hello
> >I get the wrong message when type a string which needed to format
> > such as
> >
> > msgid "An inviatation was sent to %(email)s."
> > msgstr "邀請已送到%(email)s"
> >
> >
> --
> > Incorrect string value: '\xE9\x82\x80\xE8\xAB\x8B...' for column
> > 'message' at row 1
> >
> --
> > How to fix it?
> > 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.
>
>


-- 
物竞天择,适者生存。

-- 
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: How to format string on I18n

2012-01-03 Thread 李 强
Lack of a full stop,maybe.

在 2011-12-5,下午2:07, Tsung-Hsien 写道:

> Hello
>I get the wrong message when type a string which needed to format
> such as
> 
> msgid "An inviatation was sent to %(email)s."
> msgstr "邀請已送到%(email)s"
> 
> --
> Incorrect string value: '\xE9\x82\x80\xE8\xAB\x8B...' for column
> 'message' at row 1
> --
> How to fix it?
> 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: How to format string on I18n

2011-12-05 Thread rskm1
On Dec 5, 6:05 am, Tsung-Hsien <jasoniem9...@gmail.com> wrote:
> I have been delete the "#, fuzzy" and remain the "#, python-format",
> but the string still show English.

You do need to remove the ", fuzzy" in order for the translations to
be used.
But you also need to recompile the .mo files after you make any
changes to the .po files.
https://docs.djangoproject.com/en/1.3/topics/i18n/localization/#compiling-message-files

-- 
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: How to format string on I18n

2011-12-05 Thread Tsung-Hsien
Thank you!
the default character of MySQL does not utf-8, so after altering the
character, the message can show on the page.
However, the message shows only English, except I don't use the %
(email)s.
I have been delete the "#, fuzzy" and remain the "#, python-format",
but the string still show English.

How to solve this?
thanks!!



On Dec 4, 10:45 pm, Mimi Tantono  wrote:
> Please look at the thread 
> below:http://stackoverflow.com/questions/873419/converting-to-safe-unicode-...
>
> And you would want to make sure that database encoding style is already set
> to UTF-8 (if applicable).
>
> 2011/12/5 Tsung-Hsien 
>
>
>
>
>
>
>
>
>
> > Hello
> >I get the wrong message when type a string which needed to format
> > such as
>
> > msgid "An inviatation was sent to %(email)s."
> > msgstr "邀請已送到%(email)s"
>
> > --- 
> > ---
> > Incorrect string value: '\xE9\x82\x80\xE8\xAB\x8B...' for column
> > 'message' at row 1
>
> > --- 
> > ---
> > How to fix it?
> > Thanks!!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.> To post to this group, send email 
> > todjango-us...@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.
>
> --
>
> Best Regards,
>
> Mimi Tantono 
>
> *It is always hard to do new things, and it should be getting even harder
> along the time because then it indicates that we are improving.*

-- 
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: How to format string on I18n

2011-12-05 Thread Mimi Tantono
Please look at the thread below:
http://stackoverflow.com/questions/873419/converting-to-safe-unicode-in-python

And you would want to make sure that database encoding style is already set
to UTF-8 (if applicable).

2011/12/5 Tsung-Hsien 

> Hello
>I get the wrong message when type a string which needed to format
> such as
>
> msgid "An inviatation was sent to %(email)s."
> msgstr "邀請已送到%(email)s"
>
>
> --
> Incorrect string value: '\xE9\x82\x80\xE8\xAB\x8B...' for column
> 'message' at row 1
>
> --
> How to fix it?
> 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.
>
>


-- 


Best Regards,

Mimi Tantono 

*It is always hard to do new things, and it should be getting even harder
along the time because then it indicates that we are improving.*

-- 
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.



How to format string on I18n

2011-12-04 Thread Tsung-Hsien
Hello
I get the wrong message when type a string which needed to format
such as

msgid "An inviatation was sent to %(email)s."
msgstr "邀請已送到%(email)s"

--
Incorrect string value: '\xE9\x82\x80\xE8\xAB\x8B...' for column
'message' at row 1
--
How to fix it?
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.



Django 1.4 (dev) doesn't redirect to i18n url when debug is false

2011-11-24 Thread Jesus Rodriguez
Hello, I have an app using Django 1.4 dev. Im using i18n_patterns and well, 
it works perfectly.

If im on a spanish session and I go to:

/foo/

It redirects me to:

/es/foo/

so far so good.

But when I disable DEBUG, it doesn't work.

If you go to:

/foo/ it just redirect you to 500.html.

Without DEBUG Im not able to debug, right?

So... How can I figure what's going on?

I uploaded an example: http://dl.dropbox.com/u/10283624/dalpharedirect.zip

Its just a hello world :)

Thanks.

-- 
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/-/ohHuHV-1fOoJ.
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: I18N and caching: page don't change language until I press F5 in browser

2011-11-05 Thread Torsten Bronger
Hallöchen!

Salvatore Iovene writes:

> On Sat, Nov 5, 2011 at 7:43 AM, Torsten Bronger
>  wrote:
>
>> Sending e.g. "Expires: ..." so that the page expires immediately
>> solved the problem.
>
> Sending an Expires header so that the page expires immediately
> does work, but it feels like fixing a headache with a
> guillotine. The browser should cache it's own version whenever
> possible, even though we're caching server side with memcached.

See
.
Other browsers have similar rules.  If you don't tell the browser
explicitly not to cache the page, it might just do this -- and so
won't ask the server.  Then, re-coding your web app won't help.

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
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: I18N and caching: page don't change language until I press F5 in browser

2011-11-05 Thread Salvatore Iovene
On Sat, Nov 5, 2011 at 7:43 AM, Torsten Bronger
 wrote:
> Sending e.g. "Expires: ..." so that the page expires immediately
> solved the problem.

Sending an Expires header so that the page expires immediately does
work, but it feels like fixing a headache with a guillotine. The
browser should cache it's own version whenever possible, even though
we're caching server side with memcached.

-- 
Salvatore Iovene
http://www.google.com/profiles/salvatore.iovene

-- 
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: I18N and caching: page don't change language until I press F5 in browser

2011-11-04 Thread Torsten Bronger
Hallöchen!

Salvatore Iovene writes:

> On Friday, November 4, 2011 5:31:46 PM UTC+2, Salvatore Iovene wrote:
>>
>> if hasattr(request, 'session'):
>> request.session['django_language'] = lang
>> else:
>> response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang)
>>
>
> I have solved my problem by setting the cookie unconditionally (i.e. 
> outside of that else-statement). I copied that code from 
> django.views.i18n.set_language. I wonder if that's a bug. 

Strange.  I had the very same problem, but I identified the
browser's internal caching heuristics as the problem.  If there are
no explicit caching headers in the response, the browser guesses.
Sending e.g. "Expires: ..." so that the page expires immediately
solved the problem.

(By the way, I didn't send those headers eventually.  The browser's
heuristics make the site faster in other cases, and users switch
language only seldomly.)

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
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: I18N and caching: page don't change language until I press F5 in browser

2011-11-04 Thread Salvatore Iovene
On Friday, November 4, 2011 5:31:46 PM UTC+2, Salvatore Iovene wrote:
>
> if hasattr(request, 'session'):
> request.session['django_language'] = lang
> else:
> response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang)
>

I have solved my problem by setting the cookie unconditionally (i.e. 
outside of that else-statement). I copied that code from 
django.views.i18n.set_language. I wonder if that's a bug. 

-- 
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/-/dmAVToeRYvEJ.
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: I18N and caching: page don't change language until I press F5 in browser

2011-11-04 Thread Salvatore Iovene
PS: I have also tried the @vary_on_header('Accept-Language') decorator, but 
unfortunately that didn't help either.

-- 
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/-/A7S2lsJ11x0J.
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.



I18N and caching: page don't change language until I press F5 in browser

2011-11-04 Thread Salvatore Iovene
Hi,
I've got a Django website that's multi-lingual, and I'd like to use 
memcaching on it. While everything works fine with caching disabled, I have 
observed the following when caching is enabled:

1) Open any page on the website
2) Click on link (the image of a little flat) to change language
3) This runs a view that sets the language in the session and the cookie, 
and then redirects to the referrer
4) Observe that the page is still in the original language!
5) Press F5 in the browser
6) Observe that the page is now in the language I wanted

Obviously I'm expecting the page to change language at point 4 (and that's 
the way it works without caching.

Now let me how you some relevant code:

My middlewares:

MIDDLEWARE_CLASSES = 
(   
   

'django.middleware.cache.UpdateCacheMiddleware', # KEEP AT THE 
BEGINNING

'django.middleware.http.ConditionalGetMiddleware',  



'django.middleware.common.CommonMiddleware',



'django.contrib.sessions.middleware.SessionMiddleware', 



'django.contrib.auth.middleware.AuthenticationMiddleware',  



'django.middleware.cache.CacheMiddleware',  



'django.middleware.locale.LocaleMiddleware',

  

'django.contrib.messages.middleware.MessageMiddleware', 

 

'privatebeta.middleware.PrivateBetaMiddleware', 


'django.middleware.cache.FetchFromCacheMiddleware', # KEEP AT THE 
END   
)  

The view that changes language:

@require_GET
def set_language(request, lang):
from django.utils.translation import check_for_language, activate

next = request.REQUEST.get('next', None)
if not next:
next = request.META.get('HTTP_REFERER', None)
if not next:
next = '/'
response = HttpResponseRedirect(next)
if lang and check_for_language(lang):
if hasattr(request, 'session'):
request.session['django_language'] = lang
else:
response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang)
activate(lang)

if request.user.is_authenticated():
profile = UserProfile.objects.get(user = request.user)
profile.language = lang
profile.save()

return response


I have tried changing the order of the middleware, but to no avail.

Can somebody please help?

Thanks!
  Salvatore.

-- 
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/-/ha0fhmNQZZgJ.
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: Detecting if i18n/10n are installed from a template

2011-07-25 Thread h3
Just answered my own question .. if request.LANGUAGE_CODE isn't in
context .. it's not.

Meh.

On Jul 25, 11:00 pm, h3 <hainea...@gmail.com> wrote:
> Is there a mechanisme to detect if i18n/10n are installed from the
> template code ?
>
> I don't see anything about it in the official doc..

-- 
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.



Detecting if i18n/10n are installed from a template

2011-07-25 Thread h3
Is there a mechanisme to detect if i18n/10n are installed from the
template code ?

I don't see anything about it in the official doc..

-- 
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: CSRF problem with /i18n/setlang/

2011-07-11 Thread cjwalter
...what shall I say: problem solved. By simply using RequestContext
instead of Context. Yes, the error message said so, but I somehow
assumed that this concerns the i18l code and not my view...

-- 
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: CSRF problem with /i18n/setlang/

2011-07-11 Thread cjwalter
Yes, the internationalization part seems to be configured ok and
appears working. It is really the CSRF failure that bogging me.

Apart from my current project I just created a fresh one (using Django
1.3) just to confirm the issue is not caused by possible side-effects
from within my original project (which I am migrating from
djangoappengine where  i18l works fine...)

-- 
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: CSRF problem with /i18n/setlang/

2011-07-10 Thread Venkatraman S
Have you set the LANGUAGES in settings.py?
Something like ...
ugettext = lambda s: s
LANGUAGES = (
('de', ugettext('German')),
('fr', ugettext('French')),
('en', ugettext('English')),
)

And in urls.py:
(r'^i18n/', include('django.conf.urls.i18n')),

-V

-- 
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.



CSRF problem with /i18n/setlang/

2011-07-10 Thread cjwalter
Hi all

I continue getting

CSRF token missing or incorrect.

when trying to call /i18n/setlang/

Here the pertinent snippets from settings.py:

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',
'django.middleware.locale.LocaleMiddleware',
)

and from templates/base.html:

{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}


{% csrf_token %}


{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
{{ language.name_local }}
({{ language.code }})
{% endfor %}




What else is needed??

TIA

  --ChrisW

-- 
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.



I18n on, l10n off, but django still translating date field

2011-05-26 Thread Nick Serra
Hey everyone, thanks for looking. I am developing a site that has
spanish translations. I18n is working properly, but when I switch to
spanish, my form output that has dates is in spanish. This is a
problem because I am sending out staff emails on some forms, which
cannot have spanish in them. So I turned off l10n in settings, but I'm
still getting translated forms. I was under the impression that
turning off l10n would disable all number and date localization.
Anyone have any ideas on how to solve my problem globally? 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.



Re: Limited set of languages available in Django i18n?

2011-05-04 Thread Tom Evans
On Wed, May 4, 2011 at 1:32 AM, Karen Tracey  wrote:
> On Tue, May 3, 2011 at 8:11 AM, Tom Evans  wrote:
>>
>> If you require your site
>> to be in Mongolian, it can be in Mongolian, even though Django does
>> not itself have a Mongolian translation,
>
> Need a better example. Django has had a Mongolian translation for a year
> now: http://code.djangoproject.com/changeset/13092.
>
> Karen

Darn, perhaps I should have stuck with Martian :)

Cheers

Tom

-- 
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: Limited set of languages available in Django i18n?

2011-05-03 Thread Kenneth Gonsalves
On Tue, 2011-05-03 at 09:15 -0700, Uri Goldstein wrote:
> If the issue cannot be resolved then it might be beneficial to explain
> it 
> better:
> 
>1. If the issue is driven by technical difficulty stemming from
> xgettext 
>then don't excuse it as an attempt to prevent "a mixture of
> translated 
>strings".
>2. "A good starting point is to copy the Django English .po file
> and to 
>translate at least some *translation
> strings*<http://docs.djangoproject.com/en/1.3/topics/i18n/#term-translation-string>."
>  
>is better explained by adding "from /conf/locale/en" to the
> corresponding 
>folder for the new language. 

please file a ticket - the documentation is mainly written by
developers, and I find they are very responsive to comments from end
users who find some things confusing. I am an end user, and I find that
nearly *all* my tickets wrt documentation have been accepted.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Karen Tracey
On Tue, May 3, 2011 at 8:11 AM, Tom Evans  wrote:

> If you require your site
> to be in Mongolian, it can be in Mongolian, even though Django does
> not itself have a Mongolian translation,
>

Need a better example. Django has had a Mongolian translation for a year
now: http://code.djangoproject.com/changeset/13092.

Karen
-- 
http://tracey.org/kmt/

-- 
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: Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Hello,

On Tuesday, May 3, 2011 5:08:28 PM UTC+3, Tom Evans wrote:
>
> On Tue, May 3, 2011 at 1:43 PM, Uri Goldstein <uri.go...@gmail.com> wrote:
> > Hi Tom,
> >
> > I definitely agree that having docs is good, reading and comprehending 
> the
> > docs is better. Reading and comprehending the docs yourself you might 
> have
> > noticed the following quote: "If you were to try this and Django 
> supported
> > it, you would inevitably see a mixture of translated strings (from your
> > application) and English strings (from Django itself)." No mention of a
> > technical limitation, only of a goal to not see the mixture of translated
> > strings.
>
> Were you expecting that a new translation would automatically have the 
> correct
> translations for that language? What a strange expectation.
>
No, actually I wasn't expecting that. The strangeness here seems to be your 
understanding of what I've written. 

> The technical limitation belongs to gettext, not Django. It cannot load a
> supplementary language file when the main language file doesn't exist.
> IE, for our putative Mongolian translation, it cannot load
> your_app/locale/mn/LC_MESSAGES/django.mo if
> django/locale/mn/LC_MESSAGES/django.mo does not exist.
>
>
> That's good to know. It might even have been better had any of this even 
been hinted at in the documentation. 

> >
> > The amount of effort to "to make at least a minimal translation of the
> > Django core" might be minuscule or it might not, I find that it shouldn't 
> be
> > made necessary.
>
> You think Django should support all languages, out of the box? Do you
> have a patch?
>
I do think that and no, I don't have a patch. So?

> FYI, 'a minimal translation of the Django core' means copying the 'en'
> translation to your new language. Whether you need to translate parts
> of that depends upon whether your site needs it.
>
That's also good to know and indeed makes everything a lot simpler. I only 
wish someone could have explained that earlier in the discussion or even 
better, in the documentation.

> >
> > And finally, I am assured that this is but a small issue to deal with and
> > yet, had it not been an issue in the first place it would not have been
> > mentioned in the official docs, would it?
> >
>
> Many things are mentioned in the manual that are small issues, since they
> evidently confuse new users. This is one of them. Anyone who has used 
> gettext
> before would be aware of this issue, and it is extensively detailed in the
> gettext manual.
>
> Django's docs could easily have just said "Django uses gettext to deliver
> translatable content, refer to the gettext manual for implementation 
> details",
> but it does more to help out new users.
>
>
> Bottom line: Django supports adding translations for as many languages
> as you like, but cannot and will not magically have translations for
> any languages which it does not support. You, as the website
> developer, are free to add languages that Django does not support, and
> doing so is a few trivial steps.
>
Small issues are still issues. New users such as myself might not have any 
experience with gettext and could, just like myself, be very surprised to 
learn of quirks like this. Even if it isn't Django's "fault", it scares 
people like me into thinking they could run into big problems with 
unsupported languages. It would wiser for Django to have simpler and more 
concrete explanations in the documentation. Nothing wrong with helping 
newbies learn faster.

If the issue cannot be resolved then it might be beneficial to explain it 
better:

   1. If the issue is driven by technical difficulty stemming from xgettext 
   then don't excuse it as an attempt to prevent "a mixture of translated 
   strings".
   2. "A good starting point is to copy the Django English .po file and to 
   translate at least some *translation 
strings*<http://docs.djangoproject.com/en/1.3/topics/i18n/#term-translation-string>."
 
   is better explained by adding "from /conf/locale/en" to the corresponding 
   folder for the new language.


Cheers
Uri

-- 
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: Limited set of languages available in Django i18n?

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 1:43 PM, Uri Goldstein  wrote:
> Hi Tom,
>
> I definitely agree that having docs is good, reading and comprehending the
> docs is better. Reading and comprehending the docs yourself you might have
> noticed the following quote: "If you were to try this and Django supported
> it, you would inevitably see a mixture of translated strings (from your
> application) and English strings (from Django itself)." No mention of a
> technical limitation, only of a goal to not see the mixture of translated
> strings.

Were you expecting that a new translation would automatically have the correct
translations for that language? What a strange expectation.

The technical limitation belongs to gettext, not Django. It cannot load a
supplementary language file when the main language file doesn't exist.
IE, for our putative Mongolian translation, it cannot load
your_app/locale/mn/LC_MESSAGES/django.mo if
django/locale/mn/LC_MESSAGES/django.mo does not exist.


>
> The amount of effort to "to make at least a minimal translation of the
> Django core" might be minuscule or it might not, I find that it shouldn't be
> made necessary.

You think Django should support all languages, out of the box? Do you
have a patch?

FYI, 'a minimal translation of the Django core' means copying the 'en'
translation to your new language. Whether you need to translate parts
of that depends upon whether your site needs it.

>
> And finally, I am assured that this is but a small issue to deal with and
> yet, had it not been an issue in the first place it would not have been
> mentioned in the official docs, would it?
>

Many things are mentioned in the manual that are small issues, since they
evidently confuse new users. This is one of them. Anyone who has used gettext
before would be aware of this issue, and it is extensively detailed in the
gettext manual.

Django's docs could easily have just said "Django uses gettext to deliver
translatable content, refer to the gettext manual for implementation details",
but it does more to help out new users.


Bottom line: Django supports adding translations for as many languages
as you like, but cannot and will not magically have translations for
any languages which it does not support. You, as the website
developer, are free to add languages that Django does not support, and
doing so is a few trivial steps.

Cheers

Tom

-- 
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: Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Hi Tom,

I definitely agree that having docs is good, reading and comprehending the 
docs is better. Reading and comprehending the docs yourself you might have 
noticed the following quote: "If you were to try this and Django supported 
it, you would inevitably see a mixture of translated strings (from your 
application) and English strings (from Django itself)." No mention of a 
technical limitation, only of a goal to not see the mixture of translated 
strings. 

The amount of effort to "to make at least a minimal translation of the 
Django core" might be minuscule or it might not, I find that it shouldn't be 
made necessary.

And finally, I am assured that this is but a small issue to deal with and 
yet, had it not been an issue in the first place it would not have been 
mentioned in the official docs, would it?


Cheers

Uri

-- 
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: Limited set of languages available in Django i18n?

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 12:39 PM, Uri Goldstein <uri.goldst...@gmail.com> wrote:
> Thank you Tom and KG.
>
> I now see that my friend was right(!).
> http://docs.djangoproject.com/en/1.3/topics/i18n/localization/#how-to-create-language-files
> says: "Django does not support localizing your application into a locale for
> which Django itself has not been translated."
>
> The motivation for this is explained there but I personally find this
> disappointing. In my case I only care about my strings and I don't mind
> mixing the translated language with English.
>

The 'motivation' is a technical limitation, and you omitted to quote
the part explaining how you can add translations for languages that
Django itself does not have a translation for, a process which takes
but a few seconds.

Having docs is good, reading and comprehending the docs is better. You
are looking for issues where there are none. If you require your site
to be in Mongolian, it can be in Mongolian, even though Django does
not itself have a Mongolian translation, it just requires a minuscule
amount of effort on your part - as it would in any gettext based
translation system.

Cheers

Tom

-- 
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: Limited set of languages available in Django i18n?

2011-05-03 Thread Kenneth Gonsalves
On Tue, 2011-05-03 at 04:39 -0700, Uri Goldstein wrote:
> KG, in the workaround you mention as my second option, are you
> referring to 
> the folder /conf/locale ? Is there where I will be putting my "new" 
> languages? 

yes - for example if the language you are adding is martian (with
abbreviation of mrt), then you create a directory like this:
conf/locale/mrt/LC_MESSAGES/

copy the default .po files to it, run compilemessages and you will get
the appropriatie .mo files (or you can just copy the .mo files from the
en/LC_MESSAGES/ directory). 

in your project/locale you will actually have to translate the strings
to martian if you need it.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Thank you Tom and KG. 

I now see that my friend was right(!).  
http://docs.djangoproject.com/en/1.3/topics/i18n/localization/#how-to-create-language-files
 
says: "Django does not support localizing your application into a locale for 
which Django itself has not been translated."

The motivation for this is explained there but I personally find this 
disappointing. In my case I only care about my strings and I don't mind 
mixing the translated language with English.

KG, in the workaround you mention as my second option, are you referring to 
the folder /conf/locale ? Is there where I will be putting my "new" 
languages?

-- 
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: Limited set of languages available in Django i18n?

2011-05-03 Thread Kenneth Gonsalves
On Tue, 2011-05-03 at 03:59 -0700, Uri Goldstein wrote:
> I'm fine in knowing that the i18n infrastructure in Django can handle
> any 
> available language - that was the crux of my question. 

to be precise, there are two parts in localisation - one is the strings
in django itself and the other is the strings that you create as part of
your app which you have to translate yourself. But if django itself does
not have the language, your local strings will also not be translated.
There are two ways of getting around this:

1. actually do the translation and get the language into django
or
2. Create the directory structure for the new language in the django
source code in your local version and add untranslated .po and .mo
files. The second approach is a hack in that your strings will get
translated but django strings will not.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Tom Evans
On Tue, May 3, 2011 at 11:59 AM, Uri Goldstein <uri.goldst...@gmail.com> wrote:
> Thank you for your quick response.
>
> I now realize that my friend was referring to "the strings commonly
> displayed by Django". Naturally these are yet to have been translated to all
> available languages but I'm sure we'll get there sme day :).
>
> I'm fine in knowing that the i18n infrastructure in Django can handle any
> available language - that was the crux of my question.
>

If you wish to have a language available that is not in Django's set
of base translations, so that you can add your own translations for
that language for your parts of the site, then you have to go through
some additional hoops to allow this. This is probably what your friend
was referring to.

http://docs.djangoproject.com/en/1.3/topics/i18n/localization/#how-to-create-language-files

Cheers

Tom

-- 
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: Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Thank you for your quick response. 

I now realize that my friend was referring to "the strings commonly 
displayed by Django". Naturally these are yet to have been translated to all 
available languages but I'm sure we'll get there sme day :).

I'm fine in knowing that the i18n infrastructure in Django can handle any 
available language - that was the crux of my question.


Thanks again!
urig

-- 
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: Limited set of languages available in Django i18n?

2011-05-03 Thread Kenneth Gonsalves
On Tue, 2011-05-03 at 02:19 -0700, Uri Goldstein wrote:
> Being new to Django, I was told by a friend that it only supports i18n
> for a 
> limited set of languages - these being only languages that have had
> Django 
> itself translated to. 
> 
> Is this true? Doesn't make much sense to me :) 

it is true. Why does it not make sense to you?

django has only those languages where people have come forward to do the
translation - but I would not call it a 'limited set'. There are a
helluva lot.

> Is there a definitive list of 
> languages supported by Django's i18n features?
> 
> 

yes look in the source code under django/conf/locale
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Limited set of languages available in Django i18n?

2011-05-03 Thread Lachlan Musicman
On Tue, May 3, 2011 at 19:19, Uri Goldstein <uri.goldst...@gmail.com> wrote:
> Hello,
>
> Being new to Django, I was told by a friend that it only supports i18n for a
> limited set of languages - these being only languages that have had Django
> itself translated to.
>
> Is this true? Doesn't make much sense to me :) Is there a definitive list of
> languages supported by Django's i18n features?

Strictly, since i18n is language neutral, no there isn't.

It's not that you can't translate Django into other languages or try
to use it in other languages, but if the translations aren't
there...well, we can't support them and when you build a site, most of
it will be in the default language (usually English).

The list of language into which Django has been translated can be
found in the source code here (note: this is trunk):

http://code.djangoproject.com/browser/django/trunk/django/conf/locale

Note that if you would like to translate Django into another language,
there are only about 300 strings and they are mostly easy (ie, months,
days, numbers etc)

The translation is managed through Transifex, which you can join for free.

Here is the translation project page:

http://www.transifex.net/projects/p/django/

cheers
L.



>
>
> Thanks,
> urig
>
> --
> 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.
>



-- 
Benford’s law, also called the first-digit law, states that in lists
of numbers from many (but not all) real-life sources of data, the
leading digit is distributed in a specific, non-uniform way. According
to this law, the first digit is 1 almost one third of the time, and
larger digits occur as the leading digit with lower and lower
frequency, to the point where 9 as a first digit occurs less than one
time in twenty. (via @cyberu)
from The Best of Wikipedia http://bestofwikipedia.tumblr.com/

-- 
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.



Limited set of languages available in Django i18n?

2011-05-03 Thread Uri Goldstein
Hello,

Being new to Django, I was told by a friend that it only supports i18n for a 
limited set of languages - these being only languages that have had Django 
itself translated to. 

Is this true? Doesn't make much sense to me :) Is there a definitive list of 
languages supported by Django's i18n features?


Thanks,
urig

-- 
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.



i18n strategy/experiences

2011-04-20 Thread Jjdelc
Are there any best practices or experiences dealing with
internationalized sites? Most importantly with URL structure and
crawling effects (The DB i18n is not an issue at the moment).

In some sites I've worked I've added a switch language button which
changes the language but the URLs remain the same, relying in language
accept header and cookie set. This approach leaves me in doubt on
which language is my site crawled in.

Recently I saw that http://threadless.com is using subdomains for
internationalization, which seems like a reasonable approach according
to [1].

Does anybody have input on the matter?


[1] 
http://googlewebmastercentral.blogspot.com/2010/03/working-with-multi-regional-websites.html

-- 
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.



i18n and l10n of third party applications/libraries

2011-04-04 Thread poswald
I've got a situation similar to this one:

http://stackoverflow.com/questions/3933824/djangos-i18n-with-third-party-apps

Basically, I have a pip-installed third party library with strings
marked for localization but with no localizations provided. In my
project I would like to provide translations to be used for the
strings in this library. Is there a way to get 'manage.py
makemessages' to scan a third party library and create a po file for
it? Once that is done, where would the .mo file go such that it is
applied to the library objects when they call ugettext_lazy?

Thanks,
-Paul

-- 
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: Script to find all non-i18n parts of a django template

2011-03-06 Thread Venkatraman S
On Mon, Mar 7, 2011 at 3:30 AM, Rory McCann <r...@technomancy.org> wrote:

> Link to page:
> http://www.technomancy.org/python/django-template-i18n-lint/
>

Good stuff. I was planning to write one, but would rather use this ;)
IF we make this stuff 'really' good (i mean, handling all false positives
etc), then am sure this would be a great boon to the community.

-V-
<http://about.me/venkasub>http://blizzardzblogs.blogspot.com/

-- 
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.



Script to find all non-i18n parts of a django template

2011-03-06 Thread Rory McCann
Hi all,

I'm in the middle of internationalizing an existing Django site. That
basically means adding trans/blocktrans tags to all our templates. It's
a bit of a pain! :P Also I'm likely to miss some string somewhere.

So I wrote a python programme that'll search through a template and
print out all the non-i18n bits of text that you have left to do.

Link to page:
http://www.technomancy.org/python/django-template-i18n-lint/

It's a bit rigid at the moment, and works for our code base. It uses
regular expressions to 'parse' the HTML & Django templates, so it's not
100% perfect, there might be false positives, etc. etc. However I've
found it very useful for myself when working on our site and others
might find it useful

Rory

-- 
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: database i18n

2011-02-23 Thread Kenneth Gonsalves
On Wed, 2011-02-23 at 02:21 -0800, Federico Capoano wrote:
> Thanks Hernik. I liked the idea of django-i18n-model but I couldn't
> get it working. Now I'm about to try django-transmeta.
> 
> 

django-transmeta rocks bigtime, especially if you have an unknown set of
languages.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: database i18n

2011-02-23 Thread Federico Capoano
Thanks Hernik. I liked the idea of django-i18n-model but I couldn't
get it working. Now I'm about to try django-transmeta.


On Feb 23, 10:34 am, "Henrik Genssen" <henrik.gens...@miadi.net>
wrote:
> I feel, this should be something integrated into Django, too.
>
> So far I am using transdb (but I am still sitting on Django 1.1).
>
> advantage:
> - all translations in one field as a dict so easy searchable, if icontains is 
> all you want
>
> disadvantages:
> - all translations in one field as a dict, therefor finds other rows having a 
> similar phrase (in other languages), too, as you must use icontains
> - you can not use startswith or endswith
> - no support for django-tagging
>
> regards
>
> Henrik
>
>
>
>
>
>
>
> >reply to message:
> >date: 22.02.2011 13:13:18
> >from: "Federico Capoano" <nemesis.des...@libero.it>
> >to: "Django users" <django-users@googlegroups.com>
> >subject: [] database i18n
>
> >I'm quite surprised that django doesn't have a native i18n solution
> >for models.
>
> >I've been trying some apps but one doesn't work with latest versions,
> >one is no longer developed, another one has no documentation, another
> >one simply doesn't work.
>
> >Tomorrow I'm going to try again and pheraps try some new ones.
>
> >What is your opinion regarding this matter? Is there an app you
> >suggest?
>
> >--
> >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 
> >athttp://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: [] database i18n

2011-02-23 Thread Henrik Genssen
I feel, this should be something integrated into Django, too.

So far I am using transdb (but I am still sitting on Django 1.1).

advantage:
- all translations in one field as a dict so easy searchable, if icontains is 
all you want

disadvantages:
- all translations in one field as a dict, therefor finds other rows having a 
similar phrase (in other languages), too, as you must use icontains
- you can not use startswith or endswith
- no support for django-tagging

regards

Henrik

>reply to message:
>date: 22.02.2011 13:13:18
>from: "Federico Capoano" <nemesis.des...@libero.it>
>to: "Django users" <django-users@googlegroups.com>
>subject: [] database i18n
>
>I'm quite surprised that django doesn't have a native i18n solution
>for models.
>
>I've been trying some apps but one doesn't work with latest versions,
>one is no longer developed, another one has no documentation, another
>one simply doesn't work.
>
>Tomorrow I'm going to try again and pheraps try some new ones.
>
>What is your opinion regarding this matter? Is there an app you
>suggest?
>
>-- 
>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.



database i18n

2011-02-22 Thread Federico Capoano
I'm quite surprised that django doesn't have a native i18n solution
for models.

I've been trying some apps but one doesn't work with latest versions,
one is no longer developed, another one has no documentation, another
one simply doesn't work.

Tomorrow I'm going to try again and pheraps try some new ones.

What is your opinion regarding this matter? Is there an app you
suggest?

-- 
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: i18n issue with compilemessages

2011-01-15 Thread Isaac XxX
The problem seems to come from your python path, that is not well defined.

Try to define path in an absolute (not realtive) fashion.

import os

os.environ['PYTHONPATH'] = '/path/to/myproject'
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'

and then, apache should be able to execute compile messages

Greetings,

Isaac

On Fri, Jan 14, 2011 at 7:48 AM, Akash  wrote:

> Following are the environment I am working on:
> 1. Django 1.2.3
> 2. Python 2.4
> 3. wsgi
> 4. Centos 5.4
>
> From apache, I can run makemessage command, and it works. It creates
> the *.po files.
> I use the following statement for this.
> os.system("django-admin.py makemessages -l hi")
>
> But I am unable to do compilemessages from apache. Following are the
> steps which I tried out:
>
> os.system("django-admin.py compilemessages") AND
> subprocess.Popen(["django-admin.py", "compilemessages"])
>
> The command works fine from command line though, when run from project
> location.
> $django-admin.py compilemessages.
>
> but when I do python manage.py shell and then try to run it using
> os.system, I get the following error:
> 
>  File "/usr/lib/python2.4/site-packages/django/core/management/
> commands/compilemessages.py", line 52, in handle
>compile_messages(locale)
>  File "/usr/lib/python2.4/site-packages/django/core/management/
> commands/compilemessages.py", line 10, in compile_messages
>basedirs.extend(settings.LOCALE_PATHS)
>  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 40, in _setup
>self._wrapped = Settings(settings_module)
>  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
> line 74, in __init__
>raise ImportError("Could not import settings '%s' (Is it on
> sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> e))
> ImportError: Could not import settings
> 'igp_distribution_manager.settings' (Is it on sys.path? Does it have
> syntax errors?): No module named igp_distribution_manager.settings
> 256
>
> So I am not sure If I should be using os.system for this,  or if there
> is another way to run it from apache.
>
> I am sure I am doing something wrong out here.
> If someone have faced this before and have got some solution, then
> please guide me to get through it.
>
> Regards,
> Akash
>
> --
> 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.



i18n issue with compilemessages

2011-01-14 Thread Akash
Following are the environment I am working on:
1. Django 1.2.3
2. Python 2.4
3. wsgi
4. Centos 5.4

>From apache, I can run makemessage command, and it works. It creates
the *.po files.
I use the following statement for this.
os.system("django-admin.py makemessages -l hi")

But I am unable to do compilemessages from apache. Following are the
steps which I tried out:

os.system("django-admin.py compilemessages") AND
subprocess.Popen(["django-admin.py", "compilemessages"])

The command works fine from command line though, when run from project
location.
$django-admin.py compilemessages.

but when I do python manage.py shell and then try to run it using
os.system, I get the following error:

  File "/usr/lib/python2.4/site-packages/django/core/management/
commands/compilemessages.py", line 52, in handle
compile_messages(locale)
  File "/usr/lib/python2.4/site-packages/django/core/management/
commands/compilemessages.py", line 10, in compile_messages
basedirs.extend(settings.LOCALE_PATHS)
  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 40, in _setup
self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
line 74, in __init__
raise ImportError("Could not import settings '%s' (Is it on
sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
e))
ImportError: Could not import settings
'igp_distribution_manager.settings' (Is it on sys.path? Does it have
syntax errors?): No module named igp_distribution_manager.settings
256

So I am not sure If I should be using os.system for this,  or if there
is another way to run it from apache.

I am sure I am doing something wrong out here.
If someone have faced this before and have got some solution, then
please guide me to get through it.

Regards,
Akash

-- 
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: i18n django models

2011-01-08 Thread Mo J. Al-Mughrabi
Yes, I did that part,

How can I navigate transmeta source for that function? I used python
setup.py install,



Sent from my iPhone

On Jan 9, 2011, at 1:12 AM, Alessandro Pasotti  wrote:

2011/1/8 Mo Mughrabi 

> Transmeta is much nicer and much simpler. I just installed it and I already
> like the way it is designed,
>
> I just ran into a small problem with the ./manage.py sync_transmeta_db not
> working. Any idea how it can be solved?
>
> Am just getting an unknown command,
>
>
> Cheers,
>
>
>

I dont' know... did you add transmeta to the installed app in settings.py ?


-- 
Alessandro Pasotti
w3:   www.itopen.it

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

2011-01-08 Thread Alessandro Pasotti
2011/1/8 Mo Mughrabi 

> Transmeta is much nicer and much simpler. I just installed it and I already
> like the way it is designed,
>
> I just ran into a small problem with the ./manage.py sync_transmeta_db not
> working. Any idea how it can be solved?
>
> Am just getting an unknown command,
>
>
> Cheers,
>
>
>

I dont' know... did you add transmeta to the installed app in settings.py ?


-- 
Alessandro Pasotti
w3:   www.itopen.it

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

2011-01-08 Thread Mo Mughrabi
Transmeta is much nicer and much simpler. I just installed it and I already
like the way it is designed,

I just ran into a small problem with the ./manage.py sync_transmeta_db not
working. Any idea how it can be solved?

Am just getting an unknown command,


Cheers,


On Sat, Jan 8, 2011 at 4:23 PM, Alessandro Pasotti <apaso...@gmail.com>wrote:

> 2011/1/8 Mo Mughrabi <mo.mughr...@gmail.com>
>
> This is not exactly what I need.
>>
>> this library is not done as per the common best practices for i18nlizing
>> data.
>>
>> All you have to do is declare an object (field) as an i18n field and the
>> engine takes care of the rest. This example you can see in java struct and
>> php symphony, when executing the equivalent for syncdb it will generate an
>> additional table which holds the i18n languages instead of creating columns
>> with prefixes and suffixes.
>>
>
> Hi,
>
> I've been using transmeta for a big project, I had to slightly adapt it to
> suit my needs but it works well and I found it an elegant solution.
>
> http://code.google.com/p/django-transmeta/
>
> some migration/maintenance commands are also available within the lib.
>
> --
> Alessandro Pasotti
> w3:   www.itopen.it
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@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-us...@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: i18n django models

2011-01-08 Thread Alessandro Pasotti
2011/1/8 Mo Mughrabi <mo.mughr...@gmail.com>

> This is not exactly what I need.
>
> this library is not done as per the common best practices for i18nlizing
> data.
>
> All you have to do is declare an object (field) as an i18n field and the
> engine takes care of the rest. This example you can see in java struct and
> php symphony, when executing the equivalent for syncdb it will generate an
> additional table which holds the i18n languages instead of creating columns
> with prefixes and suffixes.
>

Hi,

I've been using transmeta for a big project, I had to slightly adapt it to
suit my needs but it works well and I found it an elegant solution.

http://code.google.com/p/django-transmeta/

some migration/maintenance commands are also available within the lib.

-- 
Alessandro Pasotti
w3:   www.itopen.it

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

2011-01-08 Thread Mo Mughrabi
This is not exactly what I need.

this library is not done as per the common best practices for i18nlizing
data.

All you have to do is declare an object (field) as an i18n field and the
engine takes care of the rest. This example you can see in java struct and
php symphony, when executing the equivalent for syncdb it will generate an
additional table which holds the i18n languages instead of creating columns
with prefixes and suffixes.

Having columns mapped to a specific language means modifying your table in
the future if you need additional languages. Meanwhile, if creating a one to
many relation with a specific table that holds only the variable in
different languages means you can add as many language support as you need,

Plus, when I went through polyglot it does override a lot
of crucial functions, adding up such plugin into a critical
production environment can be risky with very little information about it.


Any other solutions?



On Fri, Jan 7, 2011 at 6:25 PM, Marcos Moyano <marcosmoy...@gmail.com>wrote:

> I've worked on/with this app
> https://github.com/Anue/django-polyglot/
>
> Hope it helps.
> Rgds,
> Marcos
>
> On Fri, Jan 7, 2011 at 12:20 PM, Mo Mughrabi <mo.mughr...@gmail.com>wrote:
>
>> Hello,
>>
>> in my design there are some models where I need to store certain fields in
>> different languages. I was wondering if anyone has done it before? I saw
>> some django modules that help do model translations but some of them did not
>> work properly.
>>
>> Any best practices out there? below is my code
>>
>> *my model.py*
>>
>> class Lookup_I18n(models.Model):
>> i18n_code = models.CharField(max_length=5,
>> default=settings.LANGUAGE_CODE)
>> value = models.CharField(max_length=300)
>>
>> class Lookup(models.Model):
>>
>> purpose = models.CharField(max_length=10)
>> key = models.CharField(max_length=10)
>> value_i18n = models.ForeignKey(Lookup_I18n)
>> value = models.Field()
>>
>> class Meta:
>> unique_together = (('purpose', 'key'),)
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Some people, when confronted with a problem, think “I know, I'll use
> regular expressions.” Now they have two problems.
>
> Jamie Zawinski, in comp.emacs.xemacs
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@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-us...@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: i18n django models

2011-01-07 Thread Marcos Moyano
I've worked on/with this app
https://github.com/Anue/django-polyglot/

Hope it helps.
Rgds,
Marcos

On Fri, Jan 7, 2011 at 12:20 PM, Mo Mughrabi  wrote:

> Hello,
>
> in my design there are some models where I need to store certain fields in
> different languages. I was wondering if anyone has done it before? I saw
> some django modules that help do model translations but some of them did not
> work properly.
>
> Any best practices out there? below is my code
>
> *my model.py*
>
> class Lookup_I18n(models.Model):
> i18n_code = models.CharField(max_length=5,
> default=settings.LANGUAGE_CODE)
> value = models.CharField(max_length=300)
>
> class Lookup(models.Model):
>
> purpose = models.CharField(max_length=10)
> key = models.CharField(max_length=10)
> value_i18n = models.ForeignKey(Lookup_I18n)
> value = models.Field()
>
> class Meta:
> unique_together = (('purpose', 'key'),)
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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.
>



-- 
Some people, when confronted with a problem, think “I know, I'll use regular
expressions.” Now they have two problems.

Jamie Zawinski, in comp.emacs.xemacs

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



i18n django models

2011-01-07 Thread Mo Mughrabi
Hello,

in my design there are some models where I need to store certain fields in
different languages. I was wondering if anyone has done it before? I saw
some django modules that help do model translations but some of them did not
work properly.

Any best practices out there? below is my code

*my model.py*

class Lookup_I18n(models.Model):
i18n_code = models.CharField(max_length=5,
default=settings.LANGUAGE_CODE)
value = models.CharField(max_length=300)

class Lookup(models.Model):

purpose = models.CharField(max_length=10)
key = models.CharField(max_length=10)
value_i18n = models.ForeignKey(Lookup_I18n)
value = models.Field()

class Meta:
unique_together = (('purpose', 'key'),)

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

2010-10-15 Thread Kenneth Gonsalves
On Thu, 2010-10-14 at 23:03 -0700, BlackMoses wrote:
> First table contains universal field which doesn't depends on
> language. Second contains fields that suposed to be in many languages,
> 'culture' field which store language code ('en', 'de' etc). Both
> tables are related with foreign keys of course. Then it is really easy
> to get some data for proper language (Symfony gives special mechanisms
> to get and set this data).
> My question is if there are any Django standards/tools that i should
> use for it? Or I have to take care with it on my own. 

try django-transmeta
-- 
regards
Kenneth Gonsalves

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

2010-10-15 Thread Jonathan Barratt
On 15 ?.?. 2010, at 13:03, BlackMoses wrote:

> have question if Django have support for I18n models.

> 

> My question is if there are any Django standards/tools that i should
> use for it? Or I have to take care with it on my own.

Yes there are standard tools, please see: 
http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/

Good luck,
Jonathan

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



I18n in Django model

2010-10-15 Thread BlackMoses
have question if Django have support for I18n models. For example in
Symfony when i create 'news' table there are 2 tables in fact :

news
  id
  date

news_i18n
  id
  culture
  title
  text

First table contains universal field which doesn't depends on
language. Second contains fields that suposed to be in many languages,
'culture' field which store language code ('en', 'de' etc). Both
tables are related with foreign keys of course. Then it is really easy
to get some data for proper language (Symfony gives special mechanisms
to get and set this data).
My question is if there are any Django standards/tools that i should
use for it? Or I have to take care with it on my own.

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



format date in javascript use i18n

2010-09-29 Thread Flytwokites
In i18n javascript_catalog view, there has a get_format() function,
but how to format date use these formats? The returned format by
get_format() is in php date() style, but no such a js format function
can deal with it.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: i18n form not working when in site root

2010-08-06 Thread Baurzhan Ismagulov
On Fri, Aug 06, 2010 at 07:26:33AM -0700, Florin wrote:
> When I change the language from any site's page it works like it
> should, but when I go to the homepage (site's root) the
> "django_language" cookie is reset and the language form doesn't work
> anymore; it makes the POST request but it doesn't change the language.

Difficult to tell, Should Work(tm). Do you {% load i18n %} in your root
template, pass context_instance=RequestContext(Request) to
render_to_response and actually have translatable strings and
translations for them? If you already have that, publishing a minimal
example of the problem and stating Django version could help people help
you.

With kind regards,
Baurzhan.

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



  1   2   3   4   5   6   >