Working!! - CB 1.2RC + JoomFish 2.0(beta)

13 years 4 months ago #65153 by 4creator
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

Please Log in to join the conversation.

13 years 4 months ago #65503 by 4creator
Replied by 4creator on topic Re:Working!! - CB 1.2RC + JoomFish 2.0(beta)
Report:

I updated JoomFish to 2.0 BETA2 yesterday. I had an issue on FireBoard, but it was resolved now!

CB 1.2RC + FireBoard 1.0.4 + JoomFish 2.0 (beta2) + ... are working for me!! :woohoo:

A combination with following 2 ideas made my joomla fine!
  • Use $mainframe->getCfg('language') instead of $mainframe->getCfg('lang')
  • Rename language files (ex. english.php to en-GB.php)
I hope this tips help you.


Thanks,
Hideto

Please Log in to join the conversation.

13 years 4 months ago #65519 by KurtSteiner
Replied by KurtSteiner on topic Re:Working!! - CB 1.2RC + JoomFish 2.0(beta)
Hey 4creator,
many thanks for sharing your solution B)

Karma you up buddy !

sunny regards from Germany

BERND (Kurt Steiner)

Please Log in to join the conversation.

13 years 4 months ago #65665 by 4creator
Replied by 4creator on topic Re:Working!! - CB 1.2RC + JoomFish 2.0(beta)
Hi KurtSteiner,

I'm glad I could help you. :P


Thanks!

Please Log in to join the conversation.

13 years 3 months ago #66031 by beat
4creator,

I believe this to be a bug in JoomFish 2.0 on joomla 1.5.

Could you please report that in their forum or better bug-tracker, and paste URL here ?

Thanks.

Description of JoomFish bug:

JoomFish returns wrong backwards-compatibility language string: e.g. "en-GB" instead of "english"

In this case:

[code:1]$lang =& JFactory::getLanguage();
return $lang->getBackwardLang();
[/code:1]
Joomla 1.5.3, with joomFish 2.0 installed seems to return "en-GB" instead of "english".

This breaks Community Builder languages selection.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

13 years 3 months ago #66126 by beat
Well, to make sure this gets fixed asap and not forgotten, I did report it here:

joomlacode.org/gf/project/joomfish/tracker/?action=TrackerItemEdit&tracker_item_id=11538

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.193 seconds

Facebook Twitter LinkedIn