@lion/localize
Advanced tools
Comparing version 0.14.5 to 0.14.6
# Change Log | ||
## 0.14.6 | ||
### Patch Changes | ||
- 7682e520: Fix formatting negative values for Turkish locale. | ||
- Updated dependencies [e92b98a4] | ||
- @lion/core@0.13.1 | ||
## 0.14.5 | ||
@@ -4,0 +12,0 @@ |
{ | ||
"name": "@lion/localize", | ||
"version": "0.14.5", | ||
"version": "0.14.6", | ||
"description": "The localization system helps to manage localization data split into locales and automate its loading", | ||
@@ -26,5 +26,7 @@ "license": "MIT", | ||
"scripts": { | ||
"debug": "cd ../../ && yarn debug --group localize", | ||
"debug:firefox": "cd ../../ && yarn debug:firefox --group localize", | ||
"debug:webkit": "cd ../../ && yarn debug:webkit --group localize", | ||
"prepublishOnly": "../../scripts/npm-prepublish.js", | ||
"test": "cd ../../ && yarn test:browser --grep \"packages/localize/test/**/*.test.js\"", | ||
"test:watch": "cd ../../ && yarn test:browser:watch --grep \"packages/localize/test/**/*.test.js\"" | ||
"test": "cd ../../ && yarn test:browser --group localize" | ||
}, | ||
@@ -34,3 +36,3 @@ "sideEffects": false, | ||
"@bundled-es-modules/message-format": "6.0.4", | ||
"@lion/core": "0.13.0", | ||
"@lion/core": "0.13.1", | ||
"singleton-manager": "1.1.2" | ||
@@ -37,0 +39,0 @@ }, |
@@ -7,11 +7,15 @@ /** | ||
*/ | ||
export function forceTryCurrencyCode(formattedParts, { currency, currencyDisplay } = {}) { | ||
const result = formattedParts; | ||
// Change the currency code from TRY to TL, for Turkey | ||
if (currency === 'TRY' && currencyDisplay === 'code') { | ||
if (result[0].value === 'TRY') { | ||
result[0].value = 'TL'; | ||
} | ||
result.map(part => { | ||
const newPart = part; | ||
if (part.type === 'currency') { | ||
newPart.value = 'TL'; | ||
} | ||
return newPart; | ||
}); | ||
} | ||
return result; | ||
} |
@@ -332,4 +332,14 @@ import { expect } from '@open-wc/testing'; | ||
}); | ||
it('forces turkish currency code ', () => { | ||
localize.locale = 'tr-TR'; | ||
expect( | ||
formatNumber(1234.56, { style: 'currency', currencyDisplay: 'code', currency: 'TRY' }), | ||
).to.equal('1.234,56 TL'); | ||
expect( | ||
formatNumber(-1234.56, { style: 'currency', currencyDisplay: 'code', currency: 'TRY' }), | ||
).to.equal('−1.234,56 TL'); | ||
}); | ||
}); | ||
}); | ||
}); |
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
234851
5117
+ Added@lion/core@0.13.1(transitive)
- Removed@lion/core@0.13.0(transitive)
Updated@lion/core@0.13.1