Closed GoogleCodeExporter closed 9 years ago
I think you don't have set PAGE_DEFAULT_LANGUAGE in your settings because I
can't
reproduce this bug.
Original comment by batiste....@gmail.com
on 17 Aug 2009 at 7:44
well, I had:
LANGUAGE_CODE = 'en' in project.settings.
ok, I added PAGE_DEFAULT_LANGUAGE, but nothing has changed.
Now I have:
LANGUAGE_CODE = 'en'
gettext_noop = lambda s: s
PAGE_LANGUAGES = (
('fr', gettext_noop('French')),
('en', gettext_noop('English')),
)
PAGE_USE_LANGUAGE_PREFIX = True
PAGE_TINYMCE = True
PAGE_PERMISSION = False
PAGE_DEFAULT_LANGUAGE = 'en'
Original comment by pakhomov...@yandex.ru
on 18 Aug 2009 at 6:26
Can you try to update to the last revision. With the last revision it's now
working fine.
Original comment by batiste....@gmail.com
on 19 Aug 2009 at 11:31
I updated to revision 649 but still with no luck.
And have links like: http://127.0.0.1:8000/None/home/test/
I doubt may be I'm installing it in a wrong way? I just copy "pages" folder from
checkout source to my project.
Original comment by pakhomov...@yandex.ru
on 20 Aug 2009 at 8:27
I can't understand you bug... The code that set the lang variable in
pages/admin/__init__/list_pages is the following:
{{{
def get_language_from_request(request):
"""Return the most obvious language according the request."""
language = request.GET.get('language', None)
if language:
return language
if hasattr(request, 'LANGUAGE_CODE'):
return settings.PAGE_LANGUAGE_MAPPING(str(request.LANGUAGE_CODE))
else:
return settings.PAGE_DEFAULT_LANGUAGE
}}}
It don't make sense that you get a None... PAGE_LANGUAGE_MAPPING is set to that
if
undefined:
PAGE_LANGUAGE_MAPPING = getattr(settings, 'PAGE_LANGUAGE_MAPPING', lambda l: l)
Can you investigate into get_language_from_request to know what is happenning?
Original comment by batiste....@gmail.com
on 25 Aug 2009 at 7:08
This bug isn't in pages list but in page edit page - /admin/pages/page/1/
Original comment by pakhomov...@yandex.ru
on 25 Aug 2009 at 7:44
in page list it's ok - link looks like /en/home/test/
Original comment by pakhomov...@yandex.ru
on 25 Aug 2009 at 7:45
Oki, should be fixed with revision 660. Can you check?
Original comment by batiste....@gmail.com
on 25 Aug 2009 at 8:11
sorry but it isn't fixed with revision 660.
in models.py if I add print statement:
def get_absolute_url(self, language=None):
"""Return the absolute page url. Add the language prefix if
``PAGE_USE_LANGUAGE_PREFIX`` setting is set to **True***."""
print language
url = reverse('pages-root')
if settings.PAGE_USE_LANGUAGE_PREFIX:
url += str(language) + '/'
return url + self.get_url(language)
it prints: None
Should we pass the language to this function?
Original comment by pakhomov...@yandex.ru
on 25 Aug 2009 at 10:43
Woups, sorry. I haven't really tested. What about now?
Original comment by batiste....@gmail.com
on 25 Aug 2009 at 11:17
now it works perfectly. Thank you!
Original comment by pakhomov...@yandex.ru
on 25 Aug 2009 at 11:37
Original comment by batiste....@gmail.com
on 25 Aug 2009 at 1:05
Original issue reported on code.google.com by
pakhomov...@yandex.ru
on 17 Aug 2009 at 7:08