Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Spanish translations #2292

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions docusaurus/docs/reactnative/basics/translations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ The React Native SDK's UI Components are available in multiple languages out-of-
At the moment we support the following languages (and more will be added in the future):

- [English (en)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/en.json)
- [Spanish (es)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/es.json)
- [French (fr)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/fr.json)
- [Hebrew (he)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/he.json)
- [Hindi (hi)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/hi.json)
- [Italian (it)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/it.json)
- [Dutch (nl)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/nl.json)
- [Turkish (tr)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/tr.json)
- [Russian (ru)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/ru.json)
- [Japanese (ja)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/ja.json)
- [Korean (ko)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/ko.json)
- [Dutch (nl)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/nl.json)
- [Russian (ru)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/ru.json)
- [Turkish (tr)](https://github.com/GetStream/stream-chat-react-native/blob/develop/package/src/i18n/tr.json)

## Usage

Expand Down Expand Up @@ -252,14 +254,16 @@ Language code for language to be used.
The following options are available:

- English (`en`)
- Spanish (`es`)
- French (`fr`)
- Hebrew (`he`)
- Hindi (`hi`)
- Italian (`it`)
- Dutch (`nl`)
- Turkish (`tr`)
- Russian (`ru`)
- Japanese (`ja`)
- Korean (`ko`)
- Dutch (`nl`)
- Russian (`ru`)
- Turkish (`tr`)

| TYPE | DEFAULT |
| ------ | ------- |
Expand Down
72 changes: 72 additions & 0 deletions package/src/i18n/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"1 Reply": "1 respuesta",
"1 Thread Reply": "1 respuesta de hilo",
"Allow access to your Gallery": "Permitir acceso a tu galería",
"Also send to channel": "También enviar al canal",
"Are you sure you want to permanently delete this message?": "¿Estás seguro de que deseas eliminar permanentemente este mensaje?",
"Block User": "Bloquear usuario",
"Cancel": "Cancelar",
"Cannot Flag Message": "No se puede reportar el mensaje",
"Copy Message": "Copiar mensaje",
"Delete": "Eliminar",
"Delete Message": "Eliminar mensaje",
"Do you want to send a copy of this message to a moderator for further investigation?": "¿Deseas enviar una copia de este mensaje a un moderador para una investigación adicional?",
"Edit Message": "Editar mensaje",
"Editing Message": "Editando mensaje",
"Emoji matching": "Coincidencia de emoji",
"Empty message...": "Mensaje vacío...",
"Error loading": "Error al cargar",
"Error loading channel list...": "Error al cargar la lista de canales...",
"Error loading messages for this channel...": "Error al cargar los mensajes de este canal...",
"Error while loading, please reload/refresh": "Error al cargar, por favor recarga/actualiza",
"File type not supported": "Tipo de archivo no admitido",
"Flag": "Reportar",
"Flag Message": "Reportar mensaje",
"Flag action failed either due to a network issue or the message is already flagged": "El reporte falló debido a un problema de red o el mensaje ya fue reportado.",
"Instant Commands": "Comandos instantáneos",
"Links are disabled": "Los enlaces están desactivados",
"Loading channels...": "Cargando canales...",
"Loading messages...": "Cargando mensajes...",
"Loading...": "Cargando...",
"Message Reactions": "Reacciones al mensaje",
"Message deleted": "Mensaje eliminado",
"Message flagged": "Mensaje reportado",
"Mute User": "Silenciar usuario",
"Not supported": "No admitido",
"Nothing yet...": "Aún no hay nada...",
"Ok": "Aceptar",
"Only visible to you": "Solo visible para ti",
"Photo": "Foto",
"Photos": "Fotos",
"Photos and Videos": "Fotos y videos",
"Pin to Conversation": "Fijar a la conversación",
"Pinned by": "Fijado por",
"Please enable access to your photos and videos so you can share them.": "Por favor, habilita el acceso a tus fotos y videos para poder compartirlos.",
"Please select a channel first": "Por favor, selecciona primero un canal",
"Reconnecting...": "Reconectando...",
"Reply": "Responder",
"Reply to Message": "Responder al mensaje",
"Resend": "Reenviar",
"Search GIFs": "Buscar GIFs",
"Send a message": "Enviar un mensaje",
"Sending links is not allowed in this conversation": "No está permitido enviar enlaces en esta conversación",
"Slow mode ON": "Modo lento ACTIVADO",
"The message has been reported to a moderator.": "El mensaje ha sido reportado a un moderador.",
"Thread Reply": "Respuesta de hilo",
"Unblock User": "Desbloquear usuario",
"Unknown User": "Usuario desconocido",
"Unmute User": "Activar sonido del usuario",
"Unpin from Conversation": "Desmarcar de la conversación",
"Unread Messages": "Mensajes no leídos",
"Video": "Video",
"You": "Tú",
"You can't send messages in this channel": "No puedes enviar mensajes en este canal",
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "{{ firstUser }} y {{ nonSelfUserLength }} más están escribiendo",
"{{ index }} of {{ photoLength }}": "{{ index }} de {{ photoLength }}",
"{{ replyCount }} Replies": "{{ replyCount }} Respuestas",
"{{ replyCount }} Thread Replies": "{{ replyCount }} respuestas de hilo",
"{{ user }} is typing": "{{ user }} está escribiendo",
"Select More Photos": "Seleccionar más fotos",
"🏙 Attachment...": "🏙 Adjunto...",
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "El archivo supera el tamaño máximo permitido. Por favor, selecciona un archivo menor a {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB."
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just added a new translations for Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB. and there is one coming for Select More Photos in https://github.com/GetStream/stream-chat-react-native/pull/2291/files.

Can you please add them? Thanks 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. Done 👍

19 changes: 13 additions & 6 deletions package/src/utils/Streami18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type moment from 'moment';

import type { TDateTimeParser } from '../contexts/translationContext/TranslationContext';
import enTranslations from '../i18n/en.json';
import esTranslations from '../i18n/es.json';
import frTranslations from '../i18n/fr.json';
import heTranslations from '../i18n/he.json';
import hiTranslations from '../i18n/hi.json';
Expand All @@ -20,15 +21,16 @@ import nlTranslations from '../i18n/nl.json';
import ruTranslations from '../i18n/ru.json';
import trTranslations from '../i18n/tr.json';

import 'dayjs/locale/es';
import 'dayjs/locale/fr';
import 'dayjs/locale/he';
import 'dayjs/locale/hi';
import 'dayjs/locale/it';
import 'dayjs/locale/ja';
import 'dayjs/locale/ko';
import 'dayjs/locale/nl';
import 'dayjs/locale/ru';
import 'dayjs/locale/tr';
import 'dayjs/locale/he';

/**
* These locale imports also set these locales globally.
Expand Down Expand Up @@ -192,12 +194,16 @@ type I18NextConfig = {
* Instance of this class should be provided to Chat component to handle translations.
* Stream provides following list of in-built translations:
* 1. English (en)
* 2. Dutch (nl)
* 3. Russian (ru)
* 4. Turkish (tr)
* 5. French (fr)
* 2. Spanish (es)
* 3. French (fr)
* 4. Hebrew (he)
* 5. Hindi (hi)
* 6. Italian (it)
* 7. Hindi (hi)
* 7. Japanese (ja)
* 8. Korean (ko)
* 9. Dutch (nl)
* 10. Russian (ru)
* 11. Turkish (tr)
*
* Simplest way to start using chat components in one of the in-built languages would be following:
*
Expand Down Expand Up @@ -370,6 +376,7 @@ export class Streami18n {
};
} = {
en: { [defaultNS]: enTranslations },
es: { [defaultNS]: esTranslations },
fr: { [defaultNS]: frTranslations },
he: { [defaultNS]: heTranslations },
hi: { [defaultNS]: hiTranslations },
Expand Down
Loading