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

Do not translate plugin data when creating instance #37

Open
wants to merge 1 commit into
base: 0.3.x
Choose a base branch
from

Conversation

XedinUnknown
Copy link
Member

When retrieving plugin data, translation is no longer used. This used to cause the plugin's text domain to be loaded. It caused weird situations when working with and overriding WP i18n. Example:

You need to override the translation file using override_load_textdomain. For this, you need the name of the text domain to override translations for, so as not to affect other plugins/themes. You decide to retrieve the plugin's text domain by using the plugin created by this plugin factory. This loaded the text domain, which caused your override to be bypassed: you are still in the process of registering it.

Now, the factory no longer causes the plugin text domain to load, and you can safely load it later at a time convenient for you.

When retrieving plugin data, translation is no longer used. This used to cause the plugin's text domain to be loaded. It caused weird situations when working with and overriding WP i18n. Example:

You need to override the translation file using `override_load_textdomain`. For this, you need the name of the text domain to override translations for, so as not to affect other plugins/themes. You decide to retrieve the plugin's text domain by using the plugin created by this plugin factory. This loaded the text domain, which caused your override to be bypassed: you are still in the process of registering it.

Now, the factory no longer causes the plugin text domain to load, and you can safely load it later at a time convenient for you.
@XedinUnknown XedinUnknown added the bug Something isn't working label Oct 13, 2023
@XedinUnknown XedinUnknown added this to the v0.3 milestone Oct 13, 2023
@XedinUnknown XedinUnknown self-assigned this Oct 13, 2023
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

Successfully merging this pull request may close these issues.

1 participant