WordPress.org

Ready to get started?Download WordPress

Forums

Codestyling Localization
[resolved] Translation of cNews theme in wrong folder (2 posts)

  1. Lea Cohen
    Member
    Posted 1 year ago #

    When running CSL on cNews theme, CSL puts the translation files in the cnews/functions/lang/ folder, but that's not the location the theme reads from. The theme reads from cnews/languages folder, as defined in its functions.php file:

    load_theme_textdomain('csc-themewp', get_template_directory() . '/languages');
    
    I can understand where CSL gets its notion about the functions/lang folder - somewhere else in the theme there is a definition:
    load_theme_textdomain(‘csc-themewp’, RWMB_DIR . ‘lang’);

    But why does CSL prefer this definition? It's not the correct one, and that means that I can't use CSL for translation of this theme :(

    Thanks for a wonderful plugin!

    http://wordpress.org/extend/plugins/codestyling-localization/

  2. codestyling
    Member
    Plugin Author

    Posted 1 year ago #

    Because this folder comes first during the dir scan and contains at least one *.mo/*.po or *.pot file. Because CSL can't analyse the path because it's created by function call and not by a constant, the only chance is to take that folder containing translation files.
    If there are 2 of them (whatoever reason?) the first found will win.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.