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: CONTRIBUTING.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,6 +149,47 @@ Build docs:
149
149
poetry run doc\make.bat html
150
150
Invoke-Item doc\main\build\html\index.html
151
151
152
+
Translations:
153
+
154
+
The documentation supports multiple languages through Sphinx's internationalization (i18n) feature.
155
+
156
+
Directory structure:
157
+
-`doc/locales/pot/` - Contains template (.pot) files generated by `make gettext`. These files contain all original strings that need to be translated.
158
+
-`doc/locales/<language>/LC_MESSAGES/` - Contains translation (.po) files for each language. These files must be directly in the LC_MESSAGES directory (not in subdirectories) and contain the actual translations that will be used to build the documentation.
159
+
160
+
Note about translations:
161
+
The translation system uses unique IDs (UUIDs) for each translatable string. This ensures that translations are preserved even if you move text to different files or lines. The source file locations are included as comments in the .po files to help track where translations are used.
162
+
163
+
Translation files:
164
+
-`.po` files are human-readable text files containing the translations. These should be committed to the repository.
165
+
-`.mo` files are compiled binary versions of .po files, generated automatically during build. These should not be committed.
166
+
167
+
To work with translations:
168
+
169
+
1. Generate translation templates:
170
+
171
+
poetry run make -C doc gettext
172
+
173
+
This creates .pot template files in `doc/locales/pot/`
174
+
175
+
2. Initialize or update a language (e.g., German 'de'):
176
+
177
+
poetry run make -C doc update-po-de
178
+
179
+
This creates or updates .po files in `doc/locales/de/LC_MESSAGES/`
180
+
181
+
3. Edit the .po files in `doc/locales/<language>/LC_MESSAGES/` to add translations
182
+
183
+
4. Build documentation for a specific language:
184
+
185
+
poetry run make -C doc html-de # For German
186
+
poetry run make -C doc html-fr # For French
187
+
poetry run make -C doc html-ja # For Japanese
188
+
189
+
When adding translations to the repository:
190
+
- Commit the .po files in `doc/locales/<language>/LC_MESSAGES/`
191
+
- Do not commit the .pot files in `doc/locales/pot/` (these are generated files)
0 commit comments