Impossible to translate the Read More button in a NSP

Premium BuddyPress WordPress theme perfect for venue, music brand or community music website.
GK User
Sat Apr 05, 2014 8:01 pm
Hello, I used the poedit tool to edit the gk-nsp language .pot file.
I added a french translation for the 'Read more' entry.
I changed the language to french, generated the .mo file.
Then I copied it in the gk-nsp/languages subfolder, and renamed it fr_FR.mo
But the buttons in the nsp modules on my page are still displaying Read More.


I also changed the languages for the theme itself, which allowed me to get rid of Read more buttons in article excerpts.
I changed the wp-config file to configure language to french, and that was it.
/**
* WordPress Localized Language, defaults to English.
*
* Change this to localize WordPress. A corresponding MO file for the chosen
* language must be installed to wp-content/languages. For example, install
* de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
* language support.
*/
define('WPLANG', 'fr_FR');

Only the ones in the nsp module do not change. Do I need to change the default language for nsp somewhere to french? Where?
Any advice please thank you!
Bill
User avatar
Fresh Boarder

GK User
Sun Apr 06, 2014 3:53 pm
I progressed a bit, and understood that I needed to do the same work for the News Show Pro plugin.
This is what I did. But it still does not work.
Is there a problem with this line in the gk-nsp.php file?
/**
* i18n
*/
load_plugin_textdomain( 'gk-nsp', false, dirname( dirname( plugin_basename( __FILE__ ) ) ).'/languages' );
shall I add a '/' at the end of the sentence?
load_plugin_textdomain( 'gk-nsp', false, dirname( dirname( plugin_basename( __FILE__ ) ) ).'/languages/' );
In both cases it does not work :(
plugin_basename( __FILE__ ) is returning "gk-nsp/gk-nsp.php"
dirname( plugin_basename( __FILE__ ) ) is returning "gk-nsp"
dirname( dirname( plugin_basename( __FILE__ ) ) ) is returning "."
dirname( dirname( plugin_basename( __FILE__ ) ) ).'/languages/' is returning "./languages"
In the languages subfolder I have my fr_FR.po and fr_FR.mo file in which I renamed the Read more into "La Suite"
If I try to display this line:
echo '<h2>' . __( 'Read more', 'gk-nsp' ) . '</h2>';
This line displays "Read more" instead of "La Suite"
why doesn't it find my language file in which the translation is "La Suite"?
Also I checked the get_locale which returns fr-FR

Any help appreciated! At least way to debug this... I'm a beginner in Wordpress development...
User avatar
Fresh Boarder

GK User
Mon Apr 07, 2014 8:48 pm
Hello,

Please change this line with load_plugin_textdomain.. from gk-nsp.php file to:

Code: Select all
load_plugin_textdomain( 'gk-nsp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );


and make sure that your .po and .mo translated files have name: gk-nsp-fr_FR.mo
User avatar
Moderator


cron