Skip to content

Commit cdfc2f0

Browse files
committed
Fix merge conflicts
# Conflicts: # CHANGELOG.md
2 parents 7f0b5b2 + 4a1a9a5 commit cdfc2f0

3 files changed

Lines changed: 73 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4545
- Expand german locale by [@matmuenzel](https://github.com/matmuenzel) in PR [#1740](https://github.com/Microsoft/BotFramework-WebChat/pull/1740)
4646
- Update Russian and Japanese locale by [@corinagum](https://github.com/corinagum) in PR [#1747](https://github.com/Microsoft/BotFramework-WebChat/pull/1747)
4747
- Update Spanish by [@ckgrafico](https://github.com/ckgrafico) in PR [#1757](https://github.com/Microsoft/BotFramework-WebChat/pull/1757)
48+
- Update Swedish by [@pekspro](https://github.com/pekspro) in PR [#1797](https://github.com/Microsoft/BotFramework-WebChat/pull/1797)
4849
- Update Dutch locale by [@imicknl](https://github.com/imicknl) in PR [#1812](https://github.com/Microsoft/BotFramework-WebChat/pull/1812)
4950

5051
### Fixed

LOCALIZATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ If you want to help to translate Web Chat to different language, please submit a
2424
| pt-br | @rcarubbi, @pedropacheco92|
2525
| pt-pt | |
2626
| ru-ru | @odysseus1973, @seaen |
27-
| sv-se | |
27+
| sv-se | @pekspro |
2828
| tr-tr | |
2929
| zh-hans | @Antimoney |
3030
| zh-hant | @compulim |
Lines changed: 71 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,82 @@
1+
function botSaidSomething(avatarInitials, text, timestamp) {
2+
return `Bot ${avatarInitials} sa, ${text}, ${xMinutesAgo(timestamp)}`;
3+
}
4+
5+
function userSaidSomething(avatarInitials, text, timestamp) {
6+
return `Användare ${avatarInitials} sa, ${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 'Alldeles nyss';
24+
} else if (deltaInMinutes === 1) {
25+
return 'För en minut sen';
26+
} else if (deltaInHours < 1) {
27+
return `${deltaInMinutes} minuter sedan`;
28+
} else if (deltaInHours === 1) {
29+
return `En timme sen`;
30+
} else if (deltaInHours < 5) {
31+
return `${deltaInHours} timmar sen`;
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('sv-SE').format(date);
38+
} else {
39+
return date.toLocaleString('sv-SE', {
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+
150
export default {
2-
// FAILED_CONNECTION_NOTIFICATION: '',
51+
FAILED_CONNECTION_NOTIFICATION: 'Kunde inte ansluta.',
352
// Do not localize {Retry}; it is a placeholder for "Retry". English translation should be, "Send failed. Retry."
453
SEND_FAILED_KEY: 'kunde inte skicka, {Retry}.',
5-
// SLOW_CONNECTION_NOTIFICATION: '',
54+
SLOW_CONNECTION_NOTIFICATION: 'Det tar längre än vanligt att ansluta.',
55+
'Bot said something': botSaidSomething,
56+
'User said something': userSaidSomething,
57+
'X minutes ago': xMinutesAgo,
58+
// '[File of type '%1']': '[File of type '%1']",
59+
// '[Unknown Card '%1']': '[Unknown Card '%1']',
60+
'Adaptive Card parse error': 'Adaptive Card parse error',
61+
'Adaptive Card render error': 'Adaptive Card render error',
662
'Chat': 'Chatt',
7-
// 'Microphone off': '',
8-
// 'Microphone on': '',
63+
'Download file': 'Ladda ned fil',
64+
'Microphone off': 'Mikrofon av',
65+
'Microphone on': 'Mikrofon på',
66+
'Left': 'Vänster',
967
'Listening…': 'Lyssnar…',
10-
// 'Download file': '',
68+
'New messages': 'Nya meddelanden',
69+
'Right': 'Höger',
1170
'retry': 'försök igen',
1271
'Retry': '{retry}', // Please alter this value if 'Retry' at the beginning of a sentence is written differently than at the end of a sentence.
1372
'Send': 'Skicka',
14-
'Sending': 'skickar',
15-
// 'Speak': '',
16-
// 'Starting…': '',
73+
'Sending': 'Skickar',
74+
'Speak': 'Läs upp',
75+
'Starting…': 'Startar…',
1776
'Tax': 'Skatt',
1877
'Total': 'Totalt',
19-
'Type your message': 'Skriv ett meddelande',
20-
// 'Upload file': '',
78+
'Type your message': 'Skriv ditt meddelande',
79+
'Upload file': 'Ladd upp fil',
2180
'VAT': 'Moms'
22-
// 'X minutes ago':
23-
}
81+
};
82+

0 commit comments

Comments
 (0)