Recent commits to derivepassphrase.git (b65b618949ca77aa0ad481ae2a517d0b469a4d9f)
https://git.schokokeks.org/derivepassphrase.git/tree/b65b618949ca77aa0ad481ae2a517d0b469a4d9f
Recent commits feed provided by GitList.Fix formatting and linting issues
https://git.schokokeks.org/derivepassphrase.git/commit/b65b618949ca77aa0ad481ae2a517d0b469a4d9f
software@the13thletter.info (Marco Ricci)Wed, 15 Jan 2025 20:09:20 +0100b65b618949ca77aa0ad481ae2a517d0b469a4d9fMerge topic branch 'l10n-machinery' into master* t/l10n-machinery:
Convert translatable string construction in enums to positional args only
Normalize and unwrap translatable strings (messages and comments)
Add hypothesis-based tests for l10n machinery
Fix obvious coverage failures among the translatable strings machinery
Split off comments in translatable string enum value constructor
Sort arguments to translatable string enum value constructor
Issue new context IDs for translatable messages
Fix debug output of messages with trimmed filenames
Support SOURCE_DATE_EPOCH for .po file generation
Move translation string preparation into the TranslatableString class
Properly support trimmed filenames in translation strings
Generate debug translations automatically, in code and on the command-line
Hide translation template enums behind a type alias
https://git.schokokeks.org/derivepassphrase.git/commit/e9c19afa34ddb3a061c243fc8b5eeca83b3f6ba5
software@the13thletter.info (Marco Ricci)Wed, 15 Jan 2025 19:31:19 +0100e9c19afa34ddb3a061c243fc8b5eeca83b3f6ba5Convert translatable string construction in enums to positional args onlyThis too makes the rendered code more readable by elliding repetitive
information.
https://git.schokokeks.org/derivepassphrase.git/commit/e1e0c1a37cd712bd6a346820d67ba2e2d24400a3
software@the13thletter.info (Marco Ricci)Wed, 15 Jan 2025 19:23:47 +0100e1e0c1a37cd712bd6a346820d67ba2e2d24400a3Normalize and unwrap translatable strings (messages and comments)Rewrite one-paragraph comments and strings as one-line strings, with
implicit line continuation if necessary. This is how they would appear
anyway if printed via `repr`, and in the `mkdocstrings`-extracted API
documentation. Further trim the "TRANSLATORS:" prefix from comments; it
is added automatically during `.po` file writing as necessary.
Some minor changes to the docstrings have also been made:
* `Label`
- `VAULT_METAVAR_SERVICE`: Trim `as "service_metavar"` from the`
comments for consistency.
* DebugMsgTemplate
- `VAULT_NATIVE_EVP_BYTESTOKEY_RESULT`: Use the correct message.
- `VAULT_NATIVE_CHECKING_MAC_DETAILS`,
`VAULT_NATIVE_V02_PAYLOAD_MAC_POSTPROCESSING`: Fix reference to
`InfoMsgTemplate.VAULT_NATIVE_PARSING_IV_PAYLOAD_AND_MAC`
* InfoMsgTemplate
- `VAULT_NATIVE_PARSING_IV_PAYLOAD_MAC`: Use "these terms" instead
of "this term".
The diff is hard to read in normal "line" mode, but much clearer if read
in "word-diff" mode (with quotes also treated as whitespace).
https://git.schokokeks.org/derivepassphrase.git/commit/f38b80e71b72c46036ddccd2dc7c5cfbb6a4daf2
software@the13thletter.info (Marco Ricci)Wed, 15 Jan 2025 16:01:44 +0100f38b80e71b72c46036ddccd2dc7c5cfbb6a4daf2Add hypothesis-based tests for l10n machineryThis specifically tests the `DebugTranslations` object, and various
asserted properties of `TranslatedStrings` and `TranslatableStrings`
such as hashability and equality under various modifications (e.g.
trimming the filename).
To further support this, `TranslatedStrings` now know their own format
string replacement fields (except for `%`-formatted strings), and the
`DebugTranslations` class now uses that knowledge instead of duplicating
it inline. Additionally, because `TranslatedString`s are always
interpolated, there is a new `TranslatedString.constant` constructor
for `str` templates which ensures that nothing is interpolated.
Some code branches previously excluded from coverage are now considered
again.
https://git.schokokeks.org/derivepassphrase.git/commit/d21c0bed73ae46bd06b004f5c0c1621b729e6fab
software@the13thletter.info (Marco Ricci)Tue, 14 Jan 2025 03:06:58 +0100d21c0bed73ae46bd06b004f5c0c1621b729e6fabFix obvious coverage failures among the translatable strings machineryUse examples in doctests where it makes didactical sense.
https://git.schokokeks.org/derivepassphrase.git/commit/5507510b6e8800ac739fd5ce5de3b3a6d771dce4
software@the13thletter.info (Marco Ricci)Mon, 13 Jan 2025 23:28:32 +01005507510b6e8800ac739fd5ce5de3b3a6d771dce4Split off comments in translatable string enum value constructorNow that the constructor for translatable string enum values is
homogeneous, split the constructor into a curried two-step function
call. This should hopefully look much better visually separated when
rendered in the API documentation than the current solution, because the
rendering normalizes the multiline strings into single-line strings with
escape sequences.
(This commit only splits the arguments into the two-step function call;
the arguments have not yet been trimmed or normalized.)
https://git.schokokeks.org/derivepassphrase.git/commit/3d077627bc7f337b394d9a265c54b6042df3f4e8
software@the13thletter.info (Marco Ricci)Mon, 13 Jan 2025 22:44:58 +01003d077627bc7f337b394d9a265c54b6042df3f4e8Sort arguments to translatable string enum value constructor
https://git.schokokeks.org/derivepassphrase.git/commit/8075959562a0ba81ec2468af6e470e85f720f5df
software@the13thletter.info (Marco Ricci)Mon, 13 Jan 2025 18:05:33 +01008075959562a0ba81ec2468af6e470e85f720f5dfIssue new context IDs for translatable messagesUse an ID system similar to the trove classifiers used the Python
packaging authority.
(Enum members were not reordered according to this new ID system.)
https://git.schokokeks.org/derivepassphrase.git/commit/0e8eaab68ebf814292a967aecf1315839baadd4d
software@the13thletter.info (Marco Ricci)Mon, 13 Jan 2025 17:36:18 +01000e8eaab68ebf814292a967aecf1315839baadd4dFix debug output of messages with trimmed filenamesWe do need to keep track of the trimming status when adding those
variants to the cache, because the debug output formatter will discover
the trimmed fields in the template anyway and otherwise attempt to emit
them. So store the set of trimmed fields in the cache for each message,
and pass it on to the formatter. We will assume that if a field gets
trimmed, then it had a `None` value, which is true for all the fields we
currently support trimming.
https://git.schokokeks.org/derivepassphrase.git/commit/ede0e19df43c7bfd4d20199f918afc62df29e3b0
software@the13thletter.info (Marco Ricci)Mon, 13 Jan 2025 17:28:25 +0100ede0e19df43c7bfd4d20199f918afc62df29e3b0