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

Include file in plural warnings? #409

Open
tmjoen opened this issue Jan 2, 2025 · 3 comments
Open

Include file in plural warnings? #409

tmjoen opened this issue Jan 2, 2025 · 3 comments

Comments

@tmjoen
Copy link

tmjoen commented Jan 2, 2025

I'm getting warnings about Plural-Forms:

warning: Plural-Forms headers in the form "nplurals=<int>" (without the "plural=<rule>" part following) are invalid and support for them will be removed in future Gettext versions. Make sure to use a complete Plural-Forms header, which also specifies the pluralization rules, or remove the Plural-Forms header completely. If you do the latter, Gettext will use its built-in pluralization rules for the languages it knows about (see Gettext.Plural).
For the "no" locale, you can use the following header:

nplurals=2; plural=(n != 1);

  (gettext 0.26.2) lib/gettext/plural.ex:282: Gettext.Plural.init/1
  (gettext 0.26.2) lib/gettext/compiler.ex:570: Gettext.Compiler.compile_plural_forms/4
  (gettext 0.26.2) lib/gettext/compiler.ex:508: Gettext.Compiler.compile_po_file/5
  (gettext 0.26.2) lib/gettext/compiler.ex:447: Gettext.Compiler.compile_unified_po_file/4
  (elixir 1.17.3) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
  (gettext 0.26.2) lib/gettext/compiler.ex:72: Gettext.Compiler."MACRO-__before_compile__"/2

However, I don't have any invalid Plural-Forms in my project, I'm using the same header as is suggested in the warning message. Which means it could possibly stem from a dep? But which dep? The warnings get awfully noisy when there are so many!

Is there a way to log where the warning stems from?

@maennchen
Copy link
Member

This was already addressed in #406 but is unfortunately not yet released. Will do one once I’m back from my vacation.

@tmjoen
Copy link
Author

tmjoen commented Jan 2, 2025

That looks like it's just for the warning for the old syntax, no? This is about the plural warning, which looks identical to me on main:

https://github.com/elixir-gettext/gettext/blob/main/lib/gettext/plural.ex#L278-L289

@maennchen
Copy link
Member

Oh, sorry. Reopening.

A PR would be welcome 😊

@maennchen maennchen reopened this Jan 2, 2025
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

No branches or pull requests

2 participants