Skip to content

Update gettext#215

Open
SerhiiFesenko wants to merge 2 commits intobluzky:mainfrom
SerhiiFesenko:update-gettext
Open

Update gettext#215
SerhiiFesenko wants to merge 2 commits intobluzky:mainfrom
SerhiiFesenko:update-gettext

Conversation

@SerhiiFesenko
Copy link
Copy Markdown
Contributor

@SerhiiFesenko SerhiiFesenko commented Sep 22, 2025

Summary

Modernize Gettext configuration in storybook to eliminate deprecation warnings and improve compile-time performance.

Changes

  • Update minimum version from ~> 0.20 to ~> 0.26
  • Modernize backend definition: use Gettext, otp_app:use Gettext.Backend, otp_app:
  • Update usage pattern: import SaladStorybookWeb.Gettextuse Gettext, backend: SaladStorybookWeb.Gettext
  • Update documentation to reflect new API pattern

Benefits

  • ✅ Eliminates compilation warnings
  • ⚡ Improves compile-time performance
  • 🔄 Uses modern API introduced in 0.26

Notes

Gettext 1.0.0 was recently released with no breaking changes from 0.26.x. We can consider upgrading to 1.0 in a future update.

Summary by Sourcery

Modernize the Storybook Phoenix app’s Gettext setup by upgrading the dependency and switching to the new backend API to remove deprecation warnings and improve compile-time performance.

Enhancements:

  • Bump Gettext dependency requirement from ~> 0.20 to ~> 0.26.
  • Switch the translation module to use Gettext.Backend for its otp_app configuration.
  • Replace all imports of SaladStorybookWeb.Gettext with use Gettext, backend: SaladStorybookWeb.Gettext across views, controllers, and components.

- Update gettext dependency from ~> 0.20 to ~> 0.26
- Enables access to modern backend API features
- Prepares for configuration modernization
- Replace deprecated `use Gettext, otp_app:` with `use Gettext.Backend, otp_app:`
- Update import statements to use `use Gettext, backend:` pattern
- Remove compilation warnings about outdated gettext usage
- Leverages modern API now available in 0.26 series
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Sep 22, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR upgrades the project’s Gettext integration to the modern 0.26+ API by bumping the dependency, switching the backend macro, migrating old imports to the new use-based pattern, and updating documentation examples accordingly.

File-Level Changes

Change Details Files
Upgrade Gettext dependency version
  • Bump {:gettext} from "> 0.20" to "> 0.26"
storybook/mix.exs
Modernize Gettext backend definition
  • Replace use Gettext, otp_app: with use Gettext.Backend, otp_app:
  • Update code examples to use use Gettext, backend: SaladStorybookWeb.Gettext
storybook/lib/salad_storybook_web/gettext.ex
Replace translation imports with use macro
  • Swap import SaladStorybookWeb.Gettext for use Gettext, backend: SaladStorybookWeb.Gettext in the main web module
  • Do the same replacement in CoreComponents
storybook/lib/salad_storybook_web.ex
storybook/lib/salad_storybook_web/components/core_components.ex

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant