My favorites | Sign in
Project Logo
             
Details: Show all Hide all

Last 30 days

  • Nov 27, 2009
    issue 34 (Documentation: ) reported by apasotti   -   The example in usage.rst has a wrong select name: <select name="language" onchange="$('#locale_switcher').submit()"> should be <select name="locale" onchange="$('#locale_switcher').submit()"> Also: a jquery-independent version should be: <select name="locale" onchange="document.getElementById('locale_switcher').submit()">
    The example in usage.rst has a wrong select name: <select name="language" onchange="$('#locale_switcher').submit()"> should be <select name="locale" onchange="$('#locale_switcher').submit()"> Also: a jquery-independent version should be: <select name="locale" onchange="document.getElementById('locale_switcher').submit()">
  • Nov 18, 2009
    issue 28 ({% url <...> %} tag fails at some moment.) commented on by iqbal.b.abdullah   -   The url tag finally worked as exepected. If I put the below import into the view which is responsible for the template, the {% url %} correctly appends the locale to the link. from localeurl.models import reverse
    The url tag finally worked as exepected. If I put the below import into the view which is responsible for the template, the {% url %} correctly appends the locale to the link. from localeurl.models import reverse
  • Nov 17, 2009
    issue 33 (Redirects break when django project is not mapped onto the d...) commented on by Lenniboy   -   I modified the code a little and it doesn't require the DJANGO_ROOT setting anymore. This is read from urlresolver.get_script_prefix() instead.
    I modified the code a little and it doesn't require the DJANGO_ROOT setting anymore. This is read from urlresolver.get_script_prefix() instead.
  • Nov 17, 2009
    issue 28 ({% url <...> %} tag fails at some moment.) commented on by iqbal.b.abdullah   -   Hi, I'm not sure if my issue is related. The links which I've added into the template with the {% url %} tag doesn't have the locale prefix. I have INSTALLED_APPS = ( 'localeurl', ... } in the settings, and tags like {% locale_url "en" view.main %} correctly gives me links with the specified locale. Clicking on those links will also correctly give me requests with the specified prefix, and the pages are correctly using the specified locale's translation. This is my setup: 1. What is the expected output? What do you see instead? Link supposed to be prepended by current locale prefix, but instead prefix is absent. 2. What version of Django are you using? On what operating system? django.VERSION(1, 1, 1, 'final', 0) Ubuntu 9.04 Server with Apache/2.2.11 (Ubuntu) mod_python/3.3.1 Python/2.6.2 3. What version of django-localeurl are you using? revision 88 4. Please provide any additional information below. I just started trying out django-localeurl today and can't really point out if it's a settings issue. It would be great if anyone can point out anything else I can check or try out.
    Hi, I'm not sure if my issue is related. The links which I've added into the template with the {% url %} tag doesn't have the locale prefix. I have INSTALLED_APPS = ( 'localeurl', ... } in the settings, and tags like {% locale_url "en" view.main %} correctly gives me links with the specified locale. Clicking on those links will also correctly give me requests with the specified prefix, and the pages are correctly using the specified locale's translation. This is my setup: 1. What is the expected output? What do you see instead? Link supposed to be prepended by current locale prefix, but instead prefix is absent. 2. What version of Django are you using? On what operating system? django.VERSION(1, 1, 1, 'final', 0) Ubuntu 9.04 Server with Apache/2.2.11 (Ubuntu) mod_python/3.3.1 Python/2.6.2 3. What version of django-localeurl are you using? revision 88 4. Please provide any additional information below. I just started trying out django-localeurl today and can't really point out if it's a settings issue. It would be great if anyone can point out anything else I can check or try out.
  • Nov 15, 2009
    issue 33 (Redirects break when django project is not mapped onto the d...) commented on by Lenniboy   -   Well, I just hacked the code a little and added the changes myself. The attached diff maybe a little rough, I will certainly test it a little more, but maybe you want to have a look if those changes are okay.
    Well, I just hacked the code a little and added the changes myself. The attached diff maybe a little rough, I will certainly test it a little more, but maybe you want to have a look if those changes are okay.

Earlier this year

  • Nov 13, 2009
    issue 33 (Redirects break when django project is not mapped onto the d...) commented on by Lenniboy   -   Let me expand a little more here. I whenever I call my page http:localhost/foo/de/ it renders okay, however the generated links generally will be wrong. Instead of http://localhost/foo/de/bar the middleware redirects sets the url to http://localhost/foo/de/foo/bar.
    Let me expand a little more here. I whenever I call my page http:localhost/foo/de/ it renders okay, however the generated links generally will be wrong. Instead of http://localhost/foo/de/bar the middleware redirects sets the url to http://localhost/foo/de/foo/bar.
  • Nov 13, 2009
    issue 33 (Redirects break when django project is not mapped onto the d...) reported by Lenniboy   -   What steps will reproduce the problem? 1. Create a django project foo 2. Make project visible on the webserver under /bar (not just /) What is the expected output? What do you see instead? Whenever /bar/en is requested, localeurl redirects to /en . Maybe that is because it thinks it is on the document root? What version of Django are you using? On what operating system? Django 1.1.1 on OSX What version of django-localeurl are you using? SVN r88 Please provide any additional information below.
    What steps will reproduce the problem? 1. Create a django project foo 2. Make project visible on the webserver under /bar (not just /) What is the expected output? What do you see instead? Whenever /bar/en is requested, localeurl redirects to /en . Maybe that is because it thinks it is on the document root? What version of Django are you using? On what operating system? Django 1.1.1 on OSX What version of django-localeurl are you using? SVN r88 Please provide any additional information below.
  • Nov 12, 2009
    issue 32 (UnicodeEncodeError with non-ascii characters in query string...) reported by aabele   -   I'm using Baltic characters in urls like ķņēš etc. Diff attached.
    I'm using Baltic characters in urls like ķņēš etc. Diff attached.
  • Sep 27, 2009
    issue 23 (problem with login url ) commented on by pawel.krzyzaniak   -   I know this is not a very good solution. I treat it rather as a quick-fix to the time this problem will be fixed. I put it here just in case someone has similar problem as I had and need to workaround it quickly. Thanks for your support :)
    I know this is not a very good solution. I treat it rather as a quick-fix to the time this problem will be fixed. I put it here just in case someone has similar problem as I had and need to workaround it quickly. Thanks for your support :)
  • Sep 25, 2009
    issue 23 (problem with login url ) Status changed by joost@cassee.net   -   Thanks for your contribution, Pawel. First of all, too bad that putting localeurl to the top if the INSTALLED_APPLICATIONS list does not work. Apparently the views are imported before the models are. (Or at least this Python module is.) Basically, it's a problem of the timing of the monkey patching. If you have a suggestion on how to fix this, I would be very interested. However, although setting the language on the request is exactly what localeurl is trying to avoid, so that work-around will probably never be implemented in this project. (A middleware that does this is trivial to add to any project.) Getting the default language from the request is a change that will be made in the next version. I'm going to leave this problem Accepted until a solution is found, or maybe it well be folded into issue 16 later.
    Status: Accepted
    Thanks for your contribution, Pawel. First of all, too bad that putting localeurl to the top if the INSTALLED_APPLICATIONS list does not work. Apparently the views are imported before the models are. (Or at least this Python module is.) Basically, it's a problem of the timing of the monkey patching. If you have a suggestion on how to fix this, I would be very interested. However, although setting the language on the request is exactly what localeurl is trying to avoid, so that work-around will probably never be implemented in this project. (A middleware that does this is trivial to add to any project.) Getting the default language from the request is a change that will be made in the next version. I'm going to leave this problem Accepted until a solution is found, or maybe it well be folded into issue 16 later.
    Status: Accepted
  • Sep 25, 2009
    issue 23 (problem with login url ) commented on by pawel.krzyzaniak   -   I had the same problem: @login_required goes to link: /accounts/login/?next=/pl/... which is changed by localeurl middleware to: /en/accounts/login/?next=/pl/... (English is set as default language) The problem is that localeurl always use settings.LANGUAGE_CODE when there is no language prefix in the link. I solved this issue by saving the current language code in the session, so when there is no language prefix I check first if it is in the session, and only if not I use settings.LANGUAGE_CODE so my process_request in middleware.py look like this: def process_request(self, request): locale, path = self.split_locale_from_request(request) if not locale: if ('django_language' in request.session): locale = request.session['django_language'] else: locale = settings.LANGUAGE_CODE locale_path = utils.locale_path(path, locale) if locale_path != request.path_info: if request.META.get("QUERY_STRING", ""): locale_path = "%s?%s" % (locale_path, request.META['QUERY_STRING']) return HttpResponseRedirect(locale_path) request.path_info = path translation.activate(locale) request.LANGUAGE_CODE = translation.get_language() request.session['django_language'] = request.LANGUAGE_CODE Btw. I've just tried to bring 'localeurl' to the top of my INSTALLED_APPLICATIONS list, and it does not solve the problem.
    I had the same problem: @login_required goes to link: /accounts/login/?next=/pl/... which is changed by localeurl middleware to: /en/accounts/login/?next=/pl/... (English is set as default language) The problem is that localeurl always use settings.LANGUAGE_CODE when there is no language prefix in the link. I solved this issue by saving the current language code in the session, so when there is no language prefix I check first if it is in the session, and only if not I use settings.LANGUAGE_CODE so my process_request in middleware.py look like this: def process_request(self, request): locale, path = self.split_locale_from_request(request) if not locale: if ('django_language' in request.session): locale = request.session['django_language'] else: locale = settings.LANGUAGE_CODE locale_path = utils.locale_path(path, locale) if locale_path != request.path_info: if request.META.get("QUERY_STRING", ""): locale_path = "%s?%s" % (locale_path, request.META['QUERY_STRING']) return HttpResponseRedirect(locale_path) request.path_info = path translation.activate(locale) request.LANGUAGE_CODE = translation.get_language() request.session['django_language'] = request.LANGUAGE_CODE Btw. I've just tried to bring 'localeurl' to the top of my INSTALLED_APPLICATIONS list, and it does not solve the problem.
  • Aug 29, 2009
    issue 31 (Problem when saving language to cookies) Status changed by joost@cassee.net   -  
    Status: Accepted
    Status: Accepted
  • Aug 28, 2009
    issue 31 (Problem when saving language to cookies) reported by nmariz   -   I've noticed that using the set_language() view from Django doesn't set the language selected to the user cookies. Therefore is not possible to make a selected language persist in the user session.
    I've noticed that using the set_language() view from Django doesn't set the language selected to the user cookies. Therefore is not possible to make a selected language persist in the user session.
  • Aug 05, 2009
    issue 28 ({% url <...> %} tag fails at some moment.) Status changed by joost@cassee.net   -   Indeed, the source of your web page now shows '<!-- url - /offer/8/, request - /en/offer/8/-->'. Now what could be the problem... You could verify my assessment of the cause by checking the identity of the reverse function used in the get_absolute_url method and urlrevolvers.reverse. They should be identical, but I expect they are different when the problem occurs. Which of the two changes after a while?
    Status: Accepted
    Indeed, the source of your web page now shows '<!-- url - /offer/8/, request - /en/offer/8/-->'. Now what could be the problem... You could verify my assessment of the cause by checking the identity of the reverse function used in the get_absolute_url method and urlrevolvers.reverse. They should be identical, but I expect they are different when the problem occurs. Which of the two changes after a while?
    Status: Accepted
  • Aug 05, 2009
    issue 26 (Gotcha with JavaScript translations) Status changed by joost@cassee.net   -   Django changeset 11237 changed the example to use the 'url' tag. Closing as invalid because it was not really a localeurl bug.
    Status: Invalid
    Django changeset 11237 changed the example to use the 'url' tag. Closing as invalid because it was not really a localeurl bug.
    Status: Invalid
  • Aug 05, 2009
    issue 29 (LocaleURL with NEW (beta1) version of Django bug.) Status changed by joost@cassee.net   -   Patch applied in r88. Thanks Akimov, Tomas and Robin!
    Status: FixedInSvn
    Patch applied in r88. Thanks Akimov, Tomas and Robin!
    Status: FixedInSvn
  • Aug 05, 2009
    r88 (Updated monkey-patch of the urlresolvers.reverse function fo...) committed by joost@cassee.net   -   Updated monkey-patch of the urlresolvers.reverse function for Django 1.1. Thanks Akimov, Tomas and Robin.
    Updated monkey-patch of the urlresolvers.reverse function for Django 1.1. Thanks Akimov, Tomas and Robin.
  • Aug 05, 2009
    issue 30 (A TemplateSyntaxError is raised when using Django 1.1) changed by joost@cassee.net   -   Thanks for the report. This is a duplicate of issue 29.
    Status: Duplicate
    Thanks for the report. This is a duplicate of issue 29.
    Status: Duplicate
  • Aug 05, 2009
    issue 29 (LocaleURL with NEW (beta1) version of Django bug.) commented on by joost@cassee.net   -   Issue 30 has been merged into this issue.
    Issue 30 has been merged into this issue.
  • Aug 05, 2009
    issue 30 (A TemplateSyntaxError is raised when using Django 1.1) reported by nmariz   -   A TemplateSyntaxError is raised when using Django 1.1 "Caught an exception while rendering: reverse() got an unexpected keyword argument 'current_app'"
    A TemplateSyntaxError is raised when using Django 1.1 "Caught an exception while rendering: reverse() got an unexpected keyword argument 'current_app'"
  • Aug 05, 2009
    issue 28 ({% url <...> %} tag fails at some moment.) commented on by Max.Tret...@gmail.com   -   Exactly the first one: INSTALLED_APPS = ( 'localeurl',
    Exactly the first one: INSTALLED_APPS = ( 'localeurl',
  • Aug 05, 2009
    issue 28 ({% url <...> %} tag fails at some moment.) commented on by joost@cassee.net   -   Aha, your last comment rings a bell. The problem with get_absolute_url is that it is often built using the reverse function that is monkey-patched by localeurl. Apparently there is some kind of race going on here. See also issue 16. Could you check that localeurl is at the top of the installed applications list?
    Aha, your last comment rings a bell. The problem with get_absolute_url is that it is often built using the reverse function that is monkey-patched by localeurl. Apparently there is some kind of race going on here. See also issue 16. Could you check that localeurl is at the top of the installed applications list?
  • Aug 05, 2009
    issue 28 ({% url <...> %} tag fails at some moment.) commented on by Max.Tret...@gmail.com   -   I am using wsgi. Not sure it will be quite useful, but you can take a glance at page source at http://elected.biz/en/offer/8/. Comment at line 83 now looks as <!-- url - /en/offer/8/, request - /en/offer/8/--> is created by mean template line <!-- url - {{ object.get_absolute_url }}, request - {{ request.path }}--> It's ok, but I can suppose that tomorrow line 83 will differ. One item I have overlooked in my report (my apologies, Joost) - wrong behaviour is concerned not the {% url <...> %} tag, but the {{ <...>.get_absolute_url }} function.
    I am using wsgi. Not sure it will be quite useful, but you can take a glance at page source at http://elected.biz/en/offer/8/. Comment at line 83 now looks as <!-- url - /en/offer/8/, request - /en/offer/8/--> is created by mean template line <!-- url - {{ object.get_absolute_url }}, request - {{ request.path }}--> It's ok, but I can suppose that tomorrow line 83 will differ. One item I have overlooked in my report (my apologies, Joost) - wrong behaviour is concerned not the {% url <...> %} tag, but the {{ <...>.get_absolute_url }} function.
  • Aug 05, 2009
    issue 28 ({% url <...> %} tag fails at some moment.) commented on by joost@cassee.net   -   This looks like an issue that will be difficult to reproduce. It might have to do with the way Django is loaded. What method do you use, mod_python, fastcgi, wsgi, something else?
    This looks like an issue that will be difficult to reproduce. It might have to do with the way Django is loaded. What method do you use, mod_python, fastcgi, wsgi, something else?
  • Aug 05, 2009
    issue 29 (LocaleURL with NEW (beta1) version of Django bug.) Status changed by joost@cassee.net   -   Sorry, I hadn't received the e-mail notifications from Google Code about new issues. This patch will be applied in the next revision.
    Status: Accepted
    Sorry, I hadn't received the e-mail notifications from Google Code about new issues. This patch will be applied in the next revision.
    Status: Accepted
  • Aug 04, 2009
    issue 29 (LocaleURL with NEW (beta1) version of Django bug.) commented on by rvdrijst   -   Attached is a patch with the correct (*args, **kwargs) notation, for backward and forward compatibility.
    Attached is a patch with the correct (*args, **kwargs) notation, for backward and forward compatibility.
  • Jul 29, 2009
    issue 29 (LocaleURL with NEW (beta1) version of Django bug.) commented on by koziel.arthur   -   The same problem still exists with Django 1.1 final.
    The same problem still exists with Django 1.1 final.
  • Jul 22, 2009
    issue 29 (LocaleURL with NEW (beta1) version of Django bug.) commented on by akimov.alex   -   Yep, and not only for future, but also for backward compatibility. But as for me, your code is not correct: it should be kwargs['kwargs'].pop() instead of kwargs.pop()
    Yep, and not only for future, but also for backward compatibility. But as for me, your code is not correct: it should be kwargs['kwargs'].pop() instead of kwargs.pop()
  • Jul 22, 2009
    issue 29 (LocaleURL with NEW (beta1) version of Django bug.) commented on by to...@drencak.com   -   I think that (*args, **kwargs) notation will be better for future changes. if localeurl.settings.URL_TYPE == 'path_prefix' and settings.USE_I18N: def reverse(*args, **kwargs): locale = utils.supported_language(kwargs.pop('locale', translation.get_language())) path = django_reverse(*args, **kwargs) return utils.locale_url(path, locale) django_reverse = urlresolvers.reverse urlresolvers.reverse = reverse
    I think that (*args, **kwargs) notation will be better for future changes. if localeurl.settings.URL_TYPE == 'path_prefix' and settings.USE_I18N: def reverse(*args, **kwargs): locale = utils.supported_language(kwargs.pop('locale', translation.get_language())) path = django_reverse(*args, **kwargs) return utils.locale_url(path, locale) django_reverse = urlresolvers.reverse urlresolvers.reverse = reverse
  • Jul 21, 2009
    issue 29 (LocaleURL with NEW (beta1) version of Django bug.) reported by akimov.alex   -   What steps will reproduce the problem? 1. add localeurl to INSTALLED_APPS 2. use URL template tag (or simply ru reverse() with current_app argument) 3. get error `reverse() got an unexpected keyword argument 'current_app'` What version of Django are you using? On what operating system? Django version 1.1 beta 1 SVN-11280 What version of django-localeurl are you using? trunk Please provide any additional information below. Since new URL behavior was applied in Django, there extra kwarg in reverse function. I think attached patch would fix it. Best regards, Alex.
    What steps will reproduce the problem? 1. add localeurl to INSTALLED_APPS 2. use URL template tag (or simply ru reverse() with current_app argument) 3. get error `reverse() got an unexpected keyword argument 'current_app'` What version of Django are you using? On what operating system? Django version 1.1 beta 1 SVN-11280 What version of django-localeurl are you using? trunk Please provide any additional information below. Since new URL behavior was applied in Django, there extra kwarg in reverse function. I think attached patch would fix it. Best regards, Alex.
  • Jul 06, 2009
    issue 28 ({% url <...> %} tag fails at some moment.) reported by Max.Tretyak   -   What steps will reproduce the problem? 1. Launch site under Apache. 2. Wait some time (from few hours to several days). 3. Use links, formed by {% url <...> %} tag. What is the expected output? What do you see instead? Link shell be prepended by current locale prefix, but instead prefix is absent. What version of Django are you using? On what operating system? django.VERSION (1, 1, 0, 'beta', 1) Ubuntu 8.10 Server with apache2 2.2.9-7ubuntu3.1 What version of django-localeurl are you using? revision 87 Please provide any additional information below. Issue is appearing consistently after some moment and may be resolved only by restarting Apache. I mean that before that moment all urls is prefixed and after that moment all urls has not prefixes.
    What steps will reproduce the problem? 1. Launch site under Apache. 2. Wait some time (from few hours to several days). 3. Use links, formed by {% url <...> %} tag. What is the expected output? What do you see instead? Link shell be prepended by current locale prefix, but instead prefix is absent. What version of Django are you using? On what operating system? django.VERSION (1, 1, 0, 'beta', 1) Ubuntu 8.10 Server with apache2 2.2.9-7ubuntu3.1 What version of django-localeurl are you using? revision 87 Please provide any additional information below. Issue is appearing consistently after some moment and may be resolved only by restarting Apache. I mean that before that moment all urls is prefixed and after that moment all urls has not prefixes.
  • Jul 04, 2009
    issue 26 (Gotcha with JavaScript translations) commented on by richardbarran   -   Oops! Next time I'll look harder in the Django tickets before posting a comment :-)
    Oops! Next time I'll look harder in the Django tickets before posting a comment :-)
  • Jul 01, 2009
    issue 27 (default language code used when no prefix, wanted behavior ?) Status changed by joost@cassee.net   -  
    Status: Accepted
    Status: Accepted
  • Jul 01, 2009
    issue 27 (default language code used when no prefix, wanted behavior ?) reported by coulix   -   When no prefix is passed to the url it will take the default language code in settings instead of looking at the http request headers "ACCEPT_LANGUAGE" This should be an option but for now i did the following: In settings.py MIDDLEWARE_CLASSES = ( 'django.middleware.locale.LocaleMiddleware', 'localeurl.middleware.LocaleURLMiddleware', .... } Update the middleware from django-localeurl def process_request(self, request): locale, path = self.split_locale_from_request(request) locale_path = utils.locale_path(path, locale) if locale_path != request.path_info: if request.META.get("QUERY_STRING", ""): locale_path = "%s?%s" % (locale_path, request.META['QUERY_STRING']) # CHANGE START elif hasattr(request,'LANGUAGE_CODE'): locale_path = utils.locale_path(path, request.LANGUAGE_CODE) # CHANGE END return HttpResponseRedirect(locale_path) request.path_info = path if not locale: locale = settings.LANGUAGE_CODE translation.activate(locale) request.LANGUAGE_CODE = translation.get_language()
    When no prefix is passed to the url it will take the default language code in settings instead of looking at the http request headers "ACCEPT_LANGUAGE" This should be an option but for now i did the following: In settings.py MIDDLEWARE_CLASSES = ( 'django.middleware.locale.LocaleMiddleware', 'localeurl.middleware.LocaleURLMiddleware', .... } Update the middleware from django-localeurl def process_request(self, request): locale, path = self.split_locale_from_request(request) locale_path = utils.locale_path(path, locale) if locale_path != request.path_info: if request.META.get("QUERY_STRING", ""): locale_path = "%s?%s" % (locale_path, request.META['QUERY_STRING']) # CHANGE START elif hasattr(request,'LANGUAGE_CODE'): locale_path = utils.locale_path(path, request.LANGUAGE_CODE) # CHANGE END return HttpResponseRedirect(locale_path) request.path_info = path if not locale: locale = settings.LANGUAGE_CODE translation.activate(locale) request.LANGUAGE_CODE = translation.get_language()
  • Jul 01, 2009
    issue 26 (Gotcha with JavaScript translations) Status changed by joost@cassee.net   -   I already did. :-) http://code.djangoproject.com/ticket/11364 I'm keeping this bug Accepted. If the Django devs reject the change I'll add a warning to the localeurl docs.
    Status: Accepted
    I already did. :-) http://code.djangoproject.com/ticket/11364 I'm keeping this bug Accepted. If the Django devs reject the change I'll add a warning to the localeurl docs.
    Status: Accepted
  • Jun 25, 2009
    issue 26 (Gotcha with JavaScript translations) commented on by richardbarran   -   Nice! You're absolutely right, the Django doc could do with updating. Do you want to send in a patch or should I do it?
    Nice! You're absolutely right, the Django doc could do with updating. Do you want to send in a patch or should I do it?
  • Jun 24, 2009
    issue 25 (MEDIA_URL='/') Status changed by joost@cassee.net   -   I added the setting (named LOCALE_INDEPENDENT_MEDIA_URL) in r87.
    Status: FixedInSvn
    I added the setting (named LOCALE_INDEPENDENT_MEDIA_URL) in r87.
    Status: FixedInSvn
  • Jun 24, 2009
    r87 (Added LOCALE_INDEPENTENT_MEDIA_URL setting. ) committed by joost@cassee.net   -   Added LOCALE_INDEPENTENT_MEDIA_URL setting.
    Added LOCALE_INDEPENTENT_MEDIA_URL setting.
  • Jun 24, 2009
    issue 26 (Gotcha with JavaScript translations) Status changed by joost@cassee.net   -   I would think the documentation in this case is... incomlete. ;-) Try referencing the view using the 'url' tag: <script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script>
    Status: MoreInfo
    I would think the documentation in this case is... incomlete. ;-) Try referencing the view using the 'url' tag: <script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script>
    Status: MoreInfo
  • Jun 23, 2009
    issue 26 (Gotcha with JavaScript translations) reported by richardbarran   -   A project that needs to i18n javascript code and uses the 'javascript_catalog' view as per Django documentation. In the Django documentation there's an example of how to load javascript translations: <script type="text/javascript" src="/path/to/jsi18n/"></script> When using django-localeurl we need to prefix this with the locale, for example: <script type="text/javascript" src="/{{ LANGUAGE_CODE }}/path/to/jsi18n/"></script> This took me a few minutes to figure out and could be a useful comment to add to the documentation.
    A project that needs to i18n javascript code and uses the 'javascript_catalog' view as per Django documentation. In the Django documentation there's an example of how to load javascript translations: <script type="text/javascript" src="/path/to/jsi18n/"></script> When using django-localeurl we need to prefix this with the locale, for example: <script type="text/javascript" src="/{{ LANGUAGE_CODE }}/path/to/jsi18n/"></script> This took me a few minutes to figure out and could be a useful comment to add to the documentation.
  • Jun 22, 2009
    issue 25 (MEDIA_URL='/') commented on by nuno.lists   -   Just to elaborate a bit more on my case: I have different FileFields in different models that upload do specific folders under media_root: <media_root>/pics <media_root>/swf. When this application was designed, we didn't know about localeurl. There are 2 other solutions we considered: a) keep all the paths fixed in all references in all templates and add a '/' before every filefield url, like "/{{ car.photo.url }}, not defining MEDIA_URL in the settings.py file b) do it the "correct" way and change all references in all templates to all static files to include {{ MEDIA_URL}}, like "{{ MEDIA_URL }}/pics/photo1.jpg" and define MEDIA_URL in the settings.py to a different path that doesn't overlap with other application URLs ( / would be out of the question ) Since this app has stuff like javascript and swf files that were created and updated by the design/html agency and they are assuming some paths right out of the root, b) would be very hard to achieve. a) would be possible, but it would require care - and perhaps we would find that the MEDIA_URL setting was being used somewhere else. I think allowing the developer to choose if MEDIA_URL urls should be ignored or not by localeurl may make it integration with some existing apps easier (if you have a strange case like mine :-P ) Thanks for accepting the suggestion.
    Just to elaborate a bit more on my case: I have different FileFields in different models that upload do specific folders under media_root: <media_root>/pics <media_root>/swf. When this application was designed, we didn't know about localeurl. There are 2 other solutions we considered: a) keep all the paths fixed in all references in all templates and add a '/' before every filefield url, like "/{{ car.photo.url }}, not defining MEDIA_URL in the settings.py file b) do it the "correct" way and change all references in all templates to all static files to include {{ MEDIA_URL}}, like "{{ MEDIA_URL }}/pics/photo1.jpg" and define MEDIA_URL in the settings.py to a different path that doesn't overlap with other application URLs ( / would be out of the question ) Since this app has stuff like javascript and swf files that were created and updated by the design/html agency and they are assuming some paths right out of the root, b) would be very hard to achieve. a) would be possible, but it would require care - and perhaps we would find that the MEDIA_URL setting was being used somewhere else. I think allowing the developer to choose if MEDIA_URL urls should be ignored or not by localeurl may make it integration with some existing apps easier (if you have a strange case like mine :-P ) Thanks for accepting the suggestion.
  • Jun 22, 2009
    issue 25 (MEDIA_URL='/') Status changed by joost@cassee.net   -   An interesting use-case. I guess you have your media url root in the photo.url field? In any case I will implement your suggestion, with a default value of True for the LOCALE_IGNORE_MEDIA_URL setting. Thanks for the suggestion.
    Status: Accepted
    An interesting use-case. I guess you have your media url root in the photo.url field? In any case I will implement your suggestion, with a default value of True for the LOCALE_IGNORE_MEDIA_URL setting. Thanks for the suggestion.
    Status: Accepted
  • Jun 22, 2009
    issue 25 (MEDIA_URL='/') reported by nuno.lists   -   I was trying out localeurl in my app, which needs to have MEDIA_URL='/'. However, this means that all URLs will be ignored by localeurl because of the way utils.is_locale_independent() works: if settings.MEDIA_URL and path.startswith(settings.MEDIA_URL): return True My suggestion is to add a setting to settings.py that allows the app developer to disable this verification: IGNORE_MEDIA_URL = getattr(settings, 'LOCALE_IGNORE_MEDIA_URL', True) and change line 22 of utils.py to: if localeurl.settings.IGNORE_MEDIA_URL and settings.MEDIA_URL and path.startswith(settings.MEDIA_URL): The reason MEDIA_URL is set to '/' is because if I don't set it at all, the url of a FileField becomes relative, i.e: {{ car.photo.url }} would be photos/car1.gif instead of /photos/car1.gif And I know this means a harder time configuring LOCALE_INDEPENDENT_PATHS :), but I think it's still easier than changing the way the whole app is built. The proposed solutions allows applications with unusual MEDIA_URL settings to work with localeurl. I'm sorry if this has any other trivial solution, but I didn't find it on my own.
    I was trying out localeurl in my app, which needs to have MEDIA_URL='/'. However, this means that all URLs will be ignored by localeurl because of the way utils.is_locale_independent() works: if settings.MEDIA_URL and path.startswith(settings.MEDIA_URL): return True My suggestion is to add a setting to settings.py that allows the app developer to disable this verification: IGNORE_MEDIA_URL = getattr(settings, 'LOCALE_IGNORE_MEDIA_URL', True) and change line 22 of utils.py to: if localeurl.settings.IGNORE_MEDIA_URL and settings.MEDIA_URL and path.startswith(settings.MEDIA_URL): The reason MEDIA_URL is set to '/' is because if I don't set it at all, the url of a FileField becomes relative, i.e: {{ car.photo.url }} would be photos/car1.gif instead of /photos/car1.gif And I know this means a harder time configuring LOCALE_INDEPENDENT_PATHS :), but I think it's still easier than changing the way the whole app is built. The proposed solutions allows applications with unusual MEDIA_URL settings to work with localeurl. I'm sorry if this has any other trivial solution, but I didn't find it on my own.
  • Jun 02, 2009
    r86 (Added the change_locale view contributed by Panos Laganakos.) committed by joost@cassee.net   -   Added the change_locale view contributed by Panos Laganakos.
    Added the change_locale view contributed by Panos Laganakos.
  • May 31, 2009
    issue 22 (Error in usage.html: request context processor shown in plac...) Status changed by joost@cassee.net   -   Fixed in r85. Thanks Carl!
    Status: FixedInSvn
    Fixed in r85. Thanks Carl!
    Status: FixedInSvn
  • May 31, 2009
    r85 (Updated to Sphinx 0.5.2. Added i18n context processor to exa...) committed by joost@cassee.net   -   Updated to Sphinx 0.5.2. Added i18n context processor to example.
    Updated to Sphinx 0.5.2. Added i18n context processor to example.
  • May 31, 2009
    issue 23 (problem with login url ) Status changed by joost@cassee.net   -   My apologies for the long delay. Can you try to bring 'localeurl' to the top of the INSTALLED_APPLICATIONS list?
    Status: MoreInfo
    My apologies for the long delay. Can you try to bring 'localeurl' to the top of the INSTALLED_APPLICATIONS list?
    Status: MoreInfo
  • May 21, 2009
    issue 24 (Add language to session in middleware...) Status changed by joost@cassee.net   -   Thanks for the suggestion, but I will not implement this idea. One of the goals of localeurl is to avoid changing state on a GET request. Your suggestion will do exactly that. Additionally, it should not be needed if all URLs are written correctly. If you want to do this in your project, you might add a simple middleware with this code yourself and add it after LocaleurlMiddleware.
    Status: WontFix
    Thanks for the suggestion, but I will not implement this idea. One of the goals of localeurl is to avoid changing state on a GET request. Your suggestion will do exactly that. Additionally, it should not be needed if all URLs are written correctly. If you want to do this in your project, you might add a simple middleware with this code yourself and add it after LocaleurlMiddleware.
    Status: WontFix
  • May 20, 2009
    issue 24 (Add language to session in middleware...) reported by danatk   -   Maybe it would be a good idea to add the language selected to the session, like in the django set_language view: if hasattr(request, 'session'): request.session['django_language'] = lang_code else: response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang_code)
    Maybe it would be a good idea to add the language selected to the session, like in the django set_language view: if hasattr(request, 'session'): request.session['django_language'] = lang_code else: response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang_code)
  • May 15, 2009
    issue 23 (problem with login url ) reported by ramzes.yan   -   What steps will reproduce the problem? 1. if i have url like this http://localhost/accounts/login/?next=/de/accounts/profile/ i got a default locale not de locale What is the expected output? What do you see instead? What version of Django are you using? On what operating system? django 1.1 What version of django-localeurl are you using? svn trunk revision 84 Please provide any additional information below. sorry for my poor english
    What steps will reproduce the problem? 1. if i have url like this http://localhost/accounts/login/?next=/de/accounts/profile/ i got a default locale not de locale What is the expected output? What do you see instead? What version of Django are you using? On what operating system? django 1.1 What version of django-localeurl are you using? svn trunk revision 84 Please provide any additional information below. sorry for my poor english
 
Hosted by Google Code