Skip to content

Commit

Permalink
Add i18n documentation
Browse files Browse the repository at this point in the history
Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed May 3, 2024
1 parent 467e149 commit 18e99f4
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
Binary file added .github/images/i18n_i18n-ally-progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/i18n_i18n-ally-translate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/images/i18n_language-picker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 48 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,53 @@ for this scenario, simply change the value of API_BASE_URL in static/config.json

## Internationalization (i18n)

This project supports internationalization. Currently, only English language is supported. Pull requests to support additional languages are encouraged.
This project supports internationalization. Supported languages are:

Note to developers: Textual labels are defined in `src/i18n/locales/{lang}.json`. Ensure that all labels are defined here and that components use i18n, not textual labels directly.
- ๐Ÿ‡ฉ๐Ÿ‡ช [German](src/i18n/locales/de.json)
- ๐Ÿ‡บ๐Ÿ‡ธ [English](src/i18n/locales/en.json)
- ๐Ÿ‡ช๐Ÿ‡ธ [Spanish](src/i18n/locales/es.json)
- ๐Ÿ‡ซ๐Ÿ‡ท [French](src/i18n/locales/fr.json)
- ๐Ÿ‡ฎ๐Ÿ‡ณ [Hindi](src/i18n/locales/hi.json)
- ๐Ÿ‡ฎ๐Ÿ‡น [Italian](src/i18n/locales/it.json)
- ๐Ÿ‡ฏ๐Ÿ‡ต [Japanese](src/i18n/locales/ja.json)
- ๐Ÿ‡ต๐Ÿ‡ฑ [Polish](src/i18n/locales/pl.json)
- ๐Ÿ‡ต๐Ÿ‡น [Portuguese](src/i18n/locales/pt.json)
- ๐Ÿ‡ง๐Ÿ‡ท [Portuguese (Brazil)](src/i18n/locales/pt-BR.json)
- ๐Ÿ‡ท๐Ÿ‡บ [Russian](src/i18n/locales/ru.json)
- ๐Ÿ‡บ๐Ÿ‡ฆ [Ukrainian](src/i18n/locales/uk-UA.json)
- ๐Ÿ‡จ๐Ÿ‡ณ [Chinese](src/i18n/locales/zh.json)

Pull requests to add support for additional languages, or improve existing
ones are highly encouraged.

> [!NOTE]
> The core maintainers are currently able to support English and German.
> Other languages rely on community contributions, and will be subject to
> machine translation otherwise.
Dependency-Track tries to detect the language preference from the user's browser.
If no matching language is available, it will fall back to English.

Users can customize their language preference via the profile dropdown menu:

![Profile dropdown menu with language picker](.github/images/i18n_language-picker.png)

> [!NOTE]
> The page may need to be reloaded in order for the language preference to take
> affect across all elements of the application.
### Adding or Improving Translations

Translations are defined in `src/i18n/locales/{lang}.json`, for example [en.json](src/i18n/locales/en.json).
We recommend using [VS Code] with the [i18n Ally] extension when working on translation.
The extension provides an overview of translation progress across all languages:

![Translation progress in i18n Ally](.github/images/i18n_i18n-ally-progress.png)

In case of missing translations, it is possible to translate automatically using Google Translate.
To do this, hover over the _No Translation_ item of a language, and click the globe icon:

![Machine translation in i18n Ally](.github/images/i18n_i18n-ally-translate.png)

## Copyright & License

Expand All @@ -93,3 +137,5 @@ Permission to modify and redistribute is granted under the terms of the
Apache 2.0 license. See the [LICENSE] file for the full license.

[License]: https://github.com/DependencyTrack/frontend/blob/master/LICENSE
[VS Code]: https://code.visualstudio.com/
[i18n Ally]: https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally

0 comments on commit 18e99f4

Please sign in to comment.