﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20280	i18n Javascript code is invalid - lack of Javascript code generator for GAE too	anonymous	nobody	"Function javascript_catalog is invalid why:
1. It is not possible to call this function without use Django compatible request (Python allow to break it but is is nto designed to do it).
2. It is not possible to pass language parameters (need some magic djangoRequest.GET['language'] = self.getLanguage())
3. There IS VERY BAD ASSUMPTION that default language is en - what is false in many regions of globe :) i.e. I have to translate Polish to Polish because loader not load Polish as first language as it defined in settings and django/template uses but loads English for Polish :):):) see INVALID CODE.
Should any default language loaded first.

    # first load all english languages files for defaults!!! WHY English is not default deprecate it !!!
    for path in paths:
        try:
            catalog = gettext_module.translation(domain, path, ['en'])
            t.update(catalog._catalog)
        except IOError:
            pass
        else:
            # 'en' is the selected language and at least one of the packages
            # listed in `packages` has an 'en' catalog
            if en_selected:
                en_catalog_missing = False
    # next load the settings.LANGUAGE_CODE translations if it isn't english
    if default_locale != 'en':
        for path in paths:
            try:
                catalog = gettext_module.translation(domain, path, [default_locale])
            except IOError:
                catalog = None
            if catalog is not None:
                t.update(catalog._catalog)
    # last load the currently selected language, if it isn't identical to the default.
    if locale != default_locale:
        # If the currently selected language is English but it doesn't have a
        # translation catalog (presumably due to being the language translated
        # from) then a wrong language catalog might have been loaded in the
        # previous step. It needs to be discarded.
        if en_selected and en_catalog_missing:
            t = {}
        else:
            locale_t = {}
            for path in paths:
                try:
                    catalog = gettext_module.translation(domain, path, [locale])
                except IOError:
                    catalog = None
                if catalog is not None:
                    locale_t.update(catalog._catalog)
            if locale_t:
                t = locale_t
"	Bug	closed	Translations	1.3	Normal	duplicate	i18n	bmispelon@…	Unreviewed	0	0	0	0	0	0
