[resolved] Languages (4 posts)

  1. Steekvlam
    Posted 2 years 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.


  2. kraterdesign
    Posted 2 years ago #

    To use localization in theme mode you have to create a folder:
    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
    Posted 2 years ago #

    Its working fine!

  4. Derek Herman
    Plugin Author

    Posted 1 year ago #

    Version 2.2.0 is now out and should fix this issue.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • OptionTree
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic