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

Translating single string #1

Open
millerf opened this issue Jun 10, 2020 · 0 comments
Open

Translating single string #1

millerf opened this issue Jun 10, 2020 · 0 comments

Comments

@millerf
Copy link

millerf commented Jun 10, 2020

Hi there,

First of all, thanks a lot for your wonderful plugin!!!

I am developing a website with Wordpress as a backend, and using react for the front. Obviously I have all my data called through the API.

Now, the data is coming translated and everything, which is perfect. except for my menus... It seems like through the API the menus are not translated (I am using Rest API menu v2).

Now I am trying to modify the plugin to translate the said menus, but I fail at it, as I don't know how to translate them, and if it is possible.

This is what I did so far:

if ( class_exists( 'TRP_Translate_Press' ) ) {
            $trp = TRP_Translate_Press::get_trp_instance();
            // This does't work as $translation_render is protected 
            $trp->translation_render->process_strings( ['string_to_translate'], 'fr');
};

What is the right way to translate? Or how should I approach this?

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

No branches or pull requests

1 participant