Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

Question Multilingual LTR and RTL sites. Load different kunena.forum.css files for each language

More
15 years 8 months ago - 15 years 8 months ago #56235 by OfekA
Replied by OfekA on topic Re: kunena.forum.css ?

Matias wrote: Kunena 1.6 supports this in the templates.

You just need to add above if's to the initialize.php in your template.

BTW: always quote strings in PHP: "he-IL" or 'he-IL'. Otherwise your error log will grow fast.

Thank you so much, the quote strings made the code work, and now it uses the "he-il.css" file, but for both languages.. it doesn't use the "en-gb.css" for english for some reason.

I tried looking for a initialize.php but there is no such file in my components\com_kunena folder.

Any suggestions?
Last edit: 15 years 8 months ago by OfekA.

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

More
15 years 8 months ago #56237 by Matias
Replied by Matias on topic Re: kunena.forum.css ?
Try this:
Code:
if ($this->language=='he-IL')
The following user(s) said Thank You: OfekA

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

More
15 years 8 months ago - 15 years 8 months ago #56238 by OfekA
Replied by OfekA on topic Re: kunena.forum.css ?

Matias wrote: Try this:

Code:
if ($this->language=='he-IL')

Now it uses for both English and Hebrew the "en-gb.css" file. Any idea what's wrong?

Edit: I also know that it's the "en-gb.css" because i made a special tweak for it so i'll notice, so just to clarify, it's not loading the "kunena.forum.css".
Last edit: 15 years 8 months ago by OfekA.

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

More
15 years 8 months ago - 15 years 8 months ago #56257 by OfekA
Replied by OfekA on topic Re: kunena.forum.css ?
So basically, this is the current code on kunena.php line 267:
Code:
if ($fbConfig->joomlastyle < 1) { if ($this->language=='he-IL') { $document->addStyleSheet(KUNENA_DIRECTURL . '/template/default_ex/he-il.css'); } else { $document->addStyleSheet(KUNENA_DIRECTURL . '/template/default_ex/en-gb.css'); }

With this code (I double checked) the kunena system loads the file "en-gb.css" on both Hebrew and English.

As far as I understand, this can only mean, that this line is somewhat corrupted:
Code:
if ($this->language=='he-IL')
I presume that's it's incorrect, but i'm not sure to what i can change it..

Any suggestions?
Last edit: 15 years 8 months ago by OfekA.

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

More
15 years 8 months ago #56260 by Matias
Replied by Matias on topic Re: kunena.forum.css ?
I didn't check the code, I just corrected the bugs in it.

Yes, $this->language does not exist in Kunena 1.5 context.

I believe that you need to detect language because of RTL? This is how you do it.
Code:
$lang = JFactory::getLanguage(); if ($lang->isRTL()) { $document->addStyleSheet(KUNENA_DIRECTURL . '/template/default_ex/rtl.css'); } else { $document->addStyleSheet(KUNENA_DIRECTURL . '/template/default_ex/ltr.css'); }
The following user(s) said Thank You: OfekA

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

More
15 years 8 months ago #56263 by OfekA
Replied by OfekA on topic Re: kunena.forum.css ?

Matias wrote: I didn't check the code, I just corrected the bugs in it.

Yes, $this->language does not exist in Kunena 1.5 context.

I believe that you need to detect language because of RTL? This is how you do it.

Code:
$lang = JFactory::getLanguage(); if ($lang->isRTL()) { $document->addStyleSheet(KUNENA_DIRECTURL . '/template/default_ex/rtl.css'); } else { $document->addStyleSheet(KUNENA_DIRECTURL . '/template/default_ex/ltr.css'); }

Matias, I can't describe in words how much I thank you!
Works perfectly!

Now hours of css tweaking :D

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

Time to create page: 0.265 seconds