Internationalization

library(datamods)

When using {datamods} modules, a simple way to modify labels display is provided for using a different language or simply use other labels. There are 4 different ways to use new labels:

# Using a supported language
set_i18n("fr")

# Using a named list
set_i18n(list("Some label" = "Its translation", ...))

# Using a data.framewith 2 columns
set_i18n(data.frame(label = c(...), translation = c(...)))

# Using a CSV file
set_i18n("path/to/file.csv")

Integrated languages

The following languages are integrated in {datamods} :

set_i18n("fr")
set_i18n("mk")
set_i18n("pt")
set_i18n("al")
set_i18n("cn")
set_i18n("es")
set_i18n("de")
set_i18n("tr")
set_i18n("kr")
set_i18n("pl")
set_i18n("ja")

If you want another language to be supported, you can submit a Pull Request to add a CSV file like the one used for french (file is located in inst/i18n folder in the package, you can see it here on GitHub).

Using a list

You can change labels with a named list, where names correspond to the labels and values to the translation to use:

options("datamods.i18n" = list(
  "Import a dataset from an environment" = "Importer un jeu de données depuis l'environnement global",
  "Select a data.frame:" = "Sélectionner un data.frame :",
  ...
))

Using a data.frame

You can change labels with a data.frame with two columns label (the original label) and translation (the new label to display):

set_i18n(data.frame(
  label = c("Import a dataset from an environment", "Select a data.frame:", ...),
  translation = c("Importer un jeu de données depuis l'environnement global", "Sélectionner un data.frame :", ...)
))

Using a file

Use a CSV file with same structure than data.frame above:

set_i18n("path/to/file.csv")

An example of file is shown below.

All labels

Here’s the file used for french translation with all labels used in the package:

label,translation,comment
"Import a dataset from an environment","Importer un jeu de données depuis l'environnement global"
"Select a data.frame:","Sélectionner un data.frame :"
"List of data.frame...","Liste des tableau de données"
"Select an environment in which to search:","Sélectionner un environnement dans lequel rechercher :"
"Select environment","Sélectionner un environnement"
"No data selected!","Pas de données sélectionnées"
"Use a data.frame from your environment or from the environment of a package.","Utiliser un tableau de données de votre environnement ou de celui d'un paquet."
"No data.frame here...","Pas de données ici..."
"Ooops","Ooops"
"Something went wrong...","Un problème est survenu..."
"Data successfully imported!","Données importées avec succès"
"Data ready to be imported!","Données prêtes à être importées"
"data has %s obs. of %s variables.","les données ont %s observations et %s colonnes."
"click to see data","cliquez pour afficher les données"
"Import data","Importer les données"
"Import a file","Import d'un fichier"
"Upload a file:","Charger un fichier :"
"Browse...","Parcourir..."
"No file selected","Pas de fichier délectionné"
"Number of rows to skip before reading data:","Nombre de lignes à sauter avant de lire les données :"
"Decimal separator:","Séparateur de décimal :"
"Encoding:","Encodage :"
"Select sheet to import:","Sélectionner la feuille à importer :"
"No file selected:","Aucun fichier sélectionné"
"You can import %s files","Vous pouvez importer des fichers %s"
"First five rows are shown below:","Les cinq premières lignes sont affichées ci-dessous :"
"Copy & paste data","Copier / coller des données"
"Paste data here:","Collez vos données ici :"
"Nothing pasted yet!","Rien n'a encore été collé !"
"Please copy and paste some data in the dialog box above.","Veuillez copier et coller certaines données dans la boîte de dialogue ci-dessus."
"Import Google Spreadsheet","Importer une GoogleSheet"
"You can either use:","Vous pouvez utiliser au choix :"
"A shareable link, in that case first sheet will be read","Un lien partageable, dans ce cas la première feuille sera lue"
"The URL that appear in your browser, in that case the current sheet will be read","L'URL qui apparaît dans votre navigateur, dans ce cas la feuille active sera lue"
"Enter a shareable link to a GoogleSheet:","Entrez un lien partageable vers une GoogleSheet :"
"Please paste a valid GoogleSheet link in the dialog box above.","Veuillez coller un lien GoogleSheet valide dans la boîte de dialogue ci-dessus."
"Help","Aide"
"Environment","Environnement"
"External file","Fichier"
"Copy / Paste","Copier / Coller"
"Googlesheets","Googlesheets"
"How to import data?","Comment importer des données ?"
"Import","Import"
"View","Affichage"
"Update","Modifier"
"Validate","Validation"
"Update & select variables","Modifier et sélectionner des variables"
"Date format:","Format des dates :"
"Date to use as origin to convert date/datetime:","Date à utiliser comme origine pour convertir des dates au format numérique :"
"Select, rename and convert variables in table above, then apply changes by clicking button below.","Sélectionner, renommer et convertir des variables avec le tableau ci-dessus, puis cliquer sur le bouton ci-dessous pour appliquer les changements."
"Apply changes","Appliquer les changements"
"Data has %s observations and %s variables.","Les données ont %s observations et %s variables."
"Data successfully updated!","Données mises à jour avec succès !"
"Validation:","Validation :"
"OK","OK"
"Failed","Echec"
"Error","Erreur"
"Number of rows:","Nombre de lignes :"
"No data to display.","Pas de données à afficher."
"Close","Fermer"
"Add a label to data","Ajouter un libellé aux données"
"URL","URL"
"Add a row","Ajouter"
"Required field","Champs requis"
"Please fill in the required fields","Merci de remplir les champs obligatoires"
"Unable to add the row, contact the platform administrator","Impossible d'ajouter la ligne, contactez l'administrateur de la plateforme"
"Registered","Enregistré"
"Row has been saved","La ligne a été enregistrée"
"Update row","Mettre à jour la ligne"
"Unable to modify the item, contact the platform administrator","Impossible de modifier l'élément, contactez l'administrateur de la plateforme"
"Item has been modified","L'élément a été modifié"
"Delete","Effacer"
"Do you want to delete the selected row ?","Voulez-vous supprimer la ligne sélectionnée ?"
"Unable to delete the row, contact platform administrator","Impossible de supprimer la ligne, contactez l'administrateur de la plateforme"
"The row has been deleted","La ligne a été supprimée"
"Information","Informations"
"Row was not deleted","La ligne n'a pas été supprimée"
"Save","Enregistrer"
"Click to edit","Cliquez pour modifier"
"Click to delete","Cliquez pour supprimer"
"Cancel","Annuler"
"No","Non"
"Yes","Oui"
"Edit data","Modifier les données"
"Select", "Sélectionner"
"Missing values character(s):","Caractère représentant les valeurs manquantes"