Skip to content

Commit e6561c5

Browse files
committed
chore: migrate translation extraction to i18next-cli
1 parent 5af5b90 commit e6561c5

File tree

16 files changed

+326
-48
lines changed

16 files changed

+326
-48
lines changed

.github/actions/setup-node/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
node-version:
66
description: 'Specify Node version'
77
required: false
8-
default: '22'
8+
default: '24'
99

1010
runs:
1111
using: 'composite'

i18next.config.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig, I18nextToolkitConfig } from 'i18next-cli';
1+
import { defineConfig } from 'i18next-cli';
22

33
export default defineConfig({
44
locales: ['de', 'en', 'es', 'fr', 'hi', 'it', 'ja', 'ko', 'nl', 'pt', 'ru', 'tr'],
@@ -10,9 +10,17 @@ export default defineConfig({
1010
keySeparator: false,
1111
nsSeparator: false,
1212
output: 'src/i18n/{{language}}.json',
13-
// sort(a, b) {
14-
// return a <= b ? -1 : 1; // alphabetical order
15-
// },
13+
preservePatterns: [
14+
// to preserve a whole group
15+
'timestamp/*',
16+
17+
// or exact key if you want :
18+
// 'timestamp/DateSeparator',
19+
20+
// or if you’re using explicit namespaces:
21+
// 'translation:timestamp/DateSeparator',
22+
],
23+
removeUnusedKeys: false,
1624
},
1725
types: {
1826
input: ['locales/{{language}}/{{namespace}}.json'],

src/components/DateSeparator/DateSeparator.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const UnMemoizedDateSeparator = (props: DateSeparatorProps) => {
3535
messageCreatedAt,
3636
t,
3737
tDateTimeParser,
38+
// todo: how to register it
3839
timestampTranslationKey: 'timestamp/DateSeparator',
3940
});
4041

src/i18n/de.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@
3434
"Archive": "Archivieren",
3535
"aria/Attachment": "Anhang",
3636
"aria/Cancel Reply": "Antwort abbrechen",
37+
"aria/Cancel upload": "Upload abbrechen",
3738
"aria/Channel list": "Kanalliste",
3839
"aria/Channel search results": "Kanalsuchergebnisse",
3940
"aria/Close thread": "Thread schließen",
4041
"aria/Download attachment": "Anhang herunterladen",
4142
"aria/Emoji picker": "Emoji-Auswahl",
43+
"aria/File input": "Dateieingabe",
4244
"aria/File upload": "Datei hochladen",
45+
"aria/Image input": "Bildeingabe",
4346
"aria/Load More Channels": "Mehr Kanäle laden",
4447
"aria/Menu": "Menü",
4548
"aria/Message Options": "Nachrichtenoptionen",
@@ -68,6 +71,8 @@
6871
"Cannot seek in the recording": "In der Aufnahme kann nicht gesucht werden",
6972
"Channel Missing": "Kanal fehlt",
7073
"Close": "Schließen",
74+
"Close emoji picker": "Emoji-Auswahl schließen",
75+
"Commands matching": "Übereinstimmende Befehle",
7176
"Connection failure, reconnecting now...": "Verbindungsfehler, Wiederherstellung der Verbindung...",
7277
"Create": "Erstellen",
7378
"Create poll": "Umfrage erstellen",
@@ -77,6 +82,7 @@
7782
"Delivered": "Zugestellt",
7883
"Download attachment {{ name }}": "Anhang {{ name }} herunterladen",
7984
"Drag your files here": "Ziehen Sie Ihre Dateien hierher",
85+
"Drag your files here to add to your post": "Ziehen Sie Ihre Dateien hierher, um sie Ihrem Beitrag hinzuzufügen",
8086
"Due {{ timeLeft }}": "Fällig {{ timeLeft }}",
8187
"Due since {{ dueSince }}": "Fällig seit {{ dueSince }}",
8288
"duration/Message reminder": "{{ milliseconds | durationFormatter(withSuffix: true) }}",
@@ -85,13 +91,15 @@
8591
"Edit Message": "Nachricht bearbeiten",
8692
"Edit message request failed": "Anfrage zum Bearbeiten der Nachricht fehlgeschlagen",
8793
"Edited": "Bearbeitet",
94+
"Emoji matching": "Passende Emojis",
8895
"Empty message...": "Leere Nachricht...",
8996
"End": "Beenden",
9097
"End vote": "Abstimmung beenden",
9198
"Enforce unique vote is enabled": "Eindeutige Abstimmung ist aktiviert",
92-
"Error": "Fehler",
99+
"Error": "Error",
93100
"Error · Unsent": "Fehler · Nicht gesendet",
94101
"Error adding flag": "Fehler beim Hinzufügen des Flags",
102+
"Error connecting to chat, refresh the page to try again.": "Verbindungsfehler zum Chat, aktualisieren Sie die Seite, um es erneut zu versuchen.",
95103
"Error deleting message": "Fehler beim Löschen der Nachricht",
96104
"Error fetching reactions": "Fehler beim Laden von Reaktionen",
97105
"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.": "Fehler beim Markieren der Nachricht als ungelesen. Kann keine älteren ungelesenen Nachrichten markieren als die neuesten 100 Kanalnachrichten.",
@@ -101,6 +109,9 @@
101109
"Error reproducing the recording": "Fehler bei der Wiedergabe der Aufnahme",
102110
"Error starting recording": "Fehler beim Starten der Aufnahme",
103111
"Error unmuting a user ...": "Fehler beim Aufheben der Stummschaltung eines Nutzers ...",
112+
"Error uploading attachment": "Fehler beim Hochladen des Anhangs",
113+
"Error uploading file": "Fehler beim Hochladen der Datei",
114+
"Error uploading image": "Fehler beim Hochladen des Bildes",
104115
"Error: {{ errorMessage }}": "Fehler: {{ errorMessage }}",
105116
"Failed to create the poll": "Fehler beim Erstellen der Umfrage",
106117
"Failed to create the poll due to {{reason}}": "Die Umfrage konnte aufgrund von {{reason}} nicht erstellt werden",
@@ -110,6 +121,7 @@
110121
"Failed to retrieve location": "Standort konnte nicht abgerufen werden",
111122
"Failed to share location": "Standort konnte nicht geteilt werden",
112123
"File": "Datei",
124+
"File is too large: {{ size }}, maximum upload size is {{ limit }}": "Datei ist zu groß: {{ size }}, maximale Upload-Größe beträgt {{ limit }}",
113125
"Flag": "Melden",
114126
"Generating...": "Generieren...",
115127
"giphy-command-args": "[Text]",
@@ -131,6 +143,8 @@
131143
"Message has been successfully flagged": "Nachricht wurde erfolgreich gemeldet",
132144
"Message pinned": "Nachricht angeheftet",
133145
"Message was blocked by moderation policies": "Nachricht wurde durch moderationsrichtlinien blockiert",
146+
"Messages have been marked unread.": "Nachrichten wurden als ungelesen markiert.",
147+
"Missing permissions to upload the attachment": "Fehlende Berechtigungen zum Hochladen des Anhangs",
134148
"Multiple answers": "Mehrere Antworten",
135149
"Mute": "Stummschalten",
136150
"mute-command-args": "[@Benutzername]",
@@ -144,9 +158,11 @@
144158
"Nothing yet...": "Noch nichts...",
145159
"Ok": "Ok",
146160
"Only numbers are allowed": "Nur Zahlen sind erlaubt",
161+
"Open emoji picker": "Emoji-Auswahl öffnen",
147162
"Option already exists": "Option existiert bereits",
148163
"Option is empty": "Option ist leer",
149164
"Options": "Optionen",
165+
"People matching": "Passende Personen",
150166
"Pin": "Anheften",
151167
"Pinned by": "Angeheftet von",
152168
"Poll": "Umfrage",
@@ -170,7 +186,7 @@
170186
"search-results-header-filter-source-button-label--channels": "Kanäle",
171187
"search-results-header-filter-source-button-label--messages": "Nachrichten",
172188
"search-results-header-filter-source-button-label--users": "Benutzer",
173-
"Searching for {{ searchSourceType }}...": "Suche nach {{ searchSourceType }}...",
189+
"Searching for {{ searchSourceType }}...": "Searching for {{ searchSourceType }}...",
174190
"Searching...": "Suchen...",
175191
"searchResultsCount_one": "1 Ergebnis",
176192
"searchResultsCount_other": "{{ count }} Ergebnisse",
@@ -196,6 +212,7 @@
196212
"Some of the files will not be accepted": "Einige der Dateien werden nicht akzeptiert",
197213
"Start typing to search": "Tippen Sie, um zu suchen",
198214
"Stop sharing": "Teilen beenden",
215+
"Submit": "Absenden",
199216
"Suggest an option": "Eine Option vorschlagen",
200217
"Thinking...": "Denken...",
201218
"this content could not be displayed": "Dieser Inhalt konnte nicht angezeigt werden",
@@ -205,10 +222,13 @@
205222
"Thread": "Thread",
206223
"Thread has not been found": "Thread wurde nicht gefunden",
207224
"Thread reply": "Thread-Antwort",
225+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
208226
"timestamp/LiveLocation": "{{ timestamp | timestampFormatter(calendar: true) }}",
227+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true) }}",
209228
"timestamp/PollVote": "{{ timestamp | timestampFormatter(format: MMM D [at] HH:mm) }}",
210229
"timestamp/PollVoteTooltip": "{{ timestamp | timestampFormatter(calendar: true) }}",
211230
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true) }}",
231+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
212232
"To start recording, allow the camera access in your browser": "Um mit der Aufnahme zu beginnen, erlauben Sie den Zugriff auf die Kamera in Ihrem Browser",
213233
"To start recording, allow the microphone access in your browser": "Um mit der Aufnahme zu beginnen, erlauben Sie den Zugriff auf das Mikrofon in Ihrem Browser",
214234
"translationBuilderTopic/notification": "{{value, notification}}",
@@ -228,6 +248,7 @@
228248
"Unsupported attachment": "Nicht unterstützter Anhang",
229249
"unsupported file type": "Nicht unterstützter Dateityp",
230250
"Update your comment": "Ihren Kommentar aktualisieren",
251+
"Upload type: \"{{ type }}\" is not allowed": "Upload-Typ: \"{{ type }}\" ist nicht erlaubt",
231252
"User uploaded content": "Vom Benutzer hochgeladener Inhalt",
232253
"View {{count}} comments_one": "{{count}} Kommentar anzeigen",
233254
"View {{count}} comments_other": "{{count}} Kommentare anzeigen",
@@ -236,5 +257,6 @@
236257
"Vote ended": "Abstimmung beendet",
237258
"Wait until all attachments have uploaded": "Bitte warten, bis alle Anhänge hochgeladen wurden",
238259
"You": "Du",
239-
"You have no channels currently": "Du hast momentan noch keine Kanäle"
260+
"You have no channels currently": "Du hast momentan noch keine Kanäle",
261+
"You've reached the maximum number of files": "Die maximale Anzahl an Dateien ist erreicht"
240262
}

src/i18n/en.json

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,25 @@
3434
"Archive": "Archive",
3535
"aria/Attachment": "Attachment",
3636
"aria/Cancel Reply": "Cancel Reply",
37+
"aria/Cancel upload": "Cancel upload",
3738
"aria/Channel list": "Channel list",
3839
"aria/Channel search results": "Channel search results",
3940
"aria/Close thread": "Close thread",
40-
"aria/Download attachment": "Download attachment",
41+
"aria/Download attachment": "aria/Download attachment",
4142
"aria/Emoji picker": "Emoji picker",
43+
"aria/File input": "File input",
4244
"aria/File upload": "File upload",
45+
"aria/Image input": "Image input",
4346
"aria/Load More Channels": "Load More Channels",
4447
"aria/Menu": "Menu",
4548
"aria/Message Options": "Message Options",
46-
"aria/Open Attachment Selector": "Open Attachment Selector",
49+
"aria/Open Attachment Selector": "aria/Open Attachment Selector",
4750
"aria/Open Menu": "Open Menu",
4851
"aria/Open Message Actions Menu": "Open Message Actions Menu",
4952
"aria/Open Reaction Selector": "Open Reaction Selector",
5053
"aria/Open Thread": "Open Thread",
5154
"aria/Reaction list": "Reaction list",
52-
"aria/Remind Me Options": "Remind Me Options",
55+
"aria/Remind Me Options": "aria/Remind Me Options",
5356
"aria/Remove attachment": "Remove attachment",
5457
"aria/Remove location attachment": "Remove location attachment",
5558
"aria/Retry upload": "Retry upload",
@@ -68,6 +71,8 @@
6871
"Cannot seek in the recording": "Cannot seek in the recording",
6972
"Channel Missing": "Channel Missing",
7073
"Close": "Close",
74+
"Close emoji picker": "Close emoji picker",
75+
"Commands matching": "Commands matching",
7176
"Connection failure, reconnecting now...": "Connection failure, reconnecting now...",
7277
"Create": "Create",
7378
"Create poll": "Create poll",
@@ -77,6 +82,7 @@
7782
"Delivered": "Delivered",
7883
"Download attachment {{ name }}": "Download attachment {{ name }}",
7984
"Drag your files here": "Drag your files here",
85+
"Drag your files here to add to your post": "Drag your files here to add to your post",
8086
"Due {{ timeLeft }}": "Due {{ timeLeft }}",
8187
"Due since {{ dueSince }}": "Due since {{ dueSince }}",
8288
"duration/Message reminder": "{{ milliseconds | durationFormatter(withSuffix: true) }}",
@@ -85,13 +91,15 @@
8591
"Edit Message": "Edit Message",
8692
"Edit message request failed": "Edit message request failed",
8793
"Edited": "Edited",
94+
"Emoji matching": "Emoji matching",
8895
"Empty message...": "Empty message...",
8996
"End": "End",
9097
"End vote": "End vote",
9198
"Enforce unique vote is enabled": "Enforce unique vote is enabled",
9299
"Error": "Error",
93100
"Error · Unsent": "Error · Unsent",
94101
"Error adding flag": "Error adding flag",
102+
"Error connecting to chat, refresh the page to try again.": "Error connecting to chat, refresh the page to try again.",
95103
"Error deleting message": "Error deleting message",
96104
"Error fetching reactions": "Error loading reactions",
97105
"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.": "Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.",
@@ -101,6 +109,9 @@
101109
"Error reproducing the recording": "Error reproducing the recording",
102110
"Error starting recording": "Error starting recording",
103111
"Error unmuting a user ...": "Error unmuting a user ...",
112+
"Error uploading attachment": "Error uploading attachment",
113+
"Error uploading file": "Error uploading file",
114+
"Error uploading image": "Error uploading image",
104115
"Error: {{ errorMessage }}": "Error: {{ errorMessage }}",
105116
"Failed to create the poll": "Failed to create the poll",
106117
"Failed to create the poll due to {{reason}}": "Failed to create the poll due to {{reason}}",
@@ -110,6 +121,7 @@
110121
"Failed to retrieve location": "Failed to retrieve location",
111122
"Failed to share location": "Failed to share location",
112123
"File": "File",
124+
"File is too large: {{ size }}, maximum upload size is {{ limit }}": "File is too large: {{ size }}, maximum upload size is {{ limit }}",
113125
"Flag": "Flag",
114126
"Generating...": "Generating...",
115127
"giphy-command-args": "[text]",
@@ -131,6 +143,8 @@
131143
"Message has been successfully flagged": "Message has been successfully flagged",
132144
"Message pinned": "Message pinned",
133145
"Message was blocked by moderation policies": "Message was blocked by moderation policies",
146+
"Messages have been marked unread.": "Messages have been marked unread.",
147+
"Missing permissions to upload the attachment": "Missing permissions to upload the attachment",
134148
"Multiple answers": "Multiple answers",
135149
"Mute": "Mute",
136150
"mute-command-args": "[@username]",
@@ -144,9 +158,11 @@
144158
"Nothing yet...": "Nothing yet...",
145159
"Ok": "Ok",
146160
"Only numbers are allowed": "Only numbers are allowed",
161+
"Open emoji picker": "Open emoji picker",
147162
"Option already exists": "Option already exists",
148163
"Option is empty": "Option is empty",
149164
"Options": "Options",
165+
"People matching": "People matching",
150166
"Pin": "Pin",
151167
"Pinned by": "Pinned by",
152168
"Poll": "Poll",
@@ -196,6 +212,7 @@
196212
"Some of the files will not be accepted": "Some of the files will not be accepted",
197213
"Start typing to search": "Start typing to search",
198214
"Stop sharing": "Stop sharing",
215+
"Submit": "Submit",
199216
"Suggest an option": "Suggest an option",
200217
"Thinking...": "Thinking...",
201218
"this content could not be displayed": "this content could not be displayed",
@@ -205,18 +222,21 @@
205222
"Thread": "Thread",
206223
"Thread has not been found": "Thread has not been found",
207224
"Thread reply": "Thread reply",
225+
"timestamp/DateSeparator": "{{ timestamp | timestampFormatter(calendar: true) }}",
208226
"timestamp/LiveLocation": "{{ timestamp | timestampFormatter(calendar: true) }}",
227+
"timestamp/MessageTimestamp": "{{ timestamp | timestampFormatter(calendar: true) }}",
209228
"timestamp/PollVote": "{{ timestamp | timestampFormatter(format: MMM D [at] HH:mm) }}",
210229
"timestamp/PollVoteTooltip": "{{ timestamp | timestampFormatter(calendar: true) }}",
211230
"timestamp/ReminderNotification": "{{ timestamp | timestampFormatter(calendar: true) }}",
231+
"timestamp/SystemMessage": "{{ timestamp | timestampFormatter(format: dddd L) }}",
212232
"To start recording, allow the camera access in your browser": "To start recording, allow the camera access in your browser",
213233
"To start recording, allow the microphone access in your browser": "To start recording, allow the microphone access in your browser",
214234
"translationBuilderTopic/notification": "{{value, notification}}",
215235
"Type a number from 2 to 10": "Type a number from 2 to 10",
216236
"Type your message": "Type your message",
217237
"Unarchive": "Unarchive",
218238
"unban-command-args": "[@username]",
219-
"unban-command-description": "Ban a user",
239+
"unban-command-description": "Unban a user",
220240
"unknown error": "unknown error",
221241
"Unmute": "Unmute",
222242
"unmute-command-args": "[@username]",
@@ -228,6 +248,7 @@
228248
"Unsupported attachment": "Unsupported attachment",
229249
"unsupported file type": "unsupported file type",
230250
"Update your comment": "Update your comment",
251+
"Upload type: \"{{ type }}\" is not allowed": "Upload type: \"{{ type }}\" is not allowed",
231252
"User uploaded content": "User uploaded content",
232253
"View {{count}} comments_one": "View {{count}} comment",
233254
"View {{count}} comments_other": "View {{count}} comments",
@@ -236,5 +257,6 @@
236257
"Vote ended": "Vote ended",
237258
"Wait until all attachments have uploaded": "Wait until all attachments have uploaded",
238259
"You": "You",
239-
"You have no channels currently": "You have no channels currently"
260+
"You have no channels currently": "You have no channels currently",
261+
"You've reached the maximum number of files": "You've reached the maximum number of files"
240262
}

0 commit comments

Comments
 (0)