Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

French localization and suggestedActionBorderRadius style option #1327

Merged
merged 5 commits into from
Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 39 additions & 14 deletions packages/component/src/Localization/fr-FR.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
function xMinutesAgo(date) {
corinagum marked this conversation as resolved.
Show resolved Hide resolved
const now = Date.now();
const deltaInMs = now - new Date(date).getTime();
const deltaInMinutes = Math.floor(deltaInMs / 60000);
const deltaInHours = Math.floor(deltaInMs / 3600000);

if (deltaInMinutes < 1) {
return "À l'instant";
} else if (deltaInMinutes === 1) {
return 'Il y a une minute';
} else if (deltaInHours < 1) {
return `Il y a ${ deltaInMinutes } minutes`;
} else if (deltaInHours === 1) {
return `Il y a une heure`;
} else if (deltaInHours < 5) {
return `Il y a ${ deltaInHours } heures`;
} else if (deltaInHours <= 24) {
return `Aujourd'hui`;
} else if (deltaInHours <= 48) {
return `Hier`;
} else {
return new Intl.DateTimeFormat('fr-FR').format(date);
}
}

export default {
'Chat': 'Chat',
'Listening…': 'Écoute…',
'retry': 'réessayer',
'Send failed, {retry}': 'envoi impossible, {retry}',
'Send': 'Envoyer',
'Sending': 'envoi',
// 'Speak': '',
// 'Starting…': '',
'Tax': 'Taxe',
'Total': 'Total',
'Type your message': 'Écrivez votre message',
// 'Upload file': '',
'VAT': 'TVA'
// 'X minutes ago':
'Chat': 'Chat',
'Listening…': 'Écoute…',
'retry': 'réessayer',
'Send failed, {retry}': 'envoi impossible, {retry}',
'Send': 'Envoyer',
'Sending': 'envoi',
'Speak': 'Parlez',
'Starting…': 'Démarrage…',
'Tax': 'Taxe',
'Total': 'Total',
'Type your message': 'Écrivez votre message',
'Upload file': 'Envoyer fichier',
'VAT': 'TVA',
'X minutes ago': xMinutesAgo
}
3 changes: 3 additions & 0 deletions packages/component/src/Styles/StyleSet/SuggestedAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default function createSuggestedActionStyle({
paddingWide,
suggestedActionBackground,
suggestedActionBorder,
suggestedActionBorderRadius,
suggestedActionTextColor,
suggestedActionDisabledBackground,
suggestedActionDisabledBorder,
Expand All @@ -28,12 +29,14 @@ export default function createSuggestedActionStyle({
'&:disabled': {
background: suggestedActionDisabledBackground,
border: suggestedActionDisabledBorder,
borderRadius: suggestedActionBorderRadius,
corinagum marked this conversation as resolved.
Show resolved Hide resolved
color: suggestedActionDisabledTextColor
},

'&:not(:disabled)': {
background: suggestedActionBackground,
border: suggestedActionBorder,
borderRadius: suggestedActionBorderRadius,
color: suggestedActionTextColor,
cursor: 'pointer'
}
Expand Down
1 change: 1 addition & 0 deletions packages/component/src/Styles/defaultStyleSetOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const DEFAULT_OPTIONS = {

suggestedActionBackground: 'White',
suggestedActionBorder: `solid 2px ${ DEFAULT_ACCENT }`,
suggestedActionBorderRadius: 0,
suggestedActionTextColor: DEFAULT_ACCENT,
suggestedActionDisabledBackground: 'White',
suggestedActionDisabledBorder: `solid 2px #E6E6E6`,
Expand Down