From 8a911609ef83b9846a349291521b45a6b50284e2 Mon Sep 17 00:00:00 2001 From: Batr Kanzitelli Date: Mon, 10 Jan 2022 21:30:12 +0100 Subject: [PATCH] translation example --- src/screens/index.ts | 15 +++++++-------- src/services/translate/translations.ts | 6 ++++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/screens/index.ts b/src/screens/index.ts index 643edda..b6abb1e 100644 --- a/src/screens/index.ts +++ b/src/screens/index.ts @@ -1,19 +1,18 @@ import {generateRNNScreens} from 'rnn-screens'; import {gestureHandlerRootHOC as withGestureHandler} from 'react-native-gesture-handler'; -import {withBottomTab, withRightButtons, withTitle} from '../services/navigation/options'; import {withStores} from '../stores'; -import {withServices} from '../services'; +import {withServices, services} from '../services'; +import {withBottomTab, withRightButtons, withTitle} from '../services/navigation/options'; import {Main} from './main'; import {Settings} from './settings'; import {Example} from './screen-sample'; -import {services} from '../services'; // Describe your screens here export const screens = generateRNNScreens( { - Main: { + Main: () => ({ component: Main, options: { topBar: { @@ -22,7 +21,7 @@ export const screens = generateRNNScreens( }, ...withBottomTab('Main', 'newspaper'), }, - }, + }), Settings: { component: Settings, options: { @@ -33,15 +32,15 @@ export const screens = generateRNNScreens( }, }, - Example: { + Example: () => ({ component: Example, options: { topBar: { - ...withTitle('Example'), + ...withTitle(services.t.do('example.title')), }, ...withBottomTab('Example', 'construct'), }, - }, + }), }, [withGestureHandler, withStores, withServices], ); diff --git a/src/services/translate/translations.ts b/src/services/translate/translations.ts index 0a4756f..7096a69 100644 --- a/src/services/translate/translations.ts +++ b/src/services/translate/translations.ts @@ -2,6 +2,9 @@ export const en = { home: { title: 'Home', }, + example: { + title: 'Example', + }, section: { navigation: { title: 'Navigation', @@ -20,6 +23,9 @@ export const ru = { home: { title: 'Хоум', }, + example: { + title: 'Пример', + }, section: { navigation: { title: 'Навигация',