Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add checks for Perl String::Errf format #5

Open
intrigeri opened this issue Sep 12, 2020 · 3 comments
Open

Please add checks for Perl String::Errf format #5

intrigeri opened this issue Sep 12, 2020 · 3 comments

Comments

@intrigeri
Copy link

Hi!

It would be nice to have some basic checks for perl-brace-format, as implemented by https://metacpan.org/pod/String::Errf.

The equivalent of python-format-string-argument-type-mismatch and python-format-string-missing-argument, even without support for plural forms, would already be a great start, and would have avoided a serious bug in Tails.

Thanks for considering :)

@jwilk jwilk changed the title Please add checks for perl-brace-format Please add checks for Perl String::Errf format Sep 12, 2020
@jwilk
Copy link
Owner

jwilk commented Sep 12, 2020

The bug in question looked like this:

#, perl-brace-format
msgid "Downloading the upgrade to %{name}s %{version}s..."
msgstr "%{name} %{version} güncellemesi indiriliyor..."

The message was flagged as perl-brace-format, which isn't really correct. GNU gettext documentation says:

Perl brace format strings are described in the Locale::TextDomain manual page […]. In brief, Perl format uses placeholders put between braces ({ and }). The placeholder must have the syntax of simple identifiers.

This is different format than String::Errf. In particular, the lack of s after } wouldn't be an error from Locale::TextDomain's point of view, since that's just literal string.

So I have the following questions:

  • Is gettext + String::Errf a common combination in the Perl world?

  • If yes, could you ask GNU gettext maintainers to add support for this format?

  • If no, would it make sense for Tails to switch to Locale::TextDomain?

To be clear, i18nspector doesn't support Locale::TextDomain format strings either, but I could be more easily convinced to add checks for something that's understood by GNU gettext.

@intrigeri
Copy link
Author

intrigeri commented Sep 13, 2020 via email

@jwilk
Copy link
Owner

jwilk commented Sep 14, 2020

Shall we repurpose this issue to be about supporting Locale::TextDomain format strings, or do you prefer rejecting this one and me filing a new issue?

I've marked this as wontfix, and opened #6.

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

No branches or pull requests

2 participants