Adding/Removing Contribution or Interface Languages from a Starter Kit Project
This documentation explains how can we add or remove a language for a new project that uses the starter-kit configuration.
A language is an instance of the object lang and needs to be activated in order to be used.
Contribution languages
Configuration of contribution languages
Contribution languages are languages in which users can provide values for internationalized properties.
Inside the portal, they are taken into account inside the indexation forms (Edition of metadata, Upload, Creative Workflow).
They were also taken into account inside the setup interface before version 2023.5.3 (see Adding/Removing Contribution or Interface Languages from a Starter Kit Project | Before version 2023.5.3 for more details).
Contribution languages can be configured on the user profile through the property contriblangs which points to the instances of the object lang.
By default, all users are assigned to the following languages :
English
French
German
Default language for indexation and search
To prevent operational hiccups, ensure the default language setting for indexing and search aligns with your data structure intentions.
For instance, if your system defaults to "French," but your data entities require French translations (e.g., namefr, descriptionfr), this setup can lead to confusion. It's like trying to provide French translations for properties that are already in French.
To avoid such conflicts, consider two solutions: either change the default language to English while keeping translations in French or stick to "French" as the default language and internationalize in English. This concrete adjustment ensures that your system operates smoothly and minimizes errors when handling translations or when indexing assets.
Interface language
The interface language is the language that is used to display labels and values inside the Wedia application.
It is set on the user profile via the property bolang.
Language selector inside the main menu
In Portal, a user can update his interface language through the selector available inside the side menu.
To update the languages displayed inside the lang selector inside the menu, you can update the configuration entry point : $.language.availableLanguages (see Main Menu | Disabling one or more languages for more details about this configuration).
Example: Remove the German language when using server config resolution from the stater-kit default configuration
To remove a language from the main menu based on the default configuration, follow these steps:
Override the array
$.language.availableLanguages: By creating the foldersrc/wedia-portal-apps-configs/starter-kit@my-project/language/available-languages[]
Square brackets in the folder name are important here(available-languages[]) because that’s what indicates that language.availableLanguages is an array and not a JSON object.
Delete the item corresponding to the German language: By creating a file inside the folder previously created named:
000003000.delete, to delete the third item from the array. (see Configuration Resolver - Concepts | XJSON strict versus lenient to have more details on the file naming).
User Profile
The interface language can also be updated through the profile menu if the latter was configured to display that property (see Main Menu - User profile for more configuration details).
Managing languages in the Wedia setup Interface
This section describes how the internationalization of the labels works through the setup interface. The languages are the ones considered when filling the labels for filters, universes, metadata names, libraries, etc.
Before version 2023.5.3
There are some points to take into account when handling languages in versions before 2023.5.3 in the Wedia setup interface.
Configuration
__wedia_config
For versions previous to2023.5.3, the languages used in the Wedia setup interface are the ones specified in the following configuration entry point:__wedia_config.locales.jsonand the default locale is the one specified in__wedia_config.default-locale.json.
The languages that are shipped by default are English (“en”), French(“fr”), and German (“de“). The default delivered language, considered the mandatory language when contributing labels, is English(“en“).
Project teams can define their languages by overriding the configuration entry points mentioned above.
Languages (Instances of object lang) must be activated on the server (lang.activated) to be displayed.
Contribution languages
When filling labels in wedia_config, the inputs that are displayed take into account the contribution languages defined in the user’s profile.
For example, if in the configuration of wedia-config the following locales are configured: “en“, “fr“ and “de“ and the user has in its profile “en“ and “fr“, only the inputs for languages French and English will be displayed inside the setup interface.Creation/Modification of Structures
It is possible to create metadata and libraries in the setup interface. For the metadata that can be internationalized, we can have two cases depending on the type of metadata to create:Type Text: In that case, the labels of the property that will be created will follow all the locales configured in the entry point __wedia_config.locales.json
Type List/Tree: The property name of the relational object (commonly called “nature“) on which the metadata points, will have a name field that will be marked as internationalizable, and two fields namefr and namede.
After version 2023.5.3
Starting version 2023.5.3, an update was made in the setup interface for the management of languages through the setup interface. This chapter provides a concise overview of the changes made for internationalization in the application, making it easier for users to manage languages and translations effectively.
Configuration of languages
Starting from 2023.5.3, languages are no longer configured in the configuration entry point __wedia_config.
Modification and creation of labels now consider all active language (instances of object lang). Filtering based on user profile language contributions has been removed as well.
The default language is now the default language for indexation and search. It is set in the system parameters for each environment.
Structures
With that update, metadata and libraries created from the setup interface follow the active languages set in each project.
Libraries and objects that hold the list of instances related to relational types metadata (List/ Tree) will have the generated properties that internationalize the property name in all variations of active languages.
Example of creation of Text metadata :
When we create text metadata, we also create the metadata that internationalizes this new metadata in all active languages.
Considering a project where French, English (default), and German are the active languages, labels are calculated as follows, following this example:
Labels entered when the new metadata is created :
English* (default language): Color
French: Couleur
German : Faber
⇒ Metadata created:
Technical name:
colorEnglish* (Default language): Color
French: Couleur (EN)
German : Faber (EN)
Technical name:
colorfrEnglish*: Color (FR)
French: Couleur
German: Faber (FR) Faber (FR)
Technical name:
colordeEnglish*: Color (DE)
French: Couleur (DE)
German: Faber
Special case: Role and Role Type
The objects role and pkgroletemplate are delivered in the NAR and thus are not created from the wediasetup interface. They are delivered by default with the fields name, namefr and namede.
When activating a new language in a project, it is mandatory to create a field in the variation of that language on that object, to be able to add labels when creating a new role or role type from the setup interface.
Summary
To sum up, the steps to activate a new language in the setup interface depend mostly on which version you’re working on.
Common Steps :
Activate the instance of lang corresponding to your new language
Deactivate the language you don't need anymore (if needed)
Add on the role and roletype objects, the corresponding fields of name for the new language, and hide if necessary on the structure the unused one(s).
Register the label of the language in the plugin PACKAGED_VueApp_I18N with the following format:
lang.label.lang_code. Example: lang.label.es.
Before 2023.5.3 :
Register the new languages in the __wedia_config entry point configuration
Set in the user profile, the corresponding new language on the field “Contribution languages“ (
user.contriblangs)
After 2023.5.3 :
As mentioned earlier, the setup interface now considers all active languages, making it possible to create or update labels in all these languages.
Merci