dl-librescore
Advanced tools
Comparing version 0.34.2 to 0.34.3
@@ -38,3 +38,3 @@ <div dir="ltr" align="left"> | ||
1. Go to the [README](https://github.com/LibreScore/app-librescore#installation) page of the `app-librescore` repository | ||
2. Follow the installation instructions for your device to install it | ||
2. Follow the installation instructions for your device | ||
@@ -41,0 +41,0 @@ ### Userscript |
@@ -38,3 +38,3 @@ <div dir="ltr" align="left"> | ||
1. Vaya a la página [LÉAME](https://github.com/LibreScore/app-librescore/blob/master/docs/es/LÉAME.md#instalación) del repositorio `app-librescore` | ||
2. Sigue las instrucciones de instalación de su dispositivo para instalarlo | ||
2. Sigue las instrucciones de instalación de su dispositivo | ||
@@ -41,0 +41,0 @@ ### Guión de usuario |
@@ -38,3 +38,3 @@ <div dir="ltr" align="left"> | ||
1. Pergi ke halaman [BACASAYA](https://github.com/LibreScore/app-librescore/blob/master/docs/ms/BACASAYA.md#pemasangan) repositori `app-librescore` | ||
2. Ikut arahan pemasangan untuk peranti anda memasangnya | ||
2. Ikut arahan pemasangan untuk peranti anda | ||
@@ -41,0 +41,0 @@ ### Skrip pengguna |
138
package.json
{ | ||
"name": "dl-librescore", | ||
"version": "0.34.2", | ||
"description": "Download sheet music", | ||
"main": "dist/main.user.js", | ||
"bin": "dist/cli.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/LibreScore/dl-librescore.git" | ||
}, | ||
"author": "LibreScore", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/LibreScore/dl-librescore/issues" | ||
}, | ||
"homepage": "https://github.com/LibreScore/dl-librescore#readme", | ||
"homepage_url": "https://github.com/LibreScore/dl-librescore#readme", | ||
"manifest_version": 2, | ||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", | ||
"content_scripts": [ | ||
{ | ||
"matches": [ | ||
"*://*.musescore.com/*/*" | ||
], | ||
"js": [ | ||
"src/web-ext.js" | ||
], | ||
"run_at": "document_start" | ||
} | ||
], | ||
"web_accessible_resources": [ | ||
"dist/main.user.js" | ||
], | ||
"dependencies": { | ||
"@librescore/fonts": "^0.4.1", | ||
"@librescore/sf3": "^0.6.1", | ||
"detect-node": "^2.1.0", | ||
"i18next": "^21.8.5", | ||
"inquirer": "^8.2.4", | ||
"node-fetch": "^2.6.7", | ||
"ora": "^5.4.1", | ||
"webmscore": "^0.21.0", | ||
"yargs": "^17.5.1" | ||
}, | ||
"devDependencies": { | ||
"@crokita/rollup-plugin-node-builtins": "^2.1.3", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@types/file-saver": "^2.0.5", | ||
"@types/inquirer": "^8.2.1", | ||
"@types/pdfkit": "^0.12.6", | ||
"@types/yargs": "^17.0.10", | ||
"pdfkit": "git+https://github.com/LibreScore/pdfkit.git", | ||
"rollup": "^2.75.3", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-node-globals": "^1.4.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-string": "^3.0.0", | ||
"rollup-plugin-typescript": "^1.0.1", | ||
"svg-to-pdfkit": "^0.1.8", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.7.2" | ||
}, | ||
"scripts": { | ||
"build": "rollup -c", | ||
"watch": "npm run build -- --watch", | ||
"start:ext": "web-ext run --url https://musescore.com/", | ||
"start:ext-chrome": "npm run start:ext -- -t chromium", | ||
"pack:ext": "zip -r dist/ext.zip manifest.json src/web-ext.js dist/main.user.js", | ||
"bump-version:patch": "npm version patch --no-git-tag && npm run build", | ||
"bump-version:minor": "npm version minor --no-git-tag && npm run build" | ||
"name": "dl-librescore", | ||
"version": "0.34.3", | ||
"description": "Download sheet music", | ||
"main": "dist/main.user.js", | ||
"bin": "dist/cli.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/LibreScore/dl-librescore.git" | ||
}, | ||
"author": "LibreScore", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/LibreScore/dl-librescore/issues" | ||
}, | ||
"homepage": "https://github.com/LibreScore/dl-librescore#readme", | ||
"homepage_url": "https://github.com/LibreScore/dl-librescore#readme", | ||
"manifest_version": 2, | ||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", | ||
"content_scripts": [ | ||
{ | ||
"matches": [ | ||
"*://*.musescore.com/*/*" | ||
], | ||
"js": [ | ||
"src/web-ext.js" | ||
], | ||
"run_at": "document_start" | ||
} | ||
], | ||
"web_accessible_resources": [ | ||
"dist/main.user.js" | ||
], | ||
"dependencies": { | ||
"@librescore/fonts": "^0.4.1", | ||
"@librescore/sf3": "^0.6.1", | ||
"detect-node": "^2.1.0", | ||
"i18next": "^21.8.5", | ||
"inquirer": "^8.2.4", | ||
"node-fetch": "^2.6.7", | ||
"ora": "^5.4.1", | ||
"webmscore": "^0.21.0", | ||
"yargs": "^17.5.1" | ||
}, | ||
"devDependencies": { | ||
"@crokita/rollup-plugin-node-builtins": "^2.1.3", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@types/file-saver": "^2.0.5", | ||
"@types/inquirer": "^8.2.1", | ||
"@types/pdfkit": "^0.12.6", | ||
"@types/yargs": "^17.0.10", | ||
"pdfkit": "git+https://github.com/LibreScore/pdfkit.git", | ||
"rollup": "^2.75.3", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-node-globals": "^1.4.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-string": "^3.0.0", | ||
"rollup-plugin-typescript": "^1.0.1", | ||
"svg-to-pdfkit": "^0.1.8", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.7.2" | ||
}, | ||
"scripts": { | ||
"build": "rollup -c", | ||
"watch": "npm run build -- --watch", | ||
"start:ext": "web-ext run --url https://musescore.com/", | ||
"start:ext-chrome": "npm run start:ext -- -t chromium", | ||
"pack:ext": "zip -r dist/ext.zip manifest.json src/web-ext.js dist/main.user.js", | ||
"bump-version:patch": "npm version patch --no-git-tag && npm run build", | ||
"bump-version:minor": "npm version minor --no-git-tag && npm run build" | ||
} | ||
} |
@@ -38,3 +38,3 @@ <div dir="ltr" align="left"> | ||
1. Go to the [README](https://github.com/LibreScore/app-librescore#installation) page of the `app-librescore` repository | ||
2. Follow the installation instructions for your device to install it | ||
2. Follow the installation instructions for your device | ||
@@ -41,0 +41,0 @@ ### Userscript |
@@ -14,84 +14,87 @@ import i18n from "i18next"; | ||
function getLocale(): string { | ||
let languageMap = [ | ||
"ar", | ||
"en", | ||
"es", | ||
"fr", | ||
"it", | ||
"ja", | ||
"ko", | ||
"ms", | ||
"ru", | ||
"zh-Hans", | ||
]; | ||
let languageMap = [ | ||
"ar", | ||
"en", | ||
"es", | ||
"fr", | ||
"it", | ||
"ja", | ||
"ko", | ||
"ms", | ||
"ru", | ||
"zh-Hans", | ||
]; | ||
let locale: string = "en"; | ||
if (typeof window !== "undefined") { | ||
let localeOrder = navigator.languages?.concat( | ||
Intl.DateTimeFormat().resolvedOptions().locale | ||
) ?? ["en"]; | ||
let localeArray = Object.values(languageMap).map((arr) => arr[0]); | ||
let locale: string = "en"; | ||
if (typeof window !== "undefined") { | ||
let localeOrder = navigator.languages?.concat( | ||
Intl.DateTimeFormat().resolvedOptions().locale | ||
) ?? ["en"]; | ||
let localeArray = Object.values(languageMap).map((arr) => arr[0]); | ||
localeOrder.some((localeItem) => { | ||
if (localeArray.includes(localeItem)) { | ||
locale = localeItem; | ||
return true; | ||
} else if (localeArray.includes(localeItem.substring(0, 2))) { | ||
locale = localeItem.substring(0, 2); | ||
return true; | ||
} else if ( | ||
localeArray.some((locale) => | ||
locale.startsWith(localeItem.substring(0, 2)) | ||
) | ||
) { | ||
locale = localeArray.find((locale) => | ||
locale.startsWith(localeItem.substring(0, 2)) | ||
)!; | ||
return true; | ||
} | ||
}); | ||
if (locale === "en") { | ||
if ( | ||
[ | ||
"ab", | ||
"et", | ||
"kk", | ||
"ky", | ||
"lv", | ||
"os", | ||
"ro-MD", | ||
"ru", | ||
"tg", | ||
"uk", | ||
"uz", | ||
].some((e) => localeOrder[0].startsWith(e)) && | ||
localeArray.includes("ru") | ||
) { | ||
locale = "ru"; | ||
} else { | ||
locale = "en"; | ||
} | ||
} | ||
localeOrder.some((localeItem) => { | ||
if (localeArray.includes(localeItem)) { | ||
locale = localeItem; | ||
return true; | ||
} else if (localeArray.includes(localeItem.substring(0, 2))) { | ||
locale = localeItem.substring(0, 2); | ||
return true; | ||
} else if ( | ||
localeArray.some((locale) => | ||
locale.startsWith(localeItem.substring(0, 2)) | ||
) | ||
) { | ||
locale = localeArray.find((locale) => | ||
locale.startsWith(localeItem.substring(0, 2)) | ||
)!; | ||
return true; | ||
} | ||
}); | ||
if (locale === "en") { | ||
if ( | ||
[ | ||
"ab", | ||
"be", | ||
"et", | ||
"hy", | ||
"kk", | ||
"ky", | ||
"lv", | ||
"os", | ||
"ro-MD", | ||
"ru", | ||
"tg", | ||
"tk", | ||
"uk", | ||
"uz", | ||
].some((e) => localeOrder[0].startsWith(e)) && | ||
localeArray.includes("ru") | ||
) { | ||
locale = "ru"; | ||
} else { | ||
locale = "en"; | ||
} | ||
} | ||
return locale; | ||
} | ||
return locale; | ||
} | ||
export default i18n.init({ | ||
compatibilityJSON: "v3", | ||
lng: getLocale(), | ||
fallbackLng: "en", | ||
resources: { | ||
ar: { translation: ar }, | ||
en: { translation: en }, | ||
es: { translation: es }, | ||
fr: { translation: fr }, | ||
it: { translation: it }, | ||
ja: { translation: ja }, | ||
ko: { translation: ko }, | ||
ms: { translation: ms }, | ||
ru: { translation: ru }, | ||
"zh-Hans": { translation: zh_Hans }, | ||
}, | ||
compatibilityJSON: "v3", | ||
lng: getLocale(), | ||
fallbackLng: "en", | ||
resources: { | ||
ar: { translation: ar }, | ||
en: { translation: en }, | ||
es: { translation: es }, | ||
fr: { translation: fr }, | ||
it: { translation: it }, | ||
ja: { translation: ja }, | ||
ko: { translation: ko }, | ||
ms: { translation: ms }, | ||
ru: { translation: ru }, | ||
"zh-Hans": { translation: zh_Hans }, | ||
}, | ||
}); | ||
export const i18next = i18n; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2758371
48
65051