🌐(react) add i18n
We need to be able to use localized texts for various components, like for accessible labels. We decided to setup a lightweight implementation of localizable to avoid relying on an existing heavy library. The Provider includes by default full translations for english, and it is also made to be able to load easily any custom locale directly from the Provider.
This commit is contained in:
20
packages/react/src/locales/en-US.json
Normal file
20
packages/react/src/locales/en-US.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"components": {
|
||||
"pagination": {
|
||||
"goto_label": "Go to",
|
||||
"goto_label_aria": "Go to any page",
|
||||
"next_aria": "Go to next page",
|
||||
"previous_aria": "Go to previous page",
|
||||
"goto_page_aria": "Go to page {page}",
|
||||
"current_page_aria": "You are currently on page {page}"
|
||||
},
|
||||
"datagrid": {
|
||||
"empty": "This table is empty",
|
||||
"empty_alt": "Illustration of an empty table",
|
||||
"loader_aria": "Loading data"
|
||||
},
|
||||
"provider": {
|
||||
"test": "This is a test: {name}"
|
||||
}
|
||||
}
|
||||
}
|
||||
20
packages/react/src/locales/fr-FR.json
Normal file
20
packages/react/src/locales/fr-FR.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"components": {
|
||||
"pagination": {
|
||||
"goto_label": "Aller à",
|
||||
"goto_label_aria": "Aller à la page",
|
||||
"next_aria": "Aller à la page suivante",
|
||||
"previous_aria": "Aller à la page précédente",
|
||||
"goto_page_aria": "Aller à la page {page}",
|
||||
"current_page_aria": "Vous êtes actuellement sur la page {page}"
|
||||
},
|
||||
"datagrid": {
|
||||
"empty": "Ce tableau est vide",
|
||||
"empty_alt": "Illustration d'un tableau vide",
|
||||
"loader_aria": "Loading data"
|
||||
},
|
||||
"provider": {
|
||||
"test": "Ceci est un test : {name}"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user