#26328: jsi18n - get_javascript_catalog obscure and hardcoded english
-------------------------------------+-------------------------------------
     Reporter:  cristianocca         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:                       |                  Version:  1.9
  Internationalization               |
     Severity:  Normal               |               Resolution:
     Keywords:  jsi18n               |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by cristianocca):

 I would like to add, the test calls my attention that it almost seems like
 translations are supposed to always have the messages ids in english, look
 at this:


 {{{
 def test_jsi18n_with_missing_en_files(self):
         """
         The javascript_catalog shouldn't load the fallback language in the
         case that the current selected language is actually the one
 translated
         from, and hence missing translation files completely.

         This happens easily when you're translating from English to other
         languages and you've set settings.LANGUAGE_CODE to some other
 language
         than English.
         """
         with self.settings(LANGUAGE_CODE='es'), override('en-us'):
             response = self.client.get('/jsi18n/')
             self.assertNotContains(response, 'esto tiene que ser
 traducido')
 }}}

 If I read it correctly, it makes the default language 'es' and tries to
 get an english translation, and the expected result is to get back an
 english translation EVEN if the english locale is not even defined (look
 at the languages inside the locale folder of the tests). So basically the
 expected behaviour is to get a translation for a language that is not even
 defined and make the test pass by giving english special treatment in the
 framework.

 "The javascript_catalog shouldn't load the fallback language in the case
 that the current selected language is actually the one translated from,
 and hence missing translation files completely." --> The logic behind this
 makes sense, but the actual implementation is completely different (only
 favoring english) and not keeping in mind that you may have multiple apps
 with different "base" language so you can't relly on a single setting

--
Ticket URL: <https://code.djangoproject.com/ticket/26328#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.bc44fbd4b17738105aed58a6814860fd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to