@video-lab/locales 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Video Lab Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # @video-lab/locales
2
+
3
+ 播放器官方语言资源。简体中文是默认语言,英文内置;越南语通过独立子路径按需导入。该包只依赖 `@video-lab/protocol`,React Frame 或 Vue Frame 用户无需安装 inline 包。
4
+
5
+ ```bash
6
+ pnpm add @video-lab/locales
7
+ ```
8
+
9
+ ```tsx
10
+ import { viVN } from '@video-lab/locales/vi-VN'
11
+ import { VideoPlayerFrame } from '@video-lab/react-frame'
12
+
13
+ const source = 'https://cdn.example.com/live.m3u8'
14
+
15
+ export function Example() {
16
+ return <VideoPlayerFrame source={source} locale={{ locale: 'vi-VN', messages: { 'vi-VN': viVN } }} />
17
+ }
18
+ ```
19
+
20
+ 还可从 `@video-lab/locales/zh-CN` 和 `@video-lab/locales/en-US` 分别导入 `zhCN`、`enUS`。两者与播放器内置资源是同一份数据。自定义语言在实例 `locale.messages` 或 Provider 的 `resources` 中按语言标签提供扁平 key 表;缺失 key 按 `fallbackLocales` 再到简体中文逐项回退。应用级配置与运行时切换见[全局播放器配置](../../docs/guides/PLAYER-GLOBAL-CONFIG.md)。
package/dist/en-US.cjs ADDED
@@ -0,0 +1,8 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _video_lab_protocol = require("@video-lab/protocol");
3
+ Object.defineProperty(exports, "enUS", {
4
+ enumerable: true,
5
+ get: function() {
6
+ return _video_lab_protocol.enUS;
7
+ }
8
+ });
@@ -0,0 +1,2 @@
1
+ import { enUS } from "@video-lab/protocol";
2
+ export { enUS };
@@ -0,0 +1,2 @@
1
+ import { enUS } from "@video-lab/protocol";
2
+ export { enUS };
package/dist/en-US.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { enUS } from "@video-lab/protocol";
2
+ export { enUS };
package/dist/vi-VN.cjs ADDED
@@ -0,0 +1,50 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/vi-VN.ts
3
+ /** 越南语官方资源,按需子路径导入。 */
4
+ const viVN = {
5
+ loading: "Đang tải…",
6
+ "loading.initializing": "Đang khởi tạo trình phát…",
7
+ "loading.buffering": "Đang tải dữ liệu phát…",
8
+ "loading.stalled": "Đang khôi phục phát video…",
9
+ "loading.reconnecting": "Đang kết nối lại…",
10
+ "loading.source_switching": "Đang chuyển nguồn video…",
11
+ "loading.frame_disconnected": "Đang kết nối với trình phát…",
12
+ play: "Phát video",
13
+ retry: "Thử phát lại",
14
+ reconnect: "Kết nối lại",
15
+ refreshSource: "Lấy liên kết phát mới",
16
+ recreatePlayer: "Kết nối lại với trình phát",
17
+ "error.E_NETWORK": "Sự cố mạng. Hãy kiểm tra kết nối và thử lại.",
18
+ "error.E_NETWORK_TIMEOUT": "Kết nối đã hết thời gian chờ. Hãy kiểm tra mạng và thử lại.",
19
+ "error.E_LOAD_FAILED": "Không thể tải video. Hãy kiểm tra kết nối và thử lại.",
20
+ "error.E_HANDSHAKE_TIMEOUT": "Trình phát khởi động quá lâu. Hãy thử lại.",
21
+ "error.E_AUTH_EXPIRED": "Quyền truy cập video đã hết hạn. Hãy lấy liên kết phát mới.",
22
+ "error.E_MEDIA_DECODE": "Không thể giải mã video. Hãy thử lại.",
23
+ "error.E_MEDIA_ABORTED": "Quá trình phát bị gián đoạn. Hãy thử lại.",
24
+ "error.E_MEDIA_NOT_SUPPORTED": "Thiết bị này không phát được định dạng video đó.",
25
+ "error.E_MANIFEST_PARSE": "Không thể đọc dữ liệu video. Hãy thử lại sau hoặc đổi nguồn phát.",
26
+ "error.E_SUBTITLE_LOAD_FAILED": "Không thể tải phụ đề. Video vẫn tiếp tục phát.",
27
+ "error.E_AUTOPLAY_BLOCKED": "Hãy nhấn phát để tiếp tục.",
28
+ "error.E_ENV_CSP_BLOCKED": "Trang này đã chặn trình phát tải.",
29
+ "error.E_METHOD_NOT_SUPPORTED": "Thao tác này hiện không khả dụng.",
30
+ "error.E_DANMAKU_SEND_FAILED": "Không thể gửi bình luận chạy trên màn hình. Hãy thử lại.",
31
+ "error.E_PLAYER_DESTROYED": "Trình phát đã đóng. Hãy mở lại.",
32
+ "error.E_FRAME_CRASHED": "Kết nối với trình phát đã bị ngắt. Hãy mở lại trình phát.",
33
+ "error.E_HANDSHAKE_VERSION_MISMATCH": "Phiên bản trình phát không tương thích. Hãy tải lại trang.",
34
+ "error.E_INTERNAL": "Trình phát gặp sự cố. Hãy tải lại trang.",
35
+ "error.E_UNKNOWN": "Đã xảy ra sự cố khi phát. Hãy thử lại sau.",
36
+ "controls.play": "Phát",
37
+ "controls.pause": "Tạm dừng",
38
+ "controls.replay": "Phát lại",
39
+ "controls.fullscreen.enter": "Toàn màn hình",
40
+ "controls.fullscreen.exit": "Thoát toàn màn hình",
41
+ "controls.pageFullscreen.enter": "Toàn màn hình trong trang",
42
+ "controls.pageFullscreen.exit": "Thoát toàn màn hình trong trang",
43
+ "controls.pip": "Hình trong hình",
44
+ "controls.subtitle": "Phụ đề",
45
+ "controls.subtitle.off": "Tắt",
46
+ "controls.live": "Trực tiếp",
47
+ "controls.rotate": "Xoay"
48
+ };
49
+ //#endregion
50
+ exports.viVN = viVN;
@@ -0,0 +1,6 @@
1
+ //#region src/vi-VN.d.ts
2
+ /** 越南语官方资源,按需子路径导入。 */
3
+ declare const viVN: Readonly<Record<string, string>>;
4
+ //#endregion
5
+ export { viVN };
6
+ //# sourceMappingURL=vi-VN.d.cts.map
@@ -0,0 +1,6 @@
1
+ //#region src/vi-VN.d.ts
2
+ /** 越南语官方资源,按需子路径导入。 */
3
+ declare const viVN: Readonly<Record<string, string>>;
4
+ //#endregion
5
+ export { viVN };
6
+ //# sourceMappingURL=vi-VN.d.mts.map
package/dist/vi-VN.mjs ADDED
@@ -0,0 +1,51 @@
1
+ //#region src/vi-VN.ts
2
+ /** 越南语官方资源,按需子路径导入。 */
3
+ const viVN = {
4
+ loading: "Đang tải…",
5
+ "loading.initializing": "Đang khởi tạo trình phát…",
6
+ "loading.buffering": "Đang tải dữ liệu phát…",
7
+ "loading.stalled": "Đang khôi phục phát video…",
8
+ "loading.reconnecting": "Đang kết nối lại…",
9
+ "loading.source_switching": "Đang chuyển nguồn video…",
10
+ "loading.frame_disconnected": "Đang kết nối với trình phát…",
11
+ play: "Phát video",
12
+ retry: "Thử phát lại",
13
+ reconnect: "Kết nối lại",
14
+ refreshSource: "Lấy liên kết phát mới",
15
+ recreatePlayer: "Kết nối lại với trình phát",
16
+ "error.E_NETWORK": "Sự cố mạng. Hãy kiểm tra kết nối và thử lại.",
17
+ "error.E_NETWORK_TIMEOUT": "Kết nối đã hết thời gian chờ. Hãy kiểm tra mạng và thử lại.",
18
+ "error.E_LOAD_FAILED": "Không thể tải video. Hãy kiểm tra kết nối và thử lại.",
19
+ "error.E_HANDSHAKE_TIMEOUT": "Trình phát khởi động quá lâu. Hãy thử lại.",
20
+ "error.E_AUTH_EXPIRED": "Quyền truy cập video đã hết hạn. Hãy lấy liên kết phát mới.",
21
+ "error.E_MEDIA_DECODE": "Không thể giải mã video. Hãy thử lại.",
22
+ "error.E_MEDIA_ABORTED": "Quá trình phát bị gián đoạn. Hãy thử lại.",
23
+ "error.E_MEDIA_NOT_SUPPORTED": "Thiết bị này không phát được định dạng video đó.",
24
+ "error.E_MANIFEST_PARSE": "Không thể đọc dữ liệu video. Hãy thử lại sau hoặc đổi nguồn phát.",
25
+ "error.E_SUBTITLE_LOAD_FAILED": "Không thể tải phụ đề. Video vẫn tiếp tục phát.",
26
+ "error.E_AUTOPLAY_BLOCKED": "Hãy nhấn phát để tiếp tục.",
27
+ "error.E_ENV_CSP_BLOCKED": "Trang này đã chặn trình phát tải.",
28
+ "error.E_METHOD_NOT_SUPPORTED": "Thao tác này hiện không khả dụng.",
29
+ "error.E_DANMAKU_SEND_FAILED": "Không thể gửi bình luận chạy trên màn hình. Hãy thử lại.",
30
+ "error.E_PLAYER_DESTROYED": "Trình phát đã đóng. Hãy mở lại.",
31
+ "error.E_FRAME_CRASHED": "Kết nối với trình phát đã bị ngắt. Hãy mở lại trình phát.",
32
+ "error.E_HANDSHAKE_VERSION_MISMATCH": "Phiên bản trình phát không tương thích. Hãy tải lại trang.",
33
+ "error.E_INTERNAL": "Trình phát gặp sự cố. Hãy tải lại trang.",
34
+ "error.E_UNKNOWN": "Đã xảy ra sự cố khi phát. Hãy thử lại sau.",
35
+ "controls.play": "Phát",
36
+ "controls.pause": "Tạm dừng",
37
+ "controls.replay": "Phát lại",
38
+ "controls.fullscreen.enter": "Toàn màn hình",
39
+ "controls.fullscreen.exit": "Thoát toàn màn hình",
40
+ "controls.pageFullscreen.enter": "Toàn màn hình trong trang",
41
+ "controls.pageFullscreen.exit": "Thoát toàn màn hình trong trang",
42
+ "controls.pip": "Hình trong hình",
43
+ "controls.subtitle": "Phụ đề",
44
+ "controls.subtitle.off": "Tắt",
45
+ "controls.live": "Trực tiếp",
46
+ "controls.rotate": "Xoay"
47
+ };
48
+ //#endregion
49
+ export { viVN };
50
+
51
+ //# sourceMappingURL=vi-VN.mjs.map
package/dist/zh-CN.cjs ADDED
@@ -0,0 +1,8 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _video_lab_protocol = require("@video-lab/protocol");
3
+ Object.defineProperty(exports, "zhCN", {
4
+ enumerable: true,
5
+ get: function() {
6
+ return _video_lab_protocol.zhCN;
7
+ }
8
+ });
@@ -0,0 +1,2 @@
1
+ import { zhCN } from "@video-lab/protocol";
2
+ export { zhCN };
@@ -0,0 +1,2 @@
1
+ import { zhCN } from "@video-lab/protocol";
2
+ export { zhCN };
package/dist/zh-CN.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { zhCN } from "@video-lab/protocol";
2
+ export { zhCN };
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@video-lab/locales",
3
+ "version": "4.0.0",
4
+ "license": "MIT",
5
+ "description": "Video Lab Player 官方语言资源",
6
+ "type": "module",
7
+ "exports": {
8
+ "./zh-CN": {
9
+ "import": {
10
+ "types": "./dist/zh-CN.d.mts",
11
+ "default": "./dist/zh-CN.mjs"
12
+ },
13
+ "require": {
14
+ "types": "./dist/zh-CN.d.cts",
15
+ "default": "./dist/zh-CN.cjs"
16
+ }
17
+ },
18
+ "./en-US": {
19
+ "import": {
20
+ "types": "./dist/en-US.d.mts",
21
+ "default": "./dist/en-US.mjs"
22
+ },
23
+ "require": {
24
+ "types": "./dist/en-US.d.cts",
25
+ "default": "./dist/en-US.cjs"
26
+ }
27
+ },
28
+ "./vi-VN": {
29
+ "import": {
30
+ "types": "./dist/vi-VN.d.mts",
31
+ "default": "./dist/vi-VN.mjs"
32
+ },
33
+ "require": {
34
+ "types": "./dist/vi-VN.d.cts",
35
+ "default": "./dist/vi-VN.cjs"
36
+ }
37
+ }
38
+ },
39
+ "files": [
40
+ "dist",
41
+ "README.md"
42
+ ],
43
+ "sideEffects": false,
44
+ "dependencies": {
45
+ "@video-lab/protocol": "4.0.0"
46
+ },
47
+ "devDependencies": {
48
+ "tsdown": "^0.22.9",
49
+ "typescript": "~5.9.0",
50
+ "vitest": "^4.1.10"
51
+ },
52
+ "publishConfig": {
53
+ "access": "public"
54
+ },
55
+ "scripts": {
56
+ "build": "tsdown src/zh-CN.ts src/en-US.ts src/vi-VN.ts --format esm,cjs --dts --clean",
57
+ "test": "vitest run",
58
+ "typecheck": "tsc --noEmit && tsc -p tsconfig.test.json --noEmit"
59
+ }
60
+ }