Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

Multiple languages for board-description

Aloittaja erlend_sh, heinäkuu 30, 2007, 11:08:55 IP

« edellinen - seuraava »

erlend_sh

Mod Description
This mod would add some extra options when creating or editing a board. It could work similar to the polls, when you add an option, but instead, you add an additional description-box. This descriptionbox would also have a scroll-menu above it (like when choosing message icon of text color) where you would choose between the languages that your forum can be written in. Then, you could manually translate the original (probably english) description to whatever language you think might also be popularly used among your users.

Mod Purpose
Should be quite obvious already. When you change the language setting on a forum, it would also be nice if the user-made descriptions around in the forum could also be read in that language. So if the admin knows a few languages, and has taken the time to add the alternate descriptions, the foreign users would have much less problems browsing the forum.

Me for instance, would at least be able to add norwegian, german and spanish in addition to the default english description. Maybe this mod could allow you to add alternate languages for more than just the boards (like board-names, navigation etc.) but I think boards is the most important one since they are usually the ones with a lot of words that can get hard to understand for some.

karlbenson

#1
If you want to do it at the moment, its very easily done.

In the admin area, modify each boards description by putting the word board then underscore, followed by the name of your board (lowercase, no spaces) eg 'board_news' or 'board_announcements'

Then open BoardIndex.php in Sources and find the line
'description' => $row_board['description'],
(it occurs twice)

replace with
'description' => $txt[$row_board['description']],

Now open MessageIndex.php in sources and find the same line again (it only occurs once)

now open Modifications.english.php in the Themes/default/languages/ directory
at the bottom (before the ?>) write out all the strings and the descriptions
$txt['board_news'] = 'Some news about the board';

Once you've done that for all of your boards. (if you don't do it for all, you may get some errors)
You can copy all of those strings into your Modifications.spanish.php and the rest

erlend_sh

That sounds fairly easy, but doesn't that mean it would also be a walk-in-the-park to make a mod that does the same thing? I have this scary tendency of always screwing up when dealing with technical stuff, even when the instructions are so simple that a child could do it. I always find a way :P

Thanks for the quick lesson though; others will probably find good use of it.

karlbenson

Actually this would be more difficult doing it via a mod.

Language stuff is best in language files in my opinion.
If you did it with a mod it would be a lot more complicated and require extra queries.

erlend_sh

Ah I see. Then code like this (along with an exlanation of why it is better to code it instead of making a mod for it) should have its own codesnippet section or something here on this site. Because currently there is no such thing right? Or are my eyes playing tricks on me again? :(

In the custom. section there could be made a new category for the codesnippets. Now do you think that's a suggestion worth posting or can you convince me to drop it? :P

lonrot

This is just what I need, really useful inded, someone has to do it in the future.

pippo76

Lainaus käyttäjältä: karlbenson - heinäkuu 30, 2007, 11:18:23 IP
If you want to do it at the moment, its very easily done.

In the admin area, modify each boards description by putting the word board then underscore, followed by the name of your board (lowercase, no spaces) eg 'board_news' or 'board_announcements'

Then open BoardIndex.php in Sources and find the line
'description' => $row_board['description'],
(it occurs twice)

replace with
'description' => $txt[$row_board['description']],

Now open MessageIndex.php in sources and find the same line again (it only occurs once)

now open Modifications.english.php in the Themes/default/languages/ directory
at the bottom (before the ?>) write out all the strings and the descriptions
$txt['board_news'] = 'Some news about the board';

Once you've done that for all of your boards. (if you don't do it for all, you may get some errors)
You can copy all of those strings into your Modifications.spanish.php and the rest

Hi,

where to change code in order to obtain the translation of the Registration Agreement based on the language selected by the User?
And for the Boards titles, path and Forum Title?

Thank You very much and compliment for your description, it works great now!

codenaught

This may help you get the registration agreement to work in other languages - http://www.simplemachines.org/community/index.php?topic=29670.msg269474#msg269474.

For board name, similar to how the board description is done as by karlbenson, you want to change each instance of:

$row_board['boardName']

With:

$txt[$row_board['boardName']]

And have the board name look something like: news_board. So if news_board was the name you would want to add a text string like this:

$txt['news_board'] = 'News Board';
Dev Consultant
Former SMF Doc Coordinator

Advertisement: