WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Languages

[Resolved] Languages

  • How can I load different language using theme mode.

    Currently optiontree loads within the template folder /themes/mythemename/option-tree/
    But I can I load my language file thats named nl_NL.po / nl_NL.mo, located in the map /themes/mythemename/option-tree/languages/

    I tried to post it on github but I cant, I get a 404.

    http://wordpress.org/plugins/option-tree/

Viewing 3 replies - 1 through 3 (of 3 total)
  • To use localization in theme mode you have to create a folder:
    /wp-content/themes/yourtheme/option-tree/languages/theme-mode
    and put your *.mo files there.

    Secondly, you have to fix a small bug in OT itself:
    open the file ot-loader.php, and find the line that reads:
    define( 'OT_LANG_DIR', dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    and replace it with:
    define( 'OT_LANG_DIR', '/' . dirname( plugin_basename( __FILE__ ) ) . '/languages/' );

    The reason for this is, the function “plugin_basename” trims any and all slashes (both leading and trailing) from the path and without the added slash OT_LANG_DIR can never be found.

    I’ve reported the issue on github: https://github.com/valendesigns/option-tree/issues/200

    EDIT: typo, had 1 closing parentheses too many

    Thanks,
    Its working fine!

    Plugin Author Derek Herman

    @valendesigns

    Version 2.2.0 is now out and should fix this issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Languages’ is closed to new replies.