Browse Source

FIX | Add translate to terms and privacy pages| Privacy and terms files

merge-requests/7/head
JetUp 2 years ago
parent
commit
63f7a35b25
  1. 2
      src/i18n/locales/en/index.ts
  2. 5
      src/i18n/locales/en/page-title.translation.ts
  3. 3
      src/i18n/locales/hi/index.tsx
  4. 5
      src/i18n/locales/hi/page-title.translation.ts
  5. 3
      src/i18n/locales/ua/index.ts
  6. 5
      src/i18n/locales/ua/page-title.translation.ts
  7. 2
      src/i18n/types/index.ts
  8. 0
      src/module/privacy-policy/config/privacy-texts.ts
  9. 8
      src/module/privacy-policy/screens/privacy-policy.tsx
  10. 2
      src/module/root/navigations-groups/on-boardings-group.tsx
  11. 6
      src/module/root/screens/questions.tsx
  12. 5
      src/module/root/screens/settings.screen.tsx
  13. 1
      src/module/shared/components/header/header.component.tsx
  14. 6
      src/module/shared/components/text-containers/main-text-container.tsx
  15. 5
      src/module/shared/interfaces/page-titles.ts
  16. 6
      src/module/terms-of-use/config/use-of-terms.translations.ts
  17. 22
      src/module/terms-of-use/screens/use-of-terms.tsx

2
src/i18n/locales/en/index.ts

@ -3,9 +3,11 @@ import {settingTranslation} from './settings.translation'; @@ -3,9 +3,11 @@ import {settingTranslation} from './settings.translation';
import {onBoardingTranslation} from './steps.translation';
import {buttonsTranslation} from './onBoardingButton.translation';
import {customPack} from './custom-pack.translation';
import {pageTitles} from './page-title.translation';
export const en: MainLocaleModule = {
settingTranslation,
stepTranslation: onBoardingTranslation,
buttonsTranslation,
customPack,
pageTitles,
};

5
src/i18n/locales/en/page-title.translation.ts

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
export const pageTitles = {
setting: 'Setting',
privacy: 'Privacy Policy',
terms: 'Terms and conditions',
}

3
src/i18n/locales/hi/index.tsx

@ -3,9 +3,12 @@ import {settingTranslation} from './settings.translation'; @@ -3,9 +3,12 @@ import {settingTranslation} from './settings.translation';
import {onBoardingTranslation} from './steps.translation';
import { buttonsTranslation } from './onBoardingButton.translation';
import {customPack} from './custom-pack.translation';
import {pageTitles} from './page-title.translation';
export const hi: MainLocaleModule = {
settingTranslation,
stepTranslation: onBoardingTranslation,
buttonsTranslation,
customPack,
pageTitles,
};

5
src/i18n/locales/hi/page-title.translation.ts

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
export const pageTitles = {
setting: 'सिग',
privacy: 'गपनयति',
terms: 'नियम और शर',
}

3
src/i18n/locales/ua/index.ts

@ -3,10 +3,13 @@ import {settingTranslation} from './settings.translation'; @@ -3,10 +3,13 @@ import {settingTranslation} from './settings.translation';
import {onBoardingTranslationUa} from './step.translation';
import { buttonsTranslation } from './onBoardingButton.translation';
import {customPack} from './custom-pack.translation';
import {pageTitles} from './page-title.translation';
export const ua: MainLocaleModule = {
stepTranslation: onBoardingTranslationUa,
settingTranslation: settingTranslation,
buttonsTranslation,
customPack,
pageTitles
};

5
src/i18n/locales/ua/page-title.translation.ts

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
export const pageTitles = {
setting: 'Налаштування',
privacy: 'Політика \n конфіденційності',
terms: 'Правила та умови',
}

2
src/i18n/types/index.ts

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
import { CustomPack } from '../../module/shared/interfaces/custom-pack';
import { PageTitles } from '../../module/shared/interfaces/page-titles';
import { Buttons } from './buttons.types';
import {OnBoardingLocale} from './on-boarding.types';
import {SettingLocale} from './settings.types';
@ -7,4 +8,5 @@ export interface MainLocaleModule { @@ -7,4 +8,5 @@ export interface MainLocaleModule {
settingTranslation: SettingLocale.Core;
buttonsTranslation: Buttons;
customPack: CustomPack;
pageTitles: PageTitles;
}

0
src/module/shared/config/privacy-texts.ts → src/module/privacy-policy/config/privacy-texts.ts

8
src/module/privacy-policy/screens/privacy-policy.tsx

@ -9,7 +9,7 @@ import { @@ -9,7 +9,7 @@ import {
ScreenLayout,
} from '../../shared';
import { MainTextContainer } from '../../shared/components/text-containers/main-text-container';
import { privacy } from '../../shared/config/privacy-texts';
import { privacy } from '../config/privacy-texts';
interface IProps extends IRouteParams {}
export const PrivacyPolicy: React.FC<IProps> = ({navigation}) => {
@ -23,8 +23,6 @@ export const PrivacyPolicy: React.FC<IProps> = ({navigation}) => { @@ -23,8 +23,6 @@ export const PrivacyPolicy: React.FC<IProps> = ({navigation}) => {
const lang = i18n.language;
console.log('lang:', i18n.language);
return (
<ScreenLayout
backgroundColor={colors.primaryColor}
@ -33,8 +31,8 @@ export const PrivacyPolicy: React.FC<IProps> = ({navigation}) => { @@ -33,8 +31,8 @@ export const PrivacyPolicy: React.FC<IProps> = ({navigation}) => {
headerComponent={
<Header
leftIcon="arrow"
title="Privacy Policy"
onPressLeft={() => goBack()}
title={t('pageTitles.privacy')}
onPressLeft={() => navigation.goBack()}
rightIcon="none"
/>
}>

2
src/module/root/navigations-groups/on-boardings-group.tsx

@ -67,7 +67,7 @@ export const OnboardingGroup: FC = () => { @@ -67,7 +67,7 @@ export const OnboardingGroup: FC = () => {
screenOptions={{
headerShown: false,
}}
initialRouteName={RouteKey.LanguageSelect}>
initialRouteName={RouteKey.Loading}>
<Stack.Screen name={RouteKey.Questions} component={Questions} />
<Stack.Screen name={RouteKey.Package} component={Game} />
<Stack.Screen name={RouteKey.Onboarding} component={Onboarding} />

6
src/module/root/screens/questions.tsx

@ -86,7 +86,7 @@ export const Questions: React.FC<IProps> = ({navigation, route}) => { @@ -86,7 +86,7 @@ export const Questions: React.FC<IProps> = ({navigation, route}) => {
style={{width: 20, height: 20}}
/>
}
width={101}
width={'30%'}
/>
<PrimaryBtn
onPress={() => {
@ -98,7 +98,7 @@ export const Questions: React.FC<IProps> = ({navigation, route}) => { @@ -98,7 +98,7 @@ export const Questions: React.FC<IProps> = ({navigation, route}) => {
style={{width: 20, height: 20}}
/>
}
width={101}
width={'30%'}
/>
<PrimaryBtn
onPress={() => {
@ -110,7 +110,7 @@ export const Questions: React.FC<IProps> = ({navigation, route}) => { @@ -110,7 +110,7 @@ export const Questions: React.FC<IProps> = ({navigation, route}) => {
style={{width: 20, height: 20}}
/>
}
width={101}
width={'30%'}
/>
</View>
</View>

5
src/module/root/screens/settings.screen.tsx

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
import React, {FC} from 'react';
import { useTranslation } from 'react-i18next';
import {StyleSheet, View} from 'react-native';
import {SettingsItem} from '../../setting/components/Settings-Item.component';
import {SettingsData} from '../../setting/config/data-setting.config';
@ -9,6 +10,8 @@ interface IProps extends IRouteParams {} @@ -9,6 +10,8 @@ interface IProps extends IRouteParams {}
export const Setting: FC<IProps> = ({route, navigation}) => {
const {previous_screen, title} = route.params;
const {t} = useTranslation();
return (
<ScreenLayout
backgroundColor={colors.primaryColor}
@ -17,7 +20,7 @@ export const Setting: FC<IProps> = ({route, navigation}) => { @@ -17,7 +20,7 @@ export const Setting: FC<IProps> = ({route, navigation}) => {
<Header
leftIcon="arrow"
rightIcon="inst"
title={title}
title={t('pageTitles.setting')}
onPressLeft={() => navigation.navigate(previous_screen)}
/>
}>

1
src/module/shared/components/header/header.component.tsx

@ -58,6 +58,7 @@ const styles = StyleSheet.create({ @@ -58,6 +58,7 @@ const styles = StyleSheet.create({
fontSize: 24,
color: '#99EDCC',
fontWeight: 'bold',
textAlign: 'center',
},
gamerTitle: {
backgroundColor: '#2C205C',

6
src/module/shared/components/text-containers/main-text-container.tsx

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
import {StyleSheet, Text, View} from 'react-native';
import React from 'react';
import { colors } from '../../colors';
import { ScrollView } from 'react-native-gesture-handler';
interface IProps {
text: string
@ -9,9 +10,11 @@ interface IProps { @@ -9,9 +10,11 @@ interface IProps {
export const MainTextContainer: React.FC<IProps> = ({text}) => {
return (
<View style={styles.container}>
<ScrollView contentContainerStyle={{paddingBottom: 0}}>
<Text style={styles.description}>
{text}
</Text>
</ScrollView>
</View>
);
};
@ -22,11 +25,12 @@ const styles = StyleSheet.create({ @@ -22,11 +25,12 @@ const styles = StyleSheet.create({
borderRadius: 20,
paddingVertical: 32,
paddingHorizontal: 20,
maxHeight: '80%'
},
description: {
lineHeight: 32,
fontSize: 22,
color: colors.purple,
textAlign: 'center'
textAlign: 'auto'
}
});

5
src/module/shared/interfaces/page-titles.ts

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
export interface PageTitles {
setting: string,
privacy: string,
terms: string,
}

6
src/module/terms-of-use/config/use-of-terms.translations.ts

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
export const terms = {
en: ' You agree to use our application for legitimate purposes and not for any illegal or unauthorized purpose, including without limitation, in violation of any intellectual property or privacy law. By agreeing to the Terms, you represent and warrant that you are at least the age of majority in your state or province of residence and are legally capable of entering into a binding contract',
ua: 'Ви погоджуєтеся використовувати нашу програму в законних цілях, а не в незаконних або несанкціонованих цілях, у тому числі, без обмежень, з порушенням будь-якого закону про інтелектуальну власність або конфіденційність. Погоджуючись із Умовами, ви заявляєте та гарантуєте, що досягли повноліття у вашому штаті чи провінції та маєте законну правоздатність укладати обов’язковий договір',
hi: 'आप हम आवदन कध उदिए उपयग करनिए सहमत ह, न किि अवध य अनधित उदय किए, जिसमिि, कििक सपदपनयतन क उलघन शिल ह। शर सहमत हकर, आप परतिििव करत और वि आप अपनय यिस कत म कम स कम वयसकत उमर क और बयक अनध मरवश करनप स सकषम ह',
};

22
src/module/terms-of-use/screens/use-of-terms.tsx

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import {View} from 'react-native';
import {
colors,
@ -9,14 +10,19 @@ import { @@ -9,14 +10,19 @@ import {
} from '../../shared';
import { MainTextContainer } from '../../shared/components/text-containers/main-text-container';
import { TermsText } from '../config/terms-text';
import { terms } from '../config/use-of-terms.translations';
interface IProps extends IRouteParams {}
export const UseOfTerms: React.FC<IProps> = ({navigation}) => {
const goBack = () => {
navigation.navigate(RouteKey.Setting, {
previous_screen: RouteKey.Game,
});
};
// const goBack = () => {
// navigation.navigate(RouteKey.Setting, {
// previous_screen: RouteKey.Game,
// });
// };
const {t, i18n} = useTranslation();
const lang = i18n.language;
return (
<ScreenLayout
@ -26,12 +32,12 @@ export const UseOfTerms: React.FC<IProps> = ({navigation}) => { @@ -26,12 +32,12 @@ export const UseOfTerms: React.FC<IProps> = ({navigation}) => {
headerComponent={
<Header
leftIcon="arrow"
title="Terms and conditions"
onPressLeft={() => goBack()}
title={t('pageTitles.terms')}
onPressLeft={() => navigation.goBack()}
rightIcon="none"
/>
}>
<MainTextContainer text={TermsText}/>
<MainTextContainer text={terms[lang as keyof typeof terms]}/>
</ScreenLayout>
);
};

Loading…
Cancel
Save