Skip to content

Translating single string #1

Description

@millerf

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions