Skip to content

Fix concatenation of sigils #412

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

Merged
merged 5 commits into from
Apr 17, 2025

Conversation

Gladear
Copy link
Contributor

@Gladear Gladear commented Apr 11, 2025

Add support for concatenation with sigils (e.g. "Hello " <> ~s(world)).

Fixes #411

@coveralls
Copy link

coveralls commented Apr 11, 2025

Pull Request Test Coverage Report for Build d8f2c8cd0ec4b7206141cae118114b7276f238c0-PR-412

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 92.518%

Totals Coverage Status
Change from base Build 6a97765953bdec82233e6509c8df4f5feda62fc3: 0.2%
Covered Lines: 643
Relevant Lines: 695

💛 - Coveralls

Copy link
Contributor

@whatyouhide whatyouhide left a comment

Choose a reason for hiding this comment

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

Just one comment and we're ready to ship!

@@ -709,15 +709,29 @@ defmodule Gettext.Macros do
"""
end

# We support nil too in order to fall back to a nil context and always use the *p
# variants of the Gettext macros.
do_expand_to_binary(term, env, raiser)
Copy link
Contributor

Choose a reason for hiding this comment

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

We kind of moved away from the convention of do_ prefixes because of their "imperative" feel. Instead, here what if we call this

Suggested change
do_expand_to_binary(term, env, raiser)
validated_expand_to_binary(term, env, raiser)

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK ! Changed 👌

@Gladear Gladear requested a review from whatyouhide April 17, 2025 06:59
@whatyouhide whatyouhide merged commit 7405f84 into elixir-gettext:main Apr 17, 2025
3 checks passed
@whatyouhide
Copy link
Contributor

Thanks @Gladear 💟

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.

gettext/1 and related macro do not support ~S concatenated strings
3 participants