Skip to content

Commit

Permalink
Updated Danish localization (#1810)
Browse files Browse the repository at this point in the history
* Updated Danish localization

* Review changes

Deleted redundant line 'X minutes ago'.
Deleted { and } on retry line.

* updated changelog.md

* Changed the Retry value back to {retry}
  • Loading branch information
Simonlfr authored and Corina committed Mar 19, 2019
1 parent cf15644 commit d8733d9
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- 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)
- Update Danish by [@simon_lfr](https://github.com/LTank) in PR [#1810](https://github.com/Microsoft/BotFramework-WebChat/pull/1810)
- 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)

Expand Down
2 changes: 1 addition & 1 deletion LOCALIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ If you want to help to translate Web Chat to different language, please submit a
| Language code | Translator |
| -------------- | --------------------- |
| cs-cz | @msimecek |
| da-dk | Thomas Skødt Andersen |
| da-dk | @Simon_lfr, Thomas Skødt Andersen |
| de-de | @matmuenzel |
| el-gr | @qdoop |
| es-es | @SantiEspada, @ckgrafico |
Expand Down
81 changes: 70 additions & 11 deletions packages/component/src/Localization/da-DK.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,82 @@
function botSaidSomething(avatarInitials, text, timestamp) {
return `Bot ${ avatarInitials } sagde, ${ text }, ${ xMinutesAgo(timestamp) }`;
}

function userSaidSomething(avatarInitials, text, timestamp) {
return `Bruger ${ avatarInitials } sagde, ${ 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 'Lige nu';
} else if (deltaInMinutes === 1) {
return 'Et minut siden';
} else if (deltaInHours < 1) {
return `${ deltaInMinutes } minutter siden`;
} else if (deltaInHours === 1) {
return `En time siden`;
} else if (deltaInHours < 5) {
return `${ deltaInHours } timer siden`;
} else if (deltaInHours <= 24) {
return `Idag`;
} else if (deltaInHours <= 48) {
return `Igår`;
} else if (window.Intl) {
return new Intl.DateTimeFormat('da-DK').format(date);
} else {
return date.toLocaleString('da-DK', {
day: '2-digit',
hour: '2-digit',
hour12: false,
minute: '2-digit',
month: '2-digit',
year: 'numeric',
});
}
}


export default {
// FAILED_CONNECTION_NOTIFICATION: '',
FAILED_CONNECTION_NOTIFICATION: 'Kunne ikke tilslutte',
// Do not localize {Retry}; it is a placeholder for "Retry". English translation should be, "Send failed. Retry."
SEND_FAILED_KEY: 'ikke sendt, {Retry}.',
// SLOW_CONNECTION_NOTIFICATION: '',
SLOW_CONNECTION_NOTIFICATION: 'Det tager længere tid at tilslutte end forventet',
'Bot said something': botSaidSomething,
'User said something': userSaidSomething,
'X minutes ago': xMinutesAgo,
// '[File of type '%1']': '[File of type '%1']",
// '[Unknown Card '%1']': '[Unknown Card '%1']',
'Adaptive Card parse error' : 'Adaptive Card parse fejl',
'Adaptive Card render error': 'Adaptive Card renderings-fejl',
'Chat': 'Chat',
// 'Download file': '',
// 'Microphone off': '',
// 'Microphone on': '',
'Download file': 'Hent fil',
'Microphone off': 'Mikrofon slukket',
'Microphone on': 'Mikrofon tændt',
'Listening…': 'Lytter…',
'Left': 'Venstre',
'New messages': 'Ny besked',
'Right': 'Højre',
'retry': 'prøv igen',
'Retry': '{retry}', // Please alter this value if 'Retry' at the beginning of a sentence is written differently than at the end of a sentence.
'Sending': 'sender',
// 'Starting…': '',
'Sending': 'Sender',
'Starting…': 'Starter...',
'Tax': 'Skat',
'Total': 'Total',
'VAT': 'Moms',
'Send': 'Send',
// 'Speak': '',
// 'Upload file': '',
'Speak': 'Tal',
'Upload file': 'Upload fil',
'Type your message': 'Skriv din besked'
// 'X minutes ago':
}
};

0 comments on commit d8733d9

Please sign in to comment.