Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User menu Item Translate #460

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions login-workflow/example/src/components/UserMenuExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type UserMenuExampleProps = {
export const UserMenuExample: React.FC<UserMenuExampleProps> = (props) => {
const { onToggleRTL, onToggleTheme } = props;
const theme = useExtendedTheme();
const { i18n } = useTranslation();
const { i18n, t } = useTranslation();
const navigation = useNavigation<NativeStackNavigationProp<any>>();
const app = useApp();
const handleLanguageChange = async (newLanguage: string): Promise<any> => {
Expand Down Expand Up @@ -70,14 +70,14 @@ export const UserMenuExample: React.FC<UserMenuExampleProps> = (props) => {
];

const menuItems: InfoListItemProps[] = [
{ title: 'Toggle RTL', icon: SwapIcon, onPress: (): void => onToggleRTL() },
{ title: t('USER_MENU.TOGGLE_RTL'), icon: SwapIcon, onPress: (): void => onToggleRTL() },
{
title: 'Toggle Theme',
title: t('USER_MENU.TOGGLE_THEME'),
icon: InvertColorsIcon,
onPress: (): void => onToggleTheme(),
},
{
title: 'Language',
title: t('USER_MENU.LANGUAGE'),
icon: { name: 'translate' },
rightComponent: (
<SelectDropdown
Expand All @@ -95,8 +95,8 @@ export const UserMenuExample: React.FC<UserMenuExampleProps> = (props) => {
/>
),
},
{ title: 'Change Password', icon: LockIcon, onPress: (): void => changePassword() },
{ title: 'Logout', icon: ExitToAppIcon, onPress: (): void => logout() },
{ title: t('USER_MENU.CHANGE_PASSWORD'), icon: LockIcon, onPress: (): void => changePassword() },
{ title: t('USER_MENU.LOG_OUT'), icon: ExitToAppIcon, onPress: (): void => logout() },
];

return (
Expand Down
3 changes: 3 additions & 0 deletions login-workflow/example/translations/dictionary/chinese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const resources: AppTranslationsFile = {
LOG_OUT: '登出',
CHANGE_PASSWORD: '更改密碼',
MY_ACCOUNT: '我的賬戶',
TOGGLE_RTL: '切换 RTL',
TOGGLE_THEME: '切换主题',
LANGUAGE: '语言',
},
ORGANAIZATION_DETAILS: {
NAME: '机构名称',
Expand Down
3 changes: 3 additions & 0 deletions login-workflow/example/translations/dictionary/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const resources: AppTranslationsFile = {
LOG_OUT: 'Log out',
CHANGE_PASSWORD: 'Change Password',
MY_ACCOUNT: 'My Account',
TOGGLE_RTL: 'Toggle RTL',
TOGGLE_THEME: 'Toggle Theme',
LANGUAGE: 'Language',
},
ORGANAIZATION_DETAILS: {
NAME: 'Organisation Name',
Expand Down
3 changes: 3 additions & 0 deletions login-workflow/example/translations/dictionary/french.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const resources: AppTranslationsFile = {
LOG_OUT: 'Se déconnecter',
CHANGE_PASSWORD: 'changer le mot de passe',
MY_ACCOUNT: 'Mon compte',
TOGGLE_RTL: 'basculer RTL',
TOGGLE_THEME: 'basculer le thème',
LANGUAGE: 'Langue',
},
ORGANAIZATION_DETAILS: {
NAME: 'Nom de lorganisme',
Expand Down
3 changes: 3 additions & 0 deletions login-workflow/example/translations/dictionary/portuguese.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const resources: AppTranslationsFile = {
LOG_OUT: 'Sair',
CHANGE_PASSWORD: 'alterar a senha',
MY_ACCOUNT: 'Minha conta',
TOGGLE_RTL: 'Alternar RTL',
TOGGLE_THEME: 'Alternar tema',
LANGUAGE: 'Linguagem ',
},
ORGANAIZATION_DETAILS: {
NAME: 'Nome da organização',
Expand Down
3 changes: 3 additions & 0 deletions login-workflow/example/translations/dictionary/spanish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const resources: AppTranslationsFile = {
LOG_OUT: 'Cerrar sesión',
CHANGE_PASSWORD: 'cambiar la contraseña',
MY_ACCOUNT: 'Mi cuenta',
TOGGLE_RTL: 'Alternar RTL',
TOGGLE_THEME: 'Alternar tema',
LANGUAGE: 'Idioma',
},
ORGANAIZATION_DETAILS: {
NAME: 'nombre de la organización',
Expand Down
3 changes: 3 additions & 0 deletions login-workflow/example/translations/dictionary/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export type AppTranslations = {
LOG_OUT: string;
CHANGE_PASSWORD: string;
MY_ACCOUNT: string;
TOGGLE_RTL: string;
TOGGLE_THEME: string;
LANGUAGE: string;
};
ORGANAIZATION_DETAILS: {
NAME: string;
Expand Down
Loading