You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/topics/Translations.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,10 @@ Then, to localize a theme:
29
29
Since the QGIS project translations mechanism does not currently allow translating some project strings which are useful for QWC, these need to be defined in an auxiliary translation file `<projectname>_<lang>.json` structured as follows:
30
30
```json
31
31
{
32
+
"layertree": {
33
+
"<layer_name>": "<translated_layer_name>",
34
+
...
35
+
},
32
36
"layouts": {
33
37
"<layout_name>": "<translated_layout_name>",
34
38
...
@@ -41,11 +45,31 @@ Since the QGIS project translations mechanism does not currently allow translati
41
45
42
46
Where:
43
47
48
+
-`layertree` is used to translated layer/group names. Most layer names can be translated via `.ts` files, but for instance group names of embedded projects are currently not handled by QGIS.
44
49
-`layouts` is used to translate print layout names. Note that if you want to translate the name of a (print layout templates)[Printing.md#layout-templates], the `layout_name` may need to include the path portion of the layout (i.e. `<subdir>/<layout_name>`).
45
50
-`theme` is used to translate the theme title (and possibly other strings in the future)
46
51
47
52
Finally, run the `ConfigGenerator` to include the translated theme names in the themes configuration.
48
53
54
+
You can specify common translations which will be applied to all themes by adding a `maptranslations` block to the viewer translations (see below) in the form
55
+
```
56
+
{
57
+
"messages": {
58
+
"maptranslations": {
59
+
"layertree": {
60
+
"<layer_name>": "<translated_layer_name>",
61
+
...
62
+
},
63
+
"layouts": {
64
+
"<layout_name>": "<translated_layout_name>",
65
+
...
66
+
}
67
+
}
68
+
}
69
+
}
70
+
```
71
+
72
+
In particular, these common translations can be specified in a `<lang>_overrides.json` file, see below.
0 commit comments