@instructure/ui-i18n
Advanced tools
Comparing version 5.11.0 to 5.12.0-rc.13
@@ -183,5 +183,3 @@ /* | ||
function _localize(input, locale) { | ||
var sourceLocale = Locale.browserLocale(); // eslint-disable-line no-param-reassign | ||
if (locale === sourceLocale) { | ||
if (locale === Locale.defaultLocale) { | ||
return input; | ||
@@ -192,3 +190,3 @@ } | ||
var sourceDelimiters = Decimal.getDelimiters(sourceLocale); | ||
var sourceDelimiters = Decimal.getDelimiters(Locale.defaultLocale); | ||
var destinationDelimiters = Decimal.getDelimiters(locale); | ||
@@ -195,0 +193,0 @@ |
@@ -27,2 +27,4 @@ /* | ||
var defaultLocale = 'en-US'; | ||
/** | ||
@@ -36,2 +38,4 @@ * --- | ||
export default { | ||
defaultLocale: defaultLocale, | ||
/** | ||
@@ -44,4 +48,2 @@ * Return the locale from the browser | ||
var defaultLocale = 'en-US'; | ||
if (nav) return nav.language; | ||
@@ -48,0 +50,0 @@ if (!hasDOM) return defaultLocale; |
@@ -197,5 +197,3 @@ 'use strict'; | ||
function _localize(input, locale) { | ||
var sourceLocale = _Locale2.default.browserLocale(); // eslint-disable-line no-param-reassign | ||
if (locale === sourceLocale) { | ||
if (locale === _Locale2.default.defaultLocale) { | ||
return input; | ||
@@ -206,3 +204,3 @@ } | ||
var sourceDelimiters = _decimal2.default.getDelimiters(sourceLocale); | ||
var sourceDelimiters = _decimal2.default.getDelimiters(_Locale2.default.defaultLocale); | ||
var destinationDelimiters = _decimal2.default.getDelimiters(locale); | ||
@@ -209,0 +207,0 @@ |
@@ -13,2 +13,4 @@ 'use strict'; | ||
var defaultLocale = 'en-US'; | ||
/** | ||
@@ -21,3 +23,29 @@ * --- | ||
*/ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2015 - present Instructure, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
exports.default = { | ||
defaultLocale: defaultLocale, | ||
/** | ||
@@ -30,4 +58,2 @@ * Return the locale from the browser | ||
var defaultLocale = 'en-US'; | ||
if (nav) return nav.language; | ||
@@ -46,24 +72,2 @@ if (!hasDOM) return defaultLocale; | ||
} | ||
}; /* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2015 - present Instructure, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
}; |
{ | ||
"name": "@instructure/ui-i18n", | ||
"version": "5.11.0", | ||
"version": "5.12.0-rc.13", | ||
"description": "A UI component library made by Instructure Inc.", | ||
@@ -25,5 +25,5 @@ "author": "Instructure, Inc. Engineering and Product Design", | ||
"devDependencies": { | ||
"@instructure/ui-presets": "^5.11.0", | ||
"@instructure/ui-testbed": "^5.11.0", | ||
"@instructure/ui-themes": "^5.11.0", | ||
"@instructure/ui-presets": "^5.12.0-rc.13", | ||
"@instructure/ui-testbed": "^5.12.0-rc.13", | ||
"@instructure/ui-themes": "^5.12.0-rc.13", | ||
"react": "15.6.2", | ||
@@ -37,3 +37,3 @@ "react-dom": "15.6.2" | ||
"dependencies": { | ||
"@instructure/ui-utils": "^5.11.0", | ||
"@instructure/ui-utils": "^5.12.0-rc.13", | ||
"decimal.js": "^9.0.1", | ||
@@ -46,3 +46,3 @@ "moment-timezone": "^0.5.14", | ||
}, | ||
"gitHead": "2c264e9c159cd9049e286a2e47f4187e6b900ecc" | ||
"gitHead": "ecc8d1c868c985c261add3bbf952f40a6d476827" | ||
} |
@@ -179,5 +179,3 @@ /* | ||
function _localize (input, locale) { | ||
const sourceLocale = Locale.browserLocale() // eslint-disable-line no-param-reassign | ||
if (locale === sourceLocale) { | ||
if (locale === Locale.defaultLocale) { | ||
return input | ||
@@ -188,3 +186,3 @@ } | ||
const sourceDelimiters = Decimal.getDelimiters(sourceLocale) | ||
const sourceDelimiters = Decimal.getDelimiters(Locale.defaultLocale) | ||
const destinationDelimiters = Decimal.getDelimiters(locale) | ||
@@ -191,0 +189,0 @@ |
@@ -27,2 +27,4 @@ /* | ||
const defaultLocale = 'en-US' | ||
/** | ||
@@ -36,2 +38,4 @@ * --- | ||
export default { | ||
defaultLocale, | ||
/** | ||
@@ -42,4 +46,2 @@ * Return the locale from the browser | ||
browserLocale (nav, hasDOM = canUseDOM) { | ||
const defaultLocale = 'en-US' | ||
if (nav) return nav.language | ||
@@ -46,0 +48,0 @@ if (!hasDOM) return defaultLocale |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
2438
136987
1
1