add localization for tab-bar
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export interface TabBarText {
|
||||
indexText: string;
|
||||
repairText: string;
|
||||
userText: string;
|
||||
}
|
||||
|
||||
export const tabBarZhCn: TabBarText = {
|
||||
indexText: '主页',
|
||||
repairText: '维修',
|
||||
userText: '我的',
|
||||
};
|
||||
|
||||
export const tabBarEnUs: TabBarText = {
|
||||
indexText: 'Home',
|
||||
repairText: 'Repair',
|
||||
userText: 'Account',
|
||||
};
|
||||
@@ -1,27 +1,31 @@
|
||||
import { PageFooterText, pageFooterZhCn, pageFooterEnUs } from './PageFooter';
|
||||
import { MainPageText, mainPageZhCn, mainPageEnUs } from './MainPage';
|
||||
import { UserPageText, userPageZhCn, userPageEnUs } from './UserPage';
|
||||
import { TabBarText, tabBarEnUs, tabBarZhCn } from './TabBar';
|
||||
|
||||
interface TextRecord {
|
||||
pageFooter: PageFooterText;
|
||||
mainPage: MainPageText;
|
||||
userPage: UserPageText;
|
||||
tabBar: TabBarText;
|
||||
}
|
||||
|
||||
const textZhCn: TextRecord = {
|
||||
pageFooter: pageFooterZhCn,
|
||||
mainPage: mainPageZhCn,
|
||||
userPage: userPageZhCn,
|
||||
tabBar: tabBarZhCn,
|
||||
};
|
||||
|
||||
const textEnUs: TextRecord = {
|
||||
pageFooter: pageFooterEnUs,
|
||||
mainPage: mainPageEnUs,
|
||||
userPage: userPageEnUs,
|
||||
tabBar: tabBarEnUs,
|
||||
};
|
||||
|
||||
// type Lang = 'zh_CN' | 'en_US' | ...;
|
||||
type Lang = 'zh_CN' | 'en_US';
|
||||
export type Lang = 'zh_CN' | 'en_US';
|
||||
|
||||
class PlainText {
|
||||
private readonly textZhCn: TextRecord;
|
||||
|
||||
Reference in New Issue
Block a user