Support » Plugin: Loco Translate » Translate po mo files associated to pages

  • Resolved Eric Malalel

    (@teachlynx)


    I have developed a plugin for my personal use, to handle page localization this way.
    Each word or sentence which needs to be translated in a page must be enclosed in a shortcode such as [locale text=”text to translate”].
    My plugin then provides a utility to extract all these shortcodes in a page and generates a po file, with one po file for each page.
    So I can then build one po file for each language I want to be supported on a page.
    I have setup a language selector on the frontend, and once a locale is selected, each page is displayed in the selected language, using the mo file associated to that page.
    Currently I use POEdit to manage translation, but your plugin could be a brilliant alternative, by enabling translators to work online.
    But my po files are not associated to theme, nor plugin, they are associated to pages.
    So, how to proceed to have all these po files displayed in loco, so loco can be used to translate them?

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

    (@timwhitlock)

    I don’t follow why the plugin you’ve developed can’t be associated with PO files. I understand that your strings aren’t extracted in the normal way, but that’s fine. You can maintain your own POT file regardless of how it’s generated. Just tell Loco where to find it and what text domain it belongs to.

    Does your plugin declare the text domain that your page strings are extracted to? Is the template file in a standard location inside the plugin?

    For more advanced configuration, see https://localise.biz/wordpress/plugin/manual/bundle-config You may want to “lock” the template if your plugin is responsible for generating it.

    My plugin handles the text domain, but is it possible to associate multiple po/mo files to the same plugin? How will it be handled by Loco?
    From the Loco admin interface, it seems I select a theme or plugin, and then I can edit the single po file associated to that theme/plugin, but I can’t see a list of files.
    Please correct me if I’m wrong.

    Plugin Author Tim W

    (@timwhitlock)

    You will see a list of files if Loco knows where to find them and they exist. The link I gave you explains how to configure your bundle if you’re not using a standard file layout.

    OK thanks a lot.
    I will dig into your documentation and I assume I should be able to handle it.
    Also, I see there are plans for Loco here: https://localise.biz/plans
    So, is the plugin free or will I need to upgrade to paid plans if I exceed 2000 translations?

    Plugin Author Tim W

    (@timwhitlock)

    The plugin has no limits, because all data is stored on your system.

    There is currently no link between the WordPress plugin and the Loco platform, so upgrading will currently give you no extra functionality. Eventually you will be able to sync to the Loco platform (and collaborate) but this is in the works.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Translate po mo files associated to pages’ is closed to new replies.