News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Multilanguage Board Name/Descriptions

Started by Antes, December 20, 2014, 09:18:46 AM

Previous topic - Next topic

Antes

Once my forum was alive and kicking around, it was in two languages and I always want to make board names/descriptions multilanguage. I'm interested in making cheap tricks or good tricks to make it happen. I'm 100% sure some forums will benefit from it very well. Following changes are basic they cover only boardindex at this point. So what i did;

Boardindex.template open
Code (Find) Select
                        <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';
Code (Replace) Select
                        <a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', !empty($txt['bname'.$board['id'].'']) ? $txt['bname'.$board['id'].''] : $board['name'], '</a>';

Code (Find) Select
                        <p>', $board['description'] , '</p>';
Code (Replace) Select
                        <p>', !empty($txt['bdesc'.$board['id'].'']) ? $txt['bdesc'.$board['id'].''] : $board['description'] , '</p>';

then simply add $txt['bname<id>'] = 'board_name'; $txt['bdesc<id>'] = 'board_description' to index.english.php

What is your solutions or suggestions?

Arantor

Not doing it is my suggestion.

It creates an inference that is not accurate, namely: if people see a board name in their language, they will assume that board is in that language. Intermixing languages inside a single board invariably confuses people and ends up having a distancing effect.

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Antes

Quote from: Arantor on December 20, 2014, 11:03:03 AM
Not doing it is my suggestion.

It creates an inference that is not accurate, namely: if people see a board name in their language, they will assume that board is in that language. Intermixing languages inside a single board invariably confuses people and ends up having a distancing effect.

In original topic I actually wrote a note for you :P I was 100% sure you gonna say this :D

Quote from: margarett on December 20, 2014, 06:34:57 PM
There was a MOD for 1.1.x that you might use as a reference ;)
http://custom.simplemachines.org/mods/index.php?mod=1276

Nope... 1.1.x too old for me to understand, I barely understand 2.x source part :P

I'm after creating a small tip/trick for people not a big mod fully automated usage etc...

Arantor

Of course I was going to say it, that's what my experience has shown over time.

sangham.net

Thanks for the great share, Antes!

Would it work for Categories as well? How would it need to look like? Thanks in advanced!

As for the outlook here, is it right in regard of id to mention it like that or example (just the number):

$board['id']
and
$txt['bname1'], $txt['bname2'], ... $txt['bname234']

or
$txt['bname<1>'], $txt['bname<2>'], ... $txt['bname<234>']

??

Antes

without <>, you can do it for categories as well same logic applies.

sangham.net

Thanks a lot, Mr. Antes! Most, most helpful. That means such can be made also for things like "News" and other only one "language possible" texts which are input-able in the Admin-panel usually? A kind of out-sourcing of the Admin-panel to the language files, so-to-speak.

Antes

Not sure about news, you probably need to code something for it. Not sure if you can do this trick to news section, you need to try.

sangham.net

Thanks Mr. Antes! Let's try the first first (so many visions...)
(Like it so much this *tickle tingle prickle*... Much better as if one does something that he understands...  :laugh: otherwise it could be even relaxed.)

sangham.net

Works fine! To get it also for the indexes of topics and the child boards, the same action can be done in MessageIndex.template.php.

Category seems a little bit more complex. In regard of the link trees its also open. Thanks again, the "trick" really helps a lot.

Advertisement: