mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-10-02 08:22:01 +00:00
7d7d75d7e5
* Add support for localization * Add docs & format code * Add lib to docs
1.1 KiB
1.1 KiB
Translations
Woodpecker uses Vue I18n as translation library, thus you can easily translate the web UI into your language. Therefore, copy the file web/src/assets/locales/en.json
to the same path with your language's code and .json
as name.
Then, translate content of this file, but only the values:
{
"dont_translate": "Only translate this text"
}
To add support for time formatting, import the language into two files:
web/src/compositions/useDate.ts
: Just add a line likeimport 'dayjs/locale/en';
to the first block ofimport
statements and replaceen
with your language's code.web/src/utils/timeAgo.ts
: Add a line likeimport en from 'javascript-time-ago/locale/en.json';
to the otherimport
-statements and replace bothen
s with your language's code. Then, add the lineTimeAgo.addDefaultLocale(en);
to the other lines of them, and replaceen
with your language's code.
Then, the web UI should be available in your language. You should open a pull request to our repository to get your changes into the next release.