File tree Expand file tree Collapse file tree 11 files changed +139
-1
lines changed
Expand file tree Collapse file tree 11 files changed +139
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,14 @@ npm start
7979- ` src/locales ` 为[ 扩展] ( https://github.com/scriptscat/scriptcat ) 翻译文件目录
8080- ` public/locales ` 为[ 脚本站] ( https://github.com/scriptscat/scriptlist-frontend ) 的翻译文件目录
8181
82+ #### 扩展开启所见即所得模式
83+
84+ 扩展开启所见即所得模式需要使用` npm run i18n ` 模式进行构建,然后通过控制台设置伪语言` localStorage['language']='ach-UG'; ` ,然后刷新页面。
85+
86+ #### 脚本站开启所见即所得模式
87+
88+ 脚本站访问:[ https://scriptcat.org/ach-UG ] ( https://scriptcat.org/ach-UG ) 即可开启所见即所得模式
89+
8290## 参与开发
8391
8492ScriptCat 使用 ESLint 来规范代码风格,使用 Jest
Original file line number Diff line number Diff line change 1+ // eslint-disable-next-line no-underscore-dangle, no-var
2+ var _jipt = [ ] ;
3+ _jipt . push ( [ "project" , "scriptcat" ] ) ;
Original file line number Diff line number Diff line change 2121 color : var (--color-text-1 );
2222 }
2323 </ style >
24+ < % if (htmlWebpackPlugin.options.mode === 'i18n') { %>
25+ < script type ="text/javascript " src ="/_locales/i18n.js "> </ script >
26+ < script
27+ type ="text/javascript "
28+ src ="https://cdn.crowdin.com/jipt/jipt.js "
29+ > </ script >
30+ < % } %>
2431</ html >
Original file line number Diff line number Diff line change 2121 color : var (--color-text-1 );
2222 }
2323 </ style >
24+ < % if (htmlWebpackPlugin.options.mode === 'i18n') { %>
25+ < script type ="text/javascript " src ="/_locales/i18n.js "> </ script >
26+ < script
27+ type ="text/javascript "
28+ src ="https://cdn.crowdin.com/jipt/jipt.js "
29+ > </ script >
30+ < % } %>
2431</ html >
Original file line number Diff line number Diff line change 2121 color : var (--color-text-1 );
2222 }
2323 </ style >
24+ < % if (htmlWebpackPlugin.options.mode === 'i18n') { %>
25+ < script type ="text/javascript " src ="/_locales/i18n.js "> </ script >
26+ < script
27+ type ="text/javascript "
28+ src ="https://cdn.crowdin.com/jipt/jipt.js "
29+ > </ script >
30+ < % } %>
2431</ html >
Original file line number Diff line number Diff line change 2222 color : var (--color-text-1 );
2323 }
2424 </ style >
25+ < % if (htmlWebpackPlugin.options.mode === 'i18n') { %>
26+ < script type ="text/javascript " src ="/_locales/i18n.js "> </ script >
27+ < script
28+ type ="text/javascript "
29+ src ="https://cdn.crowdin.com/jipt/jipt.js "
30+ > </ script >
31+ < % } %>
2532</ html >
Original file line number Diff line number Diff line change 2626 /* overflow: hidden; */
2727 }
2828 </ style >
29+ < % if (htmlWebpackPlugin.options.mode === 'i18n') { %>
30+ < script type ="text/javascript " src ="/_locales/i18n.js "> </ script >
31+ < script
32+ type ="text/javascript "
33+ src ="https://cdn.crowdin.com/jipt/jipt.js "
34+ > </ script >
35+ < % } %>
2936</ html >
Original file line number Diff line number Diff line change 1515 "dev:linter" : " webpack --mode development --config ./webpack/webpack.linter.dev.ts" ,
1616 "pack" : " node ./build/pack.js" ,
1717 "changlog" : " gitmoji-changelog" ,
18- "crowdin" : " crowdin"
18+ "crowdin" : " crowdin" ,
19+ "i18n" : " concurrently \" webpack --mode development --config ./webpack/webpack.i18n.ts\" \" webpack --mode development --config ./webpack/webpack.inject.dev.ts\" "
1920 },
2021 "dependencies" : {
2122 "@arco-design/web-react" : " ^2.51.1" ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { Metadata } from "@App/app/repo/scripts";
66import enUS from "./en/translation.json" ;
77import zhCN from "./zh-CN/translation.json" ;
88import zhTW from "./zh-TW/translation.json" ;
9+ import achUG from "./ach-UG/translation.json" ;
910import "dayjs/locale/zh-cn" ;
1011
1112i18n . use ( initReactI18next ) . init ( {
@@ -18,6 +19,7 @@ i18n.use(initReactI18next).init({
1819 "en-US" : { title : "English" , translation : enUS } ,
1920 "zh-CN" : { title : "简体中文" , translation : zhCN } ,
2021 "zh-TW" : { title : "繁体中文" , translation : zhTW } ,
22+ "ach-UG" : { title : "伪语言" , translation : achUG } ,
2123 } ,
2224} ) ;
2325
Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ function Setting() {
4242 const languageList : { key : string ; title : string } [ ] = [ ] ;
4343 const { t } = useTranslation ( ) ;
4444 Object . keys ( i18n . store . data ) . forEach ( ( key ) => {
45+ if ( key === "ach-UG" ) {
46+ return ;
47+ }
4548 languageList . push ( {
4649 key,
4750 title : i18n . store . data [ key ] . title as string ,
You can’t perform that action at this time.
0 commit comments