moved twig globals to dynamic compiler pass (#264)
This commit is contained in:
@@ -21,6 +21,7 @@ For the most part Kimai usage should be self-explanatory, so we will only cover
|
||||
- [FAQ](faq.md) - some answers to frequently asked questions
|
||||
- [Emails](emails.md) - transport configuration and handling of emails
|
||||
- [API](developers_api.md) - how to use the JSON API
|
||||
- [Translations](translations.md) - all about languages and translations
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -79,22 +79,9 @@ Be aware that this command will modify all files with violations in the director
|
||||
|
||||
Our code-styles are configured in [.php_cs.dist](../../.php_cs.dist).
|
||||
|
||||
|
||||
## Translations
|
||||
|
||||
We try to keep the number of language files small, in order to make it easier to identify the location of application messages and to unify the codebase.
|
||||
|
||||
- If you add a new key, you have to add it in every language file
|
||||
- Its very likely that you want to edit the file `messages` as it holds 90% of our application translations
|
||||
|
||||
The files in `translations/` as a quick overview:
|
||||
|
||||
- `exceptions` only holds translations of error pages and exception handlers
|
||||
- `flashmessages` hold all success and error messages, that will be shown as results from action calls after page reload
|
||||
- `messages` holds most of the visible application translations (like all the static UI elements and form translations)
|
||||
- `pagerfanta` includes the translations for the pagination component
|
||||
- `sidebar` holds all the translations of the right sidebar
|
||||
- `validators` only hold translations related to violations/validation of submitted form data (or API calls)
|
||||
Read more about [languages and translations](translations.md).
|
||||
|
||||
## Extending the navigation bar
|
||||
|
||||
|
||||
@@ -10,4 +10,4 @@ Internal documentation for project maintainers
|
||||
- Push a release branch and add it as last PR merge into master
|
||||
- Edit the release-draft and add the "Full changelog" link + everything from the "Merged pull requests" section from CHANGELOG.md
|
||||
- Create the release
|
||||
- Post a new issue at [YunoHost tracker for Kimai 2](https://github.com/YunoHost-Apps/kimai2_ynh)
|
||||
- Post a new issue at [YunoHost tracker for Kimai 2](https://github.com/YunoHost-Apps/kimai2_ynh)
|
||||
|
||||
43
var/docs/translations.md
Normal file
43
var/docs/translations.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Translations
|
||||
|
||||
We try to keep the number of language files small, in order to make it easier to identify the location of application messages and to unify the codebase.
|
||||
|
||||
- If you add a new key, you have to add it in every language file
|
||||
- Its very likely that you want to edit the file `messages` as it holds 90% of our application translations
|
||||
|
||||
The files in `translations/` as a quick overview:
|
||||
|
||||
- `exceptions` only holds translations of error pages and exception handlers
|
||||
- `flashmessages` hold all success and error messages, that will be shown as results from action calls after page reload
|
||||
- `messages` holds most of the visible application translations (like all the static UI elements and form translations)
|
||||
- `pagerfanta` includes the translations for the pagination component
|
||||
- `sidebar` holds all the translations of the right sidebar
|
||||
- `validators` only hold translations related to violations/validation of submitted form data (or API calls)
|
||||
|
||||
## Add a new language
|
||||
|
||||
As example I choose a new hypothetical language with the locale `xx`.
|
||||
|
||||
Copy each translation file from `translations/*.en.xliff` and rename them to `translations/*.xx.xliff`.
|
||||
|
||||
Adjust the `target-language` in the file header, as example for the new file `exceptions.xx.xliff`:
|
||||
```yml
|
||||
<file date="2018-08-01T20:00:00Z" source-language="en" target-language="xx" datatype="plaintext" original="exceptions.en.xliff">`
|
||||
```
|
||||
|
||||
Adjust the file `config/kimai.yaml` and add the language settings below the key `kimai.languages`:
|
||||
```yaml
|
||||
kimai:
|
||||
languages:
|
||||
xx:
|
||||
date_short: 'd.m.Y'
|
||||
```
|
||||
|
||||
Append the new locale in the file `config/services.yaml` at `parameters.app_locales` divided by a pipe:
|
||||
|
||||
```yaml
|
||||
parameters:
|
||||
locale: en
|
||||
app_locales: en|de|ru|it|xx
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user