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

Deprecate "use Gettext" for backends and improve docs #392

Merged
merged 5 commits into from
Aug 19, 2024

Conversation

whatyouhide
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Aug 18, 2024

Pull Request Test Coverage Report for Build fdfdf385cf0d6725a34780329e1a04d426f55c27-PR-392

Details

  • 43 of 62 (69.35%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.002%) to 90.937%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/gettext/compiler.ex 7 8 87.5%
lib/gettext/macros.ex 35 53 66.04%
Files with Coverage Reduction New Missed Lines %
lib/gettext/macros.ex 1 72.46%
Totals Coverage Status
Change from base Build 57c62494c02a30e8bd38189956c71b3e86a3cbc0: -0.002%
Covered Lines: 602
Relevant Lines: 662

💛 - Coveralls

lib/gettext.ex Outdated Show resolved Hide resolved
@whatyouhide
Copy link
Contributor Author

@josevalim done with the _with_backend stuff we talked about. There's refactoring to do but this works and I would love to merge this pass 😄

@@ -99,12 +97,12 @@ defmodule Gettext.Compiler do
end)
end

defp macros() do
def generate_macros(_env) do
Copy link
Contributor

Choose a reason for hiding this comment

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

I would say you can move this to a private function in Gettext. But it can also be done later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah anyway it's going away so wherever it lives it won't live there for long hihi

Same as `pngettext_noop/3`, but takes an explicit backend.
"""
defmacro pngettext_noop_with_backend(backend, msgctxt, msgid, msgid_plural) do
backend = Gettext.Compiler.expand_backend(backend, __CALLER__)
Copy link
Contributor

Choose a reason for hiding this comment

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

Honestly, I would not try to share this code, and instead have two implementations of expand_backend, one for macros and another for the compiler. Especially because we want to remove the one in compiler anyway.

@whatyouhide whatyouhide merged commit 0cdb06a into main Aug 19, 2024
3 checks passed
@whatyouhide whatyouhide deleted the al/new-backend-docs branch August 19, 2024 08:26
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.

4 participants