google-code-export / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
2 stars 1 forks source link

Dictionaries.php uses wrong path for .mo files #346

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Current dictionaries.php file contains following line:

load_plugin_textdomain( CCTM_TXTDOMAIN, false, CCTM_PATH.'/lang/' );

Which send the absolute path in the 3rd parameter to load_plugin_textdomain() 
hence its documentation says it should be a relative path to the plugin 
directory. This way no custom translations can be loaded.

Recommended Fix: 
load_plugin_textdomain( CCTM_TXTDOMAIN, false, 
'custom-content-type-manager/lang/' );

Temporary fix can be uploading a custom dictionaries.php into 
wp-content/uploads/cctm/conf/lang/ directory containing above line.

*SYSTEM INFO* 
------------------------ 
Plugin Version: 0.9.5.11-pl
WordPress Version: 3.3.1
PHP Version: 5.3.6-13ubuntu3.6
MySQL Version: 5.1.58-1ubuntu1
Server OS: Linux
------------------------ 
ACTIVE PLUGINS: 
 * Dashboard Notepad v.1.39 [http://sillybean.net/code/wordpress/dashboard-notepad/]
 * Fancybox v.1.0.6 [http://wordpress.org/extend/plugins/fancy-box/]
 * NextGEN Gallery v.1.9.2 [http://alexrabe.de/?page_id=80]
 * Private WP v.1.1 [http://www.kruse-net.dk/wordpress-plugins/private-wp/]
 * qTranslate extension v.0.1 [http://786.pe/plugins/qtranslate-extended]
 * qTranslate slug with Widget v.0.5 [http://www.3dolab.net/261/qtranslateslug-plugin-widget]
 * qTranslate v.2.5.28 [http://www.qianqin.de/qtranslate/]
 * Checkout v.1.6.6.4 [http://tribulant.com/plugins/view/10/wordpress-shopping-cart-plugin]
 * Newsletters v.3.8.8 [http://tribulant.com/plugins/view/1/wordpress-newsletter-plugin]
------------------------ 
CURRENT THEME: Twenty Eleven v.1.3 http://wordpress.org/

Original issue reported on code.google.com by antronin on 2 Mar 2012 at 10:44

GoogleCodeExporter commented 9 years ago
Actually for temporary fix the above stated path is wrong and it is wrongly 
stated in the original dictionaries.php file comment too.
It says:

This handles loading of dictionaries/lexicons for i18n/locale settings.  If you 
have
added your own modifications to this plugin or if you want to customize the
lexicon in any way, you can save a modified version of this file here:
wp-content/uploads/cctm/conf/lang/dictionaries.php

But the self::load_file() is looking for 
wp-content/uploads/cctm/config/lang/dictionaries.php

Note the "config" directory name instead of "conf".

Original comment by antronin on 2 Mar 2012 at 10:53

GoogleCodeExporter commented 9 years ago
Thanks for the report!  Good catch.  

Original comment by ever...@fireproofsocks.com on 4 Mar 2012 at 7:42

GoogleCodeExporter commented 9 years ago
The comment has been updated.  I don't like hard-coding the plugin's directory, 
so I used the following variation:

    load_plugin_textdomain( CCTM_TXTDOMAIN, false, basename(CCTM_PATH).'/lang/' );

Committed revision 515520.

Original comment by ever...@fireproofsocks.com on 6 Mar 2012 at 8:18