Permalink
Browse files

add that all language files in locale/ should be converted to utf-8 i…

…f detected mb_string overload is set, this is helpful so the directory and file names in UTF-8 are not distorted when switching UI language. Later, some development would be needed for directory / file name also be converted to utf-8.
  • Loading branch information...
1 parent 0b5b203 commit 95ac1209d726be4180142c7be2a6a20f47e551ce zhangweiwu committed Aug 28, 2010
View
@@ -1 +1 @@
-a:32:{s:2:"bg";s:9:"Bulgarian";s:2:"ca";s:16:"Catalan (Catal�)";s:2:"cs";s:5:"Czech";s:7:"cs_utf8";s:13:"Czech (UTF-8)";s:2:"da";s:14:"Danish (Dansk)";s:2:"de";s:16:"German (Deutsch)";s:2:"en";s:7:"English";s:2:"es";s:17:"Spanish (Espa�ol)";s:2:"et";s:16:"Estonian (Eesti)";s:2:"fr";s:17:"French (Fran�ais)";s:2:"hr";s:19:"Croatian (Hrvatski)";s:2:"hu";s:18:"Hungarian (Magyar)";s:2:"is";s:21:"Icelandic (Íslenska)";s:2:"it";s:18:"Italian (Italiano)";s:2:"ja";s:17:"Japanese (EUC-JP)";s:7:"ja_utf8";s:16:"Japanese (UTF-8)";s:2:"ko";s:15:"Korean (EUC-KR)";s:2:"nl";s:18:"Dutch (Nederlands)";s:5:"no_nb";s:24:"Norwegian (Norsk bokm�l)";s:2:"pl";s:15:"Polish (Polski)";s:5:"pt_br";s:19:"Portuguese (Brazil)";s:2:"ro";s:17:"Romanian (Rom�na)";s:2:"ru";s:16:"Russian (KOI8-R)";s:2:"sk";s:19:"Slovak (Sloveský) ";s:2:"sl";s:21:"Slovenian (Slovensko)";s:2:"sv";s:17:"Swedish (Svenska)";s:2:"tr";s:16:"Turkish (T�rk�e)";s:2:"vi";s:18:"Vietnamese (UTF-8)";s:5:"zh_cn";s:27:"Simplified Chinese (GB2312)";s:10:"zh_cn_utf8";s:26:"Simplified Chinese (UTF-8)";s:5:"zh_tw";s:26:"Traditional Chinese (Big5)";s:10:"zh_tw_utf8";s:27:"Traditional Chinese (UTF-8)";}
+a:31:{s:2:"bg";s:9:"Bulgarian";s:2:"ca";s:16:"Catalan (Catal�)";s:2:"cs";s:5:"Czech";s:7:"cs_utf8";s:13:"Czech (UTF-8)";s:2:"da";s:14:"Danish (Dansk)";s:2:"de";s:16:"German (Deutsch)";s:2:"en";s:7:"English";s:2:"es";s:17:"Spanish (Espa�ol)";s:2:"et";s:16:"Estonian (Eesti)";s:2:"fr";s:17:"French (Fran�ais)";s:2:"hr";s:19:"Croatian (Hrvatski)";s:2:"hu";s:18:"Hungarian (Magyar)";s:2:"is";s:21:"Icelandic (Íslenska)";s:2:"it";s:18:"Italian (Italiano)";s:2:"ja";s:17:"Japanese (EUC-JP)";s:7:"ja_utf8";s:16:"Japanese (UTF-8)";s:2:"ko";s:15:"Korean (EUC-KR)";s:2:"nl";s:18:"Dutch (Nederlands)";s:5:"no_nb";s:24:"Norwegian (Norsk bokm�l)";s:2:"pl";s:15:"Polish (Polski)";s:5:"pt_br";s:19:"Portuguese (Brazil)";s:2:"ro";s:17:"Romanian (Rom�na)";s:2:"ru";s:16:"Russian (KOI8-R)";s:2:"sk";s:19:"Slovak (Sloveský) ";s:2:"sl";s:21:"Slovenian (Slovensko)";s:2:"sv";s:17:"Swedish (Svenska)";s:2:"tr";s:16:"Turkish (T�rk�e)";s:2:"vi";s:18:"Vietnamese (UTF-8)";s:5:"zh_cn";s:27:"Simplified Chinese (GB2312)";s:5:"zh_tw";s:26:"Traditional Chinese (Big5)";s:10:"zh_tw_utf8";s:27:"Traditional Chinese (UTF-8)";}
@@ -4,7 +4,7 @@
* Main class.
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License
* @copyright (c)2003-2006 Tamlyn Rhodes
- * @version $Id: singapore.class.php,v 1.78 2010/08/25 11:28:47 zhangweiwu Exp $
+ * @version $Id: singapore.class.php,v 1.79 2010/08/28 07:03:37 zhangweiwu Exp $
*/
//define constants for regular expressions
@@ -124,7 +124,7 @@ function Singapore($basePath = "")
}
//set current gallery to root if not specified in url
- $galleryId = isset($_REQUEST[$this->config->url_gallery]) ? $_REQUEST[$this->config->url_gallery] : ".";
+ $galleryId = isset($_GET[$this->config->url_gallery]) ? $_GET[$this->config->url_gallery] : ".";
//load config from gallery ini file (gallery.ini) if present
$this->config->loadConfig($basePath.$this->config->pathto_galleries.$galleryId."/gallery.ini");
@@ -185,7 +185,10 @@ function Singapore($basePath = "")
$this->character_set = $this->translator->languageStrings[0]["charset"];
else
$this->character_set = $this->config->default_charset;
-
+
+ if (ini_get("mbstring.func_overload") == "7") {
+ $this->character_set = "UTF-8";
+ }
//set action to perform
if(empty($_REQUEST["action"])) $this->action = "view";
else $this->action = $_REQUEST["action"];
@@ -4,7 +4,7 @@
* Translation class.
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License
* @copyright (c)2003-2005 Tamlyn Rhodes
- * @version $Id: translator.class.php,v 1.5 2006/02/06 18:47:57 tamlyn Exp $
+ * @version $Id: translator.class.php,v 1.6 2010/08/28 07:03:37 zhangweiwu Exp $
*/
/**
@@ -25,7 +25,7 @@ class Translator
var $languageStrings = array();
var $language = "en";
-
+
/**
* Constructor
* @param string language code
@@ -80,7 +80,16 @@ function readLanguageFile($languageFile)
while (!feof($fp)) $str .= fread($fp, 1024);
// Unserialize
$newStrings = @unserialize($str);
-
+ if (ini_get("mbstring.func_overload") == "7") {
+ $encoding = $newStrings[0]["charset"] == 'gb2312' ? "CP936" : $newStrings[0]["charset"];
+ foreach ($newStrings as $key => $value) {
+ if (is_string($value))
+ $newStrings[$key] = mb_convert_encoding($value, "UTF-8", $encoding);
+ if (is_array($value))
+ foreach ($value as $subkey => $subvalue)
+ $newStrings[$key][$subkey] = mb_convert_encoding($subvalue, "UTF-8", $encoding);
+ }
+ }
//Append new strings to current languageStrings array
$this->languageStrings = array_merge($this->languageStrings, $newStrings);
@@ -1,7 +0,0 @@
-a:92:{s:27:"Welcome to singapore admin!";s:18:"????singapore?????";s:18:"An error occurred:";s:7:"???????";s:22:"Thank you and goodbye!";s:9:"?????????";s:14:"Password saved";s:6:"??????";s:13:"Gallery added";s:6:"??????";s:18:"Gallery info saved";s:8:"????????";s:10:"confirm|OK";s:2:"??";s:15:"Gallery deleted";s:6:"??????";s:14:"confirm|Cancel";s:2:"??";s:14:"delete gallery";s:4:"????";s:118:"Gallery %s is not empty.
-Are you sure you want to irretrievably delete it and all subgalleries and images it contains?";s:44:"%s???????????
-??????????????????????????????";s:17:"Thumbnail changed";s:7:"???????";s:11:"Image added";s:6:"??????";s:24:"Image saved successfully";s:6:"??????";s:13:"Image deleted";s:6:"??????";s:12:"delete image";s:4:"????";s:71:"Are you sure you want to irretrievably delete image %s from gallery %s?";s:24:"??????????? %s ??? %S ??";s:22:"Thumbnail cache purged";s:9:"?????????";s:23:"purge cached thumbnails";s:8:"????????";s:57:"Are you sure you want to delete all %s cached thumbnails?";s:18:"???????%s?????????";s:14:"admin bar|Back";s:2:"??";s:15:"admin bar|Admin";s:4:"????";s:19:"admin bar|Galleries";s:4:"????";s:17:"admin bar|Log out";s:2:"??";s:22:"admin bar|Edit gallery";s:6:"??????";s:24:"admin bar|Delete gallery";s:4:"????";s:24:"admin bar|New subgallery";s:5:"?????";s:20:"admin bar|Edit image";s:6:"??????";s:22:"admin bar|Delete image";s:4:"????";s:19:"admin bar|New image";s:4:"????";s:43:"There was an error saving the new password.";s:10:"??????????";s:54:"New password must be between 6 and 16 characters long.";s:18:"????????6?16??????";s:43:"The new passwords you entered do not match.";s:12:"????????????";s:72:"The current password you entered does not match the one in the database.";s:18:"??????????????????";s:53:"The username specified was not found in the database.";s:16:"????????????????";s:34:"Username and/or password incorrect";s:8:"????????";s:38:"You must enter a username and password";s:11:"???????????";s:22:"Gallery already exists";s:6:"??????";s:26:"Could not create directory";s:6:"??????";s:27:"Could not save gallery info";s:8:"????????";s:37:"Cannot delete the top level directory";s:8:"????????";s:19:"File already exists";s:6:"??????";s:21:"Could not upload file";s:6:"??????";s:23:"Invalid location choice";s:8:"????????";s:30:"Could not add image to gallery";s:11:"???????????";s:32:"Could not save image information";s:8:"????????";s:22:"Could not delete image";s:6:"??????";s:16:"choose thumbnail";s:6:"??????";s:64:"Choose the filename of the image used to represent this gallery.";s:15:"???????????????";s:14:"thumbnail|None";s:6:"??????";s:16:"thumbnail|Random";s:4:"????";s:12:"edit gallery";s:6:"??????";s:18:"Gallery thumbnail:";s:6:"??????";s:16:"Random
-thumbnail";s:8:"????
-???";s:19:"thumbnail|Change...";s:2:"??";s:12:"Gallery name";s:4:"????";s:11:"Artist name";s:4:"????";s:10:"edit image";s:6:"??????";s:5:"Image";s:2:"??";s:10:"Image name";s:4:"????";s:15:"change password";s:4:"????";s:67:"Please choose a new password between 6 and 16 characters in length.";s:22:"????????6?16??????????";s:17:"Current password:";s:5:"?????";s:13:"New password:";s:4:"????";s:17:"Confirm password:";s:9:"?????????";s:20:"singapore|Powered by";s:8:"????????";s:16:"hits table|Graph";s:2:"??";s:15:"hits table|Hits";s:3:"???";s:19:"hits table|Last hit";s:6:"??????";s:14:"Admin message:";s:6:"??????";s:20:"Return to galleries.";s:6:"??????";s:6:"log in";s:2:"??";s:110:"Only authorised users are allowed into the admin section.
-Please enter your admin username and password below.";s:30:"????????????????
-?????????????";s:9:"Username:";s:4:"????";s:9:"Password:";s:3:"???";s:24:"Please choose an option:";s:4:"????";s:27:"Manage galleries and images";s:7:"???????";s:17:"View gallery hits";s:8:"????????";s:23:"Purge cached thumbnails";s:8:"????????";s:15:"Change password";s:4:"????";s:16:"Log out of admin";s:7:"???????";s:11:"new gallery";s:7:"???????";s:11:"Identifier:";s:8:"????????";s:9:"new image";s:5:"?????";s:74:"This image will not be visible because this gallery contains subgalleries.";s:24:"????????????????????????";s:11:"Remote file";s:4:"????";s:13:"URL of image:";s:9:"???URL???";s:10:"Local file";s:4:"????";s:21:"Image file to upload:";s:9:"?????????";s:30:"Use filename of uploaded file.";s:11:"???????????";s:27:"Specify different filename:";s:8:"????????";i:0;a:3:{s:7:"charset";s:5:"utf-8";s:8:"language";s:7:"Chinese";s:6:"plural";s:31:"$nplurals=1; $plural=$n==1?0:1;";}}
Oops, something went wrong.

0 comments on commit 95ac120

Please sign in to comment.