Default language by board.

Started by fiver, May 04, 2010, 04:58:59 AM

Previous topic - Next topic

fiver


SMF 2.0 RC3

Hi,


I've search community for "default language board" and found no answer.


I'd like to set a default language for some boards on my forum such as Chinese for Chinese boards, Indonesian for Indonesia boards. Members can still change it to other languages if they want to. How do I do that please?


Thanks.

Chas Large

This is not a standard SMF option. You can choose Default FORUM language and Offer different languages for USERS but you cannot change the language on a BOARD by BOARD basis.

This mod may be of assistance though.

http://custom.simplemachines.org/mods/index.php?mod=1276
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

fiver

Hi Chas,


Thanks for the suggestion. I'm am thinking of using the language set as installed in SMF 2 RC3 with the languages changed in the buttons and tabs.


I am indeed thinking of Board by Board basis, something similar to setting default Theme for some boards. I got CurveRed theme for Chinese board and I hope to set the same for the Language. I'll be having Indonesia board with CurveBlue theme and I hope to set the language to Indonesian language as default.


I got the feeling it's something in the same line as theme setting. I can't program php but comfortable in messing with a few codes. Could you help me with some code changes please?

Chas Large

Sorry, I cannot. As I stated above, you cannot change the language on a board by board basis. All boards use the same template for displaying data, it's only the data that changes when you select a different board. So you cannot use one language file for one board and a different one for another, it just doesn't work like that.

The only way this could work is for several different forums on the same site, each in a different language but with a common login between them, I believe that's possible but have never tried it.

You can allow users to select their own language for forum display but again this makes the whole forum display in one language.

Best help I can offer, sorry. :(
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Drakmyr

I'm not sure if i have this right or not, but can't each theme have it's own language file? if so, and you are using a diferent theme for each board, couldn't you setup like a default language file in the theme's language folder and have the desired language within that file? you could then set the forum default to use the theme's default language file, that way each theme would use a different language, and you could still include the other languages as well, so the user can switch if they want... or is this not possible? I was under the impression that if a theme file is not present in a theme's folder, it would use the one in the default theme instead, thus making it look in it's theme first, then in the default, or is this not how the language files are done?

Chas Large

Quote from: Drakmyr on May 04, 2010, 10:59:55 AM
I'm not sure if i have this right or not, but can't each theme have it's own language file? if so, and you are using a diferent theme for each board, couldn't you setup like a default language file in the theme's language folder and have the desired language within that file? you could then set the forum default to use the theme's default language file, that way each theme would use a different language, and you could still include the other languages as well, so the user can switch if they want... or is this not possible? I was under the impression that if a theme file is not present in a theme's folder, it would use the one in the default theme instead, thus making it look in it's theme first, then in the default, or is this not how the language files are done?
It's a nice thought but the answer is still no. All the index references are in the language files which are in the Default/Languages directory. So even if all the language files are in the languages directory of the other theme then the language still cannot be used. It can only be used if installed in the default theme. I've just tried this on a test forum. Sorry.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

fiver

#6
Hi Drakmyr and Chas,

Many thanks for taking the time to look into it.


I had another thought:

In my forum, a member can select the language from a drop down list in their profile, and also at the top right of the each page where they can change the language anytime.

1. Is it possible to put a hidden second language in the Profile? so that when they enter a Chinese board, it set Chinese as second language and uses that instead of the selected. When they leave the Chinese board, it uses the member's selected language.

For example, somewhere in profile.php, I set: if board 44, 50, 55, switch to language Chinese.

2. or changes the language selector on the top right of the page to Chinese when they enter a Chinese board?

For example, somewhere in display.php,  if board 44, 50, 55, switch to language Chinese.

Chas Large

I think you're still missing the point. Languages are FORUM wide and no matter WHERE you put the selection to change it, it will become the language of the whole forum. It's just not possible to make it page by page or board by board as each page/board uses the same template each time, its only the data that is changed.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Arantor

There is no way out of the box to do this in SMF.

It could be possible to do by modifying the code to reset the language when going into a board, but it's actually kind of risky to do if you're not careful.

Advertisement: