Skip to content

Commit

Permalink
Updated Dutch localization (#1812)
Browse files Browse the repository at this point in the history
* Update Dutch language file

* Update changelog
  • Loading branch information
iMicknl authored and Corina committed Mar 15, 2019
1 parent caffee2 commit cf15644
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- 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)
- Update Swedish by [@pekspro](https://github.com/pekspro) in PR [#1797](https://github.com/Microsoft/BotFramework-WebChat/pull/1797)
- Update Dutch locale by [@imicknl](https://github.com/imicknl) in PR [#1812](https://github.com/Microsoft/BotFramework-WebChat/pull/1812)

### 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
72 changes: 60 additions & 12 deletions packages/component/src/Localization/nl-NL.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,71 @@
function botSaidSomething(avatarInitials, text, timestamp) {
return `Bot ${avatarInitials} zei; ${text}, ${xMinutesAgo(timestamp)}`;
}

function userSaidSomething(avatarInitials, text, timestamp) {
return `Gebruiker ${avatarInitials} zei; ${text}, ${xMinutesAgo(timestamp)}`;
}

function xMinutesAgo(dateStr) {
const date = new Date(dateStr);
const dateTime = date.getTime();

if (isNaN(dateTime)) {
return dateStr;
}

const now = Date.now();
const deltaInMs = now - dateTime;
const deltaInMinutes = Math.floor(deltaInMs / 60000);
const deltaInHours = Math.floor(deltaInMs / 3600000);

if (deltaInMinutes < 1) {
return 'Zojuist';
} else if (deltaInMinutes === 1) {
return 'Een minuut geleden';
} else if (deltaInHours < 1) {
return `${deltaInMinutes} minuten geleden`;
} else if (deltaInHours === 1) {
return `Een uur geleden`;
} else if (deltaInHours < 5) {
return `${deltaInHours} uur geleden`;
} else if (deltaInHours <= 24) {
return `Vandaag`;
} else if (deltaInHours <= 48) {
return `Gisteren`;
} else if (window.Intl) {
return new Intl.DateTimeFormat('nl-NL').format(date);
} else {
return date.toLocaleString('nl-NL', {
day: '2-digit',
hour: '2-digit',
hour12: false,
minute: '2-digit',
month: '2-digit',
year: 'numeric',
});
}
}

export default {
// FAILED_CONNECTION_NOTIFICATION: '',
// Do not localize {Retry}; it is a placeholder for "Retry". English translation should be, "Send failed. Retry."
SEND_FAILED_KEY: 'versturen mislukt, {Retry}.',
// SLOW_CONNECTION_NOTIFICATION: '',
FAILED_CONNECTION_NOTIFICATION: 'Verbinding maken niet mogelijk.',
SEND_FAILED_KEY: 'Versturen mislukt, {retry}.',
SLOW_CONNECTION_NOTIFICATION: 'Verbinding maken duurt langer dan normaal…',
'Chat': 'Chat',
// 'Download file': '',
// 'Microphone off': '',
// 'Microphone on': '',
'Download file': 'Bestand downloaden',
'Microphone off': 'Microfoon uit',
'Microphone on': 'Microfoon aan',
'Listening…': 'Aan het luisteren…',
'retry': 'opnieuw',
'Retry': '{retry}', // Please alter this value if 'Retry' at the beginning of a sentence is written differently than at the end of a sentence.
'retry': 'probeer opnieuw',
'Retry': 'Opnieuw proberen',
'Send': 'Verstuur',
'Sending': 'versturen',
'Speak': 'Spreek',
// 'Starting…': '',
'Starting…': 'Starten…',
'Tax': 'BTW',
'Total': 'Totaal',
'Type your message': 'Typ je bericht',
'Upload file': 'Bestand uploaden',
'VAT': 'VAT'
// 'X minutes ago':
'VAT': 'VAT',
'X minutes ago': xMinutesAgo
}

0 comments on commit cf15644

Please sign in to comment.