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


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

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




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.