Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author mosparo

    (@mosparo)

    Hi @astralinternet

    Thank you very much for your question.

    The plugin and mosparo are, in general, multilingual. The frontend translations of mosparo are available in multiple languages. You can find the complete list here: https://github.com/mosparo/mosparo/blob/master/translations/README.md

    When initializing mosparo, mosparo chooses the translations based on your browser’s locale.

    But there’s also a WordPress filter that allows you to adjust the settings for the frontend box. With that, you can set the language of the mosparo box independently from your browser’s locale (as long as the translation is in mosparo included), or you can even set your translations (customMessages). You can find an example here: https://github.com/mosparo/wordpress-plugin/issues/7#issuecomment-2014640026

    Or do you need something else adjustable or translatable?

    Kind regards,

    zepich / mosparo Team

    Thread Starter Astral Internet

    (@astralinternet)

    Thank you for this information, the hook work great.

    Wouln’d it be a good idea to add a hook for most multi languge extension (at least until Gutenberg natively support it (finger crossed!)). A simple addition to the code could do the trick :

    // Set Captcha language
    function mosparoOverrideMessages($options)
    {
        // Match WPML language if available
        if (has_action('wpml_current_language')) {
            $options['language'] = apply_filters( 'wpml_current_language', NULL );
            
        // Match Polylang language if available
        } elseif(function_exists(pll_current_language)) {
           $options['language'] = pll_current_language(); 
        }
        
        return $options;
    }
    add_filter('mosparo_integration_filter_frontend_options', 'mosparoOverrideMessages');

    Plugin Author mosparo

    (@mosparo)

    Hi @astralinternet 

    Thank you very much for your suggestion!

    A user on GitHub, Sapper-Morton, suggested a very similar idea: offering an option to determine the language using the HTML lang attribute. The problem with such a solution is that we must implement it in every plugin and integration.

    It’s the same with your suggestion. Of course, it’s possible, but it can be complicated based on the number of multilanguage plugins. Additionally, we should do it for all our plugins and integrations.

    But, based on the suggestion from Sapper-Morton, we had an idea to implement the HTML lang directly in the mosparo logic. We suggest always sending the HTML lang attribute to the mosparo API and adding an option in mosparo with which the project owner can choose between the source of the language (Browser or HTML tag lang). You can read the whole idea here:?https://github.com/orgs/mosparo/discussions/230#discussioncomment-9441541

    With this solution, we can add this more flexible option very easily and for all integrations simultaneously.

    Please let us know what you think about this solution.

    Kind regards,

    zepich / mosparo Team

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multi language support’ is closed to new replies.