Re: How to view your translated site?

2013-04-18 Thread Cody Scott
I agree that link is much better, I got the other one from settings.py


On Thu, Apr 18, 2013 at 12:41 PM, Tom Evans wrote:

> On Thu, Apr 18, 2013 at 5:23 PM, Cody Scott 
> wrote:
> > Thanks, I went here
> http://www.i18nguy.com/unicode/language-identifiers.html
> > ctrl+ f "japanese" saw jp on the left hand side. I thought ja was a
> > localization of jp so it would be jp-ja.
> >
>
> The columns listed on that page are "region code", "region name",
> "language". You can't use region code for language, eg the region code
> 'ca' represents 'Canada', but the language code 'ca' represents
> Catalan. It's important to use the right one.
>
> If you're looking for the right ISO-639-1 language code to use, the
> best reference is a list of ISO-639-1 codes:
>
> http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/pCJlPwvkirQ/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, 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: How to view your translated site?

2013-04-18 Thread Tom Evans
On Thu, Apr 18, 2013 at 5:23 PM, Cody Scott  wrote:
> Thanks, I went here http://www.i18nguy.com/unicode/language-identifiers.html
> ctrl+ f "japanese" saw jp on the left hand side. I thought ja was a
> localization of jp so it would be jp-ja.
>

The columns listed on that page are "region code", "region name",
"language". You can't use region code for language, eg the region code
'ca' represents 'Canada', but the language code 'ca' represents
Catalan. It's important to use the right one.

If you're looking for the right ISO-639-1 language code to use, the
best reference is a list of ISO-639-1 codes:

http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

Cheers

Tom

-- 
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: How to view your translated site?

2013-04-18 Thread Cody Scott
Thanks, I went here http://www.i18nguy.com/unicode/language-identifiers.html 
ctrl+ 
f "japanese" saw jp on the left hand side. I thought ja was a localization 
of jp so it would be jp-ja.

On Thursday, 18 April 2013 11:42:37 UTC-4, Cody Scott wrote:
>
> I am trying to view my site in japanese. I have create the translations 
> and compiled them with compilemessages.
>
> In my urls.py I have 
>
> urlpatterns = i18n_patterns('',
> #...)
>
>
> Settings.py
>
>
> LANGUAGE_CODE = 'en-us'
> #Used for translationsgettext = lambda s: sLANGUAGES = (
> ('en', gettext('English')),
> ('jp', gettext('Japanese')),)
>
>
> But when I try to access a url with /jp/ at the start I get that there is 
> only /en/
>
>
> Using the URLconf defined in PLP.urls, Django tried these URL patterns, in 
> this order:^en/The current URL, jp/accounts/login, didn't match any of these.
>
>  
>
> I am using dbgettext so I also have my database content translated in my 
> messages.
>
> But how can I display it
>
> {% trans "Question:" %}{% trans {{question.question}} %}
>
> Could not parse the remainder: '{{question.question}}' from 
> '{{question.question}}'
>
>
>

-- 
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: How to view your translated site?

2013-04-18 Thread Tom Evans
On Thu, Apr 18, 2013 at 4:42 PM, Cody Scott  wrote:
> I am trying to view my site in japanese. I have create the translations and
> compiled them with compilemessages.
>
> In my urls.py I have
>
> urlpatterns = i18n_patterns('',
> #...
> )
>
>
> Settings.py
>
>
> LANGUAGE_CODE = 'en-us'
>
> #Used for translations
> gettext = lambda s: s
> LANGUAGES = (
> ('en', gettext('English')),
> ('jp', gettext('Japanese')),
> )

Django only supports translations that Django itself has a base
translation for. Django has a Japanese translation, but it uses the
correct ISO-639-1 language name for it, 'ja'. Since you have 'jp',
this doesn't correspond to a language that django has a base
translation for, and so it is ignored.

>
>
> But when I try to access a url with /jp/ at the start I get that there is
> only /en/
>
>
> Using the URLconf defined in PLP.urls, Django tried these URL patterns, in
> this order:
> ^en/
> The current URL, jp/accounts/login, didn't match any of these.
>
>
>
> I am using dbgettext so I also have my database content translated in my
> messages.
>
> But how can I display it
>
> {% trans "Question:" %}{% trans {{question.question}} %}
>
> Could not parse the remainder: '{{question.question}}' from
> '{{question.question}}'
>

You can't use {{ }} inside a template tag, but you don't need to. {%
trans %} is expecting either a string literal or a variable, so give
it the variable - {% trans question.question %}.

Cheers

Tom

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




How to view your translated site?

2013-04-18 Thread Cody Scott
I am trying to view my site in japanese. I have create the translations and 
compiled them with compilemessages.

In my urls.py I have 

urlpatterns = i18n_patterns('',
#...)


Settings.py


LANGUAGE_CODE = 'en-us'
#Used for translationsgettext = lambda s: sLANGUAGES = (
('en', gettext('English')),
('jp', gettext('Japanese')),)


But when I try to access a url with /jp/ at the start I get that there is only 
/en/


Using the URLconf defined in PLP.urls, Django tried these URL patterns, in this 
order:^en/The current URL, jp/accounts/login, didn't match any of these.

 

I am using dbgettext so I also have my database content translated in my 
messages.

But how can I display it

{% trans "Question:" %}{% trans {{question.question}} %}

Could not parse the remainder: '{{question.question}}' from 
'{{question.question}}'


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