Skip to content

Commit

Permalink
fix(i18n): add missing SDK translations (#2157)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinCupela committed Nov 7, 2023
1 parent a01774a commit e22a6ce
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 26 deletions.
5 changes: 4 additions & 1 deletion src/components/Attachment/AttachmentActions.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';
import type { Action, Attachment } from 'stream-chat';

import { useTranslationContext } from '../../context';

import type { ActionHandlerReturnType } from '../Message/hooks/useActionHandler';
import type { DefaultStreamChatGenerics } from '../../types/types';

Expand All @@ -23,6 +25,7 @@ const UnMemoizedAttachmentActions = <
props: AttachmentActionsProps<StreamChatGenerics>,
) => {
const { actionHandler, actions, id, text } = props;
const { t } = useTranslationContext('UnMemoizedAttachmentActions');

const handleActionClick = (
event: React.MouseEvent<HTMLButtonElement, MouseEvent>,
Expand All @@ -42,7 +45,7 @@ const UnMemoizedAttachmentActions = <
key={`${id}-${action.value}`}
onClick={(event) => handleActionClick(event, action.name, action.value)}
>
{action.text}
{action.text ? t<string>(action.text) : null}
</button>
))}
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/components/LoadMore/LoadMoreButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { PropsWithChildren, useEffect } from 'react';
import { LoadingIndicator } from '../Loading';
import { deprecationAndReplacementWarning } from '../../utils/deprecationWarning';
import { useTranslationContext } from '../../context';

export type LoadMoreButtonProps = {
/** onClick handler load more button. Pagination logic should be executed in this handler. */
Expand All @@ -15,11 +16,14 @@ export type LoadMoreButtonProps = {
};

const UnMemoizedLoadMoreButton = ({
children = 'Load more',
children,
isLoading,
onClick,
refreshing,
}: PropsWithChildren<LoadMoreButtonProps>) => {
const { t } = useTranslationContext('UnMemoizedLoadMoreButton');

const childrenOrDefaultString = children ?? t<string>('Load more');
const loading = typeof isLoading !== 'undefined' ? isLoading : refreshing;

useEffect(() => {
Expand All @@ -35,7 +39,7 @@ const UnMemoizedLoadMoreButton = ({
disabled={loading}
onClick={onClick}
>
{loading ? <LoadingIndicator /> : children}
{loading ? <LoadingIndicator /> : childrenOrDefaultString}
</button>
</div>
);
Expand Down
5 changes: 4 additions & 1 deletion src/components/ReactFileUtilities/ImageDropzone.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import clsx from 'clsx';
import React, { PropsWithChildren, useCallback, useMemo } from 'react';
import { useDropzone } from 'react-dropzone';
import { useTranslationContext } from '../../context';

export type ImageDropzoneProps = {
/**
Expand All @@ -25,6 +26,8 @@ export const ImageDropzone = ({
maxNumberOfFiles,
multiple,
}: PropsWithChildren<ImageDropzoneProps>) => {
const { t } = useTranslationContext('ImageDropzone');

const handleDrop = useCallback(
(accepted: File[]) => {
if (!handleFiles) {
Expand Down Expand Up @@ -78,7 +81,7 @@ export const ImageDropzone = ({
fillRule='nonzero'
/>
</svg>
<p>Drag your files here to add to your post</p>
<p>{t<string>('Drag your files here to add to your post')}</p>
</div>
</div>
{children}
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "Verbindungsfehler, Wiederherstellung der Verbindung...",
"Delete": "Löschen",
"Delivered": "Zugestellt",
"Drag your files here": "Drag your files here",
"Drag your files here": "Ziehen Sie Ihre Dateien hierher",
"Drag your files here to add to your post": "Ziehen Sie Ihre Dateien hierher, um sie Ihrem Beitrag hinzuzufügen",
"Edit Message": "Nachricht bearbeiten",
"Edit message request failed": "Anfrage zum Bearbeiten der Nachricht fehlgeschlagen",
"Emoji matching": "Emoji passend",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "Fehler: {{ errorMessage }}",
"Flag": "Meldung",
"Latest Messages": "Neueste Nachrichten",
"Load more": "Mehr laden",
"Menu": "Menü",
"Message Failed · Click to try again": "Nachricht fehlgeschlagen · Klicken, um es erneut zu versuchen",
"Message Failed · Unauthorized": "Nachricht fehlgeschlagen · Nicht autorisiert",
Expand All @@ -50,8 +52,9 @@
"Send": "Senden",
"Send message request failed": "Senden der Nachrichtenanfrage fehlgeschlagen",
"Sending...": "Senden...",
"Shuffle": "Mischen",
"Slow Mode ON": "Slow-Mode EIN",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "Einige der Dateien werden nicht akzeptiert",
"This message was deleted...": "Diese Nachricht wurde gelöscht...",
"Thread": "Thread",
"Type your message": "Nachricht eingeben",
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"Delete": "Delete",
"Delivered": "Delivered",
"Drag your files here": "Drag your files here",
"Drag your files here to add to your post": "Drag your files here to add to your post",
"Edit Message": "Edit Message",
"Edit message request failed": "Edit message request failed",
"Emoji matching": "Emoji matching",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "Error: {{ errorMessage }}",
"Flag": "Flag",
"Latest Messages": "Latest Messages",
"Load more": "Load more",
"Menu": "Menu",
"Message Failed · Click to try again": "Message Failed · Click to try again",
"Message Failed · Unauthorized": "Message Failed · Unauthorized",
Expand All @@ -50,6 +52,7 @@
"Send": "Send",
"Send message request failed": "Send message request failed",
"Sending...": "Sending...",
"Shuffle": "Shuffle",
"Slow Mode ON": "Slow Mode ON",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"This message was deleted...": "This message was deleted...",
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "Fallo de conexión, reconectando ahora ...",
"Delete": "Borrar",
"Delivered": "Entregado",
"Drag your files here": "Drag your files here",
"Drag your files here": "Arrastra tus archivos aquí",
"Drag your files here to add to your post": "Arrastra tus archivos aquí para agregarlos a tu publicación",
"Edit Message": "Editar mensaje",
"Edit message request failed": "Error al editar la solicitud de mensaje",
"Emoji matching": "Coincidencia de emoji",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "Error: {{ errorMessage }}",
"Flag": "Bandera",
"Latest Messages": "Últimos mensajes",
"Load more": "Cargar más",
"Menu": "Menú",
"Message Failed · Click to try again": "Mensaje fallido · Haga clic para volver a intentarlo",
"Message Failed · Unauthorized": "Mensaje fallido · No autorizado",
Expand All @@ -50,8 +52,9 @@
"Send": "Enviar",
"Send message request failed": "Error al enviar la solicitud de mensaje",
"Sending...": "Enviando...",
"Shuffle": "Mezclar",
"Slow Mode ON": "Modo lento activado",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "Algunos de los archivos no serán aceptados",
"This message was deleted...": "Este mensaje fue eliminado ...",
"Thread": "Hilo",
"Type your message": "Escribe tu mensaje",
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "Échec de la connexion, reconnexion en cours...",
"Delete": "Supprimer",
"Delivered": "Publié",
"Drag your files here": "Drag your files here",
"Drag your files here": "Glissez vos fichiers ici",
"Drag your files here to add to your post": "Glissez vos fichiers ici pour les ajouter à votre publication",
"Edit Message": "Éditer un message",
"Edit message request failed": "Échec de la demande de modification du message",
"Emoji matching": "Correspondance emoji",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "Erreur : {{ errorMessage }}",
"Flag": "Signaler",
"Latest Messages": "Derniers messages",
"Load more": "Charger plus",
"Menu": "Menu",
"Message Failed · Click to try again": "Échec de l'envoi du message - Cliquez pour réessayer",
"Message Failed · Unauthorized": "Échec de l'envoi du message - Non autorisé",
Expand All @@ -50,8 +52,9 @@
"Send": "Envoyer",
"Send message request failed": "Échec de la demande d'envoi de message",
"Sending...": "Envoi en cours...",
"Shuffle": "Mélanger",
"Slow Mode ON": "Mode lent activé",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "Certains fichiers ne seront pas acceptés",
"This message was deleted...": "Ce message a été supprimé...",
"Thread": "Fil de discussion",
"Type your message": "Saisissez votre message",
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "कनेक्शन विफल रहा, अब पुनः कनेक्ट हो रहा है ...",
"Delete": "डिलीट",
"Delivered": "पहुंच गया",
"Drag your files here": "Drag your files here",
"Drag your files here": "अपनी फ़ाइलें यहाँ खींचें",
"Drag your files here to add to your post": "अपनी फ़ाइलें यहाँ खींचें और अपने पोस्ट में जोड़ने के लिए",
"Edit Message": "मैसेज में बदलाव करे",
"Edit message request failed": "संदेश संपादित करने का अनुरोध विफल रहा",
"Emoji matching": "इमोजी मिलान",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "फेल: {{ errorMessage }}",
"Flag": "फ्लैग करे",
"Latest Messages": "नवीनतम संदेश",
"Load more": "और लोड करें",
"Menu": "मेन्यू",
"Message Failed · Click to try again": "मैसेज फ़ैल - पुनः कोशिश करें",
"Message Failed · Unauthorized": "मैसेज फ़ैल - अनधिकृत",
Expand All @@ -50,8 +52,9 @@
"Send": "भेजे",
"Send message request failed": "संदेश भेजने का अनुरोध विफल रहा",
"Sending...": "भेजा जा रहा है",
"Shuffle": "मिश्रित करें",
"Slow Mode ON": "स्लो मोड ऑन",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "कुछ फ़ाइलें स्वीकार नहीं की जाएंगी",
"This message was deleted...": "मैसेज हटा दिया गया",
"Thread": "रिप्लाई थ्रेड",
"Type your message": "अपना मैसेज लिखे",
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "Connessione fallitta, riconnessione in corso...",
"Delete": "Cancella",
"Delivered": "Consegnato",
"Drag your files here": "Drag your files here",
"Drag your files here": "Trascina i tuoi file qui",
"Drag your files here to add to your post": "Trascina i tuoi file qui per aggiungerli al tuo post",
"Edit Message": "Modifica messaggio",
"Edit message request failed": "Richiesta di modifica del messaggio non riuscita",
"Emoji matching": "Abbinamento emoji",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "Errore: {{ errorMessage }}",
"Flag": "Segnala",
"Latest Messages": "Ultimi messaggi",
"Load more": "Carica di più",
"Menu": "Menù",
"Message Failed · Click to try again": "Invio messaggio fallito · Clicca per riprovare",
"Message Failed · Unauthorized": "Invio messaggio fallito · Non autorizzato",
Expand All @@ -50,8 +52,9 @@
"Send": "Invia",
"Send message request failed": "Invia messaggio di richiesta non riuscito",
"Sending...": "Invio in corso...",
"Shuffle": "Mescolare",
"Slow Mode ON": "Modalità lenta attivata",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "Alcuni dei file non saranno accettati",
"This message was deleted...": "Questo messaggio é stato cancellato",
"Thread": "Thread",
"Type your message": "Scrivi il tuo messaggio",
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "接続が失敗しました。再接続中...",
"Delete": "消去",
"Delivered": "配信しました",
"Drag your files here": "Drag your files here",
"Drag your files here": "ここにファイルをドラッグ",
"Drag your files here to add to your post": "投稿に追加するためにここにファイルをドラッグ",
"Edit Message": "メッセージを編集",
"Edit message request failed": "メッセージの編集要求が失敗しました",
"Emoji matching": "絵文字マッチング",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "エラー: {{ errorMessage }}",
"Flag": "フラグ",
"Latest Messages": "最新のメッセージ",
"Load more": "もっと読み込む",
"Menu": "メニュー",
"Message Failed · Click to try again": "メッセージが失敗しました · クリックして再試行してください",
"Message Failed · Unauthorized": "メッセージが失敗しました · 許可されていません",
Expand All @@ -50,8 +52,9 @@
"Send": "送信",
"Send message request failed": "メッセージ送信リクエストが失敗しました",
"Sending...": "送信中...",
"Shuffle": "シャッフル",
"Slow Mode ON": "スローモードオン",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "一部のファイルは受け付けられません",
"This message was deleted...": "このメッセージは削除されました...",
"Thread": "スレッド",
"Type your message": "メッセージを入力してください",
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "연결 실패, 지금 다시 연결 중...",
"Delete": "삭제",
"Delivered": "배달됨",
"Drag your files here": "Drag your files here",
"Drag your files here": "여기로 파일을 끌어다 놓으세요",
"Drag your files here to add to your post": "게시물에 추가하려면 파일을 여기로 끌어다 놓으세요",
"Edit Message": "메시지 수정",
"Edit message request failed": "메시지 수정 요청 실패",
"Emoji matching": "이모티콘 매칭",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "오류: {{ errorMessage }}",
"Flag": "플래그",
"Latest Messages": "최신 메시지",
"Load more": "더 불러오기",
"Menu": "메뉴",
"Message Failed · Click to try again": "메시지 실패 · 다시 시도하려면 클릭하세요.",
"Message Failed · Unauthorized": "메시지 실패 · 승인되지 않음",
Expand All @@ -50,8 +52,9 @@
"Send": "보내다",
"Send message request failed": "메시지 보내기 요청 실패",
"Sending...": "배상중...",
"Shuffle": "셔플",
"Slow Mode ON": "슬로우 모드 켜짐",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "일부 파일은 허용되지 않을 수 있습니다",
"This message was deleted...": "이 메시지는 삭제되었습니다...",
"Thread": "스레드",
"Type your message": "메시지 입력",
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "Probleem met de verbinding, opnieuw verbinding maken...",
"Delete": "Verwijder",
"Delivered": "Afgeleverd",
"Drag your files here": "Drag your files here",
"Drag your files here": "Sleep je bestanden hier naartoe",
"Drag your files here to add to your post": "Sleep je bestanden hier naartoe om aan je bericht toe te voegen",
"Edit Message": "Pas bericht aan",
"Edit message request failed": "Verzoek om bericht bewerken mislukt",
"Emoji matching": "Emoji-overeenkomsten",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "Error: {{ errorMessage }}",
"Flag": "Markeer",
"Latest Messages": "Laatste berichten",
"Load more": "Meer laden",
"Menu": "Menu",
"Message Failed · Click to try again": "Bericht mislukt, klik om het nogmaals te proberen",
"Message Failed · Unauthorized": "Bericht mislukt, ongeautoriseerd",
Expand All @@ -50,8 +52,9 @@
"Send": "Verstuur",
"Send message request failed": "Verzoek om bericht te verzenden mislukt",
"Sending...": "Aan het verzenden...",
"Shuffle": "Schudden",
"Slow Mode ON": "Langzame modus aan",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "Sommige bestanden zullen niet worden geaccepteerd",
"This message was deleted...": "Dit bericht was verwijderd",
"Thread": "Draadje",
"Type your message": "Type je bericht",
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "Falha de conexão, reconectando agora...",
"Delete": "Excluir",
"Delivered": "Entregue",
"Drag your files here": "Drag your files here",
"Drag your files here": "Arraste seus arquivos aqui",
"Drag your files here to add to your post": "Arraste seus arquivos aqui para adicionar ao seu post",
"Edit Message": "Editar Mensagem",
"Edit message request failed": "O pedido de edição da mensagem falhou",
"Emoji matching": "Emoji correspondente",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "Erro: {{ errorMessage }}",
"Flag": "Reportar",
"Latest Messages": "Mensagens mais recentes",
"Load more": "Carregar mais",
"Menu": "Menu",
"Message Failed · Click to try again": "A mensagem falhou · Clique para tentar novamente",
"Message Failed · Unauthorized": "A mensagem falhou · não autorizado",
Expand All @@ -50,8 +52,9 @@
"Send": "Enviar",
"Send message request failed": "O pedido de envio de mensagem falhou",
"Sending...": "Enviando...",
"Shuffle": "Embaralhar",
"Slow Mode ON": "Modo lento LIGADO",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "Alguns dos arquivos não serão aceitos",
"This message was deleted...": "Esta mensagem foi excluída...",
"Thread": "Fio",
"Type your message": "Digite sua mensagem",
Expand Down
7 changes: 5 additions & 2 deletions src/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Connection failure, reconnecting now...": "Ошибка соединения, переподключение...",
"Delete": "Удалить",
"Delivered": "Отправлено",
"Drag your files here": "Drag your files here",
"Drag your files here": "Перетащите ваши файлы сюда",
"Drag your files here to add to your post": "Перетащите ваши файлы сюда, чтобы добавить их в ваш пост",
"Edit Message": "Редактировать сообщение",
"Edit message request failed": "Не удалось изменить запрос сообщения",
"Emoji matching": "Соответствие эмодзи",
Expand All @@ -26,6 +27,7 @@
"Error: {{ errorMessage }}": "Ошибка: {{ errorMessage }}",
"Flag": "Пожаловаться",
"Latest Messages": "Последние сообщения",
"Load more": "Загрузить больше",
"Menu": "Меню",
"Message Failed · Click to try again": "Ошибка отправки сообщения · Нажмите чтобы повторить",
"Message Failed · Unauthorized": "Ошибка отправки сообщения · Неавторизованный",
Expand All @@ -50,8 +52,9 @@
"Send": "Отправить",
"Send message request failed": "Не удалось отправить запрос на отправку сообщения",
"Sending...": "Отправка...",
"Shuffle": "Перемешать",
"Slow Mode ON": "Медленный режим включен",
"Some of the files will not be accepted": "Some of the files will not be accepted",
"Some of the files will not be accepted": "Некоторые файлы не будут приняты",
"This message was deleted...": "Сообщение было удалено...",
"Thread": "Ветка",
"Type your message": "Ваше сообщение",
Expand Down
Loading

0 comments on commit e22a6ce

Please sign in to comment.