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

WPML string translation hooks #1761

Closed
srdjan-jcc opened this issue Jul 10, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@srdjan-jcc
Copy link
Contributor

commented Jul 10, 2018

Translations for Home Page Title and Home Page Description fields are not applied.
AIOSEOP is calling get_options() too early and translations are not applied.

When home page is loaded, get_options() hook is only once called from file/line
all-in-one-seo-pack-pro/all_in_one_seo_pack.php :126

If aioseop_get_options() is called on 'init' hook - translations are applied.

To Reproduce

  1. Edit Home Page Title and Home Page Description fields
  2. Translate Home Page Title and Home Page Description fields using WPML String Translation
  3. Visit home page in other language
  4. Translations are not applied

Expected behavior
Translations are applied to Home Page Title and Home Page Description fields.

@michaeltorbert

This comment has been minimized.

Copy link
Member

commented Jul 10, 2018

Thanks for the report. Feel free to submit a PR if you like.

@srdjan-jcc

This comment has been minimized.

Copy link
Contributor Author

commented Aug 30, 2018

@michaeltorbert I have no exact suggestions for changing initialization.
Here is snippet that fixes issue:
https://gist.github.com/srdjan-jcc/e4352428f1c7cc4271b7aef52aeeb0af

Tested and looks it has no (bad) impact on other code.
Would be good to perform your tests too.

Do you think it can be added like that somewhere in AIOSEOP?

@michaeltorbert

This comment has been minimized.

Copy link
Member

commented Aug 30, 2018

Do you think it can be added like that somewhere in AIOSEOP?

@srdjan-jcc Sure, but as we have hundreds of issues, we have to prioritize, so submitting a PR is the quickest way to get it included.

@srdjan-jcc

This comment has been minimized.

Copy link
Contributor Author

commented Sep 3, 2018

@michaeltorbert Created PR here #1876

Please make sure fix is also applied to PRO version, thank you!

@michaeltorbert michaeltorbert added this to the 2.8 milestone Sep 3, 2018

@michaeltorbert

This comment has been minimized.

Copy link
Member

commented Sep 5, 2018

When testing, make sure to first verify the problem, and that the linked PR fixes it.

@arnaudbroes arnaudbroes self-assigned this Sep 7, 2018

@wpsmort wpsmort modified the milestones: 2.8, 2.9 Sep 7, 2018

@arnaudbroes

This comment has been minimized.

Copy link
Contributor

commented Sep 7, 2018

@wpsmort this has first verified and then tested. Works fine. @michaeltorbert needs code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.