Front: Add translations for page titles

This commit is contained in:
Arthi-chaud
2022-09-12 10:30:05 +02:00
parent 21adec63c1
commit 4b88870963
2 changed files with 8 additions and 5 deletions
+4 -3
View File
@@ -5,16 +5,17 @@ import HomeView from './views/HomeView';
import { NavigationContainer } from '@react-navigation/native';
import { useSelector } from 'react-redux';
import SongLobbyView from './views/SongLobbyView';
import { translate } from './i18n/i18n';
const Stack = createNativeStackNavigator();
export const protectedRoutes = <>
<Stack.Screen name="Home" component={HomeView} options={{ title: 'Welcome' }} />
<Stack.Screen name="Song" component={SongLobbyView} options={{ title: 'Play' }} />
<Stack.Screen name="Home" component={HomeView} options={{ title: translate('welcome') }} />
<Stack.Screen name="Song" component={SongLobbyView} options={{ title: translate('play') }} />
</>;
export const publicRoutes = <React.Fragment>
<Stack.Screen name="Login" component={AuthenticationView} options={{}} />
<Stack.Screen name="Login" component={AuthenticationView} options={{ title: translate('signinBtn')}} />
</React.Fragment>;
export const Router = () => {
+4 -2
View File
@@ -1,5 +1,5 @@
export const en = {
welcome: 'Welcome to Chromacase',
welcome: 'Welcome',
signoutBtn: 'Sign out',
signinBtn: 'Sign in',
playBtn: 'Play',
@@ -7,10 +7,11 @@ export const en = {
chapters: 'Chapters',
bestScore: 'Best Score',
lastScore: 'Last Score',
play: 'Play'
};
export const fr: typeof en = {
welcome: 'Bienvenue sur Chromacase',
welcome: 'Bienvenue',
signoutBtn: 'Se déconnecter',
signinBtn: 'Se connecter',
playBtn: 'Jouer',
@@ -18,4 +19,5 @@ export const fr: typeof en = {
chapters: 'Chapitres',
bestScore: 'Meilleur Score',
lastScore: 'Dernier Score',
play: 'Jouer'
};