Support » Plugin: Loco Translate » Issue with translating Gravity Forms

  • Resolved Nick Ciske


    I was stumped at to why my translation for Gravity Forms was not working.

    And then I looked in the languages directory:

    Hmmm… that doesn’t work when Loco Translate outputs

    Sure enough, adding the prefix made the translations show up.

    I looked at a few more plugins and Advanced Custom Fields does this too: acf-xx_XX.

    Now I think GF is the odd one here, but it appears that being able to specify a prefix (or to indicate the textdomain should be prefixed to the .mo file) would be a useful option.

    Or perhaps outputting both (just to be safe)?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author timwhitlock


    I hope I’ve interpreted your issue correctly here.

    Are you saying that Loco outputs domainless PO and MO files even though existing PO files in the directory are prefixed correctly?

    As a rule, Loco will always prefix files with the textdomain for plugins, BUT it will attempt to copy the style that is already being used. So if you have domainless PO files already in the directory it will assume that’s want you want and copy the style.

    That bit of code is here, if you’re interested.

    Perhaps there is a bug, but I just need to be sure whether this is expected behaviour or not. Can you send me a link to a free plugin that suffers from your problem and I’ll try it out?

    Yes, existing files are

    The Korean files I created with Loco were domainless: ko_KR.po &

    It does pick up the existing languages for ACF (so it must be something different about Gravity Forms in that regard).

    But… when I create a new Korean language file for ACF… it gets created as: ko_KR.po & not acf-ko_KR.po &

    It it helps:
    WP 3.8.1
    WP Engine


    Plugin Author timwhitlock


    Ok, I’ll look into this with acf.

    Which version of Loco Translate are you using?

    Ah, I see the issue:

    // only prefix with text domain for plugins and files in global lang directory
            if( 'plugin' === $this->get_type() || 0 === strpos( $dir, $this->_lang_dir() ) ){
                $prefix = $domain.'-';
            else {
                $prefix = '';

    So Loco is saving these files in the plugin’s language folder — so it’s not using the prefix (though it appears the plugin authors are, regardless of location).

    So is the real issue the lang folder and not the path?

    Am I missing something? My root languages folder is /wp-content/languages/ – I just defined that explicitly in wp-config and Loco still stored the po/mo in the plugins language folder.

    Latest. Just installed it last night 😉

    Plugin Author timwhitlock


    I think the wording of my comment may be confusing.

    only prefix with text domain for plugins and files in global lang directory

    should perhaps be:

    prefix with text domain for all plugins and for any files in global lang directory, but not for themes in their theme directory.

    The first block should be used because your package is of type ‘plugin’.
    I’ll debug this properly and let you know when I can reproduce it.

    Plugin Author timwhitlock


    This was incredibly simple. A typo here:

    so actually not related to specific plugins, but a silly bug missed through not testing thoroughly enough.

    I’ve made an emergency fix to the current version and should be fine in future versions too.

    Happens to the best of us. Glad I could help squash it!

    I have installed gravity form to use in Arabic language. I installed WPML plugin to translate gravity form content and style should be from right to left according to Arabic language. But is doing nothing. I have configure translator as local but I do not see any document there stored for translation.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Issue with translating Gravity Forms’ is closed to new replies.