major: core 0.16
This commit is contained in:
73
README.md
73
README.md
@ -118,6 +118,17 @@ On `config.json`:
|
||||
"client": {
|
||||
"favicon": "/images/favicon.webp",
|
||||
"css": "/path/to/custom.css",
|
||||
"i18n": {
|
||||
"lang": "fr",
|
||||
"force": "false",
|
||||
"files": [
|
||||
{
|
||||
"name": "yourCustomLangName",
|
||||
"file": "/path/to/file.json"
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -126,6 +137,10 @@ Where:
|
||||
|
||||
* `client.favicon` is an URL to a distant favicon
|
||||
* `client.css` is an URL to a distant CSS that'll be the last one loaded by the Hubl
|
||||
* `client.i18n.lang` is the fallback langage in case the visitor's browser one does not contain the string
|
||||
* `client.i18n.force` allows to ignore the visitor's browser langage and force the `client.i18n.lang` one
|
||||
* `client.i18n.files[].name` allows to use custom client lang file.
|
||||
* `client.i18n.files[].file` is the path the the json lang file
|
||||
|
||||
### Allow to login to your application
|
||||
|
||||
@ -144,6 +159,56 @@ Where:
|
||||
|
||||
* `authority` is the OpenID Provider. Usually, if you use `djangoldp_account` it's the same as your djangoldp server.
|
||||
|
||||
### Custom lang files
|
||||
|
||||
Each client can overwrite langs files with their own or even create custom langs.
|
||||
|
||||
#### Overwrite langs
|
||||
|
||||
On `config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"client": {
|
||||
"i18n": {
|
||||
"files": [
|
||||
{
|
||||
"name": "fr",
|
||||
"file": "/path/to/custom-fr.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Custom langs
|
||||
|
||||
Needs `client.i18n.force` to `true` and `client.i18n.lang` to the custom lang name.
|
||||
|
||||
Your custom JSON file **must** contain every keys, from the template and from every bloxes, prefixed by the blox namespace. See example on `src/locales/fr.json`.
|
||||
|
||||
On `config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"client": {
|
||||
"i18n": {
|
||||
"lang": "pirate",
|
||||
"force": "true",
|
||||
"files": [
|
||||
{
|
||||
"name": "pirate",
|
||||
"file": "/path/to/yarr.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Setting custom langs will not allow user to choose their own lang.
|
||||
|
||||
## Optional modules
|
||||
|
||||
### Adding modules
|
||||
@ -573,6 +638,14 @@ Components can get the route of a module with `window.hubl.getRoute('componentNa
|
||||
|
||||
Did you properly created subscriptions on your DjangoLDP's server? You can quickly create them with `./manage.py create_subscriptions`
|
||||
|
||||
### I see some technical strings instead of my fallback language strings
|
||||
|
||||
By default, the template fallback to `fr` lang, which is the most complete. If you're using your own fallback lang within your configuration, please ensure that this lang is completly translated.
|
||||
|
||||
### I see some technical strings instead of my custom language
|
||||
|
||||
Using a custom language file does not allow to use the default fallback language.
|
||||
|
||||
## Built With
|
||||
|
||||
* [Sib-Core](https://git.startinblox.com/framework/sib-core/) - A SOLID-Compliant framework
|
||||
|
Reference in New Issue
Block a user