Skip to content

Commit 8afc2ed

Browse files
committed
Document localized viewer assets
1 parent 94be055 commit 8afc2ed

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/topics/Translations.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ Since the QGIS project translations mechanism does not currently allow translati
4141

4242
Finally, run the `ConfigGenerator` to include the translated theme names in the themes configuration.
4343

44+
45+
### Localized viewer asssets
46+
47+
The `qwc-map-viewer` supports returning localized viewer assets if the `lang=<lang>-<COUNTRY>` query parameter is added to the asset URL, i.e.
48+
```
49+
<baseurl>/assets/myfile.ext?lang=<lang>-<COUNTRY>
50+
```
51+
where `<lang>-<COUNTRY>` is a language-country code like `de-CH`.
52+
53+
The service will then check if `myfile_<lang>-<COUNTRY>.ext` or `myfile_<lang>.ext` exist, returning the first possible match, falling back to `myfile.ext` if neither exists.
54+
55+
4456
### Adding and modifying Viewer translations
4557

4658
When working inside a `qwc-app` source folder, the translations are located at `qwc-app/static/translations`.

0 commit comments

Comments
 (0)