This topic is the continuation of
Plugin for Language
.
At first, I have to say that I am NOT a PHP programmer. I can't write PHP at all. And I am not good at English. Make sure you do this at your own RISK!
I solved some issues around the language (including JoomFish)!
The following is my solution (my language is Japanese);
1. com_comprofiler/comprofiler.php
Before:
[code:1]$UElanguagePath = $_CB_framework->getCfg( 'absolute_path' ).'/components/com_comprofiler/plugin/language';
$UElanguage = $_CB_framework->getCfg( 'lang' );
if ( ! file_exists( $UElanguagePath . '/' . $_CB_framework->getCfg( 'lang' ) . '/' . $_CB_framework->getCfg( 'lang' ) . '.php' ) ) {
$UElanguage = 'japanese';
}
include_once( $UElanguagePath . '/' . $UElanguage . '/' . $UElanguage . '.php' );[/code:1]
After:
[code:1]$UElanguagePath = $_CB_framework->getCfg( 'absolute_path' ).'/components/com_comprofiler/plugin/language';
$UElanguage = $mainframe->getCfg('language');
include_once($UElanguagePath . '/' . $UElanguage . '/' . $UElanguage . '.php' );
include_once($UElanguagePath . '/ja-JP/ja-JP.php' ); [/code:1]
2. Copy & Rename
Before: com_comprofiler/plugin/language/default_language/default_language.php
After: com_comprofiler/plugin/language/en-CB/en-CB.php
Before: com_comprofiler/plugin/language/japanese/japanese.php
After: com_comprofiler/plugin/language/ja-JP/ja-JP.php
3. Plug-ins languages
Copy your language texts of plug-in and paste to com_comprofiler/plugin/language/en-CB/en-CB.php and/or com_comprofiler/plugin/language/ja-JP/ja-JP.php
Upload files and check and see if it works. If you use mod_jflanguageselection, it will work for CB too!
In addion, some plug-ins may need additional modification. For example, I use
My Blog.
1. com_myblog/myblog.php
Before:
[code:1]include_once(MY_COM_PATH . "/language/english.php"«»); // load english language file first
include_once(MY_COM_PATH . "/language/" . $_MY_CONFIG->language);[/code:1]
After:
[code:1]include_once(MY_COM_PATH . "/language/en-GB.php"«»); // load english language file first
//include_once(MY_COM_PATH . "/language/" . $_MY_CONFIG->language);
include_once(MY_COM_PATH . "/language/" . $mainframe->getCfg('language'). '.php' );[/code:1]
2. com_comprofiler/plugin/user/plug_myblogtab
Before:
[code:1]function getDisplayTab($tab,$user,$ui) {
global $Itemid, $MYBLOG_LANG;[/code:1]
After:
[code:1]function getDisplayTab($tab,$user,$ui) {
//global $Itemid, $MYBLOG_LANG;
global $Itemid, $MYBLOG_LANG, $mainframe;
require_once ( $mainframe->getPath( 'front_html' ) );[/code:1]
And...
Before:
[code:1]include_once($this->cms->get_path('root') . "/components/com_myblog/language/english.php"«»);
include_once($this->cms->get_path('root') . "/components/com_myblog/language/" . $myconfig->language);[/code:1]
After:
[code:1]include_once($this->cms->get_path('root') . "/components/com_myblog/language/en-GB.php"«»);
include_once($this->cms->get_path('root') . "/components/com_myblog/language/" . $mainframe->getCfg('language'). '.php' );
//include_once($this->cms->get_path('root') . "/components/com_myblog/language/" . $myconfig->language);[/code:1]
That's all!
How do you think about my lay modification?
Language selector works fine, so I will do test more from now.
If you find more better solution, let me know please!
Thanks,
Hideto
Post edited by: 4creator, at: 2008/06/09 10:45
Post edited by: 4creator, at: 2008/06/09 13:43
Post edited by: 4creator, at: 2008/08/26 04:42