CVE-2012-10013: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
value: A vulnerability was found in Kau-Boy Backend Localization Plugin up to 1.6.1 on WordPress. It has been rated as problematic. This issue affects some unknown processing of the file backend_localization.php. The manipulation leads to cross site scripting. The attack may be initiated remotely. Upgrading to version 2.0 is able to address this issue. The patch is named 43dc96defd7944da12ff116476a6890acd7dd24b. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-227231.
CWE description: The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
CVSS v3 base score: 6.1
Published: 2023-04-24T18:15Z
Repository: https://github.com/wp-plugins/kau-boys-backend-localization
Language: Other
Files changed: backend-localization-de_DE.po, backend_localization.php, readme.txt
Commit date: 2012-07-30 23:01:34 +0000
Commit message: Adding Version 2.0: Adding some new languages. Fixing link to switch languages in backend. Thanks to Justin! Fixing XSS vulnerabilities. Many Thanks to Matt Fuller from MOZILLA!

git-svn-id: https://plugins.svn.wordpress.org/kau-boys-backend-localization/trunk@579507 b8457f37-d9ea-0310-8a92-e5e31aec5664

Diff: diff --git a/backend-localization-de_DE.mo b/backend-localization-de_DE.mo
index 8706c68..fe96910 100644
Binary files a/backend-localization-de_DE.mo and b/backend-localization-de_DE.mo differ
diff --git a/backend-localization-de_DE.po b/backend-localization-de_DE.po
index 0461422..385b685 100644
--- a/backend-localization-de_DE.po
+++ b/backend-localization-de_DE.po
@@ -1,11 +1,11 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: kau-boys-backend-localization\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-10-31 13:15+0100\n"
-"PO-Revision-Date: 2011-10-31 13:16+0100\n"
+"POT-Creation-Date: 2012-07-31 00:54+0100\n"
+"PO-Revision-Date: 2012-07-31 00:57+0100\n"
 "Last-Translator: \n"
 "Language-Team: Bernhard Kau <bernhard@kau-boys.de>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -17,410 +17,463 @@ msgstr ""
 #: backend_localization.php:22
 msgid "Afrikaans"
 msgstr "Afrikaans"
 
 #: backend_localization.php:23
+msgid "Aragonese"
+msgstr "Aragonesisch"
+
+#: backend_localization.php:24
 msgid "Arabic"
 msgstr "Arabisch"
 
-#: backend_localization.php:24
+#: backend_localization.php:25
 msgid "Azerbaijani"
 msgstr "Azerbaijani"
 
-#: backend_localization.php:25
+#: backend_localization.php:26
+msgid "Azerbaijani (Turkey)"
+msgstr "Azerbaijani (Türkei)"
+
+#: backend_localization.php:27
 msgid "Bulgarian"
 msgstr "Bulgarisch"
 
-#: backend_localization.php:26
+#: backend_localization.php:28
 msgid "Bengali"
 msgstr "Bengalisch"
 
-#: backend_localization.php:27
+#: backend_localization.php:29
 msgid "Bosnian"
 msgstr "Bosnisch"
 
-#: backend_localization.php:28
+#: backend_localization.php:30
 msgid "Catalan"
 msgstr "Katalanisch"
 
-#: backend_localization.php:29
-#: backend_localization.php:69
+#: backend_localization.php:31
+#: backend_localization.php:77
 msgid "Kurdish"
 msgstr "Kurdisch"
 
-#: backend_localization.php:30
+#: backend_localization.php:32
+msgid "Corsican"
+msgstr "Korsisch"
+
+#: backend_localization.php:33
 msgid "Cape Verdean Creole"
 msgstr "Kapverdisches Kreol"
 
-#: backend_localization.php:31
+#: backend_localization.php:34
 msgid "Czech"
 msgstr "Tschechisch"
 
-#: backend_localization.php:32
+#: backend_localization.php:35
 msgid "Cymraeg (Welsh)"
 msgstr "Cymraeg (Walisisch)"
 
-#: backend_localization.php:33
+#: backend_localization.php:36
 msgid "Danish"
 msgstr "Dänisch"
 
-#: backend_localization.php:34
+#: backend_localization.php:37
 msgid "German"
 msgstr "Deutsch"
 
-#: backend_localization.php:35
+#: backend_localization.php:38
+msgid "Divehi/Maldivian"
+msgstr "Dhivehi"
+
+#: backend_localization.php:39
 msgid "Greek"
 msgstr "Griechisch"
 
-#: backend_localization.php:36
+#: backend_localization.php:40
 msgid "English"
 msgstr "Englisch"
 
-#: backend_localization.php:37
+#: backend_localization.php:41
+msgid "English (Canada)"
+msgstr "Englisch (Kanada)"
+
+#: backend_localization.php:42
+msgid "English (United Kingdom)"
+msgstr "Englisch (Vereinigtes Königreich)"
+
+#: backend_localization.php:43
 msgid "Esperanto"
 msgstr "Esperanto"
 
-#: backend_localization.php:38
+#: backend_localization.php:44
 msgid "Spanish (Chile)"
 msgstr "Spanisch (Chile)"
 
-#: backend_localization.php:39
+#: backend_localization.php:45
 msgid "Spanish"
 msgstr "Spanisch"
 
-#: backend_localization.php:40
+#: backend_localization.php:46
 msgid "Spanish (Peru)"
 msgstr "Spanisch (Peru)"
 
-#: backend_localization.php:41
+#: backend_localization.php:47
 msgid "Spanish (Venezuela)"
 msgstr "Spanisch (Venezuela)"
 
-#: backend_localization.php:42
+#: backend_localization.php:48
 msgid "Estonian"
 msgstr "Estnisch"
 
-#: backend_localization.php:43
+#: backend_localization.php:49
 msgid "Basque"
 msgstr "Baskische"
 
-#: backend_localization.php:44
+#: backend_localization.php:50
 msgid "Persian (Afghanistan)"
 msgstr "Persisch (Afghanistan)"
 
-#: backend_localization.php:45
+#: backend_localization.php:51
 msgid "Persian"
 msgstr "Persisch"
 
-#: backend_localization.php:46
+#: backend_localization.php:52
 msgid "Finnish"
 msgstr "Finnisch"
 
-#: backend_localization.php:47
+#: backend_localization.php:53
 msgid "Faroese"
 msgstr "Färöisch"
 
-#: backend_localization.php:48
+#: backend_localization.php:54
 msgid "French (Belgium)"
 msgstr "Französisch (Belgien)"
 
-#: backend_localization.php:49
+#: backend_localization.php:55
 msgid "French"
 msgstr "Französisch"
 
-#: backend_localization.php:50
+#: backend_localization.php:56
 msgid "Western Frisian"
 msgstr "Westfriesisch"
 
-#: backend_localization.php:51
+#: backend_localization.php:57
+msgid "Gaeilge/Irish"
+msgstr "Gaeilge/Irisch"
+
+#: backend_localization.php:58
 msgid "Scottish Gaelic"
 msgstr "Schottisch-Gälisch"
 
-#: backend_localization.php:52
-msgid "Galician "
+#: backend_localization.php:59
+msgid "Galician"
 msgstr "Galizisch"
 
-#: backend_localization.php:53
+#: backend_localization.php:60
+msgid "Gujarati"
+msgstr "Gujarati"
+
+#: backend_localization.php:61
 msgid "Hawaiian"
 msgstr "Hawaiisch"
 
-#: backend_localization.php:54
+#: backend_localization.php:62
 msgid "Hebrew"
 msgstr "Hebräisch"
 
-#: backend_localization.php:55
+#: backend_localization.php:63
 msgid "Hindi"
 msgstr "Hindi"
 
-#: backend_localization.php:56
+#: backend_localization.php:64
 msgid "Croatian"
 msgstr "Kroatisch"
 
-#: backend_localization.php:57
+#: backend_localization.php:65
 msgid "Hungarian"
 msgstr "Ungarisch"
 
-#: backend_localization.php:58
+#: backend_localization.php:66
 msgid "Armenian"
 msgstr "Armenisch"
 
-#: backend_localization.php:59
+#: backend_localization.php:67
 msgid "Indonesian"
 msgstr "Indonesisch"
 
-#: backend_localization.php:60
+#: backend_localization.php:68
 msgid "Icelandic"
 msgstr "Isländisch"
 
-#: backend_localization.php:61
+#: backend_localization.php:69
 msgid "Italian"
 msgstr "Italienisch"
 
-#: backend_localization.php:62
+#: backend_localization.php:70
 msgid "Japanese"
 msgstr "Japanisch"
 
-#: backend_localization.php:63
+#: backend_localization.php:71
 msgid "Javanese"
 msgstr "Javanisch"
 
-#: backend_localization.php:64
+#: backend_localization.php:72
 msgid "Georgian"
 msgstr "Georgisch"
 
-#: backend_localization.php:65
+#: backend_localization.php:73
 msgid "Kabuverdianu"
 msgstr "Kabuverdianu"
 
-#: backend_localization.php:66
+#: backend_localization.php:74
 msgid "Kazakh"
 msgstr "Kasachisch"
 
-#: backend_localization.php:67
+#: backend_localization.php:75
 msgid "Kannada"
 msgstr "Kannada"
 
-#: backend_localization.php:68
+#: backend_localization.php:76
 msgid "Korean"
 msgstr "Koreanisch"
 
-#: backend_localization.php:70
+#: backend_localization.php:78
 msgid "Kyrgyz"
 msgstr "Kirgisische"
 
-#: backend_localization.php:71
+#: backend_localization.php:79
 msgid "Limburgish"
 msgstr "Limburgisch"
 
-#: backend_localization.php:72
+#: backend_localization.php:80
+msgid "Lao"
+msgstr "Laotisch"
+
+#: backend_localization.php:81
 msgid "Latvian"
 msgstr "Lettisch"
 
-#: backend_localization.php:74
+#: backend_localization.php:83
 msgid "Malagasy"
 msgstr "Malagasy"
 
-#: backend_localization.php:75
+#: backend_localization.php:84
 msgid "Macedonian"
 msgstr "Mazedonisch"
 
-#: backend_localization.php:76
+#: backend_localization.php:85
 msgid "Malayalam"
 msgstr "Malayalam"
 
-#: backend_localization.php:77
+#: backend_localization.php:86
 msgid "Mongolian"
 msgstr "Mongolisch"
 
-#: backend_localization.php:78
+#: backend_localization.php:87
 msgid "Malay"
 msgstr "Malaiisch"
 
-#: backend_localization.php:79
+#: backend_localization.php:88
 msgid "Burmese (Myanmar)"
 msgstr "Birmanisch (Myanmar)"
 
-#: backend_localization.php:80
+#: backend_localization.php:89
 msgid "Norwegian (Bokm&aring;l)"
 msgstr "Norwegisch (Bokm&aring;l)"
 
-#: backend_localization.php:81
+#: backend_localization.php:90
 msgid "Nepali"
 msgstr "Nepali"
 
-#: backend_localization.php:82
+#: backend_localization.php:91
 msgid "Dutch"
 msgstr "Niederländisch"
 
-#: backend_localization.php:83
+#: backend_localization.php:92
 msgid "Dutch (Belgium)"
 msgstr "Niederländisch (Belgien)"
 
-#: backend_localization.php:84
+#: backend_localization.php:93
 msgid "Dutch (Netherlands)"
 msgstr "Niederländisch (Niederlande)"
 
-#: backend_localization.php:85
+#: backend_localization.php:94
 msgid "Norwegian (Nynorsk)"
 msgstr "Norwegisch (Nynorsk)"
 
-#: backend_localization.php:86
+#: backend_localization.php:95
+msgid "Ossetic/Ossetian"
+msgstr "Ossetisch"
+
+#: backend_localization.php:96
 msgid "Punjabi"
 msgstr "Panjabi"
 
-#: backend_localization.php:87
+#: backend_localization.php:97
 msgid "Polish"
 msgstr "Polnisch"
 
-#: backend_localization.php:88
+#: backend_localization.php:98
 msgid "Portuguese (Brazil)"
 msgstr "Portugiesisch (Brasilien)"
 
-#: backend_localization.php:89
+#: backend_localization.php:99
 msgid "Portuguese"
 msgstr "Portugiesisch"
 
-#: backend_localization.php:90
+#: backend_localization.php:100
 msgid "Romanian"
 msgstr "Rumänisch"
 
-#: backend_localization.php:91
+#: backend_localization.php:101
 msgid "Russian"
 msgstr "Russisch"
 
-#: backend_localization.php:92
+#: backend_localization.php:102
 msgid "Russian (Ukraine)"
 msgstr "Russisch (Ukraine)"
 
-#: backend_localization.php:93
+#: backend_localization.php:103
 msgid "Sanskrit"
 msgstr "Sanskrit"
 
-#: backend_localization.php:94
+#: backend_localization.php:104
 msgid "Sindhi"
 msgstr "Sindhi"
 
-#: backend_localization.php:95
+#: backend_localization.php:105
 msgid "Sinhalese"
 msgstr "Singhalesisch"
 
-#: backend_localization.php:96
+#: backend_localization.php:106
 msgid "Slovak"
 msgstr "Slowakisch"
 
-#: backend_localization.php:97
+#: backend_localization.php:107
 msgid "Slovenian"
 msgstr "Slowenisch"
 
-#: backend_localization.php:98
+#: backend_localization.php:108
 msgid "Somali"
 msgstr "Somali"
 
-#: backend_localization.php:99
+#: backend_localization.php:109
 msgid "Albanian"
 msgstr "Albanisch"
 
-#: backend_localization.php:100
+#: backend_localization.php:110
 msgid "Serbian"
 msgstr "Serbisch"
 
-#: backend_localization.php:101
+#: backend_localization.php:111
 msgid "Sardinian"
 msgstr "Sardisch"
 
-#: backend_localization.php:102
+#: backend_localization.php:112
 msgid "Sundanese"
 msgstr "Sundanesisch"
 
-#: backend_localization.php:103
+#: backend_localization.php:113
 msgid "Swedish"
 msgstr "Schwedisch"
 
-#: backend_localization.php:104
+#: backend_localization.php:114
 msgid "Swahili"
 msgstr "Suaheli"
 
-#: backend_localization.php:105
+#: backend_localization.php:115
 msgid "Tamil"
 msgstr "Tamilisch"
 
-#: backend_localization.php:106
+#: backend_localization.php:116
 msgid "Tamil (Sri Lanka)"
 msgstr "Tamilisch (Sri Lanka)"
 
-#: backend_localization.php:107
+#: backend_localization.php:117
+msgid "Telugu"
+msgstr "Telugu"
+
+#: backend_localization.php:118
 msgid "Thai"
 msgstr "Thai"
 
-#: backend_localization.php:108
+#: backend_localization.php:119
 msgid "Turkish"
 msgstr "Türkisch"
 
-#: backend_localization.php:109
+#: backend_localization.php:120
 msgid "Uighur"
 msgstr "Uigurisch"
 
-#: backend_localization.php:110
+#: backend_localization.php:121
 msgid "Ukrainian"
 msgstr "Ukrainisch"
 
-#: backend_localization.php:111
+#: backend_localization.php:122
 msgid "Urdu"
 msgstr "Urdu"
 
-#: backend_localization.php:112
+#: backend_localization.php:123
 msgid "Uzbek"
 msgstr "Usbekisch"
 
-#: backend_localization.php:113
+#: backend_localization.php:124
 msgid "Vietnamese"
 msgstr "Vietnamesisch"
 
-#: backend_localization.php:114
+#: backend_localization.php:125
 msgid "Chinese"
 msgstr "Chinesisch"
 
-#: backend_localization.php:115
+#: backend_localization.php:126
 msgid "Chinese (Hong Kong)"
 msgstr "Chinesisch (Hongkong)"
 
-#: backend_localization.php:116
+#: backend_localization.php:127
 msgid "Chinese (Taiwan)"
 msgstr "Chinesisch (Taiwan)"
 
-#: backend_localization.php:123
+#: backend_localization.php:134
 msgid "Backend Language"
 msgstr "Backend Sprache"
 
-#: backend_localization.php:139
+#: backend_localization.php:162
 msgid "Settings"
 msgstr ""
 
-#: backend_localization.php:163
+#: backend_localization.php:180
+msgid "Switching Language"
+msgstr "Sprache wechseln"
+
+#: backend_localization.php:181
+#, php-format
+msgid "Switching language to %1$s... If the Dashboard isn't loading, use this <a href=\"%2$s\" title=\"Dashboard\">link</a>."
+msgstr "Wechsele Sprache zu %1$s... Wenn der Dashboard nicht laden sollte, klicke<a href=\"%2$s\" title=\"Dashboard\">hier</a>."
+
+#: backend_localization.php:194
 msgid "Options saved."
 msgstr ""
 
-#: backend_localization.php:166
+#: backend_localization.php:197
 msgid "Here you can customize the plugin for your needs."
 msgstr "Hier können Sie das Plugin an Ihre eigenen Bedürfnisse anpassen."
 
-#: backend_localization.php:171
+#: backend_localization.php:202
 msgid "Hide language selection on login form"
 msgstr "Sprachen-Auswahl im Anmeldeformular verbergen"
 
-#: backend_localization.php:174
+#: backend_localization.php:205
 msgid "Available languages"
 msgstr "Verfügbare Sprachen"
 
-#: backend_localization.php:185
+#: backend_localization.php:216
 #, php-format
 msgid "If your language isn't listed, you have to download the right version from the WordPress repository: <a href=\"http://svn.automattic.com/wordpress-i18n\">http://svn.automattic.com/wordpress-i18n</a>. Browser to the language folder of your choice and get the <b>all</b> .mo files for your WordPress Version from <i><b>tags/%1s/messages/</b></i> or from the <i><b>trunk/messages/</b></i> folder. Upload them to the langauge folder <i>%2s</i>. You should than be able to choose the new language (or after a refresh of this page)."
 msgstr "Falls Ihre gewünschte Sprache hier nicht aufgeführt ist, müssen sie die Sprache aus dem WordPress Repository downloaden: <a href=\"http://svn.automattic.com/wordpress-i18n\">http://svn.automattic.com/wordpress-i18n</a>. Navigieren Sie in den Ordner der gewünschten Sprache und laden Sie <b>alle</b> .mo Dateien für Ihre WordPress Version aus dem <i><b>tags/%1s/messages/</b></i> oder aus dem <i><b>trunk/messages/</b></i> Ordner runter. Laden Sie anschließend die Dateien in den Ordner <i>%2s</i> hoch. Sie sollen jetzt in der Lage sein, die neue Sprache auszuwählen (oder nach einen Neuladen dieser Seite)."
 
-#: backend_localization.php:189
+#: backend_localization.php:220
 msgid "Save Changes"
 msgstr ""
 
-#: backend_localization.php:244
+#: backend_localization.php:275
 msgid "Language"
 msgstr "Sprache"
 
diff --git a/backend_localization.php b/backend_localization.php
index a3d6221..4858a2b 100644
--- a/backend_localization.php
+++ b/backend_localization.php
@@ -1,288 +1,323 @@
 <?php
 /*
 Plugin Name: Backend Localization
-Plugin URI: http://kau-boys.de/230/wordpress/kau-boys-backend-localization-plugin
+Plugin URI: http://kau-boys.com/230/wordpress/kau-boys-backend-localization-plugin
 Description: This plugin enables you to run your blog in a different language than the backend of your blog. So you can serve your blog using e.g. German as the default language for the users, but keep English as the language for the administration.
-Version: 1.6.1
+Version: 2.0
+Requires at least: 3.2
 Author: Bernhard Kau
-Author URI: http://kau-boys.de
+Author URI: http://kau-boys.com
 */
 
-
-define('BACKEND_LOCALIZATION_URL', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)));
+define( 'BACKEND_LOCALIZATION_URL', WP_PLUGIN_URL . '/' . str_replace( basename(  __FILE__ ), "", plugin_basename( __FILE__ ) ) );
 
 $wp_locale_all = array();
 
 function init_backend_localization(){
 	global $wp_locale_all;
 	
-	load_plugin_textdomain('backend-localization', false, dirname(plugin_basename(__FILE__)));
+	load_plugin_textdomain( 'backend-localization', false, dirname( plugin_basename( __FILE__ ) ) );
 	
 	$wp_locale_all = array(
-		'af' => __('Afrikaans', 'backend-localization'),
-			'ar' => __('Arabic', 'backend-localization'),
-			'az' => __('Azerbaijani', 'backend-localization'),
-			'bg_BG' => __('Bulgarian', 'backend-localization'),
-			'bn_BD' => __('Bengali', 'backend-localization'),
-			'bs_BA' => __('Bosnian', 'backend-localization'),
-			'ca' => __('Catalan', 'backend-localization'),
-			'ckb' => __('Kurdish', 'backend-localization'),
-			'cpp' => __('Cape Verdean Creole', 'backend-localization'),
-			'cs_CZ' => __('Czech', 'backend-localization'),
-			'cy' => __('Cymraeg (Welsh)', 'backend-localization'),
-			'da_DK' => __('Danish', 'backend-localization'),
-			'de_DE' => __('German', 'backend-localization'),
-			'el' => __('Greek', 'backend-localization'),
-			'en_US' => __('English', 'backend-localization'),
-			'eo' => __('Esperanto', 'backend-localization'),
-			'es_CL' => __('Spanish (Chile)', 'backend-localization'),
-			'es_ES' => __('Spanish', 'backend-localization'),
-			'es_PE' => __('Spanish (Peru)', 'backend-localization'),
-			'es_VE' => __('Spanish (Venezuela)', 'backend-localization'),
-			'et' => __('Estonian', 'backend-localization'),
-			'eu' => __('Basque', 'backend-localization'),
-			'fa_AF' => __('Persian (Afghanistan)', 'backend-localization'),
-			'fa_IR' => __('Persian', 'backend-localization'),
-			'fi' => __('Finnish', 'backend-localization'),
-			'fo' => __('Faroese', 'backend-localization'),
-			'fr_BE' => __('French (Belgium)', 'backend-localization'),
-			'fr_FR' => __('French', 'backend-localization'),
-			'fy' => __('Western Frisian', 'backend-localization'),
-			'gd' => __('Scottish Gaelic', 'backend-localization'),
-			'gl_ES' => __('Galician ', 'backend-localization'),
-			'haw_US' => __('Hawaiian', 'backend-localization'),
-			'he_IL' => __('Hebrew', 'backend-localization'),
-			'hi_IN' => __('Hindi', 'backend-localization'),
-			'hr' => __('Croatian', 'backend-localization'),
-			'hu_HU' => __('Hungarian', 'backend-localization'),
-			'hy' => __('Armenian', 'backend-localization'),
-			'id_ID' => __('Indonesian', 'backend-localization'),
-			'is_IS' => __('Icelandic', 'backend-localization'),
-			'it_IT' => __('Italian', 'backend-localization'),
-			'ja' => __('Japanese', 'backend-localization'),
-			'jv_ID' => __('Javanese', 'backend-localization'),
-			'ka_GE' => __('Georgian', 'backend-localization'),
-			'kea' => __('Kabuverdianu', 'backend-localization'),
-			'kk' => __('Kazakh', 'backend-localization'),
-			'kn' => __('Kannada', 'backend-localization'),
-			'ko_KR' => __('Korean', 'backend-localization'),
-			'ku' => __('Kurdish', 'backend-localization'),
-			'ky_KY' => __('Kyrgyz', 'backend-localization'),
-			'li' => __('Limburgish', 'backend-localization'),
-			'lv' => __('Latvian', 'backend-localization'),
-			// 'me_ME' => __('', 'backend-localization'),
-			'mg_MG' => __('Malagasy', 'backend-localization'),
-			'mk_MK' => __('Macedonian', 'backend-localization'),
-			'ml_IN' => __('Malayalam', 'backend-localization'),
-			'mn' => __('Mongolian', 'backend-localization'),
-			'ms_MY' => __('Malay', 'backend-localization'),
-			'my_MM' => __('Burmese (Myanmar)', 'backend-localization'),
-			'nb_NO' => __('Norwegian (Bokm&aring;l)', 'backend-localization'),
-			'ne_NP' => __('Nepali', 'backend-localization'),
-			'nl' => __('Dutch', 'backend-localization'),
-			'nl_BE' => __('Dutch (Belgium)', 'backend-localization'),
-			'nl_NL' => __('Dutch (Netherlands)', 'backend-localization'),
-			'nn_NO' => __('Norwegian (Nynorsk)', 'backend-localization'),
-			'pa_IN' => __('Punjabi', 'backend-localization'),
-			'pl_PL' => __('Polish', 'backend-localization'),
-			'pt_BR' => __('Portuguese (Brazil)', 'backend-localization'),
-			'pt_PT' => __('Portuguese', 'backend-localization'),
-			'ro_RO' => __('Romanian', 'backend-localization'),
-			'ru_RU' => __('Russian', 'backend-localization'),
-			'ru_UA' => __('Russian (Ukraine)', 'backend-localization'),
-			'sa_IN' => __('Sanskrit', 'backend-localization'),
-			'sd_PK' => __('Sindhi', 'backend-localization'),
-			'si_LK' => __('Sinhalese', 'backend-localization'),
-			'sk_SK' => __('Slovak', 'backend-localization'),
-			'sl_SI' => __('Slovenian', 'backend-localization'),
-			'so_SO' => __('Somali', 'backend-localization'),
-			'sq' => __('Albanian', 'backend-localization'),
-			'sr_RS' => __('Serbian', 'backend-localization'),
-			'srd' => __('Sardinian', 'backend-localization'),
-			'su_ID' => __('Sundanese', 'backend-localization'),
-			'sv_SE' => __('Swedish', 'backend-localization'),
-			'sw' => __('Swahili', 'backend-localization'),
-			'ta_IN' => __('Tamil', 'backend-localization'),
-			'ta_LK' => __('Tamil (Sri Lanka)', 'backend-localization'),
-			'th' => __('Thai', 'backend-localization'),
-			'tr_TR' => __('Turkish', 'backend-localization'),
-			'ug_CN' => __('Uighur', 'backend-localization'),
-			'uk' => __('Ukrainian', 'backend-localization'),
-			'ur' => __('Urdu', 'backend-localization'),
-			'uz_UZ' => __('Uzbek', 'backend-localization'),
-			'vi' => __('Vietnamese', 'backend-localization'),
-			'zh_CN' => __('Chinese', 'backend-localization'),
-			'zh_HK' => __('Chinese (Hong Kong)', 'backend-localization'),
-			'zh_TW' => __('Chinese (Taiwan)', 'backend-localization')
+		'af' => __( 'Afrikaans', 'backend-localization' ),
+		'an' => __( 'Aragonese', 'backend-localization' ),
+		'ar' => __( 'Arabic', 'backend-localization' ),
+		'az' => __( 'Azerbaijani', 'backend-localization' ),
+		'az_TR' => __( 'Azerbaijani (Turkey)', 'backend-localization' ),
+		'bg_BG' => __( 'Bulgarian', 'backend-localization' ),
+		'bn_BD' => __( 'Bengali', 'backend-localization' ),
+		'bs_BA' => __( 'Bosnian', 'backend-localization' ),
+		'ca' => __( 'Catalan', 'backend-localization' ),
+		'ckb' => __( 'Kurdish', 'backend-localization' ),
+		'co' => __( 'Corsican', 'backend-localization' ),
+		'cpp' => __( 'Cape Verdean Creole', 'backend-localization' ),
+		'cs_CZ' => __( 'Czech', 'backend-localization' ),
+		'cy' => __( 'Cymraeg (Welsh)', 'backend-localization' ),
+		'da_DK' => __( 'Danish', 'backend-localization' ),
+		'de_DE' => __( 'German', 'backend-localization' ),
+		'dv' => __( 'Divehi/Maldivian', 'backend-localization' ),
+		'el' => __( 'Greek', 'backend-localization' ),
+		'en_US' => __( 'English', 'backend-localization' ),
+		'en_CA' => __( 'English (Canada)', 'backend-localization' ),
+		'en_GB' => __( 'English (United Kingdom)', 'backend-localization' ),
+		'eo' => __( 'Esperanto', 'backend-localization' ),
+		'es_CL' => __( 'Spanish (Chile)', 'backend-localization' ),
+		'es_ES' => __( 'Spanish', 'backend-localization' ),
+		'es_PE' => __( 'Spanish (Peru)', 'backend-localization' ),
+		'es_VE' => __( 'Spanish (Venezuela)', 'backend-localization' ),
+		'et' => __( 'Estonian', 'backend-localization' ),
+		'eu' => __( 'Basque', 'backend-localization' ),
+		'fa_AF' => __( 'Persian (Afghanistan)', 'backend-localization' ),
+		'fa_IR' => __( 'Persian', 'backend-localization' ),
+		'fi' => __( 'Finnish', 'backend-localization' ),
+		'fo' => __( 'Faroese', 'backend-localization' ),
+		'fr_BE' => __( 'French (Belgium)', 'backend-localization' ),
+		'fr_FR' => __( 'French', 'backend-localization' ),
+		'fy' => __( 'Western Frisian', 'backend-localization' ),
+		'ga' => __( 'Gaeilge/Irish', 'backend-localization' ),
+		'gd' => __( 'Scottish Gaelic', 'backend-localization' ),
+		'gl_ES' => __( 'Galician', 'backend-localization' ),
+		'gu' => __( 'Gujarati', 'backend-localization' ),
+		'haw_US' => __( 'Hawaiian', 'backend-localization' ),
+		'he_IL' => __( 'Hebrew', 'backend-localization' ),
+		'hi_IN' => __( 'Hindi', 'backend-localization' ),
+		'hr' => __( 'Croatian', 'backend-localization' ),
+		'hu_HU' => __( 'Hungarian', 'backend-localization' ),
+		'hy' => __( 'Armenian', 'backend-localization' ),
+		'id_ID' => __( 'Indonesian', 'backend-localization' ),
+		'is_IS' => __( 'Icelandic', 'backend-localization' ),
+		'it_IT' => __( 'Italian', 'backend-localization' ),
+		'ja' => __( 'Japanese', 'backend-localization' ),
+		'jv_ID' => __( 'Javanese', 'backend-localization' ),
+		'ka_GE' => __( 'Georgian', 'backend-localization' ),
+		'kea' => __( 'Kabuverdianu', 'backend-localization' ),
+		'kk' => __( 'Kazakh', 'backend-localization' ),
+		'kn' => __( 'Kannada', 'backend-localization' ),
+		'ko_KR' => __( 'Korean', 'backend-localization' ),
+		'ku' => __( 'Kurdish', 'backend-localization' ),
+		'ky_KY' => __( 'Kyrgyz', 'backend-localization' ),
+		'li' => __( 'Limburgish', 'backend-localization' ),
+		'lo' => __( 'Lao', 'backend-localization' ),
+		'lv' => __( 'Latvian', 'backend-localization' ),
+		// 'me_ME' => __( '', 'backend-localization' ),
+		'mg_MG' => __( 'Malagasy', 'backend-localization' ),
+		'mk_MK' => __( 'Macedonian', 'backend-localization' ),
+		'ml_IN' => __( 'Malayalam', 'backend-localization' ),
+		'mn' => __( 'Mongolian', 'backend-localization' ),
+		'ms_MY' => __( 'Malay', 'backend-localization' ),
+		'my_MM' => __( 'Burmese (Myanmar)', 'backend-localization' ),
+		'nb_NO' => __( 'Norwegian (Bokm&aring;l)', 'backend-localization' ),
+		'ne_NP' => __( 'Nepali', 'backend-localization' ),
+		'nl' => __( 'Dutch', 'backend-localization' ),
+		'nl_BE' => __( 'Dutch (Belgium)', 'backend-localization' ),
+		'nl_NL' => __( 'Dutch (Netherlands)', 'backend-localization' ),
+		'nn_NO' => __( 'Norwegian (Nynorsk)', 'backend-localization' ),
+		'os' => __( 'Ossetic/Ossetian', 'backend-localization' ),
+		'pa_IN' => __( 'Punjabi', 'backend-localization' ),
+		'pl_PL' => __( 'Polish', 'backend-localization' ),
+		'pt_BR' => __( 'Portuguese (Brazil)', 'backend-localization' ),
+		'pt_PT' => __( 'Portuguese', 'backend-localization' ),
+		'ro_RO' => __( 'Romanian', 'backend-localization' ),
+		'ru_RU' => __( 'Russian', 'backend-localization' ),
+		'ru_UA' => __( 'Russian (Ukraine)', 'backend-localization' ),
+		'sa_IN' => __( 'Sanskrit', 'backend-localization' ),
+		'sd_PK' => __( 'Sindhi', 'backend-localization' ),
+		'si_LK' => __( 'Sinhalese', 'backend-localization' ),
+		'sk_SK' => __( 'Slovak', 'backend-localization' ),
+		'sl_SI' => __( 'Slovenian', 'backend-localization' ),
+		'so_SO' => __( 'Somali', 'backend-localization' ),
+		'sq' => __( 'Albanian', 'backend-localization' ),
+		'sr_RS' => __( 'Serbian', 'backend-localization' ),
+		'srd' => __( 'Sardinian', 'backend-localization' ),
+		'su_ID' => __( 'Sundanese', 'backend-localization' ),
+		'sv_SE' => __( 'Swedish', 'backend-localization' ),
+		'sw' => __( 'Swahili', 'backend-localization' ),
+		'ta_IN' => __( 'Tamil', 'backend-localization' ),
+		'ta_LK' => __( 'Tamil (Sri Lanka)', 'backend-localization' ),
+		'te' => __( 'Telugu', 'backend-localization' ),
+		'th' => __( 'Thai', 'backend-localization' ),
+		'tr_TR' => __( 'Turkish', 'backend-localization' ),
+		'ug_CN' => __( 'Uighur', 'backend-localization' ),
+		'uk' => __( 'Ukrainian', 'backend-localization' ),
+		'ur' => __( 'Urdu', 'backend-localization' ),
+		'uz_UZ' => __( 'Uzbek', 'backend-localization' ),
+		'vi' => __( 'Vietnamese', 'backend-localization' ),
+		'zh_CN' => __( 'Chinese', 'backend-localization' ),
+		'zh_HK' => __( 'Chinese (Hong Kong)', 'backend-localization' ),
+		'zh_TW' => __( 'Chinese (Taiwan)', 'backend-localization' )
 	);
 }
 
 function backend_localization_admin_menu(){
 	global $wp_locale_all;
 	
-	add_options_page("Kau-Boy's Backend Localization settings", __('Backend Language', 'backend-localization'), 8, __FILE__, 'backend_localization_admin_settings');
+	add_options_page( "Kau-Boy's Backend Localization settings", __( 'Backend Language', 'backend-localization' ), 'manage_options', 'backend_localization', 'backend_localization_admin_settings' );
 		
 	$backend_locale_array = backend_localization_get_languages();
 	$backend_locale = backend_localization_get_locale();
 
-	foreach($backend_locale_array as $locale_value){
-		$link = 'http://'.add_query_arg('kau-boys_backend_localization_language', $locale_value);
-		add_menu_page($wp_locale_all[$locale_value], $wp_locale_all[$locale_value], 'read', $link, NULL, BACKEND_LOCALIZATION_URL.'flag_icons/'.strtolower(substr($locale_value, (strpos($locale_value, '_') * -1))).'.png');
+	foreach( $backend_locale_array as $locale_value ){
+		$link = add_query_arg('kau-boys_backend_localization_language', $locale_value);
+		$link = ( strpos( $link, "wp-admin/" ) === false ) ? preg_replace( '#[^?&]*/#i', '', $link ) : preg_replace( '#[^?&]*wp-admin/#i', '', $link );
+		if( strpos($link, "?" ) === 0|| strpos( $link, "index.php?" ) ===0 ){
+			if( current_user_can( 'manage_options' ) ){
+				$link = 'options-general.php?page=backend_localization&godashboard=1&kau-boys_backend_localization_language=' . $locale_value; 
+			} else {
+				$link = 'edit.php?lang='.$language;
+			}
+		}
+		add_menu_page( __( $wp_locale_all[$locale_value], 'qtranslate' ), $wp_locale_all[$locale_value], 'read', $link, NULL, BACKEND_LOCALIZATION_URL . 'flag_icons/' . strtolower( substr( $locale_value, ( strpos($locale_value, '_' ) * -1 ) ) ) . '.png' );
+		/*
+		$link = admin_url( add_query_arg( 'kau-boys_backend_localization_language', $locale_value, $link ) );
+		add_menu_page( $wp_locale_all[$locale_value], $wp_locale_all[$locale_value], 'read', $link, NULL, BACKEND_LOCALIZATION_URL . 'flag_icons/' . strtolower( substr( $locale_value, ( strpos($locale_value, '_' ) * -1 ) ) ) . '.png' );
+		*/
 	}
 }
 
-function backend_localization_filter_plugin_actions($links, $file){
+function backend_localization_filter_plugin_actions( $links, $file ){
 	static $this_plugin;
-	if (!$this_plugin) $this_plugin = plugin_basename(__FILE__);
+	if ( !$this_plugin ) $this_plugin = plugin_basename( __FILE__ );
 	
-	if ($file == $this_plugin){
-		$settings_link = '<a href="options-general.php?page=kau-boys-backend-localization/backend_localization.php">'.__('Settings').'</a>';
-		array_unshift($links, $settings_link);
+	if ( $file == $this_plugin ){
+		$settings_link = '<a href="options-general.php?page=backend_localization">' . __( 'Settings' ) . '</a>';
+		array_unshift( $links, $settings_link );
 	}
 	return $links;
 }
 
 function backend_localization_admin_settings(){
 	global $wp_locale_all, $wp_version;
 	
-	if(isset($_POST['save'])){
-		update_option('kau-boys_backend_localization_loginselect', $_POST['kau-boys_backend_localization_loginselect']);
+	if( isset($_POST['save'] ) ) {
+		update_option( 'kau-boys_backend_localization_loginselect', $_POST['kau-boys_backend_localization_loginselect'] );
 	}
-	$loginselect = get_option('kau-boys_backend_localization_loginselect');
+	$loginselect = get_option( 'kau-boys_backend_localization_loginselect' );
 	
 	$backend_locale = backend_localization_get_locale();
 	
+	// do redirection for dashboard from the qTranslate Plugin (www.qianqin.de/qtranslate)
+	if(isset($_GET['godashboard'])) {
+		echo '<h2>' . __( 'Switching Language', 'backend-localization' ) . '</h2>'
+			. sprintf( __( 'Switching language to %1$s... If the Dashboard isn\'t loading, use this <a href="%2$s" title="Dashboard">link</a>.', 'backend-localization' ), $wp_locale_all[$locale_value], admin_url() )
+			. '<script type="text/javascript">document.location="' . admin_url() . '";</script>';
+		exit();
+	}
+	
 	// set default if values haven't been recieved from the database
-	if(empty($backend_locale)) $backend_locale = 'en_US';
+	if( empty( $backend_locale ) ) $backend_locale = 'en_US';
 ?>
 
 <div class="wrap">
 	<?php screen_icon(); ?>
 	<h2>Kau-Boy's Backend Localization</h2>
-	<?php if($settings_saved) : ?>
-	<div id="message" class="updated fade"><p><strong><?php _e('Options saved.') ?></strong></p></div>
+	<?php if( $settings_saved ) : ?>
+	<div id="message" class="updated fade"><p><strong><?php _e( 'Options saved.' ) ?></strong></p></div>
 	<?php endif ?>
 	<p>
-		<?php _e('Here you can customize the plugin for your needs.', 'backend-localization') ?>
+		<?php _e( 'Here you can customize the plugin for your needs.', 'backend-localization' ) ?>
 	</p>
 	<form method="post" action="">
 		<p>
-			<input type="checkbox" name="kau-boys_backend_localization_loginselect" id="kau-boys_backend_localization_loginselect"<?php echo ($loginselect == 'on')? ' checked="checked"' : '' ?>/>
-			<label for="kau-boys_backend_localization_loginselect"><?php _e('Hide language selection on login form', 'backend-localization') ?></label>
+			<input type="checkbox" name="kau-boys_backend_localization_loginselect" id="kau-boys_backend_localization_loginselect"<?php echo ( $loginselect == 'on' )? ' checked="checked"' : '' ?>/>
+			<label for="kau-boys_backend_localization_loginselect"><?php _e( 'Hide language selection on login form', 'backend-localization' ) ?></label>
 		</p>
 		<p>
 			<h2><?php _e('Available languages', 'backend-localization') ?></h2>
 			<?php $backend_locale_array = backend_localization_get_languages() ?>
 			<?php foreach($backend_locale_array as $locale_value) : ?>
-			<input type="radio" value="<?php echo $locale_value ?>" id="kau-boys_backend_localization_language_<?php echo $locale_value ?>" name="kau-boys_backend_localization_language"<?php echo ($backend_locale == $locale_value)? ' checked="checked"' : '' ?> />
+			<input type="radio" value="<?php echo $locale_value ?>" id="kau-boys_backend_localization_language_<?php echo $locale_value ?>" name="kau-boys_backend_localization_language"<?php echo ( $backend_locale == $locale_value )? ' checked="checked"' : '' ?> />
 			<label for="kau-boys_backend_localization_language_<?php echo $locale_value ?>" style="width: 200px; display: inline-block;">
-				<img src="<?php echo BACKEND_LOCALIZATION_URL.'flag_icons/'.strtolower(substr($locale_value, (strpos($locale_value, '_') * -1))).'.png' ?>" alt="<?php echo $locale_value ?>" />
-				<?php echo $wp_locale_all[$locale_value].' ('.$locale_value.')' ?>
+				<img src="<?php echo BACKEND_LOCALIZATION_URL . 'flag_icons/' . strtolower( substr( $locale_value, ( strpos( $locale_value, '_' ) * -1 ) ) ) . '.png' ?>" alt="<?php echo $locale_value ?>" />
+				<?php echo $wp_locale_all[$locale_value] . ' (' . $locale_value . ')' ?>
 			</label>
 			<br />
 			<?php endforeach ?>
 			<div class="description">
-				<?php echo sprintf(__('If your language isn\'t listed, you have to download the right version from the WordPress repository: <a href="http://svn.automattic.com/wordpress-i18n">http://svn.automattic.com/wordpress-i18n</a>. Browser to the language folder of your choice and get the <b>all</b> .mo files for your WordPress Version from <i><b>tags/%1s/messages/</b></i> or from the <i><b>trunk/messages/</b></i> folder. Upload them to the langauge folder <i>%2s</i>. You should than be able to choose the new language (or after a refresh of this page).', 'backend-localization'), $wp_version, WP_LANG_DIR) ?>
+				<?php echo sprintf( __( 'If your language isn\'t listed, you have to download the right version from the WordPress repository: <a href="http://svn.automattic.com/wordpress-i18n">http://svn.automattic.com/wordpress-i18n</a>. Browser to the language folder of your choice and get the <b>all</b> .mo files for your WordPress Version from <i><b>tags/%1s/messages/</b></i> or from the <i><b>trunk/messages/</b></i> folder. Upload them to the langauge folder <i>%2s</i>. You should than be able to choose the new language (or after a refresh of this page).', 'backend-localization' ), $wp_version, WP_LANG_DIR ) ?>
 			</div>
 		</p>
 		<p class="submit">
-			<input class="button-primary" name="save" type="submit" value="<?php _e('Save Changes') ?>" />
+			<input class="button-primary" name="save" type="submit" value="<?php _e( 'Save Changes' ) ?>" />
 		</p>
 	</form>
 </div>
 
 <?php
 }
 
 function backend_localization_get_languages(){
 	$backend_locale_array = array();
 	
-	if(is_dir(WP_LANG_DIR)){
+	if( is_dir( WP_LANG_DIR ) ){
 		/* php 4 fix */
 		$dir = WP_LANG_DIR;
-		$dh = opendir($dir);
-		while (false !== ($filename = readdir($dh))) {
+		$dh = opendir( $dir );
+		while ( false !== ( $filename = readdir( $dh ) ) ){
 			$files[] = $filename;
 		}
 		/* read the array */
-		foreach($files as $file){
-			$fileParts = pathinfo($file);
-			if($fileParts['extension'] == 'mo' && (strlen($fileParts['filename']) <= 5)){
-				$fileParts['filename'] = substr($fileParts['basename'], 0,strpos($fileParts['basename'],'.'));
+		foreach( $files as $file ){
+			$fileParts = pathinfo( $file );
+			if($fileParts['extension'] == 'mo' && ( strlen($fileParts['filename'] ) <= 5 ) ){
+				$fileParts['filename'] = substr( $fileParts['basename'], 0, strpos($fileParts['basename'], '.') );
 				$backend_locale_array[] = $fileParts['filename'];
 			}
 		}
 	}
 	
-	if(!in_array('en_US', $backend_locale_array)){
+	if( !in_array( 'en_US', $backend_locale_array ) ){
 		$backend_locale_array[] = 'en_US';
 	}
 	sort($backend_locale_array);
 	
 	return $backend_locale_array;
 }
 
 function backend_localization_save_setting(){
-	if(isset($_REQUEST['kau-boys_backend_localization_language'])){
-		setcookie('kau-boys_backend_localization_language', $_REQUEST['kau-boys_backend_localization_language'], time()+60*60*24*30, '/');
+	if( isset( $_REQUEST['kau-boys_backend_localization_language'] ) ){
+		setcookie( 'kau-boys_backend_localization_language', backend_localization_filter_var( $_REQUEST['kau-boys_backend_localization_language'] ), time()+60*60*24*30, '/' );
 	}
 	
 	return true;
 }
 
 function backend_localization_login_form(){
 	global $wp_locale_all;
 	
 	// return if language selection on login screen should be hidden
-	if(get_option('kau-boys_backend_localization_loginselect')) return;
+	if( get_option( 'kau-boys_backend_localization_loginselect' ) ) return;
 	
 	$backend_locale_array = backend_localization_get_languages();
 	$backend_locale = backend_localization_get_locale();
 ?>
 <p>
 	<label>
-		<?php _e('Language', 'backend-localization') ?><br />
+		<?php _e( 'Language', 'backend-localization' ) ?><br />
 		<select name="kau-boys_backend_localization_language" id="user_email" class="input" style="width: 100%; color: #555;">
-		<?php foreach($backend_locale_array as $locale_value) : ?>
-			<option value="<?php echo $locale_value ?>"<?php echo ($backend_locale == $locale_value)? ' selected="selected"' : '' ?>>
-				<?php echo $wp_locale_all[$locale_value].' ('.$locale_value.')' ?>
+		<?php foreach( $backend_locale_array as $locale_value ) : ?>
+			<option value="<?php echo $locale_value ?>"<?php echo ($backend_locale == $locale_value )? ' selected="selected"' : '' ?>>
+				<?php echo $wp_locale_all[$locale_value] . ' (' . $locale_value . ')' ?>
 			</option>
 		<?php endforeach ?>
 		</select>
 	</label>
 </p>
 <?php
 }
 
 function backend_localization_get_locale(){
-	return 	isset($_REQUEST['kau-boys_backend_localization_language'])
-			? $_REQUEST['kau-boys_backend_localization_language']
-			: (	isset($_COOKIE['kau-boys_backend_localization_language'])
+	return 	isset( $_REQUEST['kau-boys_backend_localization_language'] )
+			? backend_localization_filter_var( $_REQUEST['kau-boys_backend_localization_language'] )
+			: (	isset( $_COOKIE['kau-boys_backend_localization_language'] )
 				? $_COOKIE['kau-boys_backend_localization_language']
-				: get_option('kau-boys_backend_localization_language'));
+				: get_option( 'kau-boys_backend_localization_language' ) );
 }
 
 function localize_backend($locale){
 	// set langauge if user is in admin area
-	if(defined('WP_ADMIN') || (isset($_REQUEST['pwd']) && isset($_REQUEST['kau-boys_backend_localization_language']))) {
+	if( defined( 'WP_ADMIN' ) || ( isset( $_REQUEST['pwd'] ) && isset( $_REQUEST['kau-boys_backend_localization_language'] ) ) ){
 		$locale = backend_localization_get_locale();
 	}
 	return $locale;
 }
 
 function backend_localization_set_login_language(){
-	setcookie('kau-boys_backend_localization_language', "", time() - 3600, '/');
-	setcookie('kau-boys_backend_localization_language', $_REQUEST['kau-boys_backend_localization_language'], time()+60*60*24*30, '/');
+	setcookie( 'kau-boys_backend_localization_language', "", time() - 3600, '/' );
+	setcookie( 'kau-boys_backend_localization_language', backend_localization_filter_var( $_REQUEST['kau-boys_backend_localization_language'] ), time()+60*60*24*30, '/' );
+}
+
+function backend_localization_filter_var($lang){
+	return preg_replace('/\W/', '', $lang);
 }
 
-add_action('init', 'init_backend_localization');
-add_action('admin_menu', 'backend_localization_admin_menu');
-add_action('admin_menu', 'backend_localization_save_setting');
-add_action('wp_login', 'backend_localization_set_login_language');
-add_action('login_form_locale', 'localize_backend');
-add_action('login_head', 'localize_backend');
-add_action('login_form', 'backend_localization_login_form');
-add_filter('plugin_action_links', 'backend_localization_filter_plugin_actions', 10, 2);
-add_filter('locale', 'localize_backend');
+add_action( 'init', 'init_backend_localization' );
+add_action( 'admin_menu', 'backend_localization_admin_menu' );
+add_action( 'admin_menu', 'backend_localization_save_setting' );
+add_action( 'wp_login', 'backend_localization_set_login_language' );
+add_action( 'login_form_locale', 'localize_backend' );
+add_action( 'login_head', 'localize_backend' );
+add_action( 'login_form', 'backend_localization_login_form' );
+add_filter( 'plugin_action_links', 'backend_localization_filter_plugin_actions', 10, 2 );
+add_filter( 'locale', 'localize_backend' );
 
 ?>
\ No newline at end of file
diff --git a/readme.txt b/readme.txt
index 523d0c6..2dd2b2d 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,20 +1,20 @@
 === Backend Localization ===
 Contributors: Kau-Boy
 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7914504
 Tags: admin, backend, localization, english, l10n, i18n, translations, translation
-Requires at least: 2.7
-Stable tag: 1.6
+Requires at least: 3.2
+Stable tag: 2.0
 
 This plugin enables you to run your blog in a different language than the backend of your blog. So you can serve your blog using e.g. German as the default language for the users, but keep English as the language for the administration. 
 
 == Description ==
 
 This plugin enables you to run your blog in a different language than the backend of your blog. So you can serve your blog using e.g. German as the default language for the users, but keep English as the language for the administration.
 You can choose the language you want to use from all installed language files or you can install additional languages.
 
-A list of all of my plugins can be found on the [WordPress Plugin page](http://kau-boys.de/wordpress-plugins?lang=en "WordPress Plugins") on my blog [kau-boys.de](http://kau-boys.de). 
+A list of all of my plugins can be found on the [WordPress Plugin page](http://kau-boys.com/wordpress-plugins "WordPress Plugins") on my blog [kau-boys.com](http://kau-boys.com). 
 
 == Screenshots ==
 
 1. Screenshot of the settings page
 2. Screenshot of language switcher in admin menu (similar to qTranslate switcher)
@@ -59,10 +59,11 @@ Every language that is supported by WordPress can be chosen. You just need a cop
 No you don't have to. I love qTranslate and use it for my own blog. qTranslate also offers the ability to switch the backend language. But if you don't want to publish the content of your blog in more than one language, you shouldn't use qTranslate. For I created this plugin for users who only wan't to switch the backend language without the overhead of any multilingual plugin. 
 
    
 == Change Log ==
 
+* **2.0** Adding some new languages. Fixing link to switch languages in backend. Thanks to Justin! Fixing XSS vulnerabilities. Many Thanks to Matt Fuller from MOZILLA!
 * **1.6.1** Fixing typo in language names 
 * **1.6** Add WP3 CSS class for the language select on the login form
 * **1.5** Fixing the plugin for WordPress 3.0 MULTISITE feature
 * **1.4** Fixing the plugin for WordPress MU and fixing the login form selection
 * **1.3** Make the plugin working with PHP4. Thanks to David for the fix: www.est322.com/?p=520

Vulnerable code: "POT-Creation-Date: 2011-10-31 13:15+0100\n"
"PO-Revision-Date: 2011-10-31 13:16+0100\n"
#: backend_localization.php:24
#: backend_localization.php:25
#: backend_localization.php:26
#: backend_localization.php:27
#: backend_localization.php:28
#: backend_localization.php:29
#: backend_localization.php:69
#: backend_localization.php:30
#: backend_localization.php:31
#: backend_localization.php:32
#: backend_localization.php:33
#: backend_localization.php:34
#: backend_localization.php:35
#: backend_localization.php:36
#: backend_localization.php:37
#: backend_localization.php:38
#: backend_localization.php:39
#: backend_localization.php:40
#: backend_localization.php:41
#: backend_localization.php:42
#: backend_localization.php:43
#: backend_localization.php:44
#: backend_localization.php:45
#: backend_localization.php:46
#: backend_localization.php:47
#: backend_localization.php:48
#: backend_localization.php:49
#: backend_localization.php:50
#: backend_localization.php:51
#: backend_localization.php:52
msgid "Galician "
#: backend_localization.php:53
#: backend_localization.php:54
#: backend_localization.php:55
#: backend_localization.php:56
#: backend_localization.php:57
#: backend_localization.php:58
#: backend_localization.php:59
#: backend_localization.php:60
#: backend_localization.php:61
#: backend_localization.php:62
#: backend_localization.php:63
#: backend_localization.php:64
#: backend_localization.php:65
#: backend_localization.php:66
#: backend_localization.php:67
#: backend_localization.php:68
#: backend_localization.php:70
#: backend_localization.php:71
#: backend_localization.php:72
#: backend_localization.php:74
#: backend_localization.php:75
#: backend_localization.php:76
#: backend_localization.php:77
#: backend_localization.php:78
#: backend_localization.php:79
#: backend_localization.php:80
#: backend_localization.php:81
#: backend_localization.php:82
#: backend_localization.php:83
#: backend_localization.php:84
#: backend_localization.php:85
#: backend_localization.php:86
#: backend_localization.php:87
#: backend_localization.php:88
#: backend_localization.php:89
#: backend_localization.php:90
#: backend_localization.php:91
#: backend_localization.php:92
#: backend_localization.php:93
#: backend_localization.php:94
#: backend_localization.php:95
#: backend_localization.php:96
#: backend_localization.php:97
#: backend_localization.php:98
#: backend_localization.php:99
#: backend_localization.php:100
#: backend_localization.php:101
#: backend_localization.php:102
#: backend_localization.php:103
#: backend_localization.php:104
#: backend_localization.php:105
#: backend_localization.php:106
#: backend_localization.php:107
#: backend_localization.php:108
#: backend_localization.php:109
#: backend_localization.php:110
#: backend_localization.php:111
#: backend_localization.php:112
#: backend_localization.php:113
#: backend_localization.php:114
#: backend_localization.php:115
#: backend_localization.php:116
#: backend_localization.php:123
#: backend_localization.php:139
#: backend_localization.php:163
#: backend_localization.php:166
#: backend_localization.php:171
#: backend_localization.php:174
#: backend_localization.php:185
#: backend_localization.php:189
#: backend_localization.php:244
Plugin URI: http://kau-boys.de/230/wordpress/kau-boys-backend-localization-plugin
Version: 1.6.1
Author URI: http://kau-boys.de

define('BACKEND_LOCALIZATION_URL', WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)));
	load_plugin_textdomain('backend-localization', false, dirname(plugin_basename(__FILE__)));
		'af' => __('Afrikaans', 'backend-localization'),
			'ar' => __('Arabic', 'backend-localization'),
			'az' => __('Azerbaijani', 'backend-localization'),
			'bg_BG' => __('Bulgarian', 'backend-localization'),
			'bn_BD' => __('Bengali', 'backend-localization'),
			'bs_BA' => __('Bosnian', 'backend-localization'),
			'ca' => __('Catalan', 'backend-localization'),
			'ckb' => __('Kurdish', 'backend-localization'),
			'cpp' => __('Cape Verdean Creole', 'backend-localization'),
			'cs_CZ' => __('Czech', 'backend-localization'),
			'cy' => __('Cymraeg (Welsh)', 'backend-localization'),
			'da_DK' => __('Danish', 'backend-localization'),
			'de_DE' => __('German', 'backend-localization'),
			'el' => __('Greek', 'backend-localization'),
			'en_US' => __('English', 'backend-localization'),
			'eo' => __('Esperanto', 'backend-localization'),
			'es_CL' => __('Spanish (Chile)', 'backend-localization'),
			'es_ES' => __('Spanish', 'backend-localization'),
			'es_PE' => __('Spanish (Peru)', 'backend-localization'),
			'es_VE' => __('Spanish (Venezuela)', 'backend-localization'),
			'et' => __('Estonian', 'backend-localization'),
			'eu' => __('Basque', 'backend-localization'),
			'fa_AF' => __('Persian (Afghanistan)', 'backend-localization'),
			'fa_IR' => __('Persian', 'backend-localization'),
			'fi' => __('Finnish', 'backend-localization'),
			'fo' => __('Faroese', 'backend-localization'),
			'fr_BE' => __('French (Belgium)', 'backend-localization'),
			'fr_FR' => __('French', 'backend-localization'),
			'fy' => __('Western Frisian', 'backend-localization'),
			'gd' => __('Scottish Gaelic', 'backend-localization'),
			'gl_ES' => __('Galician ', 'backend-localization'),
			'haw_US' => __('Hawaiian', 'backend-localization'),
			'he_IL' => __('Hebrew', 'backend-localization'),
			'hi_IN' => __('Hindi', 'backend-localization'),
			'hr' => __('Croatian', 'backend-localization'),
			'hu_HU' => __('Hungarian', 'backend-localization'),
			'hy' => __('Armenian', 'backend-localization'),
			'id_ID' => __('Indonesian', 'backend-localization'),
			'is_IS' => __('Icelandic', 'backend-localization'),
			'it_IT' => __('Italian', 'backend-localization'),
			'ja' => __('Japanese', 'backend-localization'),
			'jv_ID' => __('Javanese', 'backend-localization'),
			'ka_GE' => __('Georgian', 'backend-localization'),
			'kea' => __('Kabuverdianu', 'backend-localization'),
			'kk' => __('Kazakh', 'backend-localization'),
			'kn' => __('Kannada', 'backend-localization'),
			'ko_KR' => __('Korean', 'backend-localization'),
			'ku' => __('Kurdish', 'backend-localization'),
			'ky_KY' => __('Kyrgyz', 'backend-localization'),
			'li' => __('Limburgish', 'backend-localization'),
			'lv' => __('Latvian', 'backend-localization'),
			// 'me_ME' => __('', 'backend-localization'),
			'mg_MG' => __('Malagasy', 'backend-localization'),
			'mk_MK' => __('Macedonian', 'backend-localization'),
			'ml_IN' => __('Malayalam', 'backend-localization'),
			'mn' => __('Mongolian', 'backend-localization'),
			'ms_MY' => __('Malay', 'backend-localization'),
			'my_MM' => __('Burmese (Myanmar)', 'backend-localization'),
			'nb_NO' => __('Norwegian (Bokm&aring;l)', 'backend-localization'),
			'ne_NP' => __('Nepali', 'backend-localization'),
			'nl' => __('Dutch', 'backend-localization'),
			'nl_BE' => __('Dutch (Belgium)', 'backend-localization'),
			'nl_NL' => __('Dutch (Netherlands)', 'backend-localization'),
			'nn_NO' => __('Norwegian (Nynorsk)', 'backend-localization'),
			'pa_IN' => __('Punjabi', 'backend-localization'),
			'pl_PL' => __('Polish', 'backend-localization'),
			'pt_BR' => __('Portuguese (Brazil)', 'backend-localization'),
			'pt_PT' => __('Portuguese', 'backend-localization'),
			'ro_RO' => __('Romanian', 'backend-localization'),
			'ru_RU' => __('Russian', 'backend-localization'),
			'ru_UA' => __('Russian (Ukraine)', 'backend-localization'),
			'sa_IN' => __('Sanskrit', 'backend-localization'),
			'sd_PK' => __('Sindhi', 'backend-localization'),
			'si_LK' => __('Sinhalese', 'backend-localization'),
			'sk_SK' => __('Slovak', 'backend-localization'),
			'sl_SI' => __('Slovenian', 'backend-localization'),
			'so_SO' => __('Somali', 'backend-localization'),
			'sq' => __('Albanian', 'backend-localization'),
			'sr_RS' => __('Serbian', 'backend-localization'),
			'srd' => __('Sardinian', 'backend-localization'),
			'su_ID' => __('Sundanese', 'backend-localization'),
			'sv_SE' => __('Swedish', 'backend-localization'),
			'sw' => __('Swahili', 'backend-localization'),
			'ta_IN' => __('Tamil', 'backend-localization'),
			'ta_LK' => __('Tamil (Sri Lanka)', 'backend-localization'),
			'th' => __('Thai', 'backend-localization'),
			'tr_TR' => __('Turkish', 'backend-localization'),
			'ug_CN' => __('Uighur', 'backend-localization'),
			'uk' => __('Ukrainian', 'backend-localization'),
			'ur' => __('Urdu', 'backend-localization'),
			'uz_UZ' => __('Uzbek', 'backend-localization'),
			'vi' => __('Vietnamese', 'backend-localization'),
			'zh_CN' => __('Chinese', 'backend-localization'),
			'zh_HK' => __('Chinese (Hong Kong)', 'backend-localization'),
			'zh_TW' => __('Chinese (Taiwan)', 'backend-localization')
	add_options_page("Kau-Boy's Backend Localization settings", __('Backend Language', 'backend-localization'), 8, __FILE__, 'backend_localization_admin_settings');
	foreach($backend_locale_array as $locale_value){
		$link = 'http://'.add_query_arg('kau-boys_backend_localization_language', $locale_value);
		add_menu_page($wp_locale_all[$locale_value], $wp_locale_all[$locale_value], 'read', $link, NULL, BACKEND_LOCALIZATION_URL.'flag_icons/'.strtolower(substr($locale_value, (strpos($locale_value, '_') * -1))).'.png');
function backend_localization_filter_plugin_actions($links, $file){
	if (!$this_plugin) $this_plugin = plugin_basename(__FILE__);
	if ($file == $this_plugin){
		$settings_link = '<a href="options-general.php?page=kau-boys-backend-localization/backend_localization.php">'.__('Settings').'</a>';
		array_unshift($links, $settings_link);
	if(isset($_POST['save'])){
		update_option('kau-boys_backend_localization_loginselect', $_POST['kau-boys_backend_localization_loginselect']);
	$loginselect = get_option('kau-boys_backend_localization_loginselect');
	if(empty($backend_locale)) $backend_locale = 'en_US';
	<?php if($settings_saved) : ?>
	<div id="message" class="updated fade"><p><strong><?php _e('Options saved.') ?></strong></p></div>
		<?php _e('Here you can customize the plugin for your needs.', 'backend-localization') ?>
			<input type="checkbox" name="kau-boys_backend_localization_loginselect" id="kau-boys_backend_localization_loginselect"<?php echo ($loginselect == 'on')? ' checked="checked"' : '' ?>/>
			<label for="kau-boys_backend_localization_loginselect"><?php _e('Hide language selection on login form', 'backend-localization') ?></label>
			<input type="radio" value="<?php echo $locale_value ?>" id="kau-boys_backend_localization_language_<?php echo $locale_value ?>" name="kau-boys_backend_localization_language"<?php echo ($backend_locale == $locale_value)? ' checked="checked"' : '' ?> />
				<img src="<?php echo BACKEND_LOCALIZATION_URL.'flag_icons/'.strtolower(substr($locale_value, (strpos($locale_value, '_') * -1))).'.png' ?>" alt="<?php echo $locale_value ?>" />
				<?php echo $wp_locale_all[$locale_value].' ('.$locale_value.')' ?>
				<?php echo sprintf(__('If your language isn\'t listed, you have to download the right version from the WordPress repository: <a href="http://svn.automattic.com/wordpress-i18n">http://svn.automattic.com/wordpress-i18n</a>. Browser to the language folder of your choice and get the <b>all</b> .mo files for your WordPress Version from <i><b>tags/%1s/messages/</b></i> or from the <i><b>trunk/messages/</b></i> folder. Upload them to the langauge folder <i>%2s</i>. You should than be able to choose the new language (or after a refresh of this page).', 'backend-localization'), $wp_version, WP_LANG_DIR) ?>
			<input class="button-primary" name="save" type="submit" value="<?php _e('Save Changes') ?>" />
	if(is_dir(WP_LANG_DIR)){
		$dh = opendir($dir);
		while (false !== ($filename = readdir($dh))) {
		foreach($files as $file){
			$fileParts = pathinfo($file);
			if($fileParts['extension'] == 'mo' && (strlen($fileParts['filename']) <= 5)){
				$fileParts['filename'] = substr($fileParts['basename'], 0,strpos($fileParts['basename'],'.'));
	if(!in_array('en_US', $backend_locale_array)){
	if(isset($_REQUEST['kau-boys_backend_localization_language'])){
		setcookie('kau-boys_backend_localization_language', $_REQUEST['kau-boys_backend_localization_language'], time()+60*60*24*30, '/');
	if(get_option('kau-boys_backend_localization_loginselect')) return;
		<?php _e('Language', 'backend-localization') ?><br />
		<?php foreach($backend_locale_array as $locale_value) : ?>
			<option value="<?php echo $locale_value ?>"<?php echo ($backend_locale == $locale_value)? ' selected="selected"' : '' ?>>
				<?php echo $wp_locale_all[$locale_value].' ('.$locale_value.')' ?>
	return 	isset($_REQUEST['kau-boys_backend_localization_language'])
			? $_REQUEST['kau-boys_backend_localization_language']
			: (	isset($_COOKIE['kau-boys_backend_localization_language'])
				: get_option('kau-boys_backend_localization_language'));
	if(defined('WP_ADMIN') || (isset($_REQUEST['pwd']) && isset($_REQUEST['kau-boys_backend_localization_language']))) {
	setcookie('kau-boys_backend_localization_language', "", time() - 3600, '/');
	setcookie('kau-boys_backend_localization_language', $_REQUEST['kau-boys_backend_localization_language'], time()+60*60*24*30, '/');
add_action('init', 'init_backend_localization');
add_action('admin_menu', 'backend_localization_admin_menu');
add_action('admin_menu', 'backend_localization_save_setting');
add_action('wp_login', 'backend_localization_set_login_language');
add_action('login_form_locale', 'localize_backend');
add_action('login_head', 'localize_backend');
add_action('login_form', 'backend_localization_login_form');
add_filter('plugin_action_links', 'backend_localization_filter_plugin_actions', 10, 2);
add_filter('locale', 'localize_backend');
Requires at least: 2.7
Stable tag: 1.6
A list of all of my plugins can be found on the [WordPress Plugin page](http://kau-boys.de/wordpress-plugins?lang=en "WordPress Plugins") on my blog [kau-boys.de](http://kau-boys.de). 
Fixed code: "POT-Creation-Date: 2012-07-31 00:54+0100\n"
"PO-Revision-Date: 2012-07-31 00:57+0100\n"
msgid "Aragonese"
msgstr "Aragonesisch"

#: backend_localization.php:24
#: backend_localization.php:25
#: backend_localization.php:26
msgid "Azerbaijani (Turkey)"
msgstr "Azerbaijani (Türkei)"

#: backend_localization.php:27
#: backend_localization.php:28
#: backend_localization.php:29
#: backend_localization.php:30
#: backend_localization.php:31
#: backend_localization.php:77
#: backend_localization.php:32
msgid "Corsican"
msgstr "Korsisch"

#: backend_localization.php:33
#: backend_localization.php:34
#: backend_localization.php:35
#: backend_localization.php:36
#: backend_localization.php:37
#: backend_localization.php:38
msgid "Divehi/Maldivian"
msgstr "Dhivehi"

#: backend_localization.php:39
#: backend_localization.php:40
#: backend_localization.php:41
msgid "English (Canada)"
msgstr "Englisch (Kanada)"

#: backend_localization.php:42
msgid "English (United Kingdom)"
msgstr "Englisch (Vereinigtes Königreich)"

#: backend_localization.php:43
#: backend_localization.php:44
#: backend_localization.php:45
#: backend_localization.php:46
#: backend_localization.php:47
#: backend_localization.php:48
#: backend_localization.php:49
#: backend_localization.php:50
#: backend_localization.php:51
#: backend_localization.php:52
#: backend_localization.php:53
#: backend_localization.php:54
#: backend_localization.php:55
#: backend_localization.php:56
#: backend_localization.php:57
msgid "Gaeilge/Irish"
msgstr "Gaeilge/Irisch"

#: backend_localization.php:58
#: backend_localization.php:59
msgid "Galician"
#: backend_localization.php:60
msgid "Gujarati"
msgstr "Gujarati"

#: backend_localization.php:61
#: backend_localization.php:62
#: backend_localization.php:63
#: backend_localization.php:64
#: backend_localization.php:65
#: backend_localization.php:66
#: backend_localization.php:67
#: backend_localization.php:68
#: backend_localization.php:69
#: backend_localization.php:70
#: backend_localization.php:71
#: backend_localization.php:72
#: backend_localization.php:73
#: backend_localization.php:74
#: backend_localization.php:75
#: backend_localization.php:76
#: backend_localization.php:78
#: backend_localization.php:79
#: backend_localization.php:80
msgid "Lao"
msgstr "Laotisch"

#: backend_localization.php:81
#: backend_localization.php:83
#: backend_localization.php:84
#: backend_localization.php:85
#: backend_localization.php:86
#: backend_localization.php:87
#: backend_localization.php:88
#: backend_localization.php:89
#: backend_localization.php:90
#: backend_localization.php:91
#: backend_localization.php:92
#: backend_localization.php:93
#: backend_localization.php:94
#: backend_localization.php:95
msgid "Ossetic/Ossetian"
msgstr "Ossetisch"

#: backend_localization.php:96
#: backend_localization.php:97
#: backend_localization.php:98
#: backend_localization.php:99
#: backend_localization.php:100
#: backend_localization.php:101
#: backend_localization.php:102
#: backend_localization.php:103
#: backend_localization.php:104
#: backend_localization.php:105
#: backend_localization.php:106
#: backend_localization.php:107
#: backend_localization.php:108
#: backend_localization.php:109
#: backend_localization.php:110
#: backend_localization.php:111
#: backend_localization.php:112
#: backend_localization.php:113
#: backend_localization.php:114
#: backend_localization.php:115
#: backend_localization.php:116
#: backend_localization.php:117
msgid "Telugu"
msgstr "Telugu"

#: backend_localization.php:118
#: backend_localization.php:119
#: backend_localization.php:120
#: backend_localization.php:121
#: backend_localization.php:122
#: backend_localization.php:123
#: backend_localization.php:124
#: backend_localization.php:125
#: backend_localization.php:126
#: backend_localization.php:127
#: backend_localization.php:134
#: backend_localization.php:162
#: backend_localization.php:180
msgid "Switching Language"
msgstr "Sprache wechseln"

#: backend_localization.php:181
#, php-format
msgid "Switching language to %1$s... If the Dashboard isn't loading, use this <a href=\"%2$s\" title=\"Dashboard\">link</a>."
msgstr "Wechsele Sprache zu %1$s... Wenn der Dashboard nicht laden sollte, klicke<a href=\"%2$s\" title=\"Dashboard\">hier</a>."

#: backend_localization.php:194
#: backend_localization.php:197
#: backend_localization.php:202
#: backend_localization.php:205
#: backend_localization.php:216
#: backend_localization.php:220
#: backend_localization.php:275
Plugin URI: http://kau-boys.com/230/wordpress/kau-boys-backend-localization-plugin
Version: 2.0
Requires at least: 3.2
Author URI: http://kau-boys.com
define( 'BACKEND_LOCALIZATION_URL', WP_PLUGIN_URL . '/' . str_replace( basename(  __FILE__ ), "", plugin_basename( __FILE__ ) ) );
	load_plugin_textdomain( 'backend-localization', false, dirname( plugin_basename( __FILE__ ) ) );
		'af' => __( 'Afrikaans', 'backend-localization' ),
		'an' => __( 'Aragonese', 'backend-localization' ),
		'ar' => __( 'Arabic', 'backend-localization' ),
		'az' => __( 'Azerbaijani', 'backend-localization' ),
		'az_TR' => __( 'Azerbaijani (Turkey)', 'backend-localization' ),
		'bg_BG' => __( 'Bulgarian', 'backend-localization' ),
		'bn_BD' => __( 'Bengali', 'backend-localization' ),
		'bs_BA' => __( 'Bosnian', 'backend-localization' ),
		'ca' => __( 'Catalan', 'backend-localization' ),
		'ckb' => __( 'Kurdish', 'backend-localization' ),
		'co' => __( 'Corsican', 'backend-localization' ),
		'cpp' => __( 'Cape Verdean Creole', 'backend-localization' ),
		'cs_CZ' => __( 'Czech', 'backend-localization' ),
		'cy' => __( 'Cymraeg (Welsh)', 'backend-localization' ),
		'da_DK' => __( 'Danish', 'backend-localization' ),
		'de_DE' => __( 'German', 'backend-localization' ),
		'dv' => __( 'Divehi/Maldivian', 'backend-localization' ),
		'el' => __( 'Greek', 'backend-localization' ),
		'en_US' => __( 'English', 'backend-localization' ),
		'en_CA' => __( 'English (Canada)', 'backend-localization' ),
		'en_GB' => __( 'English (United Kingdom)', 'backend-localization' ),
		'eo' => __( 'Esperanto', 'backend-localization' ),
		'es_CL' => __( 'Spanish (Chile)', 'backend-localization' ),
		'es_ES' => __( 'Spanish', 'backend-localization' ),
		'es_PE' => __( 'Spanish (Peru)', 'backend-localization' ),
		'es_VE' => __( 'Spanish (Venezuela)', 'backend-localization' ),
		'et' => __( 'Estonian', 'backend-localization' ),
		'eu' => __( 'Basque', 'backend-localization' ),
		'fa_AF' => __( 'Persian (Afghanistan)', 'backend-localization' ),
		'fa_IR' => __( 'Persian', 'backend-localization' ),
		'fi' => __( 'Finnish', 'backend-localization' ),
		'fo' => __( 'Faroese', 'backend-localization' ),
		'fr_BE' => __( 'French (Belgium)', 'backend-localization' ),
		'fr_FR' => __( 'French', 'backend-localization' ),
		'fy' => __( 'Western Frisian', 'backend-localization' ),
		'ga' => __( 'Gaeilge/Irish', 'backend-localization' ),
		'gd' => __( 'Scottish Gaelic', 'backend-localization' ),
		'gl_ES' => __( 'Galician', 'backend-localization' ),
		'gu' => __( 'Gujarati', 'backend-localization' ),
		'haw_US' => __( 'Hawaiian', 'backend-localization' ),
		'he_IL' => __( 'Hebrew', 'backend-localization' ),
		'hi_IN' => __( 'Hindi', 'backend-localization' ),
		'hr' => __( 'Croatian', 'backend-localization' ),
		'hu_HU' => __( 'Hungarian', 'backend-localization' ),
		'hy' => __( 'Armenian', 'backend-localization' ),
		'id_ID' => __( 'Indonesian', 'backend-localization' ),
		'is_IS' => __( 'Icelandic', 'backend-localization' ),
		'it_IT' => __( 'Italian', 'backend-localization' ),
		'ja' => __( 'Japanese', 'backend-localization' ),
		'jv_ID' => __( 'Javanese', 'backend-localization' ),
		'ka_GE' => __( 'Georgian', 'backend-localization' ),
		'kea' => __( 'Kabuverdianu', 'backend-localization' ),
		'kk' => __( 'Kazakh', 'backend-localization' ),
		'kn' => __( 'Kannada', 'backend-localization' ),
		'ko_KR' => __( 'Korean', 'backend-localization' ),
		'ku' => __( 'Kurdish', 'backend-localization' ),
		'ky_KY' => __( 'Kyrgyz', 'backend-localization' ),
		'li' => __( 'Limburgish', 'backend-localization' ),
		'lo' => __( 'Lao', 'backend-localization' ),
		'lv' => __( 'Latvian', 'backend-localization' ),
		// 'me_ME' => __( '', 'backend-localization' ),
		'mg_MG' => __( 'Malagasy', 'backend-localization' ),
		'mk_MK' => __( 'Macedonian', 'backend-localization' ),
		'ml_IN' => __( 'Malayalam', 'backend-localization' ),
		'mn' => __( 'Mongolian', 'backend-localization' ),
		'ms_MY' => __( 'Malay', 'backend-localization' ),
		'my_MM' => __( 'Burmese (Myanmar)', 'backend-localization' ),
		'nb_NO' => __( 'Norwegian (Bokm&aring;l)', 'backend-localization' ),
		'ne_NP' => __( 'Nepali', 'backend-localization' ),
		'nl' => __( 'Dutch', 'backend-localization' ),
		'nl_BE' => __( 'Dutch (Belgium)', 'backend-localization' ),
		'nl_NL' => __( 'Dutch (Netherlands)', 'backend-localization' ),
		'nn_NO' => __( 'Norwegian (Nynorsk)', 'backend-localization' ),
		'os' => __( 'Ossetic/Ossetian', 'backend-localization' ),
		'pa_IN' => __( 'Punjabi', 'backend-localization' ),
		'pl_PL' => __( 'Polish', 'backend-localization' ),
		'pt_BR' => __( 'Portuguese (Brazil)', 'backend-localization' ),
		'pt_PT' => __( 'Portuguese', 'backend-localization' ),
		'ro_RO' => __( 'Romanian', 'backend-localization' ),
		'ru_RU' => __( 'Russian', 'backend-localization' ),
		'ru_UA' => __( 'Russian (Ukraine)', 'backend-localization' ),
		'sa_IN' => __( 'Sanskrit', 'backend-localization' ),
		'sd_PK' => __( 'Sindhi', 'backend-localization' ),
		'si_LK' => __( 'Sinhalese', 'backend-localization' ),
		'sk_SK' => __( 'Slovak', 'backend-localization' ),
		'sl_SI' => __( 'Slovenian', 'backend-localization' ),
		'so_SO' => __( 'Somali', 'backend-localization' ),
		'sq' => __( 'Albanian', 'backend-localization' ),
		'sr_RS' => __( 'Serbian', 'backend-localization' ),
		'srd' => __( 'Sardinian', 'backend-localization' ),
		'su_ID' => __( 'Sundanese', 'backend-localization' ),
		'sv_SE' => __( 'Swedish', 'backend-localization' ),
		'sw' => __( 'Swahili', 'backend-localization' ),
		'ta_IN' => __( 'Tamil', 'backend-localization' ),
		'ta_LK' => __( 'Tamil (Sri Lanka)', 'backend-localization' ),
		'te' => __( 'Telugu', 'backend-localization' ),
		'th' => __( 'Thai', 'backend-localization' ),
		'tr_TR' => __( 'Turkish', 'backend-localization' ),
		'ug_CN' => __( 'Uighur', 'backend-localization' ),
		'uk' => __( 'Ukrainian', 'backend-localization' ),
		'ur' => __( 'Urdu', 'backend-localization' ),
		'uz_UZ' => __( 'Uzbek', 'backend-localization' ),
		'vi' => __( 'Vietnamese', 'backend-localization' ),
		'zh_CN' => __( 'Chinese', 'backend-localization' ),
		'zh_HK' => __( 'Chinese (Hong Kong)', 'backend-localization' ),
		'zh_TW' => __( 'Chinese (Taiwan)', 'backend-localization' )
	add_options_page( "Kau-Boy's Backend Localization settings", __( 'Backend Language', 'backend-localization' ), 'manage_options', 'backend_localization', 'backend_localization_admin_settings' );
	foreach( $backend_locale_array as $locale_value ){
		$link = add_query_arg('kau-boys_backend_localization_language', $locale_value);
		$link = ( strpos( $link, "wp-admin/" ) === false ) ? preg_replace( '#[^?&]*/#i', '', $link ) : preg_replace( '#[^?&]*wp-admin/#i', '', $link );
		if( strpos($link, "?" ) === 0|| strpos( $link, "index.php?" ) ===0 ){
			if( current_user_can( 'manage_options' ) ){
				$link = 'options-general.php?page=backend_localization&godashboard=1&kau-boys_backend_localization_language=' . $locale_value; 
			} else {
				$link = 'edit.php?lang='.$language;
			}
		}
		add_menu_page( __( $wp_locale_all[$locale_value], 'qtranslate' ), $wp_locale_all[$locale_value], 'read', $link, NULL, BACKEND_LOCALIZATION_URL . 'flag_icons/' . strtolower( substr( $locale_value, ( strpos($locale_value, '_' ) * -1 ) ) ) . '.png' );
		/*
		$link = admin_url( add_query_arg( 'kau-boys_backend_localization_language', $locale_value, $link ) );
		add_menu_page( $wp_locale_all[$locale_value], $wp_locale_all[$locale_value], 'read', $link, NULL, BACKEND_LOCALIZATION_URL . 'flag_icons/' . strtolower( substr( $locale_value, ( strpos($locale_value, '_' ) * -1 ) ) ) . '.png' );
		*/
function backend_localization_filter_plugin_actions( $links, $file ){
	if ( !$this_plugin ) $this_plugin = plugin_basename( __FILE__ );
	if ( $file == $this_plugin ){
		$settings_link = '<a href="options-general.php?page=backend_localization">' . __( 'Settings' ) . '</a>';
		array_unshift( $links, $settings_link );
	if( isset($_POST['save'] ) ) {
		update_option( 'kau-boys_backend_localization_loginselect', $_POST['kau-boys_backend_localization_loginselect'] );
	$loginselect = get_option( 'kau-boys_backend_localization_loginselect' );
	// do redirection for dashboard from the qTranslate Plugin (www.qianqin.de/qtranslate)
	if(isset($_GET['godashboard'])) {
		echo '<h2>' . __( 'Switching Language', 'backend-localization' ) . '</h2>'
			. sprintf( __( 'Switching language to %1$s... If the Dashboard isn\'t loading, use this <a href="%2$s" title="Dashboard">link</a>.', 'backend-localization' ), $wp_locale_all[$locale_value], admin_url() )
			. '<script type="text/javascript">document.location="' . admin_url() . '";</script>';
		exit();
	}
	
	if( empty( $backend_locale ) ) $backend_locale = 'en_US';
	<?php if( $settings_saved ) : ?>
	<div id="message" class="updated fade"><p><strong><?php _e( 'Options saved.' ) ?></strong></p></div>
		<?php _e( 'Here you can customize the plugin for your needs.', 'backend-localization' ) ?>
			<input type="checkbox" name="kau-boys_backend_localization_loginselect" id="kau-boys_backend_localization_loginselect"<?php echo ( $loginselect == 'on' )? ' checked="checked"' : '' ?>/>
			<label for="kau-boys_backend_localization_loginselect"><?php _e( 'Hide language selection on login form', 'backend-localization' ) ?></label>
			<input type="radio" value="<?php echo $locale_value ?>" id="kau-boys_backend_localization_language_<?php echo $locale_value ?>" name="kau-boys_backend_localization_language"<?php echo ( $backend_locale == $locale_value )? ' checked="checked"' : '' ?> />
				<img src="<?php echo BACKEND_LOCALIZATION_URL . 'flag_icons/' . strtolower( substr( $locale_value, ( strpos( $locale_value, '_' ) * -1 ) ) ) . '.png' ?>" alt="<?php echo $locale_value ?>" />
				<?php echo $wp_locale_all[$locale_value] . ' (' . $locale_value . ')' ?>
				<?php echo sprintf( __( 'If your language isn\'t listed, you have to download the right version from the WordPress repository: <a href="http://svn.automattic.com/wordpress-i18n">http://svn.automattic.com/wordpress-i18n</a>. Browser to the language folder of your choice and get the <b>all</b> .mo files for your WordPress Version from <i><b>tags/%1s/messages/</b></i> or from the <i><b>trunk/messages/</b></i> folder. Upload them to the langauge folder <i>%2s</i>. You should than be able to choose the new language (or after a refresh of this page).', 'backend-localization' ), $wp_version, WP_LANG_DIR ) ?>
			<input class="button-primary" name="save" type="submit" value="<?php _e( 'Save Changes' ) ?>" />
	if( is_dir( WP_LANG_DIR ) ){
		$dh = opendir( $dir );
		while ( false !== ( $filename = readdir( $dh ) ) ){
		foreach( $files as $file ){
			$fileParts = pathinfo( $file );
			if($fileParts['extension'] == 'mo' && ( strlen($fileParts['filename'] ) <= 5 ) ){
				$fileParts['filename'] = substr( $fileParts['basename'], 0, strpos($fileParts['basename'], '.') );
	if( !in_array( 'en_US', $backend_locale_array ) ){
	if( isset( $_REQUEST['kau-boys_backend_localization_language'] ) ){
		setcookie( 'kau-boys_backend_localization_language', backend_localization_filter_var( $_REQUEST['kau-boys_backend_localization_language'] ), time()+60*60*24*30, '/' );
	if( get_option( 'kau-boys_backend_localization_loginselect' ) ) return;
		<?php _e( 'Language', 'backend-localization' ) ?><br />
		<?php foreach( $backend_locale_array as $locale_value ) : ?>
			<option value="<?php echo $locale_value ?>"<?php echo ($backend_locale == $locale_value )? ' selected="selected"' : '' ?>>
				<?php echo $wp_locale_all[$locale_value] . ' (' . $locale_value . ')' ?>
	return 	isset( $_REQUEST['kau-boys_backend_localization_language'] )
			? backend_localization_filter_var( $_REQUEST['kau-boys_backend_localization_language'] )
			: (	isset( $_COOKIE['kau-boys_backend_localization_language'] )
				: get_option( 'kau-boys_backend_localization_language' ) );
	if( defined( 'WP_ADMIN' ) || ( isset( $_REQUEST['pwd'] ) && isset( $_REQUEST['kau-boys_backend_localization_language'] ) ) ){
	setcookie( 'kau-boys_backend_localization_language', "", time() - 3600, '/' );
	setcookie( 'kau-boys_backend_localization_language', backend_localization_filter_var( $_REQUEST['kau-boys_backend_localization_language'] ), time()+60*60*24*30, '/' );
}

function backend_localization_filter_var($lang){
	return preg_replace('/\W/', '', $lang);
add_action( 'init', 'init_backend_localization' );
add_action( 'admin_menu', 'backend_localization_admin_menu' );
add_action( 'admin_menu', 'backend_localization_save_setting' );
add_action( 'wp_login', 'backend_localization_set_login_language' );
add_action( 'login_form_locale', 'localize_backend' );
add_action( 'login_head', 'localize_backend' );
add_action( 'login_form', 'backend_localization_login_form' );
add_filter( 'plugin_action_links', 'backend_localization_filter_plugin_actions', 10, 2 );
add_filter( 'locale', 'localize_backend' );
Requires at least: 3.2
Stable tag: 2.0
A list of all of my plugins can be found on the [WordPress Plugin page](http://kau-boys.com/wordpress-plugins "WordPress Plugins") on my blog [kau-boys.com](http://kau-boys.com). 
* **2.0** Adding some new languages. Fixing link to switch languages in backend. Thanks to Justin! Fixing XSS vulnerabilities. Many Thanks to Matt Fuller from MOZILLA!