Fleximodule and default langauge

More
14 years 6 months ago #17562 by mazataza
I have define arabic as default langauge for the front site. and when i have fleximodule which shows only items of the current langauge, there is no result is showed. but as i call the site like

/index.php/ar

it shows results.
this I could understands why. I set my arabic as default language in joomla langauge manager.

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17564 by ggppdk
Which Flexicontent version are you using? and you have original mod_flexicontent of your version or replaced by files you found in this forum? (the latest Flexicontent module for 1.5.6, posted in some topics in this forum has "Current language scope")

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17587 by mazataza
I am using flexicontent 1.5.6 from SVN and the fleximodule from svn, no code from forum.

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17591 by ggppdk
Do this test:
Open file modules/mod_flexicontent/helper.php
Add at about line 474 replace code:
Code:
$language =& JFactory::getLanguage(); $currlangcode = $language->_lang; if ($method_curlang == 1) { // exclude method --- exclude items of current language $where .= ' AND ie.language <> ' . $currlangcode; } else if ($method_curlang == 2) { // include method --- include items of current language ONLY $where .= ' AND ie.language = "' . $currlangcode.'"'; } else { // Items of any language }
with
Code:
$lang = JRequest::getWord('lang', '' ); if(empty($lang)){ $langFactory= JFactory::getLanguage(); $tagLang = $langFactory->getTag(); //Well, the substr is not even required as flexi saves the Joomla language tag... so we could have kept the $tagLang tag variable directly. $lang = substr($tagLang ,0,2); } if ($method_curlang == 1) { // exclude method --- exclude items of current language //$where .= ' AND ie.language <> ' . $currlangcode; } else if ($method_curlang == 2) { // include method --- include items of current language ONLY $where .= ' AND ie.language LIKE ' . $this->_db->Quote( $lang .'%' ); } else { // Items of any language }

also on the new code, temporary change line:
$tagLang = $langFactory->getTag();
to
echo $tagLang = $langFactory->getTag();

What is the output?

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17596 by ggppdk
Also note that if your translate your items (their title and description) using Joomfish you must not use "current language scope".

Only use this scope if you have various languages for your items inside the items manager. I mean you have some items English and some Arabic.

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17644 by ggppdk
Also please execute this in phpmyadmin and post the result here:
Code:
SELECT * FROM `jos_languages`

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17652 by mazataza
thanks for your quick replays
it work well with your code.

i have modified it a lit to get it working
Code:
$lang = JRequest::getWord('lang', '' ); if(empty($lang)){ $langFactory= JFactory::getLanguage(); $tagLang = $langFactory->getTag(); //Well, the substr is not even required as flexi saves the Joomla language tag... so we could have kept the $tagLang tag variable directly. $lang = substr($tagLang ,0,2); } if ($method_curlang == 1) { // exclude method --- exclude items of current language //$where .= ' AND ie.language <> ' . $currlangcode; } else if ($method_curlang == 2) { // include method --- include items of current language ONLY $where .= ' AND ie.language LIKE ' . $db->Quote( $lang .'%' ); } else { // Items of any language }

i just replaced $this->_db->Quote with $db->Quote.

the result of SELECT * FROM `jos_languages` ist


Name active iso code shortcode
English 1 en_GB.utf8, en_GB.UT en-GB en
Arabic 1 ar_SA.utf8, ar_SA.UT ar-SA ar

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17657 by ggppdk
The second part 'SA' of "ar-SA" seems to be different for joomla language and flexicontent items. In future i will use only first part 'ar' to determine language ...

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17660 by mazataza
I have a strange behaviour in langauge.

I set the default langauge for front site in joomla to arabic and i see it also as default in the admin. but it time i clear the cookies in firefox the default lang is set to en-GE, but i don'T see this issue on IE9.

do someone have an idea?

Please Log in or Create an account to join the conversation.

More
14 years 6 months ago #17663 by ggppdk
Browser is setting language to Arabic but with different country code than your site has.

To something like ar-CC where first part 'ar' is language and second part 'CC' is the country.

I don't know match more about it. You can read more here:
www.w3.org/International/questions/qa-lang-
priorities


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save