diff --git a/base.php b/base.php index 874569d..981cfb6 100644 --- a/base.php +++ b/base.php @@ -126,10 +126,10 @@ function localize($phrase, $count=-1) { static $translations = NULL; /* If no instance of $translations has occured load the language file */ if (is_null($translations)) { - $lang = "en"; + $lang = "zh"; if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { - $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); + //$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); } $lang_file_en = NULL; $lang_file = 'lang/Localization_' . $lang . '.json'; @@ -140,8 +140,12 @@ function localize($phrase, $count=-1) { $lang_file_en = 'lang/' . 'Localization_en.json'; } $lang_file_content = file_get_contents($lang_file); + //var_dump($lang_file); + //var_dump($lang_file_content); /* Load the language file as a JSON object and transform it into an associative array */ $translations = json_decode($lang_file_content, true); + //var_dump($translations['boolean.no']); + //var_dump($translations['authors.title']); if ($lang_file_en) { $lang_file_content = file_get_contents($lang_file_en); @@ -724,4 +728,4 @@ abstract class Base } } -?> \ No newline at end of file +?> diff --git a/lang/Localization_zh.json b/lang/Localization_zh.json index 7f2f319..c2f57eb 100644 --- a/lang/Localization_zh.json +++ b/lang/Localization_zh.json @@ -8,14 +8,14 @@ "title.lastpage":"最后一页 (last)", "title.numberOfPages":"{0} (共 {1} 页)", "pubdate.title":"出版时间", -"bookword.title":"书籍名称", +"bookword.title":"书名", "bookword.none":"没有书籍", -"bookword.one":"一本书籍", +"bookword.one":"1 本书籍", "bookword.many":"{0} 本书籍", "authorword.title":"作者", "authorword.none":"未知", "authorword.one":"1 位作者", -"authorword.many":"{0} 作者", +"authorword.many":"{0} 位作者", "taglevelword.title":"Tag levels", "taglevelword.none":"No tag level", "taglevelword.one":"1 tag level", @@ -32,11 +32,11 @@ "content.series":"Series:", "content.series.data":"Book {0} in the {1} series", "content.publisher":"Publisher:", -"content.published":"Published:", +"content.published":"出版时间", "content.added":"Added: ", "content.modified":"Modified:", "content.publisher.data":"Published {1} by {0}", -"content.summary":"Summary", +"content.summary":"概要", "bookentry.series":"Book {0} in the {1} series", "bookentry.author":"{0} by {1}", "bookentry.tags":"{0} in {1}", @@ -54,31 +54,31 @@ "bookentry.download":"Download this ebook as {0}", "bookentry.rated":"{0} {1}", "bookentry.fullentrylink":"Full entry", -"tags.title":"Tags", +"tags.title":"标签", "tags.categorized":"Categorized index of the {0} tags", "tags.categorized.single":"Categorized index of the single tag - very useful indeed ;)", -"tags.alphabetical.many":"Alphabetical index of the {0} tags", +"tags.alphabetical.many":"{0} 个标签的字母索引", "tags.alphabetical.one":"Alphabetical index of the single tag - very useful indeed ;)", "tags.alphabetical.none":"Alphabetical index of absolutely no tag - very useful indeed ;)", "splitByLetter.tag.other":"Other tags", "authors.series.title":"Series: {0}", -"authors.title":"Authors", -"authors.alphabetical.many":"Alphabetical index of the {0} authors", +"authors.title":"作者", +"authors.alphabetical.many":"{0} 位作者的字母索引", "authors.alphabetical.one":"Alphabetical index of the single author - very useful indeed ;)", "authors.alphabetical.none":"Alphabetical index of absolutely no author - very useful indeed ;)", "splitByLetter.author.other":"Other authors", -"series.title":"Series", -"series.alphabetical.many":"Alphabetical index of the {0} series", +"series.title":"系列", +"series.alphabetical.many":"{0} 个系列的字母索引", "series.alphabetical.one":"Alphabetical index of the single series - very useful indeed ;)", "series.alphabetical.none":"Alphabetical index of absolutely no series - very useful indeed ;)", "splitByLetter.series.other":"Other series", -"recent.title":"Recent additions", -"recent.list":"{0} most recent books", +"recent.title":"最近添加", +"recent.list":"{0} 本最近添加的书", "recent.list.single":"Most recent single book - very useful indeed ;)", "rating.title":"Rating", "rating.summary":"{0}, grouped by rating", -"allbooks.title":"All books", -"allbooks.alphabetical.many":"Alphabetical index of the {0} books", +"allbooks.title":"所有书籍", +"allbooks.alphabetical.many":"{0} 本书籍的字母索引", "allbooks.alphabetical.one":"Alphabetical index of the single book - very useful indeed ;)", "allbooks.alphabetical.none":"Alphabetical index of absolutely no book - very useful indeed ;)", "splitByLetter.book.other":"Other books", @@ -98,19 +98,19 @@ "i18n.and":"and", "i18n.downloads":"Downloads, links and other catalogs", "i18n.links":"Links and other catalogs", -"i18n.coversection":"Cover", -"i18n.downloadfile":"Download file", -"i18n.downloadsection":"Downloads", +"i18n.coversection":"封面", +"i18n.downloadfile":"下载文件", +"i18n.downloadsection":"下载", "i18n.relatedsection":"Related catalogs", "i18n.linksection":"External links", "i18n.backToMain":"Back to the main page of the catalog", -"i18n.summarysection":"Description", +"i18n.summarysection":"描述", "i18n.dateGenerated":"Catalog generated on {0}", "deeplevel.summary":"{0} broken up by authors, tags, etc. ", -"about.title":"About COPS", -"about.summary":"Notes on using Calibre2Opds", +"about.title":"关于COPS", +"about.summary":"关于Calibre2Opds的说明", "usage.intro":"The options are taken from the configuration file located at {0}", -"config.Language.label":"Language", +"config.Language.label":"语言", "config.Language.description":"This setting changes the language used by the program ; use the standard ISO language code (e.g. EN, FR, DE...)", "config.Language.possible":"Possible values : {0}", "intro.goal":"Generate OPDS and HTML catalogs from your Calibre ebooks database", @@ -125,13 +125,13 @@ "intro.thanks.1":"Special thanks to Kb Sriram, who not only programmed Trook, an excellent and OPDS compatible ", "intro.thanks.2":"library manager for the Nook, but also was kind enough to donate a Nook !", "search.result":"Search result for *{0}*", -"search.sortorder.asc":"Asc", -"search.sortorder.desc":"Desc", +"search.sortorder.asc":"升序", +"search.sortorder.desc":"降序", "permalink.alternate":"Permalink", -"home.alternate":"Home", -"search.alternate":"Search", -"sort.alternate":"Sort", -"paging.next.alternate":"Next", -"paging.previous.alternate":"Previous", +"home.alternate":"首页", +"search.alternate":"搜索", +"sort.alternate":"排序", +"paging.next.alternate":"下一页", +"paging.previous.alternate":"上一页", "fin":"fin" }