-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
3 changed files
with
72 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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': | ||
} | ||
}; |