• Resolved carogal

    (@carogal)


    Hello, i have translate the clean-testimonials.po file. And rename it in fr-FR.po (and .mo)

    But… what can i change here :

    * Load language files
    	*
    	* @since 1.5.1
    	*
    	* @return void
    	*/
    	public function load_textdomain() {
    
    		// Set filter for plugin's languages directory
    		$lang_dir = plugin_dir_path( __FILE__ ) . 'languages/';
    
    		// Traditional WordPress plugin locale filter
    		$locale = apply_filters( 'plugin_locale', get_locale(), 'clean-testimonials' );
    		$mofile = sprintf( '%1$s-%2$s.mo', 'clean-testimonials', $locale );
    
    		// Setup paths to current locale file
    		$mofile_local = $lang_dir . $mofile;
    		$mofile_global = WP_LANG_DIR . '/clean-testimonials/' . $mofile;
    
    		if ( file_exists( $mofile_global ) ) {
    			load_textdomain( 'clean-testimonials', $mofile_global );
    		}
    		elseif ( file_exists( $mofile_local ) ) {
    			load_textdomain( 'clean-testimonials', $mofile_local );
    		}
    		else {
    			// Load the default language files
    			load_plugin_textdomain( 'clean-testimonials', false, $lang_dir );

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Thank for your help…

    https://www.ads-software.com/plugins/clean-testimonials/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter carogal

    (@carogal)

    I found the solution ….

    just replace :

    // Traditional WordPress plugin locale filter
    $locale = apply_filters( ‘plugin_locale’, get_locale(), ‘clean-testimonials’ );
    $mofile = sprintf( ‘%1$s-%2$s.mo’, ‘clean-testimonials’, $locale );

    by

    // Traditional WordPress plugin locale filter
    $locale = apply_filters( ‘plugin_locale’, get_locale(), ‘clean-testimonials’ );
    $mofile = sprintf( ‘fr-FR.mo’, ‘clean-testimonials’, $locale );

    Plugin Author lukerollans

    (@hellolukerollansme)

    Hi carogal,

    That’s awesome! Feel free to email us the translated .mo file and we’ll include it in the next version!

    Shoot it through to [email protected]

    If you’re a developer, you can submit it to us on GitHub through a pull request.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Translation’ is closed to new replies.