-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Dutch language file * Update changelog
- Loading branch information
Showing
2 changed files
with
61 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
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}.', | ||
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 | ||
} |