@nextcloud/l10n
Advanced tools
Comparing version 1.4.1 to 1.5.0
"use strict"; | ||
require("core-js/modules/es.object.to-string"); | ||
require("core-js/modules/es.regexp.exec"); | ||
require("core-js/modules/es.regexp.to-string"); | ||
require("core-js/modules/es.string.replace"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -16,2 +8,12 @@ value: true | ||
require("core-js/modules/es.regexp.exec.js"); | ||
require("core-js/modules/es.string.replace.js"); | ||
require("core-js/modules/es.object.define-property.js"); | ||
require("core-js/modules/es.object.to-string.js"); | ||
require("core-js/modules/es.regexp.to-string.js"); | ||
var _nodeGettext = _interopRequireDefault(require("node-gettext")); | ||
@@ -27,3 +29,3 @@ | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | ||
@@ -30,0 +32,0 @@ var GettextBuilder = /*#__PURE__*/function () { |
"use strict"; | ||
require("core-js/modules/es.regexp.exec"); | ||
require("core-js/modules/es.object.define-property.js"); | ||
require("core-js/modules/es.string.replace"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.getLocale = getLocale; | ||
exports.getCanonicalLocale = getCanonicalLocale; | ||
exports.getLanguage = getLanguage; | ||
exports.translate = translate; | ||
exports.translatePlural = translatePlural; | ||
exports.getFirstDay = getFirstDay; | ||
exports.getDayNames = getDayNames; | ||
exports.getDayNamesMin = getDayNamesMin; | ||
exports.getDayNamesShort = getDayNamesShort; | ||
exports.getDayNamesMin = getDayNamesMin; | ||
exports.getFirstDay = getFirstDay; | ||
exports.getLanguage = getLanguage; | ||
exports.getLocale = getLocale; | ||
exports.getMonthNames = getMonthNames; | ||
exports.getMonthNamesShort = getMonthNamesShort; | ||
exports.translate = translate; | ||
exports.translatePlural = translatePlural; | ||
require("core-js/modules/es.regexp.exec.js"); | ||
require("core-js/modules/es.string.replace.js"); | ||
/// <reference types="@nextcloud/typings" /> | ||
@@ -28,8 +30,3 @@ | ||
function getLocale() { | ||
if (typeof OC === 'undefined') { | ||
console.warn('No OC found'); | ||
return 'en'; | ||
} | ||
return OC.getLocale(); | ||
return document.documentElement.dataset.locale || 'en'; | ||
} | ||
@@ -46,8 +43,3 @@ | ||
function getLanguage() { | ||
if (typeof OC === 'undefined') { | ||
console.warn('No OC found'); | ||
return 'en'; | ||
} | ||
return OC.getLanguage(); | ||
return document.documentElement.lang || 'en'; | ||
} | ||
@@ -54,0 +46,0 @@ |
/// <reference types="@nextcloud/typings" /> | ||
declare var OC: Nextcloud.v16.OC | Nextcloud.v17.OC | Nextcloud.v18.OC | Nextcloud.v19.OC | Nextcloud.v20.OC; | ||
declare var OC: Nextcloud.v16.OC | Nextcloud.v17.OC | Nextcloud.v18.OC | Nextcloud.v19.OC | | ||
Nextcloud.v20.OC | Nextcloud.v21.OC | Nextcloud.v22.OC | Nextcloud.v23.OC | | ||
Nextcloud.v24.OC; | ||
declare var window: Nextcloud.v16.WindowWithGlobals | Nextcloud.v17.WindowWithGlobals | Nextcloud.v18.WindowWithGlobals | Nextcloud.v19.WindowWithGlobals; | ||
@@ -10,8 +12,3 @@ | ||
export function getLocale(): string { | ||
if (typeof OC === 'undefined') { | ||
console.warn('No OC found') | ||
return 'en' | ||
} | ||
return OC.getLocale() | ||
return document.documentElement.dataset.locale || 'en' | ||
} | ||
@@ -27,8 +24,3 @@ | ||
export function getLanguage(): string { | ||
if (typeof OC === 'undefined') { | ||
console.warn('No OC found') | ||
return 'en'; | ||
} | ||
return OC.getLanguage() | ||
return document.documentElement.lang || 'en' | ||
} | ||
@@ -35,0 +27,0 @@ |
{ | ||
"name": "@nextcloud/l10n", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"description": "", | ||
@@ -34,10 +34,10 @@ "main": "dist/index.js", | ||
"@babel/preset-typescript": "^7.9.0", | ||
"@nextcloud/browserslist-config": "^1.0.0", | ||
"@nextcloud/browserslist-config": "^2.2.0", | ||
"@nextcloud/typings": "^1.0.0", | ||
"@types/node-gettext": "^3.0", | ||
"babel-jest": "^26.0.1", | ||
"babel-jest": "^27.2.1", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"gettext-parser": "^4.0.3", | ||
"jest": "^26.0.1", | ||
"typedoc": "^0.19.0", | ||
"jest": "^27.2.1", | ||
"typedoc": "^0.22.4", | ||
"typescript": "^4.0.2" | ||
@@ -44,0 +44,0 @@ }, |
@@ -30,3 +30,3 @@ # @nextcloud/l10n | ||
See the [localization docs](https://docs.nextcloud.com/server/stable/developer_manual/app/view/l10n.html) for more info. | ||
See the [localization docs](https://docs.nextcloud.com/server/stable/developer_manual/basics/front-end/l10n.html) for more info. | ||
@@ -64,3 +64,3 @@ ### Independent translation | ||
See [the developer docs for general guidelines](https://docs.nextcloud.com/server/latest/developer_manual/app/view/l10n.html). | ||
See [the developer docs for general guidelines](https://docs.nextcloud.com/server/stable/developer_manual/basics/front-end/l10n.html). | ||
@@ -73,2 +73,2 @@ #### Translate plurals | ||
See [the developer docs for general guidelines](https://docs.nextcloud.com/server/latest/developer_manual/app/view/l10n.html). | ||
See [the developer docs for general guidelines](https://docs.nextcloud.com/server/stable/developer_manual/basics/front-end/l10n.html). |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
77083
19
720