Support

Account

Home Forums Backend Issues (wp-admin) Include ACF into theme and use translation Reply To: Include ACF into theme and use translation

  • Oops,
    I did a deeper search and it turns out there is a difference between the description of these two functions in the documentation and code.
    Function ‘load_textdomain’ will also merge muliple .mo files for same domain: http://core.trac.wordpress.org/browser/tags/3.5.2/wp-includes/l10n.php#L310

    So edir is right.
    The function for use in the main plugin:
    load_textdomain('acf', dirname(__FILE__) . '/lang/acf-' . get_locale() . '.mo');
    and for use in add-ons, ex. ‘Optins Page’:
    load_textdomain('acf', dirname(__FILE__) . '/lang/acf-options-page-' . get_locale() . '.mo');

    I’ve tested this solution for normal and lite mode, and it works fine.

    P.S.
    If you want to use my translation files for ‘Options Page’ add-on, you should rename it:
    ‘acf-pl_PL.mo’ => ‘acf-options-page-pl_PL.mo’
    ‘acf-pl_PL.po’ => ‘acf-options-page-pl_PL.po’