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
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Then, to localize a theme:
36
36
37
37
1. In `QGIS → Project Properties → General`, generate a project translation file by selecting the source language and pressing `Generate TS File`.
38
38
2. Rename the generated `<projectname>.ts` to `<projectname>_<lang>.ts`, where `<lang>` is language code like `de` or `de-CH`.
39
-
3. Open the `<projectname>_<lang>.ts` with the `Qt Linguist` application and fill out the translations. Note that translations need to be marked as "finished" in Qt Linguist
39
+
3. Open the `<projectname>_<lang>.ts` with the `Qt Linguist` application and fill out the translations. Note that translations need to be marked as "finished" in Qt Linguist.
40
40
41
41
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:
42
42
```json
@@ -45,6 +45,13 @@ Since the QGIS project translations mechanism does not currently allow translati
45
45
"<layer_name>": "<translated_layer_name>",
46
46
...
47
47
},
48
+
"layers": {
49
+
"<layer_name>": {
50
+
"fields": {
51
+
"<field_name>": "<translated_field_name>"
52
+
}
53
+
}
54
+
},
48
55
"layouts": {
49
56
"<layout_name>": "<translated_layout_name>",
50
57
...
@@ -57,10 +64,13 @@ Since the QGIS project translations mechanism does not currently allow translati
57
64
58
65
Where:
59
66
60
-
-`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.
67
+
-`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. Note that `<layer_name>` is a technical layer name (or short name, if set), not a layer title.
68
+
-`layers` is used to translate layer attributes, where `<layer_name>` is again a technical layer name, and `<filed_name>` a technical field name (i.e. not alias).
61
69
-`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>`).
62
70
-`theme` is used to translate the theme title (and possibly other strings in the future)
63
71
72
+
*Note*: You can also manage all string translations in the auxiliary `json` file and avoid using the `.ts` based mechanism.
73
+
64
74
Finally, run the `ConfigGenerator` to include the translated theme names in the themes configuration.
65
75
66
76
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
0 commit comments