• Hi there, thanks for this excellent plugin. I really like working with it but need some help as per the topic title.

    So when I write a custom plugin (i.e. not published here) I write the translatable strings in the code in English with a unique plugin text domain, then use WP-CLI to generate a languages/plugin-domain.pot file. I use Loco Translate on my localhost to create the relevant languages/plugin-domain-de_DE.po and languages/plugin-domain-de_DE.mo files. I commit everything to the plugin repo on GitHub/GitLab etc. On the live site, which also has Loco Translate on it, I git pull the plugin and my translations appear as expected. So far so good!

    My German, however, is passable but not great, so what I’d like to do is have a native-speaking WordPress user be able to update the translations on the live site with better versions. I plan to periodically sync those improved translations back to the plugin repo via a script that’s part of my localhost backup schedule.

    Which is where my weak understanding of the “Use this file as template when running Sync” checkbox comes in…

    In Loco Translate on the live site, when I make a copy of the plugin’s translation files to languages/loco/plugins I copy the target translations from “de_DE” so that the WordPress user has something to be getting on with. And I definitely want the translations in languages/loco/plugins to sync with the source files in the plugin’s languages directory to pull in new strings and update amended ones when the plugin gets updated.

    So here’s the question at last — should I check or uncheck “Use this file as template when running Sync” in this situation?

    Many thanks in advance.

    The page I need help with: [log in to see the link]

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

    (@timwhitlock)

    If you want your copied translation file to be in sync with plugin-domain.pot, then leave that option unchecked.

    If you want your copied translation file to be in sync with the original.po file you copied, then check this option.

    If you have a chain of dependency like template.pot -> original.po -> copied.po then you’d have to ensure you synced the files accordingly. i.e update your original PO from the POT, then update your copy from the original. Otherwise you’d sync both POs from the POT.

    I can’t tell what you should do, but creating the chain as above would mean that any translations modified in your original PO which are empty in your copied PO, would be merged in when you sync.

    Thread Starter Christian Wach

    (@needle)

    If you want your copied translation file to be in sync with plugin-domain.pot, then leave that option unchecked.

    Hmm, I think this is the option I need. I rebuild the .pot file every time there’s a new release of the plugin and once the “starter” original.po file has been shipped, it would make sense for the copied.po file to become the canonical one. I can then sync that back to the repo as and when.

    Thanks for clarifying @timwhitlock – it always surprises me how complicated translation is.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.