Skip to content

Commit

Permalink
同步修正"main(greasyfork).user.js"pubilc拼写错误
Browse files Browse the repository at this point in the history
  • Loading branch information
maboloshi committed Aug 11, 2024
1 parent 8c164e9 commit 4827645
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion locals(greasyfork).js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ I18N.zh["title"] = { // 标题翻译
],
};

I18N.zh["pubilc"] = { // 公共区域翻译
I18N.zh["public"] = { // 公共区域翻译
"static": { // 静态翻译
// 错误页面
"No server is currently available to service your request.": "当前服务器无法为您的请求提供服务。",
Expand Down
8 changes: 4 additions & 4 deletions main(greasyfork).user.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
*/
function transTimeElement(el) {
let key = el.childNodes.length > 0 ? el.lastChild.textContent : el.textContent;
let res = I18N[lang]['pubilc']['time-regexp']; // 时间正则规则
let res = I18N[lang]['public']['time-regexp']; // 时间正则规则

for (let [a, b] of res) {
let str = key.replace(a, b);
Expand Down Expand Up @@ -343,15 +343,15 @@
function fetchTranslatedText(key) {

// 静态翻译
let str = I18N[lang][page]['static'][key] || I18N[lang]['pubilc']['static'][key]; // 默认翻译 公共部分
let str = I18N[lang][page]['static'][key] || I18N[lang]['public']['static'][key]; // 默认翻译 公共部分

if (typeof str === 'string') {
return str;
}

// 正则翻译
if (enable_RegExp) {
let res = (I18N[lang][page].regexp || []).concat(I18N[lang]['pubilc'].regexp || []); // 正则数组
let res = (I18N[lang][page].regexp || []).concat(I18N[lang]['public'].regexp || []); // 正则数组

for (let [a, b] of res) {
str = key.replace(a, b);
Expand Down Expand Up @@ -447,7 +447,7 @@
*/
function transBySelector() {
// 获取当前页面的翻译规则,如果没有找到,那么使用公共的翻译规则
let res = (I18N[lang][page]?.selector || []).concat(I18N[lang]['pubilc'].selector || []); // 数组
let res = (I18N[lang][page]?.selector || []).concat(I18N[lang]['public'].selector || []); // 数组

// 如果找到了翻译规则
if (res.length > 0) {
Expand Down

0 comments on commit 4827645

Please sign in to comment.