diff --git a/composer.json b/composer.json
index 14ab4cf..fda6dc9 100644
--- a/composer.json
+++ b/composer.json
@@ -13,7 +13,8 @@
"ptachoire/process-builder-chain": "~1.2.0",
"guzzlehttp/guzzle": "~6.2.0",
"aura/session": "~2.1.0",
- "barracudanetworks/archivestream-php": "~1.0.5"
+ "barracudanetworks/archivestream-php": "~1.0.5",
+ "smarty-gettext/smarty-gettext": "~1.5.1"
},
"require-dev": {
"symfony/var-dumper": "~3.2.0",
diff --git a/composer.lock b/composer.lock
index 7887f7c..f2c62ae 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "73d6ed72dae93290d21ac47042e14886",
+ "content-hash": "9793382606938199471cea3e8c7cbb6c",
"packages": [
{
"name": "aura/session",
@@ -662,6 +662,60 @@
],
"time": "2017-03-19T17:55:20+00:00"
},
+ {
+ "name": "smarty-gettext/smarty-gettext",
+ "version": "1.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/smarty-gettext/smarty-gettext.git",
+ "reference": "00fe2fcbc41e24e0245cd9d73f96bc7b0337972d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/smarty-gettext/smarty-gettext/zipball/00fe2fcbc41e24e0245cd9d73f96bc7b0337972d",
+ "reference": "00fe2fcbc41e24e0245cd9d73f96bc7b0337972d",
+ "shasum": ""
+ },
+ "require": {
+ "ext-gettext": "*",
+ "ext-pcre": "*",
+ "php": "~5.3|~7.0"
+ },
+ "require-dev": {
+ "azatoth/php-pgettext": "~1.0",
+ "smarty/smarty": "3.1.*"
+ },
+ "suggest": {
+ "azatoth/php-pgettext": "Support msgctxt for {t} via context parameter"
+ },
+ "bin": [
+ "tsmarty2c.php"
+ ],
+ "type": "library",
+ "autoload": {
+ "files": [
+ "block.t.php",
+ "function.locale.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1+"
+ ],
+ "authors": [
+ {
+ "name": "Sagi Bashari",
+ "email": "sagi@boom.org.il"
+ },
+ {
+ "name": "Elan Ruusamäe",
+ "email": "glen@delfi.ee"
+ }
+ ],
+ "description": "Gettext plugin enabling internationalization in Smarty Package files",
+ "homepage": "https://github.com/smarty-gettext/smarty-gettext",
+ "time": "2017-05-12T12:14:46+00:00"
+ },
{
"name": "smarty/smarty",
"version": "v3.1.31",
@@ -1435,16 +1489,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "5.7.19",
+ "version": "5.7.20",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "69c4f49ff376af2692bad9cebd883d17ebaa98a1"
+ "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/69c4f49ff376af2692bad9cebd883d17ebaa98a1",
- "reference": "69c4f49ff376af2692bad9cebd883d17ebaa98a1",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3cb94a5f8c07a03c8b7527ed7468a2926203f58b",
+ "reference": "3cb94a5f8c07a03c8b7527ed7468a2926203f58b",
"shasum": ""
},
"require": {
@@ -1462,7 +1516,7 @@
"phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "^3.2",
"sebastian/comparator": "^1.2.4",
- "sebastian/diff": "~1.2",
+ "sebastian/diff": "^1.4.3",
"sebastian/environment": "^1.3.4 || ^2.0",
"sebastian/exporter": "~2.0",
"sebastian/global-state": "^1.1",
@@ -1513,7 +1567,7 @@
"testing",
"xunit"
],
- "time": "2017-04-03T02:22:27+00:00"
+ "time": "2017-05-22T07:42:55+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
@@ -1580,7 +1634,7 @@
"dist": {
"type": "zip",
"url": "https://github.com/rg3/youtube-dl/archive/2017.05.09.zip",
- "reference": "2017.05.09",
+ "reference": null,
"shasum": null
},
"type": "library"
@@ -1724,16 +1778,16 @@
},
{
"name": "sebastian/diff",
- "version": "1.4.2",
+ "version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "3c7d21999e815cdfac70c6c7d79d3a9cb1bc7bc2"
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3c7d21999e815cdfac70c6c7d79d3a9cb1bc7bc2",
- "reference": "3c7d21999e815cdfac70c6c7d79d3a9cb1bc7bc2",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
"shasum": ""
},
"require": {
@@ -1772,7 +1826,7 @@
"keywords": [
"diff"
],
- "time": "2017-05-18T13:44:30+00:00"
+ "time": "2017-05-22T07:24:03+00:00"
},
{
"name": "sebastian/environment",
diff --git a/index.php b/index.php
index 3b55687..e0231ac 100644
--- a/index.php
+++ b/index.php
@@ -1,5 +1,10 @@
\n"
+"Language-Team: \n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 2.0.2\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: ..\..\..\templates/error.tpl:5
+msgid "An error occured"
+msgstr "出错了"
+
+#: ..\..\..\templates/error.tpl:6
+msgid "Please check the URL of your video."
+msgstr "请检查您的视频的 URL。"
+
+#: ..\..\..\templates/extractors.tpl:4
+msgid "Supported websites"
+msgstr "支持的网站"
+
+#: ..\..\..\templates/inc/footer.tpl:4
+msgid "Code by"
+msgstr "代码来自"
+
+#: ..\..\..\templates/inc/footer.tpl:6
+msgid "Design by"
+msgstr "设计来自"
+
+#: ..\..\..\templates/inc/footer.tpl:12
+msgid "AllTube Download on Facebook"
+msgstr "去Alltube Download的Facebook页面"
+
+#: ..\..\..\templates/inc/footer.tpl:12
+msgid "Like us on Facebook"
+msgstr "在Facebook关注我们"
+
+#: ..\..\..\templates/inc/footer.tpl:14
+msgid "Get the code"
+msgstr "获取代码"
+
+#: ..\..\..\templates/inc/footer.tpl:16
+msgid "Based on"
+msgstr "基于"
+
+#: ..\..\..\templates/inc/header.tpl:4
+msgid "Share on Twitter"
+msgstr "分享到 Twitter"
+
+#: ..\..\..\templates/inc/header.tpl:5
+msgid "Share on Facebook"
+msgstr "分享到 Facebook"
+
+#: ..\..\..\templates/index.tpl:9
+msgid "Copy here the URL of your video (Youtube, Dailymotion, etc.)"
+msgstr "在这里复制您的视频 (Youtube、 Dailymotion 等) 的 URL"
+
+#: ..\..\..\templates/index.tpl:19 ..\..\..\templates/password.tpl:10
+#: ..\..\..\templates/playlist.tpl:23 ..\..\..\templates/video.tpl:85
+#: ..\..\..\templates/video.tpl:90
+msgid "Download"
+msgstr "下载"
+
+#: ..\..\..\templates/index.tpl:24
+msgid "Audio only (MP3)"
+msgstr "仅限音频(mp3)"
+
+#: ..\..\..\templates/index.tpl:29
+msgid "See all supported websites"
+msgstr "请参阅支持的所有网站"
+
+#: ..\..\..\templates/index.tpl:31
+msgid "Drag this to your bookmarks bar:"
+msgstr "把这个拖到你的书签:"
+
+#: ..\..\..\templates/index.tpl:32
+msgid "Bookmarklet"
+msgstr "书签工具"
+
+#: ..\..\..\templates/password.tpl:5
+msgid "This video is protected"
+msgstr "这个视频受保护"
+
+#: ..\..\..\templates/password.tpl:6
+msgid "You need a password in order to download this video."
+msgstr "你需要密码才能下载这个视频。"
+
+#: ..\..\..\templates/password.tpl:8
+msgid "Video password"
+msgstr "视频密码"
+
+#: ..\..\..\templates/playlist.tpl:5
+msgid "Videos extracted from the"
+msgstr "视频从"
+
+#: ..\..\..\templates/playlist.tpl:7
+msgid "playlist:"
+msgstr "播放列表提取:"
+
+#: ..\..\..\templates/playlist.tpl:24
+msgid "More options"
+msgstr "更多选项"
+
+#: ..\..\..\templates/video.tpl:6
+msgid "You are going to download"
+msgstr "你即将下载"
+
+#: ..\..\..\templates/video.tpl:24
+msgid "Available formats:"
+msgstr "可用的格式︰"
+
+#: ..\..\..\templates/video.tpl:31
+msgid "Generic formats"
+msgstr "通用格式"
+
+#: ..\..\..\templates/video.tpl:34
+msgid "Best"
+msgstr "最佳"
+
+#: ..\..\..\templates/video.tpl:39
+msgid "Remux best video with best audio"
+msgstr "重新封装最佳视频与最佳音频"
+
+#: ..\..\..\templates/video.tpl:43
+msgid "Worst"
+msgstr "最差"
+
+#: ..\..\..\templates/video.tpl:46
+msgid "Detailed formats"
+msgstr "详细格式"
diff --git a/templates/error.tpl b/templates/error.tpl
index 67a0fae..ded9676 100644
--- a/templates/error.tpl
+++ b/templates/error.tpl
@@ -2,8 +2,8 @@
{include file="inc/logo.tpl"}
-
An error occured
- Please check the URL of your video.
+
{t}An error occured{/t}
+ {t}Please check the URL of your video.{/t}
{foreach $errors as $error}
{$error|escape}
diff --git a/templates/extractors.tpl b/templates/extractors.tpl
index 4944193..fb85994 100644
--- a/templates/extractors.tpl
+++ b/templates/extractors.tpl
@@ -1,7 +1,7 @@
{include file='inc/head.tpl'}
{include file='inc/header.tpl'}
{include file='inc/logo.tpl'}
-Supported websites
+{t}Supported websites{/t}
{foreach $extractors as $extractor}
diff --git a/templates/inc/footer.tpl b/templates/inc/footer.tpl
index c5797fc..b9ff314 100644
--- a/templates/inc/footer.tpl
+++ b/templates/inc/footer.tpl
@@ -1,19 +1,19 @@
diff --git a/templates/inc/head.tpl b/templates/inc/head.tpl
index 392c7c2..9e63035 100644
--- a/templates/inc/head.tpl
+++ b/templates/inc/head.tpl
@@ -1,3 +1,4 @@
+{locale path="Translations" domain="Alltube"}
diff --git a/templates/inc/header.tpl b/templates/inc/header.tpl
index fc42083..628b0f7 100644
--- a/templates/inc/header.tpl
+++ b/templates/inc/header.tpl
@@ -1,8 +1,8 @@
diff --git a/templates/index.tpl b/templates/index.tpl
index 41d6b3a..ab3ea6c 100644
--- a/templates/index.tpl
+++ b/templates/index.tpl
@@ -1,11 +1,12 @@
{include file='inc/head.tpl'}
{include file='inc/header.tpl'}
+{locale path="Translations" domain="Alltube"}
diff --git a/templates/password.tpl b/templates/password.tpl
index ab8e302..a4c56f2 100644
--- a/templates/password.tpl
+++ b/templates/password.tpl
@@ -2,12 +2,12 @@
{include file="inc/logo.tpl"}
-
This video is protected
-
You need a password in order to download this video.
+
{t}This video is protected{/t}
+
{t}You need a password in order to download this video.{/t}
{include file='inc/footer.tpl'}
diff --git a/templates/playlist.tpl b/templates/playlist.tpl
index 40f3669..24d24d4 100644
--- a/templates/playlist.tpl
+++ b/templates/playlist.tpl
@@ -2,9 +2,9 @@