Kunena 6.2.6 released

The Kunena team has announce the arrival of Kunena 6.2.6 [K 6.2.6] which is now available for download as a native Joomla extension for J! 4.4.x/5.0.x. This version addresses most of the issues that were discovered in K 6.1 / K 6.2 and issues discovered during the last development stages of K 6.2

Solved [SOLVED] How to force the notification language?

More
7 years 8 months ago - 7 years 7 months ago #1 by Mezzo
Hello,

I am setting a new forum on a multilingual site. The particularity is that while the site can be translated into several languages, I want the forum to stay in English. A message appears asking everyone to write their messages in English even if the interface is in French for instance.

The problem is that when someone writes a reply, the notification emails sent to all subscribers are in the current language of the user that is writing the message, not in the language of the subscribers. Is it possible to sent notifications with the appropriate language of each subscriber? If no, is it possible to force the notifications (and the links inside) to be in English?

Regards,
Davy
Last edit: 7 years 7 months ago by Mezzo.

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

More
7 years 8 months ago #2 by xillibit
Hello,

This is a feature that we have a mind, but it's something not easy to do, i can't say for now in which Kunena version it will be set.

I don't provide support by PM, because this can be useful for someone else.

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

More
7 years 8 months ago #3 by Mezzo
Thank you for the reply.

Is there a way to remove the translation process? (with hard-coded strings in the code for instance). Even if it is an ugly fix I would find this acceptable. What file could I modify?

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

More
7 years 8 months ago #4 by Mortti
One possibility could be that you overrides every languages(notifications) to english which you are installed.
I think you mean these lines of notifications?:
Code:
COM_KUNENA_POST_EMAIL_MOD1="A new post has been made to a category to which you have assigned as moderator on the" COM_KUNENA_POST_EMAIL_MOD2="Please have a look at it after you have logged in on the site." COM_KUNENA_POST_EMAIL_NOTIFICATION1="A new reply has been posted on the" COM_KUNENA_POST_EMAIL_NOTIFICATION1_CAT="A new topic has been created on the" COM_KUNENA_POST_EMAIL_NOTIFICATION2="You can unsubscribe from this topic by visiting it and clicking the Unsubscribe button near the top or bottom of the page." COM_KUNENA_POST_EMAIL_NOTIFICATION2_CAT="You are getting this notification because of you have subscribed into category. Please visit the category to unsubscribe." COM_KUNENA_POST_EMAIL_NOTIFICATION3="Do not answer to this e-mail notification as it is a generated e-mail." COM_KUNENA_POST_EMAIL_NOTIFICATION_MORE_READ="Please note that you will not receive any further email notifications for this topic until you log in and read it." COM_KUNENA_POST_EMAIL_NOTIFICATION_MORE_SUBSCRIBE="Please note that you will not receive any further email notifications for this topic unless you subscribe into it."

You can find those lines from the administration language file xx-XX.com_kunena.libraries.ini
You can do overrides from the Joomla backend: Extensions -- Language(s) -- Overrides or direct to language files...
I haven't tested this but it should be work... then user with a language other than English, should get the notifications emails in English. Inform if you test this.

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

More
7 years 8 months ago - 7 years 8 months ago #5 by Mezzo
Yes that's it :-)

I have another question before doing a test and posting a solution.

I found the file libraries/kunena/forum/message/message.php which creates the email with the last function "attachEmailBody". It could be possible to patch it so that I don't need to change the translations anymore, though I understand that it's a bad fix (I would need to patch it after each update of Kunena).

What is still bothering me is that a url is attached to the email so that we can go to the message that has been posted, and this url is also linked to the current language of the user that wrote the message on the forum. For example here is the url that I could receive:
Code:
http://mysite.com/fr/forum/category_name/topic_name#12
But I want this, always in english ("fr" becomes "en"):
Code:
http://mysite.com/en/forum/category_name/topic_name#12
I can of course add a function to replace "/XX/forum/" into "/en/forum/", but I was wandering if there is no other solutions, for example by slightly modifying the function "getPermaUrl" or "getPermaUri".
Last edit: 7 years 8 months ago by Mezzo.

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

More
7 years 8 months ago - 7 years 8 months ago #6 by Mortti

Mezzo wrote: Yes that's it :-)

It could be possible to patch it so that I don't need to change the translations anymore, though I understand that it's a bad fix (I would need to patch it after each update of Kunena).

If you do overrides from Joomla backend Extensions -- Language(s) -- Overrides for those lines to each languages, you don't need to do that again when new language packages are available and you install it... Overwrite will always remain for those lines.

EDIT: a little bit old Joomla! Documentation of J! overrides but its almost same in J! 3.6.2
docs.joomla.org/J3.x:Language_Overrides_in_Joomla
Last edit: 7 years 8 months ago by Mortti.

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

More
7 years 8 months ago #7 by xillibit

Mezzo wrote: Yes that's it :-)

I have another question before doing a test and posting a solution.

I found the file libraries/kunena/forum/message/message.php which creates the email with the last function "attachEmailBody". It could be possible to patch it so that I don't need to change the translations anymore, though I understand that it's a bad fix (I would need to patch it after each update of Kunena).

What is still bothering me is that a url is attached to the email so that we can go to the message that has been posted, and this url is also linked to the current language of the user that wrote the message on the forum. For example here is the url that I could receive:

Code:
http://mysite.com/fr/forum/category_name/topic_name#12
But I want this, always in english ("fr" becomes "en"):
Code:
http://mysite.com/en/forum/category_name/topic_name#12
I can of course add a function to replace "/XX/forum/" into "/en/forum/", but I was wandering if there is no other solutions, for example by slightly modifying the function "getPermaUrl" or "getPermaUri".

The methods getPermaUrl or getPermaUri doesn't handle multi-language, i need to check if these methods can be changed to do that

I don't provide support by PM, because this can be useful for someone else.

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

More
7 years 7 months ago - 7 years 7 months ago #8 by Mezzo
Hello,

I understand that using overrides prevents an update to reinitialize the translations but there is still the problem with the url that can point to the site with a language other than English. I need to patch anyway.
I edited the file "components/com_kunena/template/system/layouts/email/subscription/default.php" (and not "libraries/kunena/forum/message/message.php" as I mentioned) and it worked.
I set manually the text (no translations anymore) and I modified the url with:
Code:
preg_replace('#http://([a-z\.-]+)/[a-z]+/[a-z]+/(.*)#', 'http://$1/en/forum/$2', $this->messageUrl)
This way
Code:
http://mysite.com/XX/YYYY/...
is changed to a url always pointing to the forum with the English interface
Code:
http://mysite.com/en/forum/...

I'll keep a track of these changes so that if Kunena is updated, I can patch again.

Regards,
Davy
Last edit: 7 years 7 months ago by Mezzo.

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

Time to create page: 0.366 seconds