You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
4.1 KiB

import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import * as Localization from 'expo-localization';
const resources = {
en: {
translation: {
selectCountry: 'Select your country',
subtitle: 'You can change the country & language in your profile settings anytime.',
welcomeTitle: 'Welcome!',
welcomeMessage: 'Thank you for choosing your country. You can now log in and use the app.',
loginNow: 'Log in now',
mainAppTitle: 'Welcome to MainApp',
mainAppText: 'This is the main application screen.',
resetCountry: 'Reset Country Selection',
loginTitle: 'Login For brainnel',
loginSubtitle: 'Login to start your business',
continueWithGoogle: 'Continue with Google',
continueWithFacebook: 'Continue with Facebook',
continueWithApple: 'Continue with Apple',
continueWithInstagram: 'Continue with Instagram',
continueWithEmail: 'Continue with Email',
continueWithPhone: 'Continue with phone number',
orContinueWith: 'Or continue with',
instagram: 'Instagram',
email: 'Email',
phone: 'Phone',
forgotPassword: 'Forget your password?',
termsText: 'By continuing, you agree to our',
termsOfUse: 'Terms of Use',
and: 'and',
privacyPolicy: 'Privacy Policy',
wholesalePrice: 'Wholesale price',
fastShipping: 'Fast shipping',
// Phone login screen
logInOrSignUp: 'Log in or sign up',
phoneNumber: 'Phone number',
enterPassword: 'Please re-enter your password',
passwordIncorrect: 'Password incorrect, please confirm your password.',
verificationCodeInfo: 'We will send a verification code on your number to confirm it\'s you.',
continue: 'Continue',
// Email login screen
pleaseEnterEmail: 'Please enter your e-mail address',
},
},
fr: {
translation: {
selectCountry: 'Sélectionnez votre pays',
subtitle: 'Vous pouvez modifier le pays et la langue dans les paramètres de votre profil à tout moment.',
welcomeTitle: 'Bienvenue!',
welcomeMessage: 'Merci d\'avoir choisi votre pays. Vous pouvez maintenant vous connecter et utiliser l\'application.',
loginNow: 'Se connecter maintenant',
mainAppTitle: 'Bienvenue sur MainApp',
mainAppText: 'Ceci est l\'écran principal de l\'application.',
resetCountry: 'Réinitialiser la sélection du pays',
loginTitle: 'Connexion à brainnel',
loginSubtitle: 'Connectez-vous pour démarrer votre entreprise',
continueWithGoogle: 'Continuer avec Google',
continueWithFacebook: 'Continuer avec Facebook',
continueWithApple: 'Continuer avec Apple',
continueWithInstagram: 'Continuer avec Instagram',
continueWithEmail: 'Continuer avec Email',
continueWithPhone: 'Continuer avec numéro de téléphone',
orContinueWith: 'Ou continuer avec',
instagram: 'Instagram',
email: 'Email',
phone: 'Téléphone',
forgotPassword: 'Mot de passe oublié?',
termsText: 'En continuant, vous acceptez nos',
termsOfUse: 'Conditions d\'utilisation',
and: 'et',
privacyPolicy: 'Politique de confidentialité',
wholesalePrice: 'Prix de gros',
fastShipping: 'Livraison rapide',
// Phone login screen
logInOrSignUp: 'Se connecter ou s\'inscrire',
phoneNumber: 'Numéro de téléphone',
enterPassword: 'Veuillez saisir à nouveau votre mot de passe',
passwordIncorrect: 'Mot de passe incorrect, veuillez confirmer votre mot de passe.',
verificationCodeInfo: 'Nous vous enverrons un code de vérification sur votre numéro pour confirmer que c\'est bien vous.',
continue: 'Continuer',
// Email login screen
pleaseEnterEmail: 'Veuillez entrer votre adresse e-mail',
},
},
};
const getDefaultLanguage = () => {
const locale = Localization.locale;
const languageCode = locale.split('-')[0]; // 获取语言代码部分
return languageCode === 'fr' ? 'fr' : 'en';
};
i18n
.use(initReactI18next)
.init({
resources,
lng: getDefaultLanguage(),
fallbackLng: 'en',
interpolation: {
escapeValue: false,
},
});
export default i18n;