Skip to content

Disambiguate "%u folder" - #2832

Open
jeremypw wants to merge 16 commits into
mainfrom
jeremypw/fix-po-warnings
Open

jeremypw wants to merge 16 commits into
mainfrom
jeremypw/fix-po-warnings

Conversation

@jeremypw

Copy link
Copy Markdown
Contributor

Running io.elementary.files-update-po gives the following warning

xgettext: warning: msgid '%u folder' is used without plural and with plural.
                   src/View/Widgets/OverlayBar.vala:180: Here is the occurrence without plural.
                   src/Dialogs/PropertiesWindow.vala:1283: Here is the occurrence with plural.
                   Workaround: If the msgid is a sentence, change the wording of the sentence; otherwise, use contexts for disambiguation.

This fixes that.

@jeremypw
jeremypw marked this pull request as draft September 14, 2026 12:35
@jeremypw

Copy link
Copy Markdown
Contributor Author

On reflection this might cause issues with languages that use the singular form for other numbers so returning to draft.

@jeremypw

Copy link
Copy Markdown
Contributor Author

Using ngettext in both places should be better.

@jeremypw
jeremypw marked this pull request as ready for review September 14, 2026 13:08
Comment thread src/View/Widgets/OverlayBar.vala Outdated
@tintou

tintou commented Sep 15, 2026

Copy link
Copy Markdown
Member

I think that there is still the issue of the whole sentence being made out of concatenation not working for all languages I think

Remove extraneous parentheses

Co-authored-by: Ryo Nakano <ryonakaknock3@gmail.com>
@jeremypw

Copy link
Copy Markdown
Contributor Author

@tintou Agreed. I may as well try and fix that here as well.

@jeremypw
jeremypw marked this pull request as draft September 15, 2026 10:06
@jeremypw
jeremypw marked this pull request as ready for review September 16, 2026 12:25
@jeremypw
jeremypw requested a review from ryonakano September 16, 2026 12:25
@jeremypw

jeremypw commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Keeping everything translatable into all languages is something of a challenge given the variablity of the status messages. I have tried to minimise the different msgids while maintaining flexibility for the translators. Fairly extensive comments are added. I assume that translators are familiar with positional arguments.

We may have to more radically change the layout of the status message in English to fully achieve translatability but I have kept fairly close to the existing layout for now.

Comment thread src/View/Widgets/OverlayBar.vala Outdated
@jeremypw
jeremypw requested a review from ryonakano September 18, 2026 12:11
Comment thread src/View/Widgets/OverlayBar.vala
Comment thread src/View/Widgets/OverlayBar.vala Outdated
Comment thread src/View/Widgets/OverlayBar.vala Outdated
jeremypw and others added 3 commits September 19, 2026 11:11
Fix indentation

Co-authored-by: Ryo Nakano <ryonakaknock3@gmail.com>
Fix whitespace

Co-authored-by: Ryo Nakano <ryonakaknock3@gmail.com>
@jeremypw

Copy link
Copy Markdown
Contributor Author

@ryonakano Thanks for the review - sorry about the careless mistakes. Hopefully now fixed.

@jeremypw
jeremypw requested a review from ryonakano September 19, 2026 10:24
Comment on lines +186 to +188
str = ngettext ("%u folder selected", "%u folders selected", folders_count).printf (
folders_count
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
str = ngettext ("%u folder selected", "%u folders selected", folders_count).printf (
folders_count
);
str = ngettext ("%u folder selected", "%u folders selected", folders_count).printf (
folders_count
);

The malformed indentation still presents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants