Changing a link based on a user's language setting
4 posters
Page 1 of 1
Changing a link based on a user's language setting
Hello!
I'm not sure if this is possible, but is there a way that a link would change from the original URL address to a different one for users who have a different language set in their options?
For example, I'd have a clickable icon in my forum's header that'd redirect you to some English website, but for my German users I'd like that icon to lead to a German website.
I hope I explained it properly and didn't confuse you lol
Forum version: AwesomeBB
Thank you in advance!
I'm not sure if this is possible, but is there a way that a link would change from the original URL address to a different one for users who have a different language set in their options?
For example, I'd have a clickable icon in my forum's header that'd redirect you to some English website, but for my German users I'd like that icon to lead to a German website.
I hope I explained it properly and didn't confuse you lol
Forum version: AwesomeBB
Thank you in advance!
Last edited by Ayushka on December 10th 2023, 3:27 am; edited 1 time in total
Re: Changing a link based on a user's language setting
Hello, Ayushka.
are you referring to the url address of your forum? Here is a thread that might help you. hope you figure out the problem you are having. https://help.forumotion.com/t59451-frequently-asked-questions
are you referring to the url address of your forum? Here is a thread that might help you. hope you figure out the problem you are having. https://help.forumotion.com/t59451-frequently-asked-questions
matt4116- New Member
- Posts : 7
Reputation : 1
Language : english
Re: Changing a link based on a user's language setting
Hello
You want an icon to be redirect to 2 pages depend the language?
I dont know if it possible by adding an onclick event to the image:
You want an icon to be redirect to 2 pages depend the language?
I dont know if it possible by adding an onclick event to the image:
Re: Changing a link based on a user's language setting
Good afternoon!
AP - Modules - Javascript codes management - Create new Javascript
Title: any
Placement: In all the pages
Javascript code:
Save.
- on this line we recognise the language of the user's browser.
- on this line we are looking for a button that responds to go to another site. My button has class
. Yours may have a different class.
- If the user's browser language is German, the user will go to the https://www.example.com address when clicking on the button. Other users will be directed to the site at https://www.anotherexample.com
AP - Modules - Javascript codes management - Create new Javascript
Title: any
Placement: In all the pages
Javascript code:
- Code:
jQuery(document).ready(function() {
const language = navigator.language || navigator.userLanguage;
const button = document.querySelector('.button__site');
if (button) {
button.addEventListener('click', function(e) {
e.preventDefault();
if (language === 'de-DE') window.location.href = 'https://www.example.com';
else window.location.href = 'https://www.anotherexample.com';
});
}
});
Save.
|
|
|
|
Razor12345- Support Moderator
- Posts : 1586
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
skouliki, TonnyKamper and Jucarese like this post
Re: Changing a link based on a user's language setting
hello
if your request is completed/answered, please mark it as Solved.
if your request is completed/answered, please mark it as Solved.
Re: Changing a link based on a user's language setting
Good afternoon!
It's been over two weeks now. We still have not received a reply from the author.
I am closing the topic and moving it to the archive.
If your problem is not solved - write me a private message and I will open this topic for further help.
It's been over two weeks now. We still have not received a reply from the author.
I am closing the topic and moving it to the archive.
If your problem is not solved - write me a private message and I will open this topic for further help.
Problem solved & topic archived.
|
Razor12345- Support Moderator
- Posts : 1586
Reputation : 268
Language : Ukr, Rus, Eng
Location : Ukraine
Similar topics
» Changing Japanese language to English Language.
» Changing the LINK to the banner
» setting a image with the link
» Changing my standard language!
» How do I display a Special rank and a post based rank on all applicable users at the same time?
» Changing the LINK to the banner
» setting a image with the link
» Changing my standard language!
» How do I display a Special rank and a post based rank on all applicable users at the same time?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum