/** @format */ import { defineI18nProperties, defineI18nProperty } from './useI18n'; import { isEnableLocale } from './utils'; export function initNavigationBarI18n(navigationBar: QinApp.PageNavigationBar) { if (isEnableLocale()) { return defineI18nProperties(navigationBar, [ ['titleText'], ['searchInput', 'placeholder'], ['buttons', 'text'], ]) as [boolean, boolean]; } } export function initPullToRefreshI18n( pullToRefresh: QinApp.PageRefreshOptions, ) { if (isEnableLocale()) { const CAPTION = 'caption'; return defineI18nProperties(pullToRefresh, [ ['contentdown', CAPTION], ['contentover', CAPTION], ['contentrefresh', CAPTION], ]) as [boolean, boolean, boolean]; } } export function initTabBarI18n(tabBar: QinApp.TabBarOptions) { if (isEnableLocale() && tabBar.list) { tabBar.list.forEach((item) => { defineI18nProperty(item, ['text']); }); } return tabBar; }