feat: add danmuku plugin documentation and i18n setup guide

- Created a new documentation file for the danmuku plugin with code examples.
- Added comprehensive i18n setup instructions, including default language settings, language imports, and examples for adding and modifying languages.
- Updated the structure and content of the i18n documentation to enhance clarity and usability.
This commit is contained in:
Harvey Zack committed 2025-09-06 13:48:25 +08:00
1 parent 18475f08fd
commit 5b1cebb334
82 files changed
+268 -174

No files matched your search

@@ -16,7 +16,7 @@ const config = {
{ text: 'English Docs', link: '/en/', activeMatch: '/en/' },
{ text: 'Online Editor', link: 'https://artplayer.org' },
{
text: '5.2.x',
text: '5.3.x',
items: [
{ text: 'Changelog', link: 'https://github.com/zhw2590582/ArtPlayer/blob/master/CHANGELOG.md' },
{ text: 'Donation', link: 'https://github.com/zhw2590582/ArtPlayer#donations' },
@@ -238,9 +238,9 @@ art.current = new Artplayer();
You can also use the option type
```ts{3}
import Artplayer from 'artplayer';
import Artplayer, { type Option } from 'artplayer';
const option: Artplayer['Option'] = {
const option: Option = {
container: '.artplayer-app',
url: './assets/sample/video.mp4',
};
@@ -317,7 +317,7 @@ The production build of `artplayer.js` is only compatible with the latest major
For ancient browsers, you can use the `artplayer.legacy.js` file, which is compatible up to: `IE 11`
```js
import Artplayer from 'artplayer/dist/artplayer.legacy.js'
import Artplayer from 'artplayer/legacy'
```
::: code-group
@@ -26,14 +26,15 @@ var art = new Artplayer({
## Importing Languages
Language files before packaging are located in: `artplayer/src/i18n/*.js`. You are welcome to add your language.
Packaged language files are located at: `artplayer/dist/i18n/*.js`
Language files before packaging are located in: `artplayer/src/i18n/*.js`.
Packaged language files are located at: `artplayer/dist/i18n/*.js`.
::: code-group
```js [import]
import id from 'artplayer/dist/i18n/id.js';
import zhTw from 'artplayer/dist/i18n/zh-tw.js';
import id from 'artplayer/i18n/id';
import zhTw from 'artplayer/i18n/zh-tw';
var art = new Artplayer({
container: '.artplayer-app',
@@ -80,7 +81,7 @@ var art = new Artplayer({
## Modify Language
```js
import zhTw from 'artplayer/i18n/zh-tw.js';
import zhTw from 'artplayer/i18n/zh-tw';
var art = new Artplayer({
container: '.artplayer-app',
+3 -3
View File
@@ -238,9 +238,9 @@ art.current = new Artplayer();
你也可以使用选项的类型
```ts{3}
import Artplayer from 'artplayer';
import Artplayer, { type Option } from 'artplayer';
const option: Artplayer['Option'] = {
const option: Option = {
container: '.artplayer-app',
url: './assets/sample/video.mp4',
};
@@ -319,7 +319,7 @@ const art8 = new Artplayer(option);
对于古老的浏览器,可以使用 `artplayer.legacy.js` 文件,可以兼容到:`IE 11`
```js
import Artplayer from 'artplayer/dist/artplayer.legacy.js'
import Artplayer from 'artplayer/legacy'
```
::: code-group
@@ -33,8 +33,8 @@ var art = new Artplayer({
::: code-group
```js [import]
import id from 'artplayer/dist/i18n/id.js';
import zhTw from 'artplayer/dist/i18n/zh-tw.js';
import id from 'artplayer/i18n/id';
import zhTw from 'artplayer/i18n/zh-tw';
var art = new Artplayer({
container: '.artplayer-app',
@@ -82,7 +82,7 @@ var art = new Artplayer({
## 修改语言
```js
import zhTw from 'artplayer/i18n/zh-tw.js';
import zhTw from 'artplayer/i18n/zh-tw';
var art = new Artplayer({
container: '.artplayer-app',