WordPress.org

Ready to get started?Download WordPress

Forums

OptionTree
[resolved] Languages (4 posts)

  1. Steekvlam
    Member
    Posted 5 months ago #

    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/

  2. kraterdesign
    Member
    Posted 5 months ago #

    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

  3. Steekvlam
    Member
    Posted 5 months ago #

    Thanks,
    Its working fine!

  4. Derek Herman
    Member
    Plugin Author

    Posted 3 months ago #

    Version 2.2.0 is now out and should fix this issue.

Reply

You must log in to post.

About this Plugin

About this Topic