Support

Account

Forum Replies Created

  • 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’

  • @elliot
    I’m not sure if it’s a good solution. Look at ‘load_textdomain’ documentation: http://codex.wordpress.org/Function_Reference/load_textdomain and ‘load_plugin_textdomain’ http://codex.wordpress.org/Function_Reference/load_plugin_textdomain.

    Function ‘load_plugin_textdomain’ will megre multiple lang files for the same domain, ‘load_textdomain’ will not.

    In plugin ‘Options Page’, there is problem with loading transtaltions. Why? You use ‘load_plugin_textdomain’ for ‘acf’ domain, but ‘lang’ dir contains ‘acf-options-page.pot’ file. It’s name should be ‘acf.pot’. Similarly: ‘acf-options-page-pt_BR.mo’ should be ‘acf-pt_BR.mo’.

    Here is Polish translation for ‘Options Page’ plugin.

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