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

Load translations manually in the widget constructor #46

Merged
merged 1 commit into from
Feb 27, 2015

Conversation

mweimerskirch
Copy link
Contributor

otherwise the translations are not available inside the constructor.

Fixes #43

…se the translations are not available inside the constructor

Fixes qTranslate-Team#43
@johnclause
Copy link
Member

Why it is not available? Is constructed called too early, of textdomain is set too late? Should not we reconcile their sequence? Otherwise, what if we add another widget, we will have to set text domain in each of them? This does not seem to be quite right, does it?

@pedro-mendonca
Copy link
Contributor

pedro-mendonca commented Feb 26, 2015 via email

@mweimerskirch
Copy link
Contributor Author

I tried changing the priorities, but this is the only way it works. I had a look at a few other plugins (Akismet, GravityForms, ...). They do it the same way. No idea why though :-(

@pedro-mendonca
Copy link
Contributor

Same here, changed order of php files loading and in the end tried that doble textdomain call in widget.

johnclause added a commit that referenced this pull request Feb 27, 2015
Load translations manually in the widget constructor
@johnclause johnclause merged commit 5de279d into qTranslate-Team:master Feb 27, 2015
@johnclause
Copy link
Member

It is strange indeed, but there is no time to figure it out, so let it be in for now.

@johnclause
Copy link
Member

Actually, https://codex.wordpress.org/Function_Reference/load_plugin_textdomain seem to recommend to run load_plugin_textdomain in 'plugins_loaded' action, so I moved it and it seems to have helped. Let see what else gets broken :) It will be uploaded in 3.2-b3, not yet there.

@pedro-mendonca
Copy link
Contributor

It's ok now, everything translated, core, menu and widget.

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.

Widget 'qTranslate Language Chooser' not translated
3 participants