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

Updated Dutch localization #1812

Merged
merged 3 commits into from
Mar 15, 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 @@ -46,6 +46,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}.',
iMicknl marked this conversation as resolved.
Show resolved Hide resolved
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
}