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

[BUG] - i18n not set up correctly for plugin usage #442

Open
dingo-d opened this issue Nov 20, 2024 · 0 comments
Open

[BUG] - i18n not set up correctly for plugin usage #442

dingo-d opened this issue Nov 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@dingo-d
Copy link
Collaborator

dingo-d commented Nov 20, 2024

WP 6.7 caused some weird translation issues, which got me looking into how the translations are handled in the libs.

Long story short, the translation class (I18nExample) is only valid for the themes, not plugins.

  1. In the case of the plugin, the call to translation callback (loadThemeTextdomain) should be hooked to init, not after_setup_theme
  2. In the case of the plugin, the callback should use load_plugin_textdomain function, not load_theme_textdomain (there's a difference)

I think you could create two examples, one for a theme and another for a plugin, and then in the CLI use one or the other.

@dingo-d dingo-d added the bug Something isn't working label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants