Repository navigation
Feat/plural forms secondstostring - #32
Merged
ralflang merged 2 commits intoAug 26, 2026
Merged
Conversation
ralflang
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Nag::secondsToString()built duration strings using four composite translatable strings ("%d hours, %d minute","%d hour, %d minutes", etc.) covering every singular/plural combination of hours and minutes. This produced%d hour/%d minuteas plain (non-plural) msgids innag.pot, colliding withkronolith.pot, which already defines the same strings as a properngettext()plural pair for the same concept (task/event duration). The mismatch mademsgcatfail when building the translation compendium:This PR rewrites
secondsToString()to build the hour and minute parts independently viangettext(), then joins them. This removes the four composite strings entirely, replacing them with the same plural pair pattern already used by kronolith for hours and minutes.Translation impact
This changes the set of translatable strings: the four composite msgids become obsolete, replaced by two
ngettext()-based plural pairs. This does mean existing translations of the composite strings will need to be redone by translators. Aligning with kronolith's existing plural pattern seemed preferable to preserving a structure that was already causing tooling issues."Note on testing
I was unable to test this through the Nag UI — task due/start date fields are currently broken on my dev instance independently of this change, so I couldn't exercise
secondsToString()end-to-end via the task list or portal block.I verified the refactored function directly via CLI instead:
Output matches the original implementation's expected behavior for all singular/plural boundary cases.