First off, thank you for considering contributing to Fleetbase translations! Your efforts help make Fleetbase accessible to a global audience. This guide will walk you through the process of adding or updating language translations for the Fleetbase platform and its various extensions.
Fleetbase is a modular system. The main application, known as Fleetbase Console, has its own set of translations. Additionally, each extension (like FleetOps or Storefront) also contains its own translation files. This means that to provide a complete translation for a specific language, you may need to contribute to multiple repositories.
- Main Application (
fleetbase/fleetbase): Contains the core translation files for the Fleetbase Console. - Extensions/Modules: Each extension has its own repository and its own set of translation files.
All translation files are in the YAML format (.yaml or .yml). The base language for all translations is American English (en-us.yaml).
- In the main
fleetbase/fleetbaserepository, the translation files are located at./console/translations/. - In each extension repository, the translation files are located at
./translations/.
Translation files are named using the language and region code, for example:
en-us.yaml(American English)fr-fr.yaml(French, France)zh-cn.yaml(Chinese, Simplified)
Follow these steps to contribute a new translation or update an existing one.
First, you need to fork the repository you want to contribute to. This could be the main fleetbase/fleetbase repository or one of the extension repositories. After forking, clone it to your local machine.
Navigate to the appropriate translations directory (./console/translations/ or ./translations/).
- To add a new language: Copy the
en-us.yamlfile and rename it to your target language code (e.g.,es-es.yaml). - To update an existing language: Open the existing language file. You can compare it with
en-us.yamlto find missing keys or phrases that need updating.
Open the YAML file in a text editor. You will see a structure of nested keys and values.
# Example from en-us.yaml
common:
new: New
create: Create
delete-selected-count: Delete {count} SelectedWhen translating, you should:
- Only translate the values, not the keys. For example, in
new: New, you would only translateNew. - Keep placeholders intact. Some phrases contain placeholders like
{count}or{resource}. These should not be translated. They are used by the application to insert dynamic values.
Here is an example of the French translation for the keys above:
# Example from fr-fr.yaml
common:
new: Nouveau
create: Créer
delete-selected-count: Supprimer {count} sélectionné(s)Once you have finished translating, commit your changes and push them to your forked repository. Then, open a pull request to the original Fleetbase repository.
- Make sure your pull request has a clear title and description of the changes you made.
- If you are translating an extension, you may need to submit a pull request to the extension's repository. If your changes also affect the main console, a separate PR to the
fleetbase/fleetbaserepository might be necessary.
Your contribution will be reviewed by the Fleetbase team, and once approved, it will be merged into the project.
Here is a list of the primary repositories that accept translation contributions:
| Repository | Translation Path |
|---|---|
| fleetbase/fleetbase | ./console/translations/ |
| fleetbase/fleetops | ./translations/ |
| fleetbase/storefront | ./translations/ |
| fleetbase/dev-engine | ./translations/ |
| fleetbase/iam-engine | ./translations/ |
| fleetbase/pallet | ./translations/ |
| fleetbase/ledger | ./translations/ |
| fleetbase/registry-bridge | ./translations/ |
Thank you again for your contribution to the Fleetbase community!