@kano/i18n
Advanced tools
Comparing version 1.0.0 to 1.0.1
export interface IMessageDB { | ||
[k: string]: string; | ||
} | ||
export declare function setDebug(state: boolean): void; | ||
/** | ||
@@ -5,0 +6,0 @@ * Set the default language for this session. The default language will be used if the detected |
; | ||
let debug = false; | ||
// Detected language | ||
@@ -46,2 +47,5 @@ let lang; | ||
} | ||
export function setDebug(state) { | ||
debug = state; | ||
} | ||
/** | ||
@@ -66,3 +70,3 @@ * Set the default language for this session. The default language will be used if the detected | ||
export function localize(key, fallback) { | ||
return db[key] || fallback; | ||
return debug ? `\${${key}}` : db[key] || fallback; | ||
} | ||
@@ -69,0 +73,0 @@ // Alias for localize |
declare type Constructor<T> = new (...args: any[]) => T; | ||
/** | ||
* A Polymer mixin adding the localize and _ method to use in templates | ||
* A Polymer mixin adding the localize method to use in templates | ||
*/ | ||
export declare function I18nMixin<T extends Constructor<HTMLElement>>(base: T): { | ||
new (...args: any[]): { | ||
_(key: string, fallback?: string | undefined): string | undefined; | ||
localize(key: string, fallback?: string | undefined): string | undefined; | ||
@@ -9,0 +8,0 @@ accessKey: string; |
{ | ||
"name": "@kano/i18n", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"main": "index.js", | ||
@@ -17,3 +17,4 @@ "repository": "git@github.com:KanoComputing/web-i18n.git", | ||
"build:tools": "tsc -p tsconfig.tools.json", | ||
"watch:tools": "yarn build:tools --watch" | ||
"watch:tools": "yarn build:tools --watch", | ||
"prepublishOnly": "yarn build:release" | ||
}, | ||
@@ -20,0 +21,0 @@ "devDependencies": { |
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
43227
613