×
Kunena 5.1.15 Released (27 Oct 2019)

The Kunena team has announce the arrival of Kunena 5.1.15 [K 5.1.15] which is now available for download as a native Joomla extension for J! 3.9.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1.

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

More
9 years 5 months ago - 9 years 3 months ago #1 by hopewise
hello,

it will be great if the admin can determine a different css file per language,
for ex:

kunena.forum_en.css for englsih

kunena.forum_ar.css for arabic

instead of hard coding the css file name to always be kunena.forum.css

this will be a great feature for languages that are right to left, and will increase Kunena penetration into more communities.

how can i do that trick ?

thanks,
hopewise
Last edit: 9 years 3 months ago by sozzled. Reason: Changed subject to improve search relevance

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

More
9 years 5 months ago #2 by @quila
Hi,

how you think to load this diferent files?

With option in the configuration or..??

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

More
9 years 5 months ago #3 by hopewise
i shall load the css depending on the selected language at JoomFish,
but, where to tell Kunena about the desired css file ??

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

More
9 years 3 months ago - 9 years 3 months ago #4 by OfekA
Anything new with topic? I really need this feature.
If someone can try and guide me which files i need to edit I'd be so greatful!

I have a multilingual website with English and Hebrew, and I can't seem to find any solution for the css.

Thanks in advance..!
Last edit: 9 years 3 months ago by OfekA.

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

More
9 years 3 months ago - 9 years 3 months ago #5 by OfekA
Maybe if I'll try something like this, will it work?

kunena.php lines 267-275 original:
if ($fbConfig->joomlastyle < 1) {
	if (file_exists(KUNENA_JTEMPLATEPATH.'/css/kunena.forum.css'))
	{
		$document->addStyleSheet(KUNENA_JTEMPLATEURL . '/css/kunena.forum.css');
	}
	else
	{
		$document->addStyleSheet(KUNENA_TMPLTCSSURL);
	}

I changed it to this:
if ($fbConfig->joomlastyle < 1) {
	if ($this->language=he-IL)
	{
		$document->addStyleSheet(KUNENA_JTEMPLATEURL . '/css/he-il.css');
	}
	else
	{
		$document->addStyleSheet(KUNENA_JTEMPLATEURL . '/css/en-gb.css');
	}
Last edit: 9 years 3 months ago by OfekA.

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

More
9 years 3 months ago #6 by Matias
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.
The following user(s) said Thank You: OfekA

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

More
9 years 3 months ago - 9 years 3 months ago #7 by OfekA

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: 9 years 3 months ago by OfekA.

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

More
9 years 3 months ago #8 by Matias
Try this:
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
9 years 3 months ago - 9 years 3 months ago #9 by OfekA

Matias wrote: Try this:

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: 9 years 3 months ago by OfekA.

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

More
9 years 3 months ago - 9 years 3 months ago #10 by OfekA
So basically, this is the current code on kunena.php line 267:
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:
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: 9 years 3 months ago by OfekA.

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

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.102 seconds