Re: multilingual flatpages

2009-12-01 Thread Jani Tiainen
On Mon, 2009-11-30 at 16:36 -0800, Nev wrote:
> Hey,
> 
> Today I did a bunch of searching and reading to find what is the best
> way to have flatpages presented in multiple languages. Flatpages
> apparently don't support internationalization and I went down several
> avenues looking for the recommended way, and finding various things
> that appeared way over the top for my simple requirement - present the
> translated version of my flat page according to the current
> 'django_language'.

There also exists django-multilingual pluggable app that has (among
other features), multilingual flatpages application.

-- 

Jani Tiainen


--

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: multilingual flatpages

2009-12-01 Thread andreas schmid
hi,

i didnt work on that yet but i will in the next weeks because ill need
the content translated on flatpages.
wouldnt it be easier to subclass the flatpages model or to get the
flatpages package and make the modifications there to get a
custom_flatpages app?

im thinkin that because im already using transmeta for all my other apps.

Nev wrote:
> Hey,
>
> Today I did a bunch of searching and reading to find what is the best
> way to have flatpages presented in multiple languages. Flatpages
> apparently don't support internationalization and I went down several
> avenues looking for the recommended way, and finding various things
> that appeared way over the top for my simple requirement - present the
> translated version of my flat page according to the current
> 'django_language'.
>
> So I thought I'd share it... (It's really only five lines added to
> your templates, and links to the pages updated).
>
> In my base template I have the usual forms for changing the languages,
> which are presented as clickable flags. The addition is the next_input
> block.
>
> 
>   {% for lang in languages %}
> 
>   
>   {% block next_input %}
>   {% endblock %}
> type="image"
>  src="/images/{{ lang.0 }}.png"
>  alt="{{ lang.1 }}"/>
> 
>   {% endfor %}
> 
>
> In my flatpage template which extends the base template I supply that
> block, which supplies a input tag which supplies the next value for
> the form.
>
> {% block next_input %}
>   
> {% endblock %}
>
> The key is that the urls of the flatpages are as such...
>
> /welcome/en/
> /welcome/es/
> /welcome/pt/
>
> The form therefore, after going to /i18n/setlang, returns to the same
> page, but in the new language by removing the trailing slash and
> language code and replacing it with the new currently selected
> language.
>
> Click on the flags for non-flatpages works as normal.
>
> And links to these flat pages within other templates are thus
> supplied... (where 'language' is supplied by the view as the value of
> 'django_language' or an appropriate default if it's not yet been
> selected, 'en' in my case).
>
> {% trans "Welcome" %}
>
> Hope this helps someone. It's extremely easy, does what I need, along
> with the django internationalization, without installing anything
> extra or getting complicated.
>
> Cheers,
>
> Nev
>
> --
>
> 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.