예제 #1
0
파일: config.py 프로젝트: matrixorz/ikaaro
    def get_namespace(self, resource, context):
        ws_languages = context.root.get_value('website_languages')

        # Active languages
        default = ws_languages[0]
        active = []
        for code in ws_languages:
            language_name = get_language_name(code)
            active.append({
                'code': code,
                'name': language_name,
                'isdefault': code == default})

        # Not active languages
        not_active = [
            x for x in get_languages() if x['code'] not in ws_languages ]
        not_active.sort(lambda x, y: cmp(x['name'], y['name']))

        # Ok
        return {
            'active_languages': active,
            'not_active_languages': not_active}
예제 #2
0
    def get_namespace(self, resource, context):
        ws_languages = context.root.get_value('website_languages')

        # Active languages
        default = ws_languages[0]
        active = []
        for code in ws_languages:
            language_name = get_language_name(code)
            active.append({
                'code': code,
                'name': language_name,
                'isdefault': code == default
            })

        # Not active languages
        not_active = [
            x for x in get_languages() if x['code'] not in ws_languages
        ]
        not_active.sort(lambda x, y: cmp(x['name'], y['name']))

        # Ok
        return {'active_languages': active, 'not_active_languages': not_active}
예제 #3
0
def get_all_languages(self):
    """
    Returns all ISO languages, used by 'manage_languages'.
    """
    return i18n.get_languages() + self.get_user_defined_languages()
예제 #4
0
 def get_all_languages(self):
     """
     Returns all ISO languages, used by 'manage_languages'.
     """
     return get_languages()
예제 #5
0
 def get_all_languages(self):
     """
     Returns all ISO languages, used by 'manage_languages'.
     """
     return get_languages()