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

feat: Add French translation for the webapp #759

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion packages/server/src/services/Organization/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const MONTHS = [
'december',
];

export const ACCEPTED_LOCALES = ['en', 'ar'];
export const ACCEPTED_LOCALES = ['en', 'ar', 'fr'];

export const ERRORS = {
TENANT_DATABASE_UPGRADED: 'TENANT_DATABASE_UPGRADED',
Expand Down
1 change: 1 addition & 0 deletions packages/webapp/src/components/AppIntlLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import withDashboardActions from '@/containers/Dashboard/withDashboardActions';

const SUPPORTED_LOCALES = [
{ name: 'English', value: 'en' },
{ name: 'Français', value: 'fr' },
{ name: 'العربية', value: 'ar' },
];

Expand Down
1 change: 1 addition & 0 deletions packages/webapp/src/constants/languagesOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import intl from 'react-intl-universal';

export const getLanguages = () => [
{ name: intl.get('english'), value: 'en' },
{ name: intl.get('french'), value: 'fr' },
];
6 changes: 3 additions & 3 deletions packages/webapp/src/constants/preferencesMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ export default [
href: '/preferences/general',
},
{
text: 'Branding',
text: <T id={'branding'} />,
disabled: false,
href: '/preferences/branding',
},
{
text: 'Billing',
text: <T id={'billing'} />,
href: '/preferences/billing',
},
{
text: <T id={'users'} />,
href: '/preferences/users',
},
{
text: 'Payment Methods',
text: <T id={'payment_methods'} />,
href: '/preferences/payment-methods'
},
{
Expand Down
2 changes: 2 additions & 0 deletions packages/webapp/src/lang/ar/index.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"branding": "Branding",
"hello_world": "مرحبا بالعالم",
"email_or_phone_number": "البريد الإلكتروني أو رقم الهاتف",
"password": "كلمه السر",
Expand Down Expand Up @@ -1048,6 +1049,7 @@
"none": "",
"english": "English",
"arabic": "العربية",
"french": "Français",
"just_a_moment_we_re_calculating_your_cost_transactions": "لحظة واحدة! نحن نحسب معاملات التكلفة الخاصة بك ، هذا لا يستغرق الكثير من الوقت ، يرجى التحقق بعد فترة.",
"refresh": "",
"total_name": "إجمالي {name}",
Expand Down
2 changes: 2 additions & 0 deletions packages/webapp/src/lang/en/index.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"branding": "Branding",
"email_or_phone_number": "Email or phone number",
"password": "Password",
"login": "Login",
Expand Down Expand Up @@ -1040,6 +1041,7 @@
"libyan_diner": "Libyan Diner",
"english": "English",
"arabic": "Arabic",
"french": "Français",
"just_a_moment_we_re_calculating_your_cost_transactions": "Just a moment! We're calculating your cost transactions and this doesn't take much time. Please check after some time.",
"refresh": "Refresh",
"total_name": "Total {name}",
Expand Down
6 changes: 6 additions & 0 deletions packages/webapp/src/lang/fr/authentication.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// @ts-nocheck

export default {
"login": "Connexion",
"reset_password": "Réinitialiser le mot de passe",
};
2,249 changes: 2,249 additions & 0 deletions packages/webapp/src/lang/fr/index.json

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions packages/webapp/src/lang/fr/locale.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// @ts-nocheck
import printValue from '../printValue';

export const locale = {
mixed: {
default: '${path} est invalide',
required: '${path} est un champ requis',
oneOf: '${path} doit être l\'une des valeurs suivantes: ${values}',
notOneOf: '${path} ne doit pas être l\'une des valeurs suivantes: ${values}',
notType: ({ path, type, value, originalValue }) => {
let isCast = originalValue != null && originalValue !== value;
let msg =
`${path} doit être de type \`${type}\`, ` +
`mais la valeur finale était: \`${printValue(value, true)}\`` +
(isCast
? ` (converti à partir de la valeur \`${printValue(originalValue, true)}\`).`
: '.');

if (value === null) {
msg += `\n Si "null" est prévu comme une valeur vide, assurez-vous de marquer le schéma comme \`.nullable()\``;
}

return msg;
},
defined: '${path} doit être défini',
},
string: {
length: '${path} doit être exactement de ${length} caractères',
min: '${path} doit être au moins de ${min} caractères',
max: '${path} doit être au plus de ${max} caractères',
matches: '${path} doit correspondre à ce qui suit: "${regex}"',
email: '${path} doit être un email valide',
url: '${path} doit être une URL valide',
trim: '${path} doit être une chaîne sans espaces superflus',
lowercase: '${path} doit être une chaîne en minuscules',
uppercase: '${path} doit être une chaîne en majuscules',
},
number: {
min: '${path} doit être supérieur ou égal à ${min}',
max: '${path} doit être inférieur ou égal à ${max}',
lessThan: '${path} doit être inférieur à ${less}',
moreThan: '${path} doit être supérieur à ${more}',
notEqual: '${path} ne doit pas être égal à ${notEqual}',
positive: '${path} doit être un nombre positif',
negative: '${path} doit être un nombre négatif',
integer: '${path} doit être un entier',
},
date: {
min: '${path} doit être postérieur à ${min}',
max: '${path} doit être antérieur à ${max}',
},
boolean: {},
object: {
noUnknown:
'${path} ne peut pas avoir de clés non spécifiées dans la forme de l\'objet',
},
array: {
min: '${path} doit avoir au moins ${min} éléments',
max: '${path} doit avoir au plus ${max} éléments',
},
};