add localization for settings page

yhy
Dawn_Ocean 2024-03-07 14:30:45 +08:00
parent d995c6ed43
commit 3232994fb2
3 changed files with 24 additions and 2 deletions

View File

@ -58,11 +58,11 @@ export default class SettingsPage extends Component {
</Picker>
</View>
<AtButton type='secondary' onClick={this.handleAbout.bind(this)}>
EVA Notify
{pt.get().settingsPage.aboutText}
</AtButton>
<AtButton type='primary' onClick={this.handleQuit.bind(this)}>
退
{pt.get().settingsPage.quitText}
</AtButton>
</View>
);

View File

@ -0,0 +1,14 @@
export interface SettingsPageText {
aboutText: string;
quitText: string;
}
export const settingsPageZhCn: SettingsPageText = {
aboutText: '关于 EVA Notify',
quitText: '退出账号',
};
export const settingsPageEnUs: SettingsPageText = {
aboutText: 'About EVA Notify',
quitText: 'Log Out',
};

View File

@ -2,12 +2,18 @@ import { PageFooterText, pageFooterZhCn, pageFooterEnUs } from './PageFooter';
import { MainPageText, mainPageZhCn, mainPageEnUs } from './MainPage';
import { UserPageText, userPageZhCn, userPageEnUs } from './UserPage';
import { TabBarText, tabBarEnUs, tabBarZhCn } from './TabBar';
import {
SettingsPageText,
settingsPageEnUs,
settingsPageZhCn,
} from './SettingsPage';
interface TextRecord {
pageFooter: PageFooterText;
mainPage: MainPageText;
userPage: UserPageText;
tabBar: TabBarText;
settingsPage: SettingsPageText;
}
const textZhCn: TextRecord = {
@ -15,6 +21,7 @@ const textZhCn: TextRecord = {
mainPage: mainPageZhCn,
userPage: userPageZhCn,
tabBar: tabBarZhCn,
settingsPage: settingsPageZhCn,
};
const textEnUs: TextRecord = {
@ -22,6 +29,7 @@ const textEnUs: TextRecord = {
mainPage: mainPageEnUs,
userPage: userPageEnUs,
tabBar: tabBarEnUs,
settingsPage: settingsPageEnUs,
};
// type Lang = 'zh_CN' | 'en_US' | ...;