Skip to content

Commit d8733d9

Browse files
SimonlfrCorina
authored andcommitted
Updated Danish localization (#1810)
* 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}
1 parent cf15644 commit d8733d9

3 files changed

Lines changed: 72 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5252
- Expand german locale by [@matmuenzel](https://github.com/matmuenzel) in PR [#1740](https://github.com/Microsoft/BotFramework-WebChat/pull/1740)
5353
- Update Russian and Japanese locale by [@corinagum](https://github.com/corinagum) in PR [#1747](https://github.com/Microsoft/BotFramework-WebChat/pull/1747)
5454
- Update Spanish by [@ckgrafico](https://github.com/ckgrafico) in PR [#1757](https://github.com/Microsoft/BotFramework-WebChat/pull/1757)
55+
- Update Danish by [@simon_lfr](https://github.com/LTank) in PR [#1810](https://github.com/Microsoft/BotFramework-WebChat/pull/1810)
5556
- Update Swedish by [@pekspro](https://github.com/pekspro) in PR [#1797](https://github.com/Microsoft/BotFramework-WebChat/pull/1797)
5657
- Update Dutch locale by [@imicknl](https://github.com/imicknl) in PR [#1812](https://github.com/Microsoft/BotFramework-WebChat/pull/1812)
5758

LOCALIZATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ If you want to help to translate Web Chat to different language, please submit a
77
| Language code | Translator |
88
| -------------- | --------------------- |
99
| cs-cz | @msimecek |
10-
| da-dk | Thomas Skødt Andersen |
10+
| da-dk | @Simon_lfr, Thomas Skødt Andersen |
1111
| de-de | @matmuenzel |
1212
| el-gr | @qdoop |
1313
| es-es | @SantiEspada, @ckgrafico |
Lines changed: 70 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,82 @@
1+
function botSaidSomething(avatarInitials, text, timestamp) {
2+
return `Bot ${ avatarInitials } sagde, ${ text }, ${ xMinutesAgo(timestamp) }`;
3+
}
4+
5+
function userSaidSomething(avatarInitials, text, timestamp) {
6+
return `Bruger ${ avatarInitials } sagde, ${ text }, ${ xMinutesAgo(timestamp) }`;
7+
}
8+
9+
function xMinutesAgo(dateStr) {
10+
const date = new Date(dateStr);
11+
const dateTime = date.getTime();
12+
13+
if (isNaN(dateTime)) {
14+
return dateStr;
15+
}
16+
17+
const now = Date.now();
18+
const deltaInMs = now - dateTime;
19+
const deltaInMinutes = Math.floor(deltaInMs / 60000);
20+
const deltaInHours = Math.floor(deltaInMs / 3600000);
21+
22+
if (deltaInMinutes < 1) {
23+
return 'Lige nu';
24+
} else if (deltaInMinutes === 1) {
25+
return 'Et minut siden';
26+
} else if (deltaInHours < 1) {
27+
return `${ deltaInMinutes } minutter siden`;
28+
} else if (deltaInHours === 1) {
29+
return `En time siden`;
30+
} else if (deltaInHours < 5) {
31+
return `${ deltaInHours } timer siden`;
32+
} else if (deltaInHours <= 24) {
33+
return `Idag`;
34+
} else if (deltaInHours <= 48) {
35+
return `Igår`;
36+
} else if (window.Intl) {
37+
return new Intl.DateTimeFormat('da-DK').format(date);
38+
} else {
39+
return date.toLocaleString('da-DK', {
40+
day: '2-digit',
41+
hour: '2-digit',
42+
hour12: false,
43+
minute: '2-digit',
44+
month: '2-digit',
45+
year: 'numeric',
46+
});
47+
}
48+
}
49+
50+
151
export default {
2-
// FAILED_CONNECTION_NOTIFICATION: '',
52+
FAILED_CONNECTION_NOTIFICATION: 'Kunne ikke tilslutte',
353
// Do not localize {Retry}; it is a placeholder for "Retry". English translation should be, "Send failed. Retry."
454
SEND_FAILED_KEY: 'ikke sendt, {Retry}.',
5-
// SLOW_CONNECTION_NOTIFICATION: '',
55+
SLOW_CONNECTION_NOTIFICATION: 'Det tager længere tid at tilslutte end forventet',
56+
'Bot said something': botSaidSomething,
57+
'User said something': userSaidSomething,
58+
'X minutes ago': xMinutesAgo,
59+
// '[File of type '%1']': '[File of type '%1']",
60+
// '[Unknown Card '%1']': '[Unknown Card '%1']',
61+
'Adaptive Card parse error' : 'Adaptive Card parse fejl',
62+
'Adaptive Card render error': 'Adaptive Card renderings-fejl',
663
'Chat': 'Chat',
7-
// 'Download file': '',
8-
// 'Microphone off': '',
9-
// 'Microphone on': '',
64+
'Download file': 'Hent fil',
65+
'Microphone off': 'Mikrofon slukket',
66+
'Microphone on': 'Mikrofon tændt',
1067
'Listening…': 'Lytter…',
68+
'Left': 'Venstre',
69+
'New messages': 'Ny besked',
70+
'Right': 'Højre',
1171
'retry': 'prøv igen',
1272
'Retry': '{retry}', // Please alter this value if 'Retry' at the beginning of a sentence is written differently than at the end of a sentence.
13-
'Sending': 'sender',
14-
// 'Starting…': '',
73+
'Sending': 'Sender',
74+
'Starting…': 'Starter...',
1575
'Tax': 'Skat',
1676
'Total': 'Total',
1777
'VAT': 'Moms',
1878
'Send': 'Send',
19-
// 'Speak': '',
20-
// 'Upload file': '',
79+
'Speak': 'Tal',
80+
'Upload file': 'Upload fil',
2181
'Type your message': 'Skriv din besked'
22-
// 'X minutes ago':
23-
}
82+
};

0 commit comments

Comments
 (0)