INNER CODE UNIT · Python

_persist_locale

slive777/OpenAver · web/app.py:597

            def _persist_locale(cfg):
                cfg.setdefault('general', {})['locale'] = locale
            mutate_config(_persist_locale)
        except Exception as e:
            logger.warning("[i18n] 首次偵測語系寫入 config 失敗: %s", e)

    merged_translations = get_merged_translations(locale)

    def _t_bound(key, **params):
        return _t(key, locale=locale, **params)

    # 63c-3:per-source routable / available 注入(CD-63c-9)。在 save_config 之後 mutate,
    # 確保 transient 欄位不被寫回 config.json。_advanced_search_bootstrap.html 做
    # config.sources|tojson → routable/available 自動帶出(不需逐欄改 template)。
    # builtin 永遠 routable+available;metatube 依 runtime 連線 + availability gate。
    from core.metatube.state import metatube_state as _mt_state
    _avail_map = _mt_state.availability_map()
    _mt_connected = _mt_state.is_connected

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…