mirror of
https://github.com/tachiyomiorg/website.git
synced 2025-01-02 13:31:55 +01:00
Fix pt-br returning () (#716)
* Fix pt-br returning () * Replace ISO-639-1 with Intl.DisplayNames
This commit is contained in:
parent
8330219459
commit
45b2583efd
25
package-lock.json
generated
25
package-lock.json
generated
@ -13,7 +13,6 @@
|
|||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"core-js": "2.6.4",
|
"core-js": "2.6.4",
|
||||||
"element-ui": "^2.15.3",
|
"element-ui": "^2.15.3",
|
||||||
"iso-639-1": "^2.1.9",
|
|
||||||
"lodash.groupby": "^4.6.0",
|
"lodash.groupby": "^4.6.0",
|
||||||
"lodash.sortby": "^4.7.0",
|
"lodash.sortby": "^4.7.0",
|
||||||
"marked": "^2.1.3",
|
"marked": "^2.1.3",
|
||||||
@ -2137,6 +2136,8 @@
|
|||||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.16.0.tgz",
|
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.16.0.tgz",
|
||||||
"integrity": "sha512-5+5VxRFmSf97nM8Jr2wzOwLqRo6zphH2aX+7KsAUONObyzakDNq2G/bgbhinxB4PoV9L3aXQYhiDKyIKWd2c8g==",
|
"integrity": "sha512-5+5VxRFmSf97nM8Jr2wzOwLqRo6zphH2aX+7KsAUONObyzakDNq2G/bgbhinxB4PoV9L3aXQYhiDKyIKWd2c8g==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
|
"optional": true,
|
||||||
|
"peer": true,
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
"url": "https://opencollective.com/core-js"
|
"url": "https://opencollective.com/core-js"
|
||||||
@ -9692,14 +9693,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||||
},
|
},
|
||||||
"node_modules/iso-639-1": {
|
|
||||||
"version": "2.1.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/iso-639-1/-/iso-639-1-2.1.9.tgz",
|
|
||||||
"integrity": "sha512-owRu9up+Cpx/hwSzm83j6G8PtC7U99UCtPVItsafefNfEgMl+pi8KBwhXwJkJfp6IouyYWFxj8n24SvCWpKZEQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/isobject": {
|
"node_modules/isobject": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
|
||||||
@ -18883,7 +18876,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@vue/babel-preset-app/-/babel-preset-app-4.5.13.tgz",
|
"resolved": "https://registry.npmjs.org/@vue/babel-preset-app/-/babel-preset-app-4.5.13.tgz",
|
||||||
"integrity": "sha512-pM7CR3yXB6L8Gfn6EmX7FLNE3+V/15I3o33GkSNsWvgsMp6HVGXKkXgojrcfUUauyL1LZOdvTmu4enU2RePGHw==",
|
"integrity": "sha512-pM7CR3yXB6L8Gfn6EmX7FLNE3+V/15I3o33GkSNsWvgsMp6HVGXKkXgojrcfUUauyL1LZOdvTmu4enU2RePGHw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/core": "^7.11.0",
|
|
||||||
"@babel/helper-compilation-targets": "^7.9.6",
|
"@babel/helper-compilation-targets": "^7.9.6",
|
||||||
"@babel/helper-module-imports": "^7.8.3",
|
"@babel/helper-module-imports": "^7.8.3",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
||||||
@ -18896,15 +18888,15 @@
|
|||||||
"@vue/babel-plugin-jsx": "^1.0.3",
|
"@vue/babel-plugin-jsx": "^1.0.3",
|
||||||
"@vue/babel-preset-jsx": "^1.2.4",
|
"@vue/babel-preset-jsx": "^1.2.4",
|
||||||
"babel-plugin-dynamic-import-node": "^2.3.3",
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
||||||
"core-js": "^3.6.5",
|
|
||||||
"core-js-compat": "^3.6.5",
|
"core-js-compat": "^3.6.5",
|
||||||
"semver": "^6.1.0"
|
"semver": "^6.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": {
|
"core-js": {
|
||||||
"version": "3.16.0",
|
"version": "https://registry.npmjs.org/core-js/-/core-js-3.16.0.tgz",
|
||||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.16.0.tgz",
|
"integrity": "sha512-5+5VxRFmSf97nM8Jr2wzOwLqRo6zphH2aX+7KsAUONObyzakDNq2G/bgbhinxB4PoV9L3aXQYhiDKyIKWd2c8g==",
|
||||||
"integrity": "sha512-5+5VxRFmSf97nM8Jr2wzOwLqRo6zphH2aX+7KsAUONObyzakDNq2G/bgbhinxB4PoV9L3aXQYhiDKyIKWd2c8g=="
|
"optional": true,
|
||||||
|
"peer": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -24821,11 +24813,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||||
},
|
},
|
||||||
"iso-639-1": {
|
|
||||||
"version": "2.1.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/iso-639-1/-/iso-639-1-2.1.9.tgz",
|
|
||||||
"integrity": "sha512-owRu9up+Cpx/hwSzm83j6G8PtC7U99UCtPVItsafefNfEgMl+pi8KBwhXwJkJfp6IouyYWFxj8n24SvCWpKZEQ=="
|
|
||||||
},
|
|
||||||
"isobject": {
|
"isobject": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"core-js": "2.6.4",
|
"core-js": "2.6.4",
|
||||||
"element-ui": "^2.15.3",
|
"element-ui": "^2.15.3",
|
||||||
"iso-639-1": "^2.1.9",
|
|
||||||
"lodash.groupby": "^4.6.0",
|
"lodash.groupby": "^4.6.0",
|
||||||
"lodash.sortby": "^4.7.0",
|
"lodash.sortby": "^4.7.0",
|
||||||
"marked": "^2.1.3",
|
"marked": "^2.1.3",
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
import ISO6391 from "iso-639-1";
|
|
||||||
|
|
||||||
export function simpleLangName(code) {
|
export function simpleLangName(code) {
|
||||||
return code === "all" ? "All" : ISO6391.getName(code);
|
if (code === "all") {
|
||||||
|
return "All";
|
||||||
|
}
|
||||||
|
const namesInEnglish = new Intl.DisplayNames(["en"], { type: "language" });
|
||||||
|
return namesInEnglish.of(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function langName(code) {
|
export function langName(code) {
|
||||||
return code === "all" ? "All" : `${ISO6391.getName(code)} (${ISO6391.getNativeName(code)})`;
|
if (code === "all") {
|
||||||
|
return "All";
|
||||||
|
}
|
||||||
|
const namesInEnglish = new Intl.DisplayNames(["en"], { type: "language" });
|
||||||
|
const namesInNative = new Intl.DisplayNames([code], { type: "language" });
|
||||||
|
return `${namesInEnglish.of(code)} - ${namesInNative.of(code)}`;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user