Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.76k stars 885 forks source link

First-time configuration Translations not applied #18495

Closed iamheretoscale closed 2 years ago

iamheretoscale commented 2 years ago

Please give us a description of what happened.

First-time configuration not translatable.

Please describe what you expected to happen and why.

i have added translation for strings in other language file and change wordpress admin language to tested language. nothing was translated in First-time configuration menu. all contents are in english and not translated to any other languages in this menu.

How can we reproduce this behavior?

1.install yoast seo 18.9 and yoast seo premium 18.5 2.change wordpress admin language to other languages (such as Germany) 3.add translation for any desired string on .js file in path: "wordpress-seo-premium\languages\wordpress-seo-premiumjs-de_DE.json". 4.goto First-time configuration menu "/wp-admin/admin.php?page=wpseo_dashboard#top#first-time-configuration" and check translation. nothing happen.

Technical info

Used versions

mmikhan commented 2 years ago

How did you translate any desired strings? Did you use any plugins? If so, which one? If not, how did you do it?

iamheretoscale commented 2 years ago

Hi iamazik,

i checked the string and found that it load wordpress-seo text domain. goto wordpress.org website and get wordpress-seo translation file. translate all untranslated strings and copy .mo, .po files on the \wp-content\languages\plugins folder. all of my translated strings on all parts of plugin are loaded. except First-time configuration tab content. "Tab title is translated to my custom string. tab contents not translated into any language and translated strings on the .mo file not loaded. my website is persian language. all sections are translated. for your info i have inserted custom translation for Tab title. as you can see on the attached image. content not translated.

image_2022-05-31_001404170

mmikhan commented 2 years ago

Thanks for your clarification. I have looked into this and can confirm the relevant strings are indeed translatable in Yoast SEO. For your convenience, I have referenced the relevant strings from inside the Yoast SEO plugin below:

So, why are the relevant translations that you have added inside the /wp-content/languagelanguages/plugins/ isn't working for you?

That's because the relevant strings are inside of a React component and using the WordPress @wordpress/i18n package that works differently when comparing how you translate strings from a PHP file manually or using a 3rd party plugin like Loco Translate.

The best way to translate the relevant strings is by contributing to your language through https://translate.wordpress.org/. Once there are enough (90%) translated strings, WordPress will automatically load the relevant strings in your language when you select the site language from WordPress general settings.

However, if you'd still like to manually translate the relevant strings manually on your own, you'll need to follow the steps given in the relevant resources: