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

Update Spanish localization #1757

Merged
merged 4 commits into from
Mar 6, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- `component`: Bump to [`[email protected]`](https://npmjs.com/package/react-film/) and [`[email protected]`](https://npmjs.com/package/react-scroll-to-bottom/), by [@compulim](https://github.com/compulim), in PR [#1621](https://github.com/Microsoft/BotFramework-WebChat/pull/1621) and PR [#1725](https://github.com/Microsoft/BotFramework-WebChat/pull/1725)
- Expand german locale by [@matmuenzel](https://github.com/matmuenzel) in PR [#1740](https://github.com/Microsoft/BotFramework-WebChat/pull/1740)
- Update Russian and Japanese locale by [@corinagum](https://github.com/corinagum) in PR [#1747](https://github.com/Microsoft/BotFramework-WebChat/pull/1747)
- Update Spanish by [@ckgrafico](https://github.com/ckgrafico) in PR [#1757](https://github.com/Microsoft/BotFramework-WebChat/pull/1757)

### Fixed
- Fix [#1360](https://github.com/Microsoft/BotFramework-WebChat/issues/1360). Added `roles` to components of Web Chat, by [@corinagum](https://github.com/corinagum) in PR [#1462](https://github.com/Microsoft/BotFramework-WebChat/pull/1462)
Expand Down
2 changes: 1 addition & 1 deletion LOCALIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If you want to help to translate Web Chat to different language, please submit a
| da-dk | Thomas Skødt Andersen |
| de-de | @matmuenzel |
| el-gr | @qdoop |
| es-es | @SantiEspada |
| es-es | @SantiEspada, @ckgrafico |
| fi-fi | @jsur |
| fr-fr | @meulta, @tao1 |
| hu-hu | |
Expand Down
31 changes: 28 additions & 3 deletions packages/component/src/Localization/es-ES.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
function xMinutesAgo(date) {
const now = Date.now();
const deltaInMs = now - new Date(date).getTime();
const deltaInMinutes = Math.floor(deltaInMs / 60000);
const deltaInHours = Math.floor(deltaInMs / 3600000);

if (deltaInMinutes < 1) {
return 'Ahora';
} else if (deltaInMinutes === 1) {
return 'Hace un minuto';
} else if (deltaInHours < 1) {
return `Hace ${deltaInMinutes} minutos`;
} else if (deltaInHours === 1) {
return `Hace una hora`;
} else if (deltaInHours < 5) {
return `Hace ${deltaInHours} horas`;
} else if (deltaInHours <= 24) {
return `Hoy`;
} else if (deltaInHours <= 48) {
return `Ayer`;
} else {
return new Intl.DateTimeFormat('es-ES').format(date);
}
}

export default {
// FAILED_CONNECTION_NOTIFICATION: '',
FAILED_CONNECTION_NOTIFICATION: 'Imposible conectar.',
// Do not localize {Retry}; it is a placeholder for "Retry". English translation should be, "Send failed. Retry."
SEND_FAILED_KEY: 'No enviado. {Retry}.',
// SLOW_CONNECTION_NOTIFICATION: '',
SLOW_CONNECTION_NOTIFICATION: 'Está tardando mucho en conectar.',
'X minutes ago': xMinutesAgo,
'Chat': 'Chat',
'Microphone off': 'Apagar micrófono',
'Microphone on': 'Encender micrófono',
Expand All @@ -20,5 +46,4 @@ export default {
'Type your message': 'Escribe tu mensaje...',
'Upload file': 'Subir archivo',
'VAT': 'IVA'
// 'X minutes ago':
}