Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
I am trying to modify Chris's socialize plugin for i18n support but I just don't know where I lost it. I've read the wiki and created a gs-socialize/lang/ folder along with two necessary php language files: en_US.php & pl_PL.php. However, I always get the text shown in English.

Code:
<?php
/*
Plugin Name: GS-Socialize
Description: Adds social bookmark icons/links to the bottom of all posts/pages.
Version: 1.1
Author: Chris Cagle
Author URI: http://www.cagintranet.com/
*/

# get correct id for plugin
$thisfile=basename(__FILE__, ".php");
define('GSSOCIALICONPATH', $SITEURL.'plugins/gs-socialize/img/');

#i18n support
global $LANG;
if (function_exists('i18n_load_texts')) {
  i18n_load_texts('gs-socialize');
} else {  
  i18n_merge('gs-socialize') || i18n_merge('gs-socialize','en_US');
}

# registration
register_plugin(
    $thisfile,
    'GS Socialize',
    '1.1',
    'Chris Cagle',
    'http://www.cagintranet.com/',
    'Adds social bookmark icons/links to the bottom of all posts/pages',
    '',
    ''
);

# hooks
add_action('theme-header', 'gssocial_css');
add_action('content-bottom', 'gssocial_icons');

# functions
function gssocial_css() {
    echo '
        <style type="text/css">
            div#socialize {margin:20px 0;}
            div#socialize a {margin:0 8px 0 0 0;}
        </style>
    ';
}

function gssocial_icons() {
    echo '
    <div id="socialize">
        <b class="gssocial-title" >' .i18n_r("gs-socialize/SHARE"). '</b>&nbsp;
        <a href="http://www.facebook.com/share.php?u='. get_page_url(TRUE) .'&t='. return_page_title() .'" title="Facebook" ><img src="'.GSSOCIALICONPATH .'facebook.png" alt="Facebook" /></a>
        <a href="http://twitter.com/home?status='. return_page_title() .' - '. get_page_url(TRUE) .'" title="Twitter" ><img src="'.GSSOCIALICONPATH .'twitter.png" alt="Twitter" /></a>
    </div>';
/*        
        <a href="http://delicious.com/post?url='. get_page_url(TRUE) .'&title='. return_page_title() .'" title="Add to Delicious" ><img src="'.GSSOCIALICONPATH .'delicious.png" alt="Add to Delicious" /></a>
        <a href="http://digg.com/submit?phase=2&url='. get_page_url(TRUE) .'&title='. return_page_title() .'" title="Submit to Digg" ><img src="'.GSSOCIALICONPATH .'digg.png" alt="Submit to Digg" /></a>
        <a href="http://www.stumbleupon.com/submit?url='. get_page_url(TRUE) .'&title='. return_page_title() .'" title="Stumble This" ><img src="'.GSSOCIALICONPATH .'stumble.png" alt="Stumble This" /></a>
    
    ';
*/
}

?>
Reply


Messages In This Thread
rewrite language problem - by tomkop - 2013-03-27, 06:34:44
Enhancement suggestion - by hameau - 2013-05-12, 04:17:12
Enhancement request - by hameau - 2013-06-14, 20:02:07
RE: Enhancement request - by mvlcek - 2013-06-14, 22:04:12
RE: Enhancement request - by hameau - 2013-06-14, 23:01:36
Duplicate language cookies bug - by enzy - 2013-08-20, 07:03:26
RE: Duplicate language cookies bug - by ohayo - 2013-08-20, 18:12:25
Plugin is not shown - by tosho - 2013-09-15, 12:10:37
1000 pages limit in i18n_navigation - by titus - 2014-10-13, 21:58:36
Bug found - by lbarsov - 2014-10-17, 03:41:53
Menu with picture - by Dimi - 2015-04-28, 16:05:45
Rendering Menu in Component - by Alexander_ - 2016-05-04, 23:06:51
Meta desc for different languages - by Alexander_ - 2017-02-14, 20:29:32
Hierarchical Menus - by celextel - 2019-07-26, 16:41:47
Ri18n_navigation - by celextel - 2021-02-19, 16:07:48
Support for multilanguage sites, Internationalization (I18N) - by vinta9e - 2011-06-28, 01:47:58



Users browsing this thread: 6 Guest(s)