Customizing SMF > Modifications and Packages

Show Specified Language

(1/5) > >>

dougiefresh:
Link to Mod

SHOW SPECIFIED LANGUAGE v2.2
By Dougiefresh -> Link to Mod

Introduction
This mod allows a user to make a SINGLE post in multiple language and show ONLY the appropriate language to the visiting user.

For example, if a user posted this:

--- Quote ---[language=EN]Hi, this is a test[/language]
[language=EE]Tere, see on test[/language]
[language=ES]Hola, esta es una prueba[/language]
[language=english]Hi, this is a test[/language]
[language=estonian]Tere, see on test[/language]
[language=spanish]Hola, esta es una prueba[/language]

--- End quote ---
If the user had the Estonian language set, he/she would see this:

--- Quote ---Tere, see on test
Tere, see on test

--- End quote ---
Either the 2-character language code (ex: en) or the 5-character code (ex: en-US) may be used to specify the language to display.  Note that both en-US and en-GB will be matched to en, likewise for other languages.

If the user's language is not found, the code will either display the preferred default language (if specified) OR the first language code encountered.

Admin Settings
Under Admin => Forum => Posts and Topics => Post Settings, there are 3 new settings:
o Allow sub-languages for language bbcode?
o Show only installed languages for language dropdown?
o Show natural language IDs instead of RFC-1766 IDs?

Related Discussion
o Support for multiple languages!

Translators
o Spanish Latin: Rock Lee

Compatibility Notes
This mod was tested on SMF 2.0.11 and SMF 2.1 Beta 2, but should work on SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Copyright (c) 2016 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Colin:
Nice mod, thanks Dougie.

Rock Lee:
Great work indeed :D As always I leave the Latin translation spanish ;)

ManageSettings.spanish_latin.php


--- Code: ---$txt['SLBBC_Default'] = 'Idioma predeterminado por el <strong>idioma</strong> bbcode:<div class="smalltext">Informaci&oacute;n adicional se puede encontrar <a href="http://www.lingoes.net/en/translator/langcode.htm">Aqu&iacute;</a>!</div>';
--- End code ---

ManageSettings.spanish_latin-utf8.php


--- Code: ---$txt['SLBBC_Default'] = 'Idioma predeterminado por el <strong>idioma</strong> bbcode:<div class="smalltext">InformaciĆ³n adicional se puede encontrar <a href="http://www.lingoes.net/en/translator/langcode.htm">AquĆ­</a>!</div>';
--- End code ---


Regards!

4Kstore:
Thanks a lots, this is a great mod for multilanguages forums.

tehnetman:
Hello,
This is a great mod! I was always looking for something like that so my users from different countries don't need to translate or open some additional spoilers to see the message in different language.
BUT, it has one problem. It doesn't work well when using
--- Code: --- or [list] etc inside it, the bbcodes just start messing up, and you can see [/language] in the post or you can see both language texts etc. Could somebody help me fixing that? I'm a total newb in any form of web development, can only edit some code.
Thanks in advance and sorry for digging up, but this is a great mod and has only this little flaw.
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version