Translate models

0 views
Skip to first unread message

Alessandro Ronchi

unread,
Nov 25, 2009, 7:08:47 AM11/25/09
to django...@googlegroups.com
I need to make my model translatable into different languages.
Is there any simple way to handle that in a transparent manner?
I've fround transmeta project on google, anyone is using that?

--
Alessandro Ronchi

SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
http://www.linkedin.com/in/ronchialessandro

andreas schmid

unread,
Nov 25, 2009, 7:25:58 AM11/25/09
to django...@googlegroups.com
ciao alessandro,

i am using transmeta for a project im developing and it seems to fit my
needs.
transmeta is easy to use and it creates a db column for every field you
defined as translatable.
the default and required language is the one you define as site language
in settings.py, and its also the "neutral" language which is shown even
on the other languages if you didnt write a translation.

in the last days i found a way to have a better behaviour for fields
which language doesnt exist but i dont want to show the default language:
in the template:
{% ifequal LANGUAGE_CODE 'en' %}
{% if object.body_en %}
<p>{{ object.body_en|safe }}</p>
{% else %}
<p>Sorry but the requested content doesnt exist in this
language. </p>
{% endif %}
{% endifequal %}

i think in this way im having a clean way to avoid an ugly language mix.
im also using localeurl to get the language choice directly in the url
like http://www.mysite.com/en/my-content or
http://www.mysite.com/it/my-content

i hope this can help you
> --
>
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

Alessandro Pasotti

unread,
Nov 25, 2009, 7:32:14 AM11/25/09
to django...@googlegroups.com
2009/11/25 Alessandro Ronchi <alessand...@soasi.com>

I need to make my model translatable into different languages.
Is there any simple way to handle that in a transparent manner?
I've fround transmeta project on google, anyone is using that?


Hi,

yes, I'm using transmeta, I had to modify a couple of things to suit my needs but it's working fine so far.


--
Alessandro Pasotti
w3:   www.itopen.it

Jani Tiainen

unread,
Nov 25, 2009, 3:40:54 PM11/25/09
to django...@googlegroups.com
On 11/25/09, Alessandro Ronchi <alessand...@soasi.com> wrote:
> I need to make my model translatable into different languages.
> Is there any simple way to handle that in a transparent manner?
> I've fround transmeta project on google, anyone is using that?
>

I'm using django-multilingual which pretty much makes same thing just
a bit different way.

--

Jani Tiainen
Reply all
Reply to author
Forward
0 new messages