Skip to content

Commit 2c5c9fe

Browse files
committed
fix: upgrade to i18next-cli
1 parent fb952fc commit 2c5c9fe

File tree

7 files changed

+661
-738
lines changed

7 files changed

+661
-738
lines changed

package/i18next-parser.config.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

package/i18next.config.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { defineConfig } from 'i18next-cli';
2+
3+
export default defineConfig({
4+
"locales": [
5+
"en",
6+
"es",
7+
"fr",
8+
"he",
9+
"hi",
10+
"it",
11+
"ja",
12+
"ko",
13+
"nl",
14+
"pt-br",
15+
"ru",
16+
"tr"
17+
],
18+
"extract": {
19+
"input": [
20+
"./src/**/*.{tsx,ts}"
21+
],
22+
"output": "src/i18n/{{language}}.json",
23+
"defaultNS": "translation",
24+
"keySeparator": false,
25+
"nsSeparator": false,
26+
"functions": [
27+
"t",
28+
"*.t"
29+
],
30+
"transComponents": [
31+
"Trans"
32+
]
33+
},
34+
"types": {
35+
"input": [
36+
"locales/{{language}}/{{namespace}}.json"
37+
],
38+
"output": "src/types/i18next.d.ts"
39+
}
40+
});

package/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"scripts": {
2525
"install-all": "(yarn install --force && (cd native-package && yarn install --force) && (cd expo-package && yarn install --force))",
2626
"build": "rimraf lib && yarn run --silent build-translations && bob build && yarn run --silent copy-translations",
27-
"build-translations": "i18next",
27+
"build-translations": "i18next-cli sync",
2828
"copy-translations": "echo '\u001b[34mℹ\u001b[0m Copying translation files to \u001b[34mlib/typescript/i18n\u001b[0m' && cp -R -f ./src/i18n ./lib/typescript/i18n && echo '\u001b[32m✓\u001b[0m Done Copying Translations'",
2929
"eslint": "eslint 'src/**/*.{js,md,ts,jsx,tsx}' --max-warnings 0",
3030
"lint": "prettier --ignore-path ../.prettierignore --list-different 'src/**/*.{js,ts,tsx,md,json}' eslint.config.mjs ../.prettierrc babel.config.js && eslint 'src/**/*.{js,ts,tsx,md}' --max-warnings 0 && yarn run validate-translations",
@@ -112,11 +112,11 @@
112112
"@babel/core": "^7.27.4",
113113
"@babel/runtime": "^7.27.6",
114114
"@op-engineering/op-sqlite": "^14.0.3",
115-
"@shopify/flash-list": "^2.1.0",
116115
"@react-native-community/eslint-config": "3.2.0",
117116
"@react-native-community/eslint-plugin": "1.3.0",
118117
"@react-native-community/netinfo": "^11.4.1",
119118
"@react-native/babel-preset": "0.79.3",
119+
"@shopify/flash-list": "^2.1.0",
120120
"@testing-library/jest-native": "^5.4.3",
121121
"@testing-library/react-native": "13.2.0",
122122
"@types/better-sqlite3": "^7.6.13",
@@ -145,7 +145,7 @@
145145
"eslint-plugin-react": "^7.37.5",
146146
"eslint-plugin-react-hooks": "^5.2.0",
147147
"eslint-plugin-react-native": "^5.0.0",
148-
"i18next-parser": "^9.3.0",
148+
"i18next-cli": "^1.31.0",
149149
"jest": "^30.0.0",
150150
"moment-timezone": "^0.6.0",
151151
"prettier": "^3.5.3",

package/src/i18n/es.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,17 @@
129129
"Vote ended": "Votación finalizada",
130130
"You": "",
131131
"You can't send messages in this channel": "No puedes enviar mensajes en este canal",
132+
"duration/Location end at": "",
132133
"duration/Message reminder": "{{ milliseconds | durationFormatter(withSuffix: true) }}",
133134
"duration/Remind Me": "{{ milliseconds | durationFormatter(withSuffix: true) }}",
134135
"replied to": "respondió a",
135136
"timestamp/ChannelPreviewStatus": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: {\"lastDay\":\"[Ayer]\", \"lastWeek\":\"dddd\", \"nextDay\":\"[Mañana]\", \"nextWeek\":\"dddd [a las] LT\", \"sameDay\":\"LT\", \"sameElse\":\"L\"}) }}",
136137
"timestamp/ImageGalleryHeader": "{{ timestamp | timestampFormatter(calendar: true) }}",
137138
"timestamp/InlineDateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
138-
"timestamp/Location end at": "{{ milliseconds | durationFormatter(withSuffix: false) }}",
139139
"timestamp/MessageEditedTimestamp": "{{ timestamp | timestampFormatter(calendar: true) }}",
140140
"timestamp/MessageSystem": "{{ timestamp | timestampFormatter(calendar: true) }}",
141141
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(format: LT) }}",
142142
"timestamp/PollVote": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: {\"lastDay\":\"[Ayer]\", \"lastWeek\":\"dddd\", \"nextDay\":\"[Mañana]\", \"nextWeek\":\"dddd [a las] LT\", \"sameDay\":\"LT\", \"sameElse\":\"L\"}) }}",
143-
"timestamp/Remind me": "{{ milliseconds | durationFormatter(withSuffix: true) }}",
144143
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true) }}",
145144
"timestamp/StickyHeader": "{{ timestamp | timestampFormatter(calendar: true) }}",
146145
"timestamp/ThreadListItem": "{{ timestamp | timestampFormatter(calendar: true; calendarFormats: {\"lastDay\":\"[Ayer]\", \"lastWeek\":\"dddd\", \"nextDay\":\"[Mañana]\", \"nextWeek\":\"dddd [a las] LT\", \"sameDay\":\"LT\", \"sameElse\":\"L\"}) }}",

package/src/i18n/he.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2+
"+{{count}}_many": "",
23
"+{{count}}_one": "+{{count}}",
34
"+{{count}}_other": "+{{count}}",
4-
"+{{count}}_two": "+{{count}}",
55
"1 Reply": "תגובה אחת",
66
"1 Thread Reply": "תגובה אחת לשרשור",
77
"Add a comment": "הוסף תגובה",
@@ -91,15 +91,15 @@
9191
"Resend": "שלח/י שוב",
9292
"SEND": "שלח",
9393
"Search": "חפש/י",
94+
"See all {{count}} options_many": "",
9495
"See all {{count}} options_one": "הצג את כל {{count}} האפשרויות",
9596
"See all {{count}} options_other": "הצג את כל {{count}} האפשרויות",
96-
"See all {{count}} options_two": "הצג את כל {{count}} האפשרויות",
9797
"Select More Photos": "בחר עוד תמונות",
9898
"Select one": "בחר אחת",
9999
"Select one or more": "בחר אחת או יותר",
100+
"Select up to {{count}}_many": "",
100101
"Select up to {{count}}_one": "בחר עד {{count}}",
101102
"Select up to {{count}}_other": "בחר עד {{count}}",
102-
"Select up to {{count}}_two": "בחר עד {{count}}",
103103
"Send Anyway": "שלח בכל זאת",
104104
"Send a message": "שלח/י הודעה",
105105
"Sending links is not allowed in this conversation": "שליחת קישורים אינה מותרת בשיחה זו",
@@ -122,9 +122,9 @@
122122
"Update your comment": "עדכן את התגובה שלך",
123123
"Video": "וִידֵאוֹ",
124124
"View Results": "הצג תוצאות",
125+
"View {{count}} comments_many": "",
125126
"View {{count}} comments_one": "הצג {{count}} תגובה",
126127
"View {{count}} comments_other": "הצג {{count}} תגובות",
127-
"View {{count}} comments_two": "הצג {{count}} תגובות",
128128
"Voice message": "הודעת קול",
129129
"Vote ended": "ההצבעה הסתיימה",
130130
"You": "את/ה",
@@ -148,8 +148,8 @@
148148
"{{ replyCount }} Replies": "{{ replyCount }} תגובות",
149149
"{{ replyCount }} Thread Replies": "{{ replyCount }} תגובות שרשור",
150150
"{{ user }} is typing": "{{ user }} מקליד/ה",
151+
"{{count}} votes_many": "",
151152
"{{count}} votes_one": "{{count}} הצבעה",
152153
"{{count}} votes_other": "{{count}} הצבעות",
153-
"{{count}} votes_two": "{{count}} הצבעות",
154154
"🏙 Attachment...": "🏙 קובץ מצורף..."
155155
}

package/src/i18n/ru.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"+{{count}}_few": "+{{count}}",
32
"+{{count}}_many": "+{{count}}",
43
"+{{count}}_one": "+{{count}}",
54
"+{{count}}_other": "+{{count}}",
@@ -92,14 +91,12 @@
9291
"Resend": "Отправить",
9392
"SEND": "ОТПРАВИТЬ",
9493
"Search": "Поиск",
95-
"See all {{count}} options_few": "Посмотреть все {{count}} вариантов",
9694
"See all {{count}} options_many": "Посмотреть все {{count}} вариантов",
9795
"See all {{count}} options_one": "Посмотреть все {{count}} вариант",
9896
"See all {{count}} options_other": "Посмотреть все {{count}} вариантов",
9997
"Select More Photos": "Выбрать больше фотографий",
10098
"Select one": "Выберите один",
10199
"Select one or more": "Выберите один или несколько",
102-
"Select up to {{count}}_few": "Выберите до {{count}}",
103100
"Select up to {{count}}_many": "Выберите до {{count}}",
104101
"Select up to {{count}}_one": "Выберите до {{count}}",
105102
"Select up to {{count}}_other": "Выберите до {{count}}",
@@ -125,7 +122,6 @@
125122
"Update your comment": "Обновить ваш комментарий",
126123
"Video": "видео",
127124
"View Results": "Посмотреть результаты",
128-
"View {{count}} comments_few": "Посмотреть {{count}} комментария",
129125
"View {{count}} comments_many": "Посмотреть {{count}} комментария",
130126
"View {{count}} comments_one": "Посмотреть {{count}} комментарий",
131127
"View {{count}} comments_other": "Посмотреть {{count}} комментария",
@@ -152,7 +148,6 @@
152148
"{{ replyCount }} Replies": "{{ replyCount }} Ответов",
153149
"{{ replyCount }} Thread Replies": "{{replyCount}} Ответы в темах",
154150
"{{ user }} is typing": "{{ user }} пишет",
155-
"{{count}} votes_few": "{{count}} голосов",
156151
"{{count}} votes_many": "{{count}} голосов",
157152
"{{count}} votes_one": "{{count}} голос",
158153
"{{count}} votes_other": "{{count}} голосов",

0 commit comments

Comments
 (0)