AlexanderZaytsev from React-native-i18n Repository

MIT License

Closed
How to use Angular i18n json syntax translation file in react native. #274

Issue Opened
Akunal1 Opened Issue On Nov 29th 2020, 2:02

Akunal1

Hi,

in our angular website we are using i18n . Now we are creating react native app for the same website and instead of using different translation file we are planning to use same .

issue: Angular i18n syntax for plural and selection is totally different than react native i18n. is there any way to use angular i18n syntax in react native app.

Please find bellow json format and kindly help if we have any solution or work-around for react native.

// en_en.json

{
"has-expired": "<ph name=\"INTERPOLATION\"><ex>{{alert.uniqueId}}</ex>{{alert.uniqueId}}</ph> has expired.",
"sent-msg": "Message was sent to the phone: <ph name=\"INTERPOLATION\"><ex>{{mb1}}</ex>{{mb1}}</ph> *** *** <ph name=\"INTERPOLATION_1\"><ex>{{mb2}}</ex>{{mb2}}</ph>",

 "your-profile": "{VAR_SELECT, select, en_GB {Your Profile} de_DE {Ihr Profil} fr_FR {Votre profil} }",
"select-country-language": "{VAR_SELECT, select, en_GB {Please select country and language} de_DE {Bitte wählen Sie Land und Sprache aus} fr_FR {Veuillez sélectionner votre pays et votre langue} }",

"search-results-count": "<ph name=\"INTERPOLATION\"><ex>{{searchCount}}</ex>{{searchCount}}</ph> <ph name=\"ICU\"><ex>{searchCount, plural, =1 {...} other {...}}</ex>{searchCount, plural, =1 {...} other {...}}</ph>",
  "search-results": " <ph name=\"INTERPOLATION\"><ex>{{searchResults}}</ex>{{searchResults}}</ph> <ph name=\"ICU\"><ex>{searchResults, plural, =1 {...} other {...}}</ex>{searchResults, plural, =1 {...} other {...}}</ph>",
  
} 
Comment
Akunal1 commented on 1 year ago

Akunal1

I found out that above extracted syntax are done Angular i18n. can not be used in react native.

About Repository

React Native + i18n.js
Language: Objective-C
Star: 2159
Fork: 470
Watchers: 2159
Open Issues: 70
https://github.com/AlexanderZaytsev/react-native-i18n
MIT License
Last updated: 30 Nov 2022