Beispiel #1
0
    def GET(self):
        # Set language preference on the first load of home page
        global lang_in_use
        if not lang_in_use:
            lang_in_use = seafile_rpc.get_config("lang_in_use")
            if not lang_in_use:
                seafile_rpc.set_config("lang_in_use", DEFAULT_LANG)
                lang_in_use = DEFAULT_LANG

            gettext.translation("messages", localedir, languages=[lang_in_use]).install(True)

            default_options["lang"] = lang_in_use
        return self.show_repos()
Beispiel #2
0
    def GET(self):
        # Set language preference on the first load of home page
        global lang_in_use
        if not lang_in_use:
            lang_in_use = seafile_rpc.get_config('lang_in_use')
            if not lang_in_use:
                seafile_rpc.set_config('lang_in_use', DEFAULT_LANG)
                lang_in_use = DEFAULT_LANG

            gettext.translation('messages', localedir,
                                languages=[lang_in_use]).install(True)

            default_options['lang'] = lang_in_use
        return self.show_repos()