• Resolved Uriahs Victor

    (@uriahs-victor)


    Hi there,

    We’re adding more support for Loco into one of our theme’s(Neve) features (custom layouts). Can you please point me to the documentation for the plugin?

    I’m trying to find some helper functions for the following:

    – Function to get all currently added languages for the website
    – Function to get the current language being loaded on the front end

    I’ve been able to find this information for both WPML and Polylang from their docs so trying to find it for your plugin as well so we can add support

Viewing 1 replies (of 1 total)
  • Plugin Author Tim W

    (@timwhitlock)

    Hello.

    The two functions you list don’t exist as such in Loco Translate. They are simply WordPress functions.

    – Function to get all currently added languages for the website

    Loco Translate uses get_available_languages to produce its list of “installed” languages. It does not maintain its own list of languages added through the plugin.

    – Function to get the current language being loaded on the front end

    Loco Translate does not select a language to display on the front end. This job is left to WordPress and whatever language switching plugins you might have installed. It does not maintain its own language setting.

    I’ve been able to find this information for both WPML and Polylang from their docs so trying to find it for your plugin as well so we can add support

    Unlike other l10n plugins, Loco Translate is a file editor. Think of it in the same way you would think of POEdit.

    Loco Translate does not provide any PHP functions intended for userland code. It provides only these filters and actions. Don’t call any of the plugin’s PHP code directly as this could change at any time.

    As a theme developer I’m unsure what functions of Loco Translate you would need to support. Feel free to elaborate on that if you need any further help.

    One thing you might want to look at is adding a loco.xml config file to ensure your theme files are understood correctly by the file editor.

Viewing 1 replies (of 1 total)

The topic ‘Plugin language functions’ is closed to new replies.