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
Almost all strings are fetched from *.properties files. Remaining non-localized strings are used at times when the loc module may not be loaded (e.g throwing an error stack).
When translations are being brought in, we can just paste in the whole file and let it delete the ones we don't need.
* fix: use print_and_write consistently in check_strings.py
* fix: add missing i18n keys, update stale key references
* do a one-time cleanup to get rid of unused strings
* Add script for double-checking messages found in source code vs properties files
* document loc process, fix misreferenced string ids
- cleaned up string ids that either added "tabcmd" as a prefix or took it off as a prefix incorrectly
- incorporate check_strings into the localization build and pushed some output into a log file
- added docs in Contributing.md and i18n/README
Copy file name to clipboardExpand all lines: bin/i18n/README.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,18 @@ These steps are separated for easier troubleshooting: each step is idempotent an
11
11
12
12
1. convert strings from .properties files to .mo for bundling
13
13
This step combines the .properties files into a single file, discarding any strings that are not present in code and normalizing curly quotes and unrecognized characters in the strings it keeps. (These files are separate because they are pulled from separate translation sources internally.)
14
-
> python -m doit properties
14
+
> python -m doit combine_property_files
15
15
16
16
2. Convert the combined .properties file into a .po file (these are human readable)
17
17
> python -m doit po
18
18
19
19
3. Convert the .po files into .mo files (these are not human readable)
20
20
This also checks the .mo files for validity by loading them with gettext
21
-
> python -m doit mo
21
+
> python -m doit mo
22
+
23
+
## Optional reorganization task
24
+
25
+
Move all strings from extra.properties to the bottom of tabcmd_messages_xx.properties:
26
+
> python -m doit move_tabcmd_strings
27
+
28
+
This consolidates all strings into the main tabcmd_messages files and clears the extra.properties files.
Copy file name to clipboardExpand all lines: contributing.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,26 @@ The version reflected in the executable (tabcmd -v) is stored in a metadata file
137
137
138
138
139
139
140
+
141
+
### Localization
142
+
143
+
Strings should be added/edited in /tabcmd/locales/en/{name}.properties by id and referred to in code as
144
+
> string = _("string.id")
145
+
146
+
- regenerate updated strings for packaging as exe
147
+
> python -m doit combine_property_files po mo
148
+
149
+
150
+
### Versioning
151
+
152
+
Versioning is done with setuptools_scm and based on git tags. The version number will be x.y.dev0.dirty except for commits with a new version tag.
153
+
This is pulled from the git state, and to get a clean version like "v2.1.0", you must be on a commit with the tag "v2.1.0" (Creating a Github release also creates a tag on the selected branch.)
154
+
155
+
The version reflected in the executable (tabcmd -v) is stored in a metadata file created by a .doit script:
156
+
> python -m doit version
157
+
158
+
159
+
140
160
### Packaging
141
161
Packaging for release is done in a github action and should not need to be done locally.
0 commit comments