bobril-g11n
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
function __export(m) { | ||
@@ -2,0 +3,0 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; |
{ | ||
"name": "bobril-g11n", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Bobril globalization", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
function extractUsedParams(msgAst) { | ||
@@ -2,0 +3,0 @@ var params = Object.create(null); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
function jsonp(url) { | ||
@@ -2,0 +3,0 @@ return new Promise(function (r, e) { |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var defs = Object.create(null); | ||
@@ -2,0 +3,0 @@ defs['en'] = { |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var sourceText; | ||
@@ -2,0 +3,0 @@ var pos; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var RuntimeFunctionGenerator_1 = require('./RuntimeFunctionGenerator'); | ||
@@ -2,0 +3,0 @@ var localeDataStorage = require('./localeDataStorage'); |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var RuntimeFunctionGenerator = (function () { | ||
@@ -45,3 +46,3 @@ function RuntimeFunctionGenerator() { | ||
return RuntimeFunctionGenerator; | ||
})(); | ||
}()); | ||
exports.RuntimeFunctionGenerator = RuntimeFunctionGenerator; |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var msgFormatParser = require("./msgFormatParser"); | ||
@@ -97,6 +98,6 @@ var msgFormatter = require('./msgFormatter'); | ||
if (pathToTranslation) { | ||
var p = pathToTranslation(locale); | ||
if (p) { | ||
var p_1 = pathToTranslation(locale); | ||
if (p_1) { | ||
prom = prom.then(function () { | ||
return jsonp_1.jsonp(p); | ||
return jsonp_1.jsonp(p_1); | ||
}); | ||
@@ -122,6 +123,14 @@ } | ||
exports.getLocale = getLocale; | ||
function getMoment() { | ||
function getMoment(init) { | ||
if (init !== undefined) { | ||
return window.moment(init).locale(currentLocale); | ||
} | ||
return momentInstance.clone(); | ||
} | ||
exports.getMoment = getMoment; | ||
var numeral = require('numeral'); | ||
function unformatNumber(str) { | ||
return numeral().unformat(str); | ||
} | ||
exports.unformatNumber = unformatNumber; | ||
function registerTranslations(locale, localeDefs, msgs) { | ||
@@ -128,0 +137,0 @@ if (Array.isArray(localeDefs)) { |
@@ -135,6 +135,16 @@ import * as msgFormatParser from "./msgFormatParser"; | ||
export function getMoment(): moment.Moment { | ||
export function getMoment(init?: any): moment.Moment { | ||
if (init!==undefined) { | ||
return (<any>window).moment(init).locale(currentLocale); | ||
} | ||
return momentInstance.clone(); | ||
} | ||
declare var require: any; | ||
var numeral = require('numeral'); | ||
export function unformatNumber(str: string): number { | ||
return numeral().unformat(str); | ||
} | ||
export function registerTranslations(locale: string, localeDefs: any[], msgs: string[]): void { | ||
@@ -141,0 +151,0 @@ if (Array.isArray(localeDefs)) { |
@@ -40,2 +40,3 @@ { | ||
"./test/extractUsedParamsSpec.ts", | ||
"./test/translateSpec.ts", | ||
"./typings/moment/moment-node.d.ts", | ||
@@ -42,0 +43,0 @@ "./typings/numeral/numeral.d.ts", |
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
167728
3920