Replies: 6 comments 1 reply
-
This is a custom solution for your forum as there is only one main section. However, if multiple main sections are created, the same description would apply to all of them. It would no longer be possible to create a separate description for each of different main sections. |
Beta Was this translation helpful? Give feedback.
-
hi, I think the current solution of kunena limits the flexibility to have a more attractive frontend with consistent multi language support and this should be improved. |
Beta Was this translation helpful? Give feedback.
-
You have 2 category lists. For German Itemid=1318 and for English Itemid=1319. |
Beta Was this translation helpful? Give feedback.
-
No! I do not have two different category lists! itemid is a joomla specific variable and has nothing to do with kunena, You should know that there is only one category database table with unique settings |
Beta Was this translation helpful? Give feedback.
-
To clarify this issue/problem: A main design principle for application which support (multi)language text strings is to use references to text strings and avoid the use of text strings direcly. In the case of displaying forum category information this principle is violated - therefore kunena can only display I've fixed this design weakness by using language keys for category description and title instead of using textual formats of those. Doing this alone would result only into a display of the text of language keys and not the related text string. A needed second change for this implements the use of the joomla language API with the help of language ini-files. This then renders the text to its correct language string. Hopefully one of the developers of kunena understands this issue and solves these problems in the near future. |
Beta Was this translation helpful? Give feedback.
-
@jschmi102 I also suggested my solution for this, you can see here: #6890 & #6889 I hope Multilanguage will appear in @Kunena |
Beta Was this translation helpful? Give feedback.
-
If one of you have ever used kunena on a site which provides multi language support you will face similar problems. My site "speaks" english and german - so if I open my kunena forum using german language all seems to be consistent. The kunena index page displays completely in german language. Now if I try this using english lanuage, the category title displays "Categories" but the headings and description are still in german language. There is now a mixup with german and english language text strings. This is mainly caused by the design of setting forum categories - heading and description are both stored in the category db-table and provided in only one (language) version and in addition may contain only pure text.
I changed this design and behaviour and I was quite surprised how easily this had to be accomplished. I would be glad if you check this (my) solution and comment on it. Solution/change is built on Kunena V6.0.0-RC3 with template "aurelia"
Change interface to display description and headings on kunena index (home) page in different languages:
1. change description text and heading into language keys.
create /edit forum category via admin backend
create/enter language keys and place them into "category description" and "category header" use
a naming convention for those keys like "COM_KUNENA_name_of_category_DESCRIPTION" and
"COM_KUNENA_name_of_category_HEADER"
below this is the setting for category "php_rgraph":
2. Create new ini-file(s) - language-textfiles:
e.g. "../com_kunena/language/en-GB/en-GB.com_kunena.category.ini" and
"../com_kunena/language/de-DE/de-DE.com_kunena.category.ini" for english and german language
Enter content in the form (key="text"):
COM_KUNENA_name_of_catagory_HEADER=" text for kunena category header"
and
COM_KUNENA_name_of_catagory_DESCRIPTION=" text for kunena category description"
3. Change code in template scripts
edit change these 3 files:
../components/com_kunena/template/aurelia/layouts/category/index/default.php
../components/com_kunena/template/aurelia/layouts/category/item/default.php
../components/com_kunena/template/aurelia/layouts/topic/item/default.php
a. check/add definition of required namespaces
use Joomla\CMS\Language\Text;
use Kunena\Forum\Libraries\Factory\KunenaFactory;
b: add language keys/text:
KunenaFactory::loadLanguage('com_kunena.category')
;c: change code
replace
echo $section->displayField('description');
with
echo Text::_( $section->displayField('description') );
and replace
echo $this->category->displayField('headerdesc');
with
echo Text::_( $this->category->displayField('headerdesc') );
You may check result/my solution at
https://www.jschmidt-systemberatung.de/index.php?option=com_kunena&view=category&layout=list&Itemid=1318&lang=de
and
https://www.jschmidt-systemberatung.de/index.php?option=com_kunena&view=category&layout=list&lang=en&Itemid=1319
Beta Was this translation helpful? Give feedback.
All reactions