plugin:multilingual
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:multilingual [2009-12-28 16:10] – 61.123.195.192 | plugin:multilingual [2023-10-30 23:09] (current) – Klap-in | ||
---|---|---|---|
Line 6: | Line 6: | ||
email : d.stonier@gmail.com | email : d.stonier@gmail.com | ||
type : syntax, | type : syntax, | ||
- | lastupdate : 2009-02-11 | + | lastupdate : 2020-12-15 |
- | compatible : 2008-05-05 | + | compatible : Greebo, Hogfather |
depends | depends | ||
conflicts | conflicts | ||
similar | similar | ||
- | tags : language | + | tags : language, translation |
+ | downloadurl: | ||
+ | sourcerepo : https:// | ||
+ | bugtracker : https:// | ||
---- | ---- | ||
This plugin tries to collect and improve on a few multilingual plugins and tips that are floating around and collate them into a single plugin that provides a consistent interface for multilingual capabilities. | This plugin tries to collect and improve on a few multilingual plugins and tips that are floating around and collate them into a single plugin that provides a consistent interface for multilingual capabilities. | ||
- | ===== Links ===== | ||
- | * [[http:// | + | ===== Installation |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | * [[http:// | + | |
- | ===== Requests/ | + | |
- | You can either use the forum above, or add below for any discussion about problems/ | + | Download and install |
- | == Use browser language for the UI == | + | https:// |
- | I couldn' | + | Use the plugin manager, or alternatively, |
- | <code php> | + | ===== Configuration ===== |
- | $languages | + | |
- | </ | + | |
- | I changed | + | You'll need to hack your template a little to get it to show the plugin' |
+ | |||
+ | ===Template=== | ||
+ | |||
+ | Without hacking your template too much, the cleanest way is to create a file in your template directory called ''/ | ||
+ | <code php show_languages.html> | ||
+ | <?php | ||
+ | $multi_lingual_plugin = & | ||
+ | if ( $multi_lingual_plugin ) { | ||
+ | if ( !plugin_isdisabled($multi_lingual_plugin-> | ||
+ | print $multi_lingual_plugin-> | ||
+ | } | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | Note that the if conditions check first that the plugin both exists and is enabled - this allows your template to function, even if you do not currently have the plugin installed. Then add the following line somewhere in your template' | ||
<code php> | <code php> | ||
- | $languages = split(',', | + | <?php @include(dirname(__FILE__).'/show_languages.html')?> |
</ | </ | ||
- | -- //Viktor Söderqvist, | + | ===Configuration Manager=== |
- | What browser and php version were you using? Neither escaping should strictly be necessary, but have added it to the plugin as it doesn' | + | As admin, under the configuration settings page, there are some important configuration settings that are necessary |
- | -- //Daniel Stonier, 2009-10-08 23:24// | + | ^Enabled Languages | provide a comma separated list here (no default is assumed, so include\\ all languages you wish to enable).| |
+ | ^Use Flags | enables graphics for the language items.| | ||
+ | ^Utilise Browser UI Preference | use the browser' | ||
+ | ^Start page redirection | when logging in, redirect the user to the start page corresponding to\\ their language.| | ||
- | Why escape | + | You can test the browser sniffing in Firefox by simply going to edit-> |
- | > Actually it was like that for no better reason than I didn't write that part - it inherited from the translation plugin or whatever I was building from (can't recall for sure). I might review it later when I get a chance. | + | ===== Requests/ |
- | The HTTP_ACCEPT_LANGUAGE variable cannot have literal brackets there. And not used for back referencing | + | You can either |
- | <code php> | ||
- | | ||
- | | ||
- | </ | ||
- | |||
- | > Actually, I think choosing the browser for the user interface is better. Most users' will always be more comfortable with their native interface. For instance, I'm rapidly becoming multilingual (english+korean), | ||
- | |||
- | > -- //Daniel Stonier, 2009-12-26 5:24// | ||
- | |||
- | > Say, you are not on your usual computer and the language settings differ from your preferred one, you go pick the language you want on the interface, the contents are changed but the interface staying same looks odd. Average use of this is to make it feel as native as it can. | ||
- | |||
- | > -- //h1d, 2009-12-28// | ||
== Root Page Redirection == | == Root Page Redirection == | ||
- | Also, I figured I wanted the user to be redirected to a language page instead of page not found when visiting the top site without explicitly specifying the language namespace. (ex : http:// | + | Also, I figured I wanted the user to be redirected to a language page instead of page not found when visiting the top site without explicitly specifying the language namespace. (ex : http:// |
<code php> | <code php> | ||
Line 90: | Line 91: | ||
-- //h1d, 2009-11-21// | -- //h1d, 2009-11-21// | ||
+ | |||
+ | To remove redundant ' | ||
+ | |||
+ | < | ||
+ | // always print the startpage | ||
+ | tpl_pagelink(':' | ||
+ | </ | ||
+ | |||
+ | Also interface language could be switched to a different one from the document' | ||
+ | |||
+ | < | ||
+ | array_unshift($languages, | ||
+ | </ | ||
+ | |||
+ | before this block, | ||
+ | |||
+ | < | ||
+ | | ||
+ | if (in_array($language, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | A note to developer but there is a small bug in ' | ||
+ | < | ||
+ | $languages = preg_split("/,/", | ||
+ | </ | ||
+ | |||
+ | First parameter of ' | ||
+ | |||
+ | -- //h1d, 2013-07-08// |
plugin/multilingual.1262013024.txt.gz · Last modified: 2009-12-28 16:10 by 61.123.195.192