KristianOellegaard/django-hvad — Issue #26: How to get a translated value for a specified language?
Author: leonderijke
Created: 2012-02-25 13:35:41+00:00
State: open

I'm trying to get Django-CMS's [language chooser](http://django-cms.readthedocs.org/en/latest/advanced/i18n.html#language-chooser) to work with my TranslatableModel.

I'm trying to pass a language to my get_absolute_url function in order for it to get a translated slug:

```python
def get_slug(self, language):
# What to do with language?
return self.lazy_translation_getter('slug')

def get_absolute_url(self, language = None):
return reverse('events.detail', args = [], kwargs = { 'slug': self.get_slug(language)} )
```

How can I get a translated value for 'slug' in the language I pass in? I tried to use the safe and lazy translation getters but they only take the language of the request into account, while I need to get the value for other languages too.