0

I'm currently developing a User Registration plugin, since I couldn't find any free that are properly translated I decided to create my own.

The Plugin is mainly completed... My PO and MO files are created for both language I want it to work for now.

The way I launch my Plugin, I use ShortCodes inside pages to launch my plugin.

Once the ShortCode is included in a page the user has to select that page inside my plugin configuration. The ID of the page is save in Options of WordPress and then I pull that information when someone click on REGISTER:

define("EASYREG_REDIRECT", home_url() . '?page_id=' . get_option('easyreg_redirect_page'));

My problem is when I use a Plugin like Polylang, each page has it's own "Language" value. How can I find the "Equivalent" page from Let's say English to French.

So let's say the user select the English Page: Registration (Page ID 4) how can I find the "french" equivalence Inscription (Page ID 6).

Is there a way to do it from within WordPress?

1 Answer 1

1

There is no standard way to get this information across all multilingual plugins. Some plugin use taxonomies for translation relations, other custom tables, separates sites in a network or options.

You shouldn’t have to worry about that. Just let the user use different shortcodes in each translation.

2
  • If they use different ShortCodes for different languages, does that mean I would have to "rewrite" my plugin and do the translation from inside the plugin itself like 2 different function form for French and English? Or could I use some other kind of hooks to launch the registration form?
    – pSyToR
    Commented Feb 22, 2015 at 8:54
  • @pSyToR That should be done by your language files automatically. Leave it to the translation plugin to define the proper language. Maybe let the user pass the page ID in the shortcode.
    – fuxia
    Commented Feb 22, 2015 at 8:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.