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

Translation replaced by theme #2538

Open
murilocarvalhodev opened this issue Oct 2, 2024 · 1 comment
Open

Translation replaced by theme #2538

murilocarvalhodev opened this issue Oct 2, 2024 · 1 comment

Comments

@murilocarvalhodev
Copy link

public function __construct( $textdomain = 'kirki', $languages_path = '' ) {
$this->textdomain = $textdomain;
$this->languages_path = $languages_path;
// This will only work if we're inside a plugin.
add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] );
// If we got this far, then Kirki is embedded in a plugin.
// We want the theme's textdomain to handle translations.
add_filter( 'override_load_textdomain', [ $this, 'override_load_textdomain' ], 5, 3 );
}

I'm using Kirki as a plugin installed on WordPress, but the translation is still being passed to the theme's textdomain. I would like to keep the plugin translation separate from the theme translation. I've tried using different hooks to prevent the default behavior, but I haven't been successful.

The plugin only recognizes its own translation files after commenting out the 'override_load_textdomain' filter linked to the method which is also called 'override_load_textdomain'.

As I said earlier, I tried using the same 'override_load_textdomain' filter to prevent the behavior, but it doesn't seem to prevent the 'override_load_textdomain' method from being started along with the class. I tried to do this through my child theme's functions.php and through a custom plugin.

I don't know if I'm doing something wrong, can anyone help me?

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
@murilocarvalhodev and others