@vlado have you had a chance to look at this?
@hdebruyne Sorry for the late reply. Didnt see your message. What did you mean here:
So I mean the Restricted Pages section and everything in it.
Is that the Pages page where you have an overview of all your pages you can restrict?
Hi @vladogrcic
What I mean is the My Account page on the frontend. There you have made a Restricted Pages section, where a logged in user can view the restricted pages and expiration. I want to be able to translate this section, since it’s all in English. But somehow the translation in the .po file has no effect. Maybe I’m doing something wrong…?
Regards,
Hans.
@hdebruyne I think I know what might be wrong. Did you generate .mo files? Those are needed for this to work. So try Poedit. That one should be able to create them. The exception are json files. They don’t need that. You just need to change the country code in the filename and edit it. They are for the Gutenberg editor. Alternately you could use a translation plugin to translate strings like Polylang, Loco Translate or WPML.
Hi @vladogrcic
I tried both poedit (with generated .mo file) and Loco translate. But no effect. Are you sure the text isn’t hardcoded by accident?
@hdebruyne I’m 100% sure its not hardcoded. I just checked to be sure. However it might not be loading correctly. I’ll check whats wrong. Does that happen just on that page or on others as well?
I only tried on this page. It’s the only place I want to translate..
Could you check if there are files named page_restrict_domain-nl_NL.po and page_restrict_domain-nl_NL.mo (or maybe nl_BE if its Belgium, I don’t know) in wp-content/languages/plugins? If its there, did you set your site language to Dutch in Settings->General? I checked and translations seem to work fine.
No, they are here: public_html/wp-content/plugins/page-restrict-for-woocommerce/languages
Do I need to move or copy them?
Hi,
I moved them to wp-content/languages/plugins, using Loco translate. And it works!
Don’t know why the other location didn’t work though. I’m not very familiar with the translation stuff.
Thanks @vladogrcic !
So the files are in wp-content/languages/plugins? Your translation files shouldn’t be in the wp-content/plugins folder. It might disappear when you update the plugin. But if you used translation plugins it should work. Maybe you are using them incorrectly? Maybe try translating another plugin to check.
Also what about this:
If its there, did you set your site language to Dutch in Settings->General?
Loco translate lets you choose among several options to store the translation files.
System: languages/plugins/page_restrict_domain-nl_NL.po
Author: plugins/page-restrict-for-woocommerce/languages/page_restrict_domain-nl_NL.po
Custom: languages/loco/plugins/page_restrict_domain-nl_NL.po`
So, now I’ve choosen System and it works fine. The default is Author, which doesn’t work apparently.
Glad to hear it! The author option might work now, I added some updates to the plugin. As long as the plugin handles the author part its fine so you can choose that one if you prefer, if it works.