@ribajs/i18n
Advanced tools
Comparing version 1.9.0-beta.1 to 1.9.0-beta.2
import { BinderWrapper } from "@ribajs/core"; | ||
export interface BinderAttributeChangedEvent { | ||
detail: { | ||
name: string; | ||
oldValue: string; | ||
newValue: string; | ||
namespace: null; | ||
}; | ||
detail: { | ||
name: string; | ||
oldValue: string; | ||
newValue: string; | ||
namespace: null; | ||
}; | ||
} | ||
@@ -10,0 +10,0 @@ /** |
@@ -1,218 +0,179 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const core_1 = require("@ribajs/core"); | ||
import { concat } from "@ribajs/utils/src/type"; | ||
/** | ||
* | ||
*/ | ||
exports.i18nStarBinderWrapper = (localesService) => { | ||
return { | ||
name: "i18n-*", | ||
block: false, | ||
priority: 0, | ||
bind(el) { | ||
const getElementData = () => { | ||
const customData = {}; | ||
customData.type = el.type; | ||
customData.tagName = el.tagName; | ||
customData.contenteditable = el.getAttribute("contenteditable") | ||
? true | ||
: false; | ||
customData.isRadio = | ||
customData.tagName === "INPUT" && customData.type === "radio"; | ||
return customData; | ||
}; | ||
this.customData = getElementData(); | ||
this.customData.i18n = localesService; | ||
this.customData.vars = {}; | ||
this.customData.translateMePathString = null; | ||
this.customData.properties = []; | ||
this.customData.attributeName = this.args[0].toString(); | ||
this.customData.applyTranslation = (locale) => { | ||
if (!locale) { | ||
if (this.customData.i18n.showMissingTranslation) { | ||
locale = `translation missing: "${this.customData.properties.join( | ||
"." | ||
)}"`; | ||
} else { | ||
return; | ||
} | ||
} | ||
if (this.customData.attributeName === "html") { | ||
el.innerHTML = locale; | ||
} else if (this.customData.attributeName === "text") { | ||
el.innerText = locale; | ||
} else if (this.customData.attributeName === "value") { | ||
// TODO support also: https://github.com/JumpLinkNetwork/tinybind/blob/master/src/binders/basic/value.binder.ts#L51 | ||
if (this.customData.contenteditable) { | ||
el.innerHTML = locale; | ||
} else { | ||
el.value = locale; | ||
} | ||
} else { | ||
el.setAttribute(this.customData.attributeName, locale); | ||
} | ||
}; | ||
this.customData.parseVars = (_el) => { | ||
// parse templates to vars | ||
const newVars = this.customData.i18n.parseTemplateVars(_el); | ||
this.customData.vars = core_1.Utils.concat( | ||
true, | ||
this.customData.vars, | ||
newVars | ||
); | ||
// if (Object.keys(this.customData.vars).length) { | ||
// console.warn('parsed templates vars', this.customData.vars); | ||
// } | ||
// parse data attributes to vars | ||
// Vanilla works better than jquery data function? | ||
this.customData.vars = core_1.Utils.concat( | ||
true, | ||
this.customData.vars, | ||
_el.dataset | ||
); | ||
// if (Object.keys(this.customData.vars).length) { | ||
// console.warn('parsed attribute vars', this.customData.vars); | ||
// } | ||
// Parse templates wich have his own translations | ||
this.customData.langVars = this.customData.i18n.parseLocalVars(_el); | ||
// if (this.customData.langVars && Object.keys(this.customData.langVars).length) { | ||
// console.warn('parsed own translations', this.customData.langVars); | ||
// } | ||
}; | ||
this.customData.translate = (langcode) => { | ||
// If language service is not ready do nothing | ||
if (!this.customData.i18n.ready) { | ||
return; | ||
} | ||
if (!langcode) { | ||
langcode = this.customData.i18n.getLangcode(); | ||
if (!langcode) { | ||
console.error("Langcode is requred", langcode); | ||
return; | ||
} | ||
} | ||
// translate by using the already translated language variable | ||
if (this.customData.langVars && this.customData.langVars[langcode]) { | ||
return this.customData.applyTranslation( | ||
this.customData.langVars[langcode] | ||
); | ||
} | ||
if ( | ||
!this.customData.properties || | ||
this.customData.properties.length === 0 | ||
) { | ||
// get the default translation if available | ||
if (this.customData.langVars && this.customData.langVars.default) { | ||
// console.warn('Translate by default', this.customData.langVars.default); | ||
return this.customData.applyTranslation( | ||
this.customData.langVars.default | ||
); | ||
} | ||
} | ||
// translate by properies, e.g. de.cart.add | ||
return this.customData.i18n | ||
.get([langcode, ...this.customData.properties], this.customData.vars) | ||
.then((local) => { | ||
if (local && typeof local === "string") { | ||
// console.warn('Translate by properties', [langcode, ...this.customData.properties], local); | ||
return this.customData.applyTranslation(local); | ||
export const i18nStarBinderWrapper = (localesService) => { | ||
return { | ||
name: "i18n-*", | ||
block: false, | ||
priority: 0, | ||
bind(el) { | ||
const getElementData = () => { | ||
const customData = {}; | ||
customData.type = el.type; | ||
customData.tagName = el.tagName; | ||
customData.contenteditable = el.getAttribute("contenteditable") | ||
? true | ||
: false; | ||
customData.isRadio = | ||
customData.tagName === "INPUT" && customData.type === "radio"; | ||
return customData; | ||
}; | ||
this.customData = getElementData(); | ||
this.customData.i18n = localesService; | ||
this.customData.vars = {}; | ||
this.customData.translateMePathString = null; | ||
this.customData.properties = []; | ||
this.customData.attributeName = this.args[0].toString(); | ||
this.customData.applyTranslation = (locale) => { | ||
if (!locale) { | ||
if (this.customData.i18n.showMissingTranslation) { | ||
locale = `translation missing: "${this.customData.properties.join(".")}"`; | ||
} | ||
else { | ||
return; | ||
} | ||
} | ||
if (this.customData.attributeName === "html") { | ||
el.innerHTML = locale; | ||
} | ||
else if (this.customData.attributeName === "text") { | ||
el.innerText = locale; | ||
} | ||
else if (this.customData.attributeName === "value") { | ||
// TODO support also: https://github.com/JumpLinkNetwork/tinybind/blob/master/src/binders/basic/value.binder.ts#L51 | ||
if (this.customData.contenteditable) { | ||
el.innerHTML = locale; | ||
} | ||
else { | ||
el.value = locale; | ||
} | ||
} | ||
else { | ||
el.setAttribute(this.customData.attributeName, locale); | ||
} | ||
}; | ||
this.customData.parseVars = (_el) => { | ||
// parse templates to vars | ||
const newVars = this.customData.i18n.parseTemplateVars(_el); | ||
this.customData.vars = concat(true, this.customData.vars, newVars); | ||
// if (Object.keys(this.customData.vars).length) { | ||
// console.warn('parsed templates vars', this.customData.vars); | ||
// } | ||
// parse data attributes to vars | ||
this.customData.vars = concat(true, this.customData.vars, _el.dataset); | ||
// if (Object.keys(this.customData.vars).length) { | ||
// console.warn('parsed attribute vars', this.customData.vars); | ||
// } | ||
// Parse templates wich have his own translations | ||
this.customData.langVars = this.customData.i18n.parseLocalVars(_el); | ||
// if (this.customData.langVars && Object.keys(this.customData.langVars).length) { | ||
// console.warn('parsed own translations', this.customData.langVars); | ||
// } | ||
}; | ||
this.customData.translate = (langcode) => { | ||
// If language service is not ready do nothing | ||
if (!this.customData.i18n.ready) { | ||
return; | ||
} | ||
if (!langcode) { | ||
langcode = this.customData.i18n.getLangcode(); | ||
if (!langcode) { | ||
console.error("Langcode is requred", langcode); | ||
return; | ||
} | ||
} | ||
// translate by using the already translated language variable | ||
if (this.customData.langVars && this.customData.langVars[langcode]) { | ||
return this.customData.applyTranslation(this.customData.langVars[langcode]); | ||
} | ||
if (!this.customData.properties || | ||
this.customData.properties.length === 0) { | ||
// get the default translation if available | ||
if (this.customData.langVars && this.customData.langVars.default) { | ||
// console.warn('Translate by default', this.customData.langVars.default); | ||
return this.customData.applyTranslation(this.customData.langVars.default); | ||
} | ||
} | ||
// translate by properies, e.g. de.cart.add | ||
return this.customData.i18n | ||
.get([langcode, ...this.customData.properties], this.customData.vars) | ||
.then((local) => { | ||
if (local && typeof local === "string") { | ||
// console.warn('Translate by properties', [langcode, ...this.customData.properties], local); | ||
return this.customData.applyTranslation(local); | ||
} | ||
// get the default translation if available | ||
if (this.customData.langVars && this.customData.langVars.default) { | ||
// console.warn('Translate by default as fallback', this.customData.langVars.default); | ||
return this.customData.applyTranslation(this.customData.langVars.default); | ||
} | ||
return this.customData.applyTranslation(null); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
}; | ||
this.customData.onAttributeChanged = (data) => { | ||
if (data.detail.name.startsWith("data-")) { | ||
const varName = data.detail.name.slice(5); | ||
const newVar = {}; | ||
newVar[varName] = data.detail.newValue; | ||
// console.warn('binder-changed newVar', newVar); | ||
this.customData.vars = concat(true, this.customData.vars, newVar); | ||
this.customData.translate(); | ||
} | ||
}; | ||
this.customData.onLanguageChanged = (langcode, initial) => { | ||
// Do not translate on inital language change, we use the ready event for this | ||
if (!initial) { | ||
this.customData.translate(langcode); | ||
} | ||
}; | ||
/** | ||
* Initial stuff wee need to do after the language service is ready | ||
*/ | ||
this.customData.initOnReady = (langcode, translationNeeded) => { | ||
// Translate on translation service ready if needed | ||
if (translationNeeded) { | ||
this.customData.translate(langcode); | ||
} | ||
// Translate if language changes | ||
this.customData.i18n.event.on("changed", this.customData.onLanguageChanged); | ||
// Translate if binder attribute event is changed | ||
el.addEventListener("binder-changed", this.customData.onAttributeChanged); | ||
}; | ||
}, | ||
routine(el, translateMePathString) { | ||
if (this.customData.translateMePathString === null) { | ||
// if this is the first call of this function | ||
this.customData.translateMePathString = translateMePathString; | ||
if (translateMePathString) { | ||
this.customData.properties = this.customData.translateMePathString.split("."); | ||
} | ||
this.customData.parseVars(el); | ||
// Translate if language is ready | ||
if (this.customData.i18n.ready) { | ||
this.customData.initOnReady(this.customData.i18n.getLangcode(), this.customData.i18n.currentLangcode !== | ||
this.customData.i18n.initalLangcode || | ||
!localesService.doNotTranslateDefaultLanguage); | ||
} | ||
else { | ||
this.customData.i18n.event.on("ready", this.customData.initOnReady); | ||
} | ||
} | ||
// get the default translation if available | ||
if (this.customData.langVars && this.customData.langVars.default) { | ||
// console.warn('Translate by default as fallback', this.customData.langVars.default); | ||
return this.customData.applyTranslation( | ||
this.customData.langVars.default | ||
); | ||
else if (this.customData.translateMePathString !== translateMePathString) { | ||
// If translate string was changed | ||
this.customData.translateMePathString = translateMePathString; | ||
this.customData.properties = this.customData.translateMePathString.split("."); | ||
this.customData.parseVars(el); | ||
this.customData.translate(); | ||
} | ||
return this.customData.applyTranslation(null); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
}; | ||
this.customData.onAttributeChanged = (data) => { | ||
if (data.detail.name.startsWith("data-")) { | ||
const varName = data.detail.name.slice(5); | ||
const newVar = {}; | ||
newVar[varName] = data.detail.newValue; | ||
// console.warn('binder-changed newVar', newVar); | ||
this.customData.vars = core_1.Utils.concat( | ||
true, | ||
this.customData.vars, | ||
newVar | ||
); | ||
this.customData.translate(); | ||
} | ||
}; | ||
this.customData.onLanguageChanged = (langcode, initial) => { | ||
// Do not translate on inital language change, we use the ready event for this | ||
if (!initial) { | ||
this.customData.translate(langcode); | ||
} | ||
}; | ||
/** | ||
* Initial stuff wee need to do after the language service is ready | ||
*/ | ||
this.customData.initOnReady = (langcode, translationNeeded) => { | ||
// Translate on translation service ready if needed | ||
if (translationNeeded) { | ||
this.customData.translate(langcode); | ||
} | ||
// Translate if language changes | ||
this.customData.i18n.event.on( | ||
"changed", | ||
this.customData.onLanguageChanged | ||
); | ||
// Translate if binder attribute event is changed | ||
el.addEventListener( | ||
"binder-changed", | ||
this.customData.onAttributeChanged | ||
); | ||
}; | ||
}, | ||
routine(el, translateMePathString) { | ||
if (this.customData.translateMePathString === null) { | ||
// if this is the first call of this function | ||
this.customData.translateMePathString = translateMePathString; | ||
if (translateMePathString) { | ||
this.customData.properties = this.customData.translateMePathString.split( | ||
"." | ||
); | ||
} | ||
this.customData.parseVars(el); | ||
// Translate if language is ready | ||
if (this.customData.i18n.ready) { | ||
this.customData.initOnReady( | ||
this.customData.i18n.getLangcode(), | ||
this.customData.i18n.currentLangcode !== | ||
this.customData.i18n.initalLangcode || | ||
!localesService.doNotTranslateDefaultLanguage | ||
); | ||
} else { | ||
this.customData.i18n.event.on("ready", this.customData.initOnReady); | ||
} | ||
} else if ( | ||
this.customData.translateMePathString !== translateMePathString | ||
) { | ||
// If translate string was changed | ||
this.customData.translateMePathString = translateMePathString; | ||
this.customData.properties = this.customData.translateMePathString.split( | ||
"." | ||
); | ||
this.customData.parseVars(el); | ||
this.customData.translate(); | ||
} | ||
}, | ||
unbind() { | ||
this.el.removeEventListener( | ||
"binder-changed", | ||
this.customData.onAttributeChanged | ||
); | ||
this.customData.i18n.event.off( | ||
"changed", | ||
this.customData.onLanguageChanged | ||
); | ||
}, | ||
}; | ||
}, | ||
unbind() { | ||
this.el.removeEventListener("binder-changed", this.customData.onAttributeChanged); | ||
this.customData.i18n.event.off("changed", this.customData.onLanguageChanged); | ||
}, | ||
}; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJ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UFVLENBQUMsa0JBQWtCLENBQ25DLENBQUM7WUFDRixJQUFJLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUM1QixTQUFTLEVBQ1QsSUFBSSxDQUFDLFVBQVUsQ0FBQyxpQkFBaUIsQ0FDbEMsQ0FBQztRQUNKLENBQUM7S0FDZ0IsQ0FBQztBQUN0QixDQUFDLENBQUMifQ== |
@@ -1,9 +0,7 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const i18n_star_binder_1 = require("./i18n/i18n-star.binder"); | ||
exports.default = (localesService) => { | ||
return { | ||
i18nStarBinder: i18n_star_binder_1.i18nStarBinderWrapper(localesService), | ||
}; | ||
import { i18nStarBinderWrapper } from "./i18n/i18n-star.binder"; | ||
export default (localesService) => { | ||
return { | ||
i18nStarBinder: i18nStarBinderWrapper(localesService), | ||
}; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYmluZGVycy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDhEQUFnRTtBQUloRSxrQkFBZSxDQUFDLGNBQStCLEVBQUUsRUFBRTtJQUNqRCxPQUFPO1FBQ0wsY0FBYyxFQUFFLHdDQUFxQixDQUFDLGNBQWMsQ0FBQztLQUNyQyxDQUFDO0FBQ3JCLENBQUMsQ0FBQyJ9 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYmluZGVycy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUloRSxlQUFlLENBQUMsY0FBK0IsRUFBRSxFQUFFO0lBQ2pELE9BQU87UUFDTCxjQUFjLEVBQUUscUJBQXFCLENBQUMsY0FBYyxDQUFDO0tBQ3RDLENBQUM7QUFDcEIsQ0FBQyxDQUFDIn0= |
@@ -1,46 +0,37 @@ | ||
import { Component, Binder, View } from "@ribajs/core"; | ||
import { Component } from "@ribajs/core"; | ||
import { Langcode } from "../../interfaces"; | ||
import { ALocalesService } from "../../services/locales-base.service"; | ||
export interface Scope { | ||
langcodes: Langcode[]; | ||
switch: AI18nSwitcherComponent["switch"]; | ||
toggle: AI18nSwitcherComponent["toggle"]; | ||
ready: boolean; | ||
} | ||
export declare abstract class AI18nSwitcherComponent extends Component { | ||
protected abstract localesService: ALocalesService; | ||
protected scope: { | ||
langcodes: Langcode[]; | ||
switch: ( | ||
langcode: Langcode, | ||
context?: Binder<any> | undefined, | ||
event?: Event | undefined | ||
) => void; | ||
toggle: ( | ||
context?: Binder<any> | undefined, | ||
event?: Event | undefined | ||
) => void; | ||
switch: AI18nSwitcherComponent["switch"]; | ||
toggle: AI18nSwitcherComponent["toggle"]; | ||
ready: boolean; | ||
}; | ||
constructor(element?: HTMLElement); | ||
/** | ||
* Switch to language by langcode | ||
* @param langcode | ||
* @param event | ||
*/ | ||
switch(langcode: Langcode, context?: Binder<any>, event?: Event): void; | ||
/** | ||
* Toggle language, makes only sense if you have only two languages | ||
* @param langcode | ||
* @param event | ||
*/ | ||
toggle(context?: Binder<any>, event?: Event): void; | ||
protected init( | ||
observedAttributes: string[] | ||
): Promise<View | null | undefined>; | ||
protected initLocales(langcode: string): Promise<Langcode[]>; | ||
protected setLangcode(langcode: string): void; | ||
protected requiredAttributes(): never[]; | ||
protected disconnectedCallback(): void; | ||
protected template(): null; | ||
} | ||
export declare abstract class AI18nSwitcherComponent extends Component { | ||
protected abstract localesService: ALocalesService; | ||
protected scope: { | ||
langcodes: Langcode[]; | ||
switch: (langcode: Langcode, event?: Event | undefined) => void; | ||
toggle: (event?: Event | undefined) => void; | ||
ready: boolean; | ||
}; | ||
constructor(element?: HTMLElement); | ||
/** | ||
* Switch to language by langcode | ||
* @param langcode | ||
* @param event | ||
*/ | ||
switch(langcode: Langcode, event?: Event): void; | ||
/** | ||
* Toggle language, makes only sense if you have only two languages | ||
* @param langcode | ||
* @param event | ||
*/ | ||
toggle(event?: Event): void; | ||
protected init(observedAttributes: string[]): Promise<null | undefined>; | ||
protected initLocales(langcode: string): Promise<Langcode[]>; | ||
protected setLangcode(langcode: string): void; | ||
protected requiredAttributes(): never[]; | ||
protected disconnectedCallback(): void; | ||
protected template(): null; | ||
} |
@@ -1,106 +0,103 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const core_1 = require("@ribajs/core"); | ||
class AI18nSwitcherComponent extends core_1.Component { | ||
constructor(element) { | ||
super(element); | ||
this.scope = { | ||
langcodes: [], | ||
switch: this.switch, | ||
toggle: this.toggle, | ||
ready: false, | ||
}; | ||
} | ||
/** | ||
* Switch to language by langcode | ||
* @param langcode | ||
* @param event | ||
*/ | ||
switch(langcode, context, event) { | ||
if (event) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
import { Component } from "@ribajs/core"; | ||
export class AI18nSwitcherComponent extends Component { | ||
constructor(element) { | ||
super(element); | ||
this.scope = { | ||
langcodes: [], | ||
switch: this.switch, | ||
toggle: this.toggle, | ||
ready: false, | ||
}; | ||
} | ||
if (!langcode.active) { | ||
this.setLangcode(langcode.code); | ||
/** | ||
* Switch to language by langcode | ||
* @param langcode | ||
* @param event | ||
*/ | ||
switch(langcode, event) { | ||
if (event) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
} | ||
if (!langcode.active) { | ||
this.setLangcode(langcode.code); | ||
} | ||
} | ||
} | ||
/** | ||
* Toggle language, makes only sense if you have only two languages | ||
* @param langcode | ||
* @param event | ||
*/ | ||
toggle(context, event) { | ||
if (event) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
/** | ||
* Toggle language, makes only sense if you have only two languages | ||
* @param langcode | ||
* @param event | ||
*/ | ||
toggle(event) { | ||
if (event) { | ||
event.preventDefault(); | ||
event.stopPropagation(); | ||
} | ||
for (const i in this.scope.langcodes) { | ||
if (Object.prototype.hasOwnProperty.call(this.scope.langcodes, i)) { | ||
if (this.scope.langcodes[i].active !== true) { | ||
this.setLangcode(this.scope.langcodes[i].code); | ||
return; | ||
} | ||
} | ||
} | ||
} | ||
for (const i in this.scope.langcodes) { | ||
if (this.scope.langcodes.hasOwnProperty(i)) { | ||
if (this.scope.langcodes[i].active !== true) { | ||
this.setLangcode(this.scope.langcodes[i].code); | ||
return; | ||
async init(observedAttributes) { | ||
if (this.localesService.ready) { | ||
const langcode = this.localesService.getLangcode(); | ||
if (langcode) { | ||
return this.initLocales(langcode).then(() => { | ||
return super.init(observedAttributes); | ||
}); | ||
} | ||
} | ||
} | ||
return new Promise((resolve) => { | ||
this.localesService.event.on("ready", (langcode /*, translationNeeded: boolean*/) => { | ||
return this.initLocales(langcode).then(( /*langcodes*/) => { | ||
return super.init(observedAttributes).then((view) => { | ||
resolve(view); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
async init(observedAttributes) { | ||
if (this.localesService.ready) { | ||
const langcode = this.localesService.getLangcode(); | ||
if (langcode) { | ||
return this.initLocales(langcode).then((langcodes) => { | ||
return super.init(observedAttributes); | ||
async initLocales(langcode) { | ||
// set avaible langcodes | ||
return this.localesService | ||
.getAvailableLangcodes() | ||
.then((langcodes) => { | ||
this.scope.langcodes = langcodes; | ||
// set active langcodes | ||
this.scope.langcodes.forEach((langCode) => { | ||
langCode.active = langCode.code === langcode; | ||
}); | ||
return this.scope.langcodes; | ||
}) | ||
.then((langcodes) => { | ||
this.localesService.event.on("changed", (changedLangcode /*, initial: boolean*/) => { | ||
// Activate localcode and disable the other | ||
this.scope.langcodes.forEach((langCode) => { | ||
langCode.active = langCode.code === changedLangcode; | ||
}); | ||
}); | ||
return langcodes; | ||
}) | ||
.then((langcodes) => { | ||
this.scope.ready = true; | ||
return langcodes; | ||
}); | ||
} | ||
} | ||
return new Promise((resolve, reject) => { | ||
this.localesService.event.on("ready", (langcode, translationNeeded) => { | ||
this.initLocales(langcode).then((langcodes) => { | ||
super.init(observedAttributes).then((view) => { | ||
resolve(view); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} | ||
async initLocales(langcode) { | ||
// set avaible langcodes | ||
return this.localesService | ||
.getAvailableLangcodes() | ||
.then((langcodes) => { | ||
this.scope.langcodes = langcodes; | ||
// set active langcodes | ||
this.scope.langcodes.forEach((langCode) => { | ||
langCode.active = langCode.code === langcode; | ||
}); | ||
return this.scope.langcodes; | ||
}) | ||
.then((langcodes) => { | ||
this.localesService.event.on("changed", (changedLangcode, initial) => { | ||
// Activate localcode and disable the other | ||
this.scope.langcodes.forEach((langCode) => { | ||
langCode.active = langCode.code === changedLangcode; | ||
}); | ||
}); | ||
return langcodes; | ||
}) | ||
.then((langcodes) => { | ||
this.scope.ready = true; | ||
return langcodes; | ||
}); | ||
} | ||
setLangcode(langcode) { | ||
this.localesService.setLangcode(langcode); | ||
} | ||
requiredAttributes() { | ||
return []; | ||
} | ||
disconnectedCallback() { | ||
super.disconnectedCallback(); | ||
} | ||
template() { | ||
return null; | ||
} | ||
setLangcode(langcode) { | ||
this.localesService.setLangcode(langcode); | ||
} | ||
requiredAttributes() { | ||
return []; | ||
} | ||
disconnectedCallback() { | ||
super.disconnectedCallback(); | ||
} | ||
template() { | ||
return null; | ||
} | ||
} | ||
exports.AI18nSwitcherComponent = AI18nSwitcherComponent; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpdGNoZXIuYWJzdHJhY3QuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvYWJzdHJhY3Qtc3dpdGNoZXIvc3dpdGNoZXIuYWJzdH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UFBSSxDQUFDLEtBQUssQ0FBQyxLQUFLLEdBQUcsSUFBSSxDQUFDO1lBQ3hCLE9BQU8sU0FBUyxDQUFDO1FBQ25CLENBQUMsQ0FBQyxDQUFDO0lBQ1AsQ0FBQztJQUVTLFdBQVcsQ0FBQyxRQUFnQjtRQUNwQyxJQUFJLENBQUMsY0FBYyxDQUFDLFdBQVcsQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUM1QyxDQUFDO0lBRVMsa0JBQWtCO1FBQzFCLE9BQU8sRUFBRSxDQUFDO0lBQ1osQ0FBQztJQUVTLG9CQUFvQjtRQUM1QixLQUFLLENBQUMsb0JBQW9CLEVBQUUsQ0FBQztJQUMvQixDQUFDO0lBRVMsUUFBUTtRQUNoQixPQUFPLElBQUksQ0FBQztJQUNkLENBQUM7Q0FDRiJ9 |
@@ -1,14 +0,10 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var switcher_abstract_component_1 = require("./abstract-switcher/switcher.abstract.component"); | ||
exports.AI18nSwitcherComponent = | ||
switcher_abstract_component_1.AI18nSwitcherComponent; | ||
const switcher_component_1 = require("./switcher/switcher.component"); | ||
exports.default = (localesService) => { | ||
return { | ||
i18nSwitcherComponent: switcher_component_1.i18nSwitcherComponentWrapper( | ||
localesService | ||
), | ||
}; | ||
export { AI18nSwitcherComponent } from "./abstract-switcher/switcher.abstract.component"; | ||
import { i18nSwitcherComponentWrapper } from "./switcher/switcher.component"; | ||
import { i18nShareComponentWrapper } from "./share/share.component"; | ||
export default (localesService) => { | ||
return { | ||
I18nSwitcherComponent: i18nSwitcherComponentWrapper(localesService), | ||
I18nShareComponent: i18nShareComponentWrapper(localesService), | ||
}; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29tcG9uZW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLCtGQUF5RjtBQUFoRiwrREFBQSxzQkFBc0IsQ0FBQTtBQUMvQixzRUFBNkU7QUFJN0Usa0JBQWUsQ0FBQyxjQUErQixFQUFjLEVBQUU7SUFDN0QsT0FBTztRQUNMLHFCQUFxQixFQUFFLGlEQUE0QixDQUFDLGNBQWMsQ0FBQztLQUNwRSxDQUFDO0FBQ0osQ0FBQyxDQUFDIn0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29tcG9uZW50cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsc0JBQXNCLEVBQUUsTUFBTSxpREFBaUQsQ0FBQztBQUN6RixPQUFPLEVBQUUsNEJBQTRCLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUM3RSxPQUFPLEVBQUUseUJBQXlCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUlwRSxlQUFlLENBQUMsY0FBK0IsRUFBYyxFQUFFO0lBQzdELE9BQU87UUFDTCxxQkFBcUIsRUFBRSw0QkFBNEIsQ0FBQyxjQUFjLENBQUM7UUFDbkUsa0JBQWtCLEVBQUUseUJBQXlCLENBQUMsY0FBYyxDQUFDO0tBQzlELENBQUM7QUFDSixDQUFDLENBQUMifQ== |
import { TypeOfComponent } from "@ribajs/core"; | ||
import { AI18nSwitcherComponent } from "../abstract-switcher/switcher.abstract.component"; | ||
import { ALocalesService } from "../../services/locales-base.service"; | ||
export declare const i18nSwitcherComponentWrapper: ( | ||
localesService: ALocalesService | ||
) => TypeOfComponent<AI18nSwitcherComponent>; | ||
export declare const i18nSwitcherComponentWrapper: (localesService: ALocalesService) => TypeOfComponent<AI18nSwitcherComponent>; |
@@ -1,55 +0,53 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const switcher_abstract_component_1 = require("../abstract-switcher/switcher.abstract.component"); | ||
exports.i18nSwitcherComponentWrapper = (localesService) => { | ||
var _a; | ||
return ( | ||
(_a = class I18nSwitcherComponent extends switcher_abstract_component_1.AI18nSwitcherComponent { | ||
constructor(element) { | ||
super(element); | ||
this.localesService = localesService; | ||
this.scope = { | ||
langcodes: [], | ||
switch: this.switch, | ||
toggle: this.toggle, | ||
ready: false, | ||
}; | ||
this.init(I18nSwitcherComponent.observedAttributes); | ||
} | ||
static get observedAttributes() { | ||
return []; | ||
} | ||
/** | ||
* Switch to language by langcode | ||
* @param langcode | ||
* @param event | ||
*/ | ||
switch(langcode, context, event) { | ||
return super.switch(langcode, context, event); | ||
} | ||
/** | ||
* Toggle language, makes only sense if you have only two languages | ||
* @param langcode | ||
* @param event | ||
*/ | ||
toggle(context, event) { | ||
return super.toggle(context, event); | ||
} | ||
setLangcode(langcode) { | ||
return super.setLangcode(langcode); | ||
} | ||
requiredAttributes() { | ||
return []; | ||
} | ||
disconnectedCallback() { | ||
super.disconnectedCallback(); | ||
} | ||
template() { | ||
return null; | ||
} | ||
}), | ||
(_a.tagName = "i18n-switcher"), | ||
_a | ||
); | ||
import { AI18nSwitcherComponent } from "../abstract-switcher/switcher.abstract.component"; | ||
export const i18nSwitcherComponentWrapper = (localesService) => { | ||
var _a; | ||
return _a = class I18nSwitcherComponent extends AI18nSwitcherComponent { | ||
constructor(element) { | ||
super(element); | ||
this._debug = false; | ||
this.localesService = localesService; | ||
this.scope = { | ||
langcodes: [], | ||
switch: this.switch, | ||
toggle: this.toggle, | ||
ready: false, | ||
}; | ||
this.init(I18nSwitcherComponent.observedAttributes); | ||
} | ||
static get observedAttributes() { | ||
return []; | ||
} | ||
/** | ||
* Switch to language by langcode | ||
* @param langcode | ||
* @param event | ||
*/ | ||
switch(langcode, event) { | ||
this.debug("switch", langcode); | ||
return super.switch(langcode, event); | ||
} | ||
/** | ||
* Toggle language, makes only sense if you have only two languages | ||
* @param langcode | ||
* @param event | ||
*/ | ||
toggle(event) { | ||
return super.toggle(event); | ||
} | ||
setLangcode(langcode) { | ||
return super.setLangcode(langcode); | ||
} | ||
requiredAttributes() { | ||
return []; | ||
} | ||
disconnectedCallback() { | ||
super.disconnectedCallback(); | ||
} | ||
template() { | ||
return null; | ||
} | ||
}, | ||
_a.tagName = "i18n-switcher", | ||
_a; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpdGNoZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc3dpdGNoZXIvc3dpdGNoZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0Esa0dBQTBGO0FBSTdFLFFBQUEsNEJBQTRCLEdBQUcsQ0FBQyxjQUErQixFQUEyQyxFQUFFOztJQUV2SCxZQUFPLE1BQU0scUJBQXNCLFNBQVEsb0RBQXNCO1lBaUIvRCxZQUFZLE9BQXFCO2dCQUMvQixLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7Z0JBVlAsbUJBQWMsR0FBRyxjQUFjLENBQUM7Z0JBRWhDLFVBQUssR0FBRztvQkFDaEIsU0FBUyxFQUFlLEVBQUU7b0JBQzFCLE1BQU0sRUFBRSxJQUFJLENBQUMsTUFBTTtvQkFDbkIsTUFBTSxFQUFFLElBQUksQ0FBQyxNQUFNO29CQUNuQixLQUFLLEVBQVksS0FBSztpQkFDdkIsQ0FBQztnQkFJQSxJQUFJLENBQUMsSUFBSSxDQUFDLHFCQUFxQixDQUFDLGtCQUFrQixDQUFDLENBQUM7WUFDdEQsQ0FBQztZQWhCRCxNQUFNLEtBQUssa0JBQWtCO2dCQUMzQixPQUFPLEVBQUUsQ0FBQztZQUNaLENBQUM7WUFnQkQ7Ozs7ZUFJRztZQUNJLE1BQU0sQ0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UIsS0FBSyxDQUFDLG9CQUFvQixFQUFFLENBQUM7WUFDL0IsQ0FBQztZQUVTLFFBQVE7Z0JBQ2hCLE9BQU8sSUFBSSxDQUFDO1lBQ2QsQ0FBQztTQUNGO1FBeERlLFVBQU8sR0FBRyxlQUFnQjtXQXdEeEM7QUFDSixDQUFDLENBQUMifQ== |
@@ -1,9 +0,7 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const t_formatter_1 = require("./t.formatter"); | ||
exports.default = (localesService) => { | ||
return { | ||
t: t_formatter_1.tFormatterWrapper(localesService), | ||
}; | ||
import { tFormatterWrapper } from "./t.formatter"; | ||
export default (localesService) => { | ||
return { | ||
t: tFormatterWrapper(localesService), | ||
}; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZm9ybWF0dGVycy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLCtDQUFrRDtBQUlsRCxrQkFBZSxDQUFDLGNBQStCLEVBQWMsRUFBRTtJQUM3RCxPQUFPO1FBQ0wsQ0FBQyxFQUFFLCtCQUFpQixDQUFDLGNBQWMsQ0FBQztLQUNyQyxDQUFDO0FBQ0osQ0FBQyxDQUFDIn0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZm9ybWF0dGVycy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFJbEQsZUFBZSxDQUFDLGNBQStCLEVBQWMsRUFBRTtJQUM3RCxPQUFPO1FBQ0wsQ0FBQyxFQUFFLGlCQUFpQixDQUFDLGNBQWMsQ0FBQztLQUNyQyxDQUFDO0FBQ0osQ0FBQyxDQUFDIn0= |
import { Formatter } from "@ribajs/core"; | ||
import { ALocalesService } from "../services/locales-base.service"; | ||
export declare const tFormatterWrapper: ( | ||
localesService: ALocalesService | ||
) => Formatter; | ||
export declare const tFormatterWrapper: (localesService: ALocalesService) => Formatter; |
@@ -1,55 +0,51 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const translate = async (translateMePathString, localesService, langcode) => { | ||
const properties = translateMePathString.split("."); | ||
if (!langcode) { | ||
langcode = localesService.getLangcode(); | ||
const properties = translateMePathString.split("."); | ||
if (!langcode) { | ||
return null; | ||
langcode = localesService.getLangcode(); | ||
if (!langcode) { | ||
return null; | ||
} | ||
} | ||
} | ||
return localesService | ||
.get([langcode, ...properties] /*, vars */) | ||
.then((locale) => { | ||
return locale; | ||
return localesService | ||
.get([langcode, ...properties] /*, vars */) | ||
.then((locale) => { | ||
return locale; | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
}; | ||
exports.tFormatterWrapper = (localesService) => { | ||
return { | ||
name: "t", | ||
read(translateMePathString, langcode, ...vars) { | ||
return new Promise((resolve, reject) => { | ||
localesService.event.on("changed", () => { | ||
// console.debug('changed'); | ||
translate(translateMePathString, localesService, langcode) | ||
.then((locale) => { | ||
resolve(locale); | ||
}) | ||
.catch((error) => { | ||
reject(error); | ||
export const tFormatterWrapper = (localesService) => { | ||
return { | ||
name: "t", | ||
read(translateMePathString, langcode /*, ...vars: string[]*/) { | ||
return new Promise((resolve, reject) => { | ||
localesService.event.on("changed", () => { | ||
// console.debug('changed'); | ||
translate(translateMePathString, localesService, langcode) | ||
.then((locale) => { | ||
resolve(locale); | ||
}) | ||
.catch((error) => { | ||
reject(error); | ||
}); | ||
}); | ||
localesService.event.on("ready", () => { | ||
translate(translateMePathString, localesService, langcode) | ||
.then((locale) => { | ||
resolve(locale); | ||
}) | ||
.catch((error) => { | ||
reject(error); | ||
}); | ||
}); | ||
if (localesService.ready) { | ||
translate(translateMePathString, localesService, langcode).then((locale) => { | ||
resolve(locale); | ||
}); | ||
} | ||
}); | ||
}); | ||
localesService.event.on("ready", () => { | ||
translate(translateMePathString, localesService, langcode) | ||
.then((locale) => { | ||
resolve(locale); | ||
}) | ||
.catch((error) => { | ||
reject(error); | ||
}); | ||
}); | ||
if (localesService.ready) { | ||
translate(translateMePathString, localesService, langcode).then( | ||
(locale) => { | ||
resolve(locale); | ||
} | ||
); | ||
} | ||
}); | ||
}, | ||
}; | ||
}, | ||
}; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidC5mb3JtYXR0ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZm9ybWF0dGVycy90LmZvcm1hdHRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUdBLE1BQU0sU0FBUyxHQUFHLEtBQUssRUFBRSxxQkFBNkIsRUFBRSxjQUErQixFQUFFLFFBQWlCLEVBQUUsRUFBRTtJQUM1RyxNQUFNLFVBQVUsR0FBRyxxQkFBcUIsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDcEQsSUFBSSxDQUFDLFFBQVEsRUFBRTtRQUNiLFFBQVEsR0FBRyxjQUFjLENBQUMsV0FBVyxFQUFFLENBQUM7UUFDeEMsSUFBSSxDQUFDLFFBQVEsRUFBRTtZQUNiLE9BQU8sSUFBSSxDQUFDO1NBQ2I7S0FDRjtJQUNELE9BQU8sY0FBYyxDQUFDLEdBQUcsQ0FBQyxDQUFDLFFBQVEsRUFBRSxHQUFHLFVBQVUsQ0FBQyxDQUFBLFdBQVcsQ0FBQztTQUM5RCxJQUFJLENBQUMsQ0FBQyxNQUFjLEVBQUUsRUFBRTtRQUN2QixPQUFPLE1BQU0sQ0FBQztJQUNo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QUFPLEVBQUUsR0FBRyxFQUFFO29CQUNwQyxTQUFTLENBQUMscUJBQXFCLEVBQUUsY0FBYyxFQUFFLFFBQVEsQ0FBQzt5QkFDdkQsSUFBSSxDQUFDLENBQUMsTUFBTSxFQUFFLEVBQUU7d0JBQ2YsT0FBTyxDQUFDLE1BQWEsQ0FBQyxDQUFDO29CQUN6QixDQUFDLENBQUM7eUJBQ0QsS0FBSyxDQUFDLENBQUMsS0FBWSxFQUFFLEVBQUU7d0JBQ3RCLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQztvQkFDaEIsQ0FBQyxDQUFDLENBQUM7Z0JBQ1AsQ0FBQyxDQUFDLENBQUM7Z0JBRUgsSUFBSSxjQUFjLENBQUMsS0FBSyxFQUFFO29CQUN4QixTQUFTLENBQUMscUJBQXFCLEVBQUUsY0FBYyxFQUFFLFFBQVEsQ0FBQyxDQUFDLElBQUksQ0FDN0QsQ0FBQyxNQUFNLEVBQUUsRUFBRTt3QkFDVCxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7b0JBQ2xCLENBQUMsQ0FDRixDQUFDO2lCQUNIO1lBQ0gsQ0FBQyxDQUFDLENBQUM7UUFDTCxDQUFDO0tBQ1csQ0FBQztBQUNqQixDQUFDLENBQUMifQ== |
@@ -1,2 +0,1 @@ | ||
import { RibaModule } from "@ribajs/core"; | ||
export * from "./binders"; | ||
@@ -7,6 +6,2 @@ export * from "./components"; | ||
export * from "./services"; | ||
import * as services from "./services"; | ||
export declare const i18nModule: ( | ||
localesService: services.ALocalesService | ||
) => RibaModule; | ||
export default i18nModule; | ||
export * from "./i18n.module"; |
@@ -1,39 +0,7 @@ | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __importDefault = | ||
(this && this.__importDefault) || | ||
function (mod) { | ||
return mod && mod.__esModule ? mod : { default: mod }; | ||
}; | ||
var __importStar = | ||
(this && this.__importStar) || | ||
function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) | ||
for (var k in mod) | ||
if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./binders")); | ||
__export(require("./components")); | ||
__export(require("./formatters")); | ||
__export(require("./services")); | ||
const binders_1 = __importDefault(require("./binders")); | ||
const formatters_1 = __importDefault(require("./formatters")); | ||
const components_1 = __importDefault(require("./components")); | ||
const services = __importStar(require("./services")); | ||
exports.i18nModule = (localesService) => { | ||
return { | ||
binders: binders_1.default(localesService), | ||
components: components_1.default(localesService), | ||
formatters: formatters_1.default(localesService), | ||
services, | ||
}; | ||
}; | ||
exports.default = exports.i18nModule; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O0FBRUEsK0JBQTBCO0FBQzFCLGtDQUE2QjtBQUM3QixrQ0FBNkI7QUFFN0IsZ0NBQTJCO0FBRTNCLHdEQUF1QztBQUN2Qyw4REFBNkM7QUFDN0MsOERBQTZDO0FBQzdDLHFEQUF1QztBQUUxQixRQUFBLFVBQVUsR0FBRyxDQUFDLGNBQXdDLEVBQWMsRUFBRTtJQUNqRixPQUFPO1FBQ0wsT0FBTyxFQUFFLGlCQUFjLENBQUMsY0FBYyxDQUFDO1FBQ3ZDLFVBQVUsRUFBRSxvQkFBaUIsQ0FBQyxjQUFjLENBQUM7UUFDN0MsVUFBVSxFQUFFLG9CQUFpQixDQUFDLGNBQWMsQ0FBQztRQUM3QyxRQUFRO0tBQ1QsQ0FBQztBQUNKLENBQUMsQ0FBQztBQUVGLGtCQUFlLGtCQUFVLENBQUMifQ== | ||
export * from "./binders"; | ||
export * from "./components"; | ||
export * from "./formatters"; | ||
export * from "./interfaces"; | ||
export * from "./services"; | ||
export * from "./i18n.module"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxZQUFZLENBQUM7QUFDM0IsY0FBYyxlQUFlLENBQUMifQ== |
@@ -1,3 +0,3 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW50ZXJmYWNlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0= | ||
export * from "./langcode"; | ||
export * from "./local-var"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW50ZXJmYWNlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLGFBQWEsQ0FBQyJ9 |
export interface Langcode { | ||
code: string; | ||
active: boolean; | ||
code: string; | ||
active: boolean; | ||
} |
@@ -1,3 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFuZ2NvZGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW50ZXJmYWNlcy9sYW5nY29kZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0= | ||
export {}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFuZ2NvZGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW50ZXJmYWNlcy9sYW5nY29kZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0= |
export interface LocalPluralization { | ||
zero?: string; | ||
one?: string; | ||
two?: string; | ||
other?: string; | ||
zero?: string; | ||
one?: string; | ||
two?: string; | ||
other?: string; | ||
} | ||
export interface LocalVar { | ||
[name: string]: string | LocalPluralization; | ||
[name: string]: string | LocalPluralization; | ||
} |
@@ -1,3 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtdmFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ludGVyZmFjZXMvbG9jYWwtdmFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ== | ||
export {}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwtdmFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ludGVyZmFjZXMvbG9jYWwtdmFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ== |
@@ -1,9 +0,4 @@ | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./locales-base.service")); | ||
__export(require("./locales-rest.service")); | ||
__export(require("./locales-static.service")); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VydmljZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSw0Q0FBdUM7QUFDdkMsNENBQXVDO0FBQ3ZDLDhDQUF5QyJ9 | ||
export * from "./locales-base.service"; | ||
export * from "./locales-rest.service"; | ||
export * from "./locales-static.service"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VydmljZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsMEJBQTBCLENBQUMifQ== |
import { EventDispatcher } from "@ribajs/core"; | ||
import { Langcode, LocalPluralization, LocalVar } from "../interfaces"; | ||
export declare abstract class ALocalesService { | ||
doNotTranslateDefaultLanguage: boolean; | ||
get ready(): boolean; | ||
event: EventDispatcher; | ||
showMissingTranslation: boolean; | ||
protected _ready: boolean; | ||
/** | ||
* The current setted langcode | ||
*/ | ||
protected abstract currentLangcode?: string; | ||
/** | ||
* The default theme langcode before any language was choosed | ||
*/ | ||
protected abstract initalLangcode?: string; | ||
constructor( | ||
doNotTranslateDefaultLanguage: boolean, | ||
showMissingTranslation: boolean | ||
); | ||
/** | ||
* Get translation by properties, e.g. `de.form.newsletter_label` | ||
* Properties object must include the language code, e.g. `de`. | ||
* @param properties properties, e.g. `['de', 'form', 'newsletter', 'label']` | ||
* @param force Set this to true if you want to force the request also if the service is not ready, you should use this only one the time | ||
*/ | ||
get(properties?: string[], vars?: LocalVar, force?: boolean): Promise<any>; | ||
/** | ||
* Get translation by properties, e.g. `form.newsletter_label` | ||
* Properties object must not include the language code. | ||
* @param properties properties, e.g. `[form', 'newsletter', 'label']` | ||
*/ | ||
getByCurrentLang(properties?: string[], vars?: LocalVar): Promise<any>; | ||
getBrowserLangcode(): any; | ||
getHTMLLangcode(): string; | ||
/** | ||
* Get the current langcode, | ||
* if lang was not choosed this is the langcode of the lang attribute of the html element. | ||
* If the language was changed this returns the changed language | ||
*/ | ||
getLangcode(): string | undefined; | ||
getInitialLangcode(): string | undefined; | ||
setLangcode(langcode: string, initial?: boolean): void; | ||
getAvailableLangcodes(): Promise<Langcode[]>; | ||
/** | ||
* Parse templates wich can be used to set variables on language strings | ||
*/ | ||
parseTemplateVars(el: HTMLElement): LocalVar; | ||
/** | ||
* Parse templates wich have his own translations | ||
*/ | ||
parseLocalVars(el: HTMLElement): LocalVar; | ||
/** | ||
* Replace variables on translated string | ||
* @param translateString | ||
* @param vars | ||
*/ | ||
setTranslateStringVars(translateString: string, vars: LocalVar): string; | ||
/** | ||
* Get file with all languages | ||
*/ | ||
protected abstract getAll(): Promise<any>; | ||
protected init(): Promise<any>; | ||
/** | ||
* see https://help.shopify.com/en/themes/development/theme-store-requirements/internationalizing/translation-filter#pluralization-in-translation-keys | ||
* @param translateString | ||
* @param vars | ||
*/ | ||
protected setTranslateStringPluralization( | ||
translateObj: LocalPluralization | string, | ||
vars: LocalVar | ||
): string; | ||
doNotTranslateDefaultLanguage: boolean; | ||
get ready(): boolean; | ||
event: EventDispatcher; | ||
showMissingTranslation: boolean; | ||
protected _ready: boolean; | ||
/** | ||
* The current setted langcode | ||
*/ | ||
protected abstract currentLangcode?: string; | ||
/** | ||
* The default theme langcode before any language was choosed | ||
*/ | ||
protected abstract initalLangcode?: string; | ||
constructor(doNotTranslateDefaultLanguage: boolean, showMissingTranslation: boolean); | ||
/** | ||
* Get translation by properties, e.g. `de.form.newsletter_label` | ||
* Properties object must include the language code, e.g. `de`. | ||
* @param properties properties, e.g. `['de', 'form', 'newsletter', 'label']` | ||
* @param force Set this to true if you want to force the request also if the service is not ready, you should use this only one the time | ||
*/ | ||
get(properties?: string[], vars?: LocalVar, force?: boolean): Promise<any>; | ||
/** | ||
* Get translation by properties, e.g. `form.newsletter_label` | ||
* Properties object must not include the language code. | ||
* @param properties properties, e.g. `[form', 'newsletter', 'label']` | ||
*/ | ||
getByCurrentLang(properties?: string[], vars?: LocalVar): Promise<any>; | ||
getBrowserLangcode(): any; | ||
getHTMLLangcode(): string; | ||
/** | ||
* Get the current langcode, | ||
* if lang was not choosed this is the langcode of the lang attribute of the html element. | ||
* If the language was changed this returns the changed language | ||
*/ | ||
getLangcode(): string | undefined; | ||
getInitialLangcode(): string | undefined; | ||
setLangcode(langcode: string, initial?: boolean): void; | ||
getAvailableLangcodes(): Promise<Langcode[]>; | ||
/** | ||
* Parse templates wich can be used to set variables on language strings | ||
*/ | ||
parseTemplateVars(el: HTMLElement): LocalVar; | ||
/** | ||
* Parse templates wich have his own translations | ||
*/ | ||
parseLocalVars(el: HTMLElement): LocalVar; | ||
/** | ||
* Replace variables on translated string | ||
* @param translateString | ||
* @param vars | ||
*/ | ||
setTranslateStringVars(translateString: string, vars: LocalVar): string; | ||
/** | ||
* Get file with all languages | ||
*/ | ||
protected abstract getAll(): Promise<any>; | ||
protected init(): Promise<any>; | ||
/** | ||
* see https://help.shopify.com/en/themes/development/theme-store-requirements/internationalizing/translation-filter#pluralization-in-translation-keys | ||
* @param translateString | ||
* @param vars | ||
*/ | ||
protected setTranslateStringPluralization(translateObj: LocalPluralization | string, vars: LocalVar): string; | ||
} |
@@ -1,263 +0,245 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const core_1 = require("@ribajs/core"); | ||
class ALocalesService { | ||
constructor(doNotTranslateDefaultLanguage, showMissingTranslation) { | ||
this.doNotTranslateDefaultLanguage = doNotTranslateDefaultLanguage; | ||
this.event = new core_1.EventDispatcher("i18n"); | ||
this.showMissingTranslation = false; | ||
this._ready = false; | ||
this.doNotTranslateDefaultLanguage = doNotTranslateDefaultLanguage; | ||
this.showMissingTranslation = showMissingTranslation; | ||
} | ||
get ready() { | ||
return this._ready; | ||
} | ||
/** | ||
* Get translation by properties, e.g. `de.form.newsletter_label` | ||
* Properties object must include the language code, e.g. `de`. | ||
* @param properties properties, e.g. `['de', 'form', 'newsletter', 'label']` | ||
* @param force Set this to true if you want to force the request also if the service is not ready, you should use this only one the time | ||
*/ | ||
async get(properties, vars, force = false) { | ||
if (!this.ready && !force) { | ||
throw new Error("not ready"); | ||
import { EventDispatcher } from "@ribajs/core"; | ||
import { clone } from "@ribajs/utils/src/type"; | ||
export class ALocalesService { | ||
constructor(doNotTranslateDefaultLanguage, showMissingTranslation) { | ||
this.doNotTranslateDefaultLanguage = doNotTranslateDefaultLanguage; | ||
this.event = new EventDispatcher("i18n"); | ||
this.showMissingTranslation = false; | ||
this._ready = false; | ||
this.doNotTranslateDefaultLanguage = doNotTranslateDefaultLanguage; | ||
this.showMissingTranslation = showMissingTranslation; | ||
} | ||
return ( | ||
this.getAll() | ||
// extract properties | ||
.then((locals) => { | ||
if (properties && properties.length) { | ||
let local = core_1.Utils.clone(true, locals); | ||
for (const property of properties) { | ||
if (!property) { | ||
return; | ||
} | ||
if (local[property]) { | ||
local = local[property]; | ||
} else { | ||
return null; | ||
} | ||
get ready() { | ||
return this._ready; | ||
} | ||
/** | ||
* Get translation by properties, e.g. `de.form.newsletter_label` | ||
* Properties object must include the language code, e.g. `de`. | ||
* @param properties properties, e.g. `['de', 'form', 'newsletter', 'label']` | ||
* @param force Set this to true if you want to force the request also if the service is not ready, you should use this only one the time | ||
*/ | ||
async get(properties, vars, force = false) { | ||
if (!this.ready && !force) { | ||
throw new Error("not ready"); | ||
} | ||
return (this.getAll() | ||
// extract properties | ||
.then((locals) => { | ||
if (properties && properties.length) { | ||
let local = clone(true, locals); | ||
for (const property of properties) { | ||
if (!property) { | ||
return; | ||
} | ||
if (local[property]) { | ||
local = local[property]; | ||
} | ||
else { | ||
return null; | ||
} | ||
} | ||
return local; | ||
} | ||
return locals; | ||
}) | ||
.then((local) => { | ||
if (local === null && properties) { | ||
console.warn(`WARNING translation missing: "${properties.join(".")}"`, local, properties); | ||
} | ||
return local; | ||
} | ||
return locals; | ||
}) | ||
.then((local) => { | ||
if (local === null && properties) { | ||
console.warn( | ||
`WARNING translation missing: "${properties.join(".")}"`, | ||
local, | ||
properties | ||
); | ||
} | ||
return local; | ||
// Replace variables in local string if vars are set | ||
.then((local) => { | ||
if (vars) { | ||
local = this.setTranslateStringPluralization(local, vars); | ||
local = this.setTranslateStringVars(local, vars); | ||
} | ||
return local; | ||
}) | ||
// Replace variables in local string if vars are set | ||
.then((local) => { | ||
if (vars) { | ||
local = this.setTranslateStringPluralization(local, vars); | ||
local = this.setTranslateStringVars(local, vars); | ||
} | ||
return local; | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
this._ready = false; | ||
return error; | ||
}) | ||
); | ||
} | ||
/** | ||
* Get translation by properties, e.g. `form.newsletter_label` | ||
* Properties object must not include the language code. | ||
* @param properties properties, e.g. `[form', 'newsletter', 'label']` | ||
*/ | ||
async getByCurrentLang(properties = [], vars) { | ||
const langcode = this.getLangcode(); | ||
if (!langcode) { | ||
throw new Error("Langcode not found in html tag"); | ||
.catch((error) => { | ||
console.error(error); | ||
this._ready = false; | ||
return error; | ||
})); | ||
} | ||
return this.get([langcode, ...properties], vars); | ||
} | ||
getBrowserLangcode() { | ||
const lang = navigator.language || navigator.userLanguage; | ||
const simplified = lang.split("-")[0].toLowerCase(); | ||
return simplified; | ||
} | ||
getHTMLLangcode() { | ||
const langcode = document.documentElement | ||
? document.documentElement.lang | ||
: "en"; | ||
return langcode; | ||
} | ||
/** | ||
* Get the current langcode, | ||
* if lang was not choosed this is the langcode of the lang attribute of the html element. | ||
* If the language was changed this returns the changed language | ||
*/ | ||
getLangcode() { | ||
return this.currentLangcode; | ||
} | ||
getInitialLangcode() { | ||
return this.initalLangcode; | ||
} | ||
setLangcode(langcode, initial = false) { | ||
if (this.currentLangcode !== langcode) { | ||
this.currentLangcode = langcode; | ||
// $('html').attr('lang', langcode); | ||
if (document.documentElement) { | ||
document.documentElement.lang = langcode; | ||
} | ||
this.event.trigger("changed", langcode, initial); | ||
/** | ||
* Get translation by properties, e.g. `form.newsletter_label` | ||
* Properties object must not include the language code. | ||
* @param properties properties, e.g. `[form', 'newsletter', 'label']` | ||
*/ | ||
async getByCurrentLang(properties = [], vars) { | ||
const langcode = this.getLangcode(); | ||
if (!langcode) { | ||
throw new Error("Langcode not found in html tag"); | ||
} | ||
return this.get([langcode, ...properties], vars); | ||
} | ||
} | ||
async getAvailableLangcodes() { | ||
const activeCode = this.getLangcode(); | ||
return this.get(undefined, undefined, true).then((locals) => { | ||
const langcodes = []; | ||
Object.keys(locals).forEach((langcode) => { | ||
langcodes.push({ | ||
code: langcode, | ||
active: langcode === activeCode, | ||
}); | ||
}); | ||
return langcodes; | ||
}); | ||
} | ||
/** | ||
* Parse templates wich can be used to set variables on language strings | ||
*/ | ||
parseTemplateVars(el) { | ||
const templates = el.querySelectorAll("template"); | ||
const vars = {}; | ||
templates.forEach((template) => { | ||
const name = template.getAttribute("name"); | ||
if (name !== null) { | ||
vars[name] = template.innerHTML.trim(); | ||
} | ||
}); | ||
return vars; | ||
} | ||
/** | ||
* Parse templates wich have his own translations | ||
*/ | ||
parseLocalVars(el) { | ||
const templates = el.querySelectorAll("template"); | ||
const vars = {}; | ||
templates.forEach((template) => { | ||
const lang = template.getAttribute("lang"); | ||
if (lang !== null) { | ||
vars[lang] = template.innerHTML.trim(); | ||
} | ||
}); | ||
return vars; | ||
} | ||
/** | ||
* Replace variables on translated string | ||
* @param translateString | ||
* @param vars | ||
*/ | ||
setTranslateStringVars(translateString, vars) { | ||
if ( | ||
!translateString || | ||
Object.keys(vars).length === 0 || | ||
typeof translateString.match !== "function" | ||
) { | ||
return translateString; | ||
getBrowserLangcode() { | ||
const lang = navigator.language || navigator.userLanguage; | ||
const simplified = lang.split("-")[0].toLowerCase(); | ||
return simplified; | ||
} | ||
const matches = translateString.match(/{{\s*?[A-Za-z0-9_-]+\s*?}}/gm); | ||
if (matches) { | ||
for (const match of matches) { | ||
if (match) { | ||
const varName = match.replace(/{{\s*|\s*}}/gm, ""); | ||
if ( | ||
typeof vars[varName] === "string" || | ||
typeof vars[varName] === "number" | ||
) { | ||
translateString = translateString.replace(match, vars[varName]); | ||
} | ||
getHTMLLangcode() { | ||
const langcode = document.documentElement | ||
? document.documentElement.lang | ||
: "en"; | ||
return langcode; | ||
} | ||
/** | ||
* Get the current langcode, | ||
* if lang was not choosed this is the langcode of the lang attribute of the html element. | ||
* If the language was changed this returns the changed language | ||
*/ | ||
getLangcode() { | ||
return this.currentLangcode; | ||
} | ||
getInitialLangcode() { | ||
return this.initalLangcode; | ||
} | ||
setLangcode(langcode, initial = false) { | ||
if (this.currentLangcode !== langcode) { | ||
this.currentLangcode = langcode; | ||
// $('html').attr('lang', langcode); | ||
if (document.documentElement) { | ||
document.documentElement.lang = langcode; | ||
} | ||
this.event.trigger("changed", langcode, initial); | ||
} | ||
} | ||
} | ||
return translateString; | ||
} | ||
async init() { | ||
this.initalLangcode = this.getHTMLLangcode(); | ||
this.currentLangcode = this.initalLangcode; | ||
if (!this.initalLangcode) { | ||
throw new Error( | ||
`The lang attribute on the html element is requred to detect the default theme language: ${this.initalLangcode}` | ||
); | ||
async getAvailableLangcodes() { | ||
const activeCode = this.getLangcode(); | ||
return this.get(undefined, undefined, true).then((locals) => { | ||
const langcodes = []; | ||
Object.keys(locals).forEach((langcode) => { | ||
langcodes.push({ | ||
code: langcode, | ||
active: langcode === activeCode, | ||
}); | ||
}); | ||
return langcodes; | ||
}); | ||
} | ||
// Detect browser language and switch to this language when available | ||
const browserLangcode = this.getBrowserLangcode(); | ||
return this.getAvailableLangcodes() | ||
.then((availableLangcodes) => { | ||
let browserLangFound = false; | ||
for (const availableLangcodeObj of availableLangcodes) { | ||
if (availableLangcodeObj.code === browserLangcode) { | ||
browserLangFound = true; | ||
} | ||
/** | ||
* Parse templates wich can be used to set variables on language strings | ||
*/ | ||
parseTemplateVars(el) { | ||
const templates = el.querySelectorAll("template"); | ||
const vars = {}; | ||
templates.forEach((template) => { | ||
const name = template.getAttribute("name"); | ||
if (name !== null) { | ||
vars[name] = template.innerHTML.trim(); | ||
} | ||
}); | ||
return vars; | ||
} | ||
/** | ||
* Parse templates wich have his own translations | ||
*/ | ||
parseLocalVars(el) { | ||
const templates = el.querySelectorAll("template"); | ||
const vars = {}; | ||
templates.forEach((template) => { | ||
const lang = template.getAttribute("lang"); | ||
if (lang !== null) { | ||
vars[lang] = template.innerHTML.trim(); | ||
} | ||
}); | ||
return vars; | ||
} | ||
/** | ||
* Replace variables on translated string | ||
* @param translateString | ||
* @param vars | ||
*/ | ||
setTranslateStringVars(translateString, vars) { | ||
if (!translateString || | ||
Object.keys(vars).length === 0 || | ||
typeof translateString.match !== "function") { | ||
return translateString; | ||
} | ||
// only switch language if the browser language is not the default language (if doNotTranslateDefaultLanguage is true) | ||
if ( | ||
!this.doNotTranslateDefaultLanguage || | ||
(browserLangFound && browserLangcode !== this.currentLangcode) | ||
) { | ||
this.setLangcode(browserLangcode, true); | ||
const matches = translateString.match(/{{\s*?[A-Za-z0-9_-]+\s*?}}/gm); | ||
if (matches) { | ||
for (const match of matches) { | ||
if (match) { | ||
const varName = match.replace(/{{\s*|\s*}}/gm, ""); | ||
if (typeof vars[varName] === "string" || | ||
typeof vars[varName] === "number") { | ||
translateString = translateString.replace(match, vars[varName]); | ||
} | ||
} | ||
} | ||
} | ||
return availableLangcodes; | ||
}) | ||
.then((availableLangcodes) => { | ||
this._ready = true; | ||
// If the current langcode is not the inital langcode then translation is needed | ||
const translationNeeded = | ||
this.currentLangcode !== this.initalLangcode || | ||
!this.doNotTranslateDefaultLanguage; | ||
this.event.trigger("ready", this.currentLangcode, translationNeeded); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
this._ready = false; | ||
return error; | ||
}); | ||
} | ||
/** | ||
* see https://help.shopify.com/en/themes/development/theme-store-requirements/internationalizing/translation-filter#pluralization-in-translation-keys | ||
* @param translateString | ||
* @param vars | ||
*/ | ||
setTranslateStringPluralization(translateObj, vars) { | ||
if ( | ||
vars.count && | ||
typeof translateObj === "object" && | ||
translateObj !== null | ||
) { | ||
const count = Number(vars.count); | ||
if (count === 0) { | ||
if (translateObj.zero) { | ||
return translateObj.zero; | ||
return translateString; | ||
} | ||
async init() { | ||
this.initalLangcode = this.getHTMLLangcode(); | ||
this.currentLangcode = this.initalLangcode; | ||
if (!this.initalLangcode) { | ||
throw new Error(`The lang attribute on the html element is requred to detect the default theme language: ${this.initalLangcode}`); | ||
} | ||
} else if (count === 1) { | ||
if (translateObj.one) { | ||
return translateObj.one; | ||
// Detect browser language and switch to this language when available | ||
const browserLangcode = this.getBrowserLangcode(); | ||
return this.getAvailableLangcodes() | ||
.then((availableLangcodes) => { | ||
let browserLangFound = false; | ||
for (const availableLangcodeObj of availableLangcodes) { | ||
if (availableLangcodeObj.code === browserLangcode) { | ||
browserLangFound = true; | ||
} | ||
} | ||
// only switch language if the browser language is not the default language (if doNotTranslateDefaultLanguage is true) | ||
if (!this.doNotTranslateDefaultLanguage || | ||
(browserLangFound && browserLangcode !== this.currentLangcode)) { | ||
this.setLangcode(browserLangcode, true); | ||
} | ||
return availableLangcodes; | ||
}) | ||
.then(( /*availableLangcodes*/) => { | ||
this._ready = true; | ||
// If the current langcode is not the inital langcode then translation is needed | ||
const translationNeeded = this.currentLangcode !== this.initalLangcode || | ||
!this.doNotTranslateDefaultLanguage; | ||
this.event.trigger("ready", this.currentLangcode, translationNeeded); | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
this._ready = false; | ||
return error; | ||
}); | ||
} | ||
/** | ||
* see https://help.shopify.com/en/themes/development/theme-store-requirements/internationalizing/translation-filter#pluralization-in-translation-keys | ||
* @param translateString | ||
* @param vars | ||
*/ | ||
setTranslateStringPluralization(translateObj, vars) { | ||
if (vars.count && | ||
typeof translateObj === "object" && | ||
translateObj !== null) { | ||
const count = Number(vars.count); | ||
if (count === 0) { | ||
if (translateObj.zero) { | ||
return translateObj.zero; | ||
} | ||
} | ||
else if (count === 1) { | ||
if (translateObj.one) { | ||
return translateObj.one; | ||
} | ||
} | ||
else if (count === 2) { | ||
if (translateObj.two) { | ||
return translateObj.two; | ||
} | ||
} | ||
} | ||
} else if (count === 2) { | ||
if (translateObj.two) { | ||
return translateObj.two; | ||
if (typeof translateObj === "object" && | ||
translateObj !== null && | ||
translateObj.other) { | ||
return translateObj.other; | ||
} | ||
} | ||
return translateObj; | ||
} | ||
if ( | ||
typeof translateObj === "object" && | ||
translateObj !== null && | ||
translateObj.other | ||
) { | ||
return translateObj.other; | ||
} | ||
return translateObj; | ||
} | ||
} | ||
exports.ALocalesService = ALocalesService; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxlcy1iYXNlLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VydmljZXMvbG9jYWxlcy1iYXNlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx1Q0FBc0Q7QUFHdEQsTUFBc0IsZUFBZTtJQXNCbkMsWUFBbUIsNkJBQXNDLEVBQUUsc0JBQStCO1FBQXZFLGtDQUE2QixHQUE3Qiw2QkFBNkIsQ0FBUztRQWhCbEQsVUFBSyxHQUFHLElBQUksc0JBQWUsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUVwQywyQkFBc0IsR0FBWSxLQUFLLENBQUM7UUFFckMsV0FBTSxHQUFZLEtBQUssQ0FBQztRQWFoQyxJQUFJLENBQUMsNkJBQTZCLEdBQUcsNkJBQTZCLENBQUM7UUFDbkUsSUFBSSxDQUFDLHNCQUFz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DQUFDLE1BQU0sR0FBRyxLQUFLLENBQUM7WUFDcEIsT0FBTyxLQUFLLENBQUM7UUFDZixDQUFDLENBQUMsQ0FBQztJQUNQLENBQUM7SUFFRDs7OztPQUlHO0lBQ08sK0JBQStCLENBQ3ZDLFlBQXlDLEVBQ3pDLElBQWM7UUFFZCxJQUNFLElBQUksQ0FBQyxLQUFLO1lBQ1YsT0FBTyxZQUFZLEtBQUssUUFBUTtZQUNoQyxZQUFZLEtBQUssSUFBSSxFQUNyQjtZQUNBLE1BQU0sS0FBSyxHQUFHLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7WUFDakMsSUFBSSxLQUFLLEtBQUssQ0FBQyxFQUFFO2dCQUNmLElBQUksWUFBWSxDQUFDLElBQUksRUFBRTtvQkFDckIsT0FBTyxZQUFZLENBQUMsSUFBSSxDQUFDO2lCQUMxQjthQUNGO2lCQUFNLElBQUksS0FBSyxLQUFLLENBQUMsRUFBRTtnQkFDdEIsSUFBSSxZQUFZLENBQUMsR0FBRyxFQUFFO29CQUNwQixPQUFPLFlBQVksQ0FBQyxHQUFHLENBQUM7aUJBQ3pCO2FBQ0Y7aUJBQU0sSUFBSSxLQUFLLEtBQUssQ0FBQyxFQUFFO2dCQUN0QixJQUFJLFlBQVksQ0FBQyxHQUFHLEVBQUU7b0JBQ3BCLE9BQU8sWUFBWSxDQUFDLEdBQUcsQ0FBQztpQkFDekI7YUFDRjtTQUNGO1FBRUQsSUFDRSxPQUFPLFlBQVksS0FBSyxRQUFRO1lBQ2hDLFlBQVksS0FBSyxJQUFJO1lBQ3JCLFlBQVksQ0FBQyxLQUFLLEVBQ2xCO1lBQ0EsT0FBTyxZQUFZLENBQUMsS0FBSyxDQUFDO1NBQzNCO1FBQ0QsT0FBTyxZQUFzQixDQUFDO0lBQ2hDLENBQUM7Q0FDRiJ9 |
@@ -6,26 +6,22 @@ import { ALocalesService } from "./locales-base.service"; | ||
export declare class LocalesRestService extends ALocalesService { | ||
protected url: string; | ||
static instances: { | ||
[url: string]: LocalesRestService; | ||
}; | ||
static getInstance(url: string): LocalesRestService; | ||
locales: any; | ||
/** | ||
* The current setted langcode | ||
*/ | ||
protected currentLangcode?: string; | ||
/** | ||
* The default theme langcode before any language was choosed | ||
*/ | ||
protected initalLangcode?: string; | ||
constructor( | ||
url: string, | ||
doNotTranslateDefaultLanguage?: boolean, | ||
showMissingTranslation?: boolean | ||
); | ||
/** | ||
* Get file with all languages | ||
* @param themeID | ||
*/ | ||
protected getAll(url?: string): Promise<any>; | ||
protected url: string; | ||
static instances: { | ||
[url: string]: LocalesRestService; | ||
}; | ||
static getInstance(url: string): LocalesRestService; | ||
locales: any; | ||
/** | ||
* The current setted langcode | ||
*/ | ||
protected currentLangcode?: string; | ||
/** | ||
* The default theme langcode before any language was choosed | ||
*/ | ||
protected initalLangcode?: string; | ||
constructor(url: string, doNotTranslateDefaultLanguage?: boolean, showMissingTranslation?: boolean); | ||
/** | ||
* Get file with all languages | ||
* @param themeID | ||
*/ | ||
protected getAll(url?: string): Promise<any>; | ||
} |
@@ -1,55 +0,48 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const core_1 = require("@ribajs/core"); | ||
const locales_base_service_1 = require("./locales-base.service"); | ||
import { HttpService } from "@ribajs/core"; | ||
import { ALocalesService } from "./locales-base.service"; | ||
/** | ||
* LocalesRestService get locales object from url | ||
*/ | ||
class LocalesRestService extends locales_base_service_1.ALocalesService { | ||
constructor( | ||
url, | ||
doNotTranslateDefaultLanguage = false, | ||
showMissingTranslation = false | ||
) { | ||
super(doNotTranslateDefaultLanguage, showMissingTranslation); | ||
this.url = url; | ||
this.locales = {}; | ||
this.url = url; | ||
if (!this.url) { | ||
throw new Error(`Url is requred!`); | ||
export class LocalesRestService extends ALocalesService { | ||
constructor(url, doNotTranslateDefaultLanguage = false, showMissingTranslation = false) { | ||
super(doNotTranslateDefaultLanguage, showMissingTranslation); | ||
this.url = url; | ||
this.locales = {}; | ||
this.url = url; | ||
if (!this.url) { | ||
throw new Error(`Url is requred!`); | ||
} | ||
if (LocalesRestService.instances[this.url]) { | ||
return LocalesRestService.instances[this.url]; | ||
} | ||
this.init(); | ||
LocalesRestService.instances[this.url] = this; | ||
} | ||
if (LocalesRestService.instances[this.url]) { | ||
return LocalesRestService.instances[this.url]; | ||
static getInstance(url) { | ||
return LocalesRestService.instances[url]; | ||
} | ||
this.init(); | ||
LocalesRestService.instances[this.url] = this; | ||
} | ||
static getInstance(url) { | ||
return LocalesRestService.instances[url]; | ||
} | ||
/** | ||
* Get file with all languages | ||
* @param themeID | ||
*/ | ||
async getAll(url) { | ||
if (!url) { | ||
url = this.url; | ||
/** | ||
* Get file with all languages | ||
* @param themeID | ||
*/ | ||
async getAll(url) { | ||
if (!url) { | ||
url = this.url; | ||
} | ||
if (!url) { | ||
throw new Error(`Url is requred!`); | ||
} | ||
if (window.Shopify.shop) { | ||
url = url + `?shop=${window.Shopify.shop}`; | ||
} | ||
if (this.locales[url]) { | ||
return this.locales[url]; | ||
} | ||
return HttpService.getJSON(url).then((locales) => { | ||
this.locales[url] = locales; | ||
return this.locales[url]; | ||
}); | ||
} | ||
if (!url) { | ||
throw new Error(`Url is requred!`); | ||
} | ||
if (window.Shopify.shop) { | ||
url = url + `?shop=${window.Shopify.shop}`; | ||
} | ||
if (this.locales[url]) { | ||
return this.locales[url]; | ||
} | ||
return core_1.HttpService.getJSON(url).then((locales) => { | ||
this.locales[url] = locales; | ||
return this.locales[url]; | ||
}); | ||
} | ||
} | ||
exports.LocalesRestService = LocalesRestService; | ||
LocalesRestService.instances = {}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxlcy1yZXN0LnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VydmljZXMvbG9jYWxlcy1yZXN0LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYX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ztTQUNwQztRQUVELElBQUssTUFBYyxDQUFDLE9BQU8sQ0FBQyxJQUFJLEVBQUU7WUFDaEMsR0FBRyxHQUFHLEdBQUcsR0FBRyxTQUFVLE1BQWMsQ0FBQyxPQUFPLENBQUMsSUFBSSxFQUFFLENBQUM7U0FDckQ7UUFDRCxJQUFJLElBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUU7WUFDckIsT0FBTyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1NBQzFCO1FBQ0QsT0FBTyxXQUFXLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLE9BQVksRUFBRSxFQUFFO1lBQ3BELElBQUksQ0FBQyxPQUFPLENBQUMsR0FBYSxDQUFDLEdBQUcsT0FBTyxDQUFDO1lBQ3RDLE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQyxHQUFhLENBQUMsQ0FBQztRQUNyQyxDQUFDLENBQUMsQ0FBQztJQUNMLENBQUM7O0FBaEVhLDRCQUFTLEdBRW5CLEVBQUUsQ0FBQyJ9 |
import { ALocalesService } from "./locales-base.service"; | ||
export declare class LocalesStaticService extends ALocalesService { | ||
protected locales: any; | ||
protected id?: string | undefined; | ||
static instances: { | ||
[id: string]: LocalesStaticService; | ||
}; | ||
static getInstance(id?: string): LocalesStaticService; | ||
/** | ||
* The current setted langcode | ||
*/ | ||
protected currentLangcode?: string; | ||
/** | ||
* The default theme langcode before any language was choosed | ||
*/ | ||
protected initalLangcode?: string; | ||
constructor( | ||
locales: any, | ||
id?: string | undefined, | ||
doNotTranslateDefaultLanguage?: boolean, | ||
showMissingTranslation?: boolean | ||
); | ||
/** | ||
* Get file with all languages | ||
* @param themeID | ||
*/ | ||
protected getAll(themeID?: number): Promise<any>; | ||
protected locales: any; | ||
protected id?: string | undefined; | ||
static instances: { | ||
[id: string]: LocalesStaticService; | ||
}; | ||
static getInstance(id?: string): LocalesStaticService; | ||
/** | ||
* The current setted langcode | ||
*/ | ||
protected currentLangcode?: string; | ||
/** | ||
* The default theme langcode before any language was choosed | ||
*/ | ||
protected initalLangcode?: string; | ||
constructor(locales: any, id?: string | undefined, doNotTranslateDefaultLanguage?: boolean, showMissingTranslation?: boolean); | ||
/** | ||
* Get file with all languages | ||
* @param themeID | ||
*/ | ||
protected getAll(): Promise<any>; | ||
} |
@@ -1,37 +0,29 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const locales_base_service_1 = require("./locales-base.service"); | ||
class LocalesStaticService extends locales_base_service_1.ALocalesService { | ||
constructor( | ||
locales, | ||
id, | ||
doNotTranslateDefaultLanguage = false, | ||
showMissingTranslation = false | ||
) { | ||
super(doNotTranslateDefaultLanguage, showMissingTranslation); | ||
this.locales = locales; | ||
this.id = id; | ||
if (!id) { | ||
id = "main"; | ||
import { ALocalesService } from "./locales-base.service"; | ||
export class LocalesStaticService extends ALocalesService { | ||
constructor(locales, id, doNotTranslateDefaultLanguage = false, showMissingTranslation = false) { | ||
super(doNotTranslateDefaultLanguage, showMissingTranslation); | ||
this.locales = locales; | ||
this.id = id; | ||
if (!id) { | ||
id = "main"; | ||
} | ||
this.locales = locales; | ||
if (LocalesStaticService.instances[id]) { | ||
return LocalesStaticService.instances[id]; | ||
} | ||
this.init(); | ||
LocalesStaticService.instances[id] = this; | ||
} | ||
this.locales = locales; | ||
if (LocalesStaticService.instances[id]) { | ||
return LocalesStaticService.instances[id]; | ||
static getInstance(id = "main") { | ||
return LocalesStaticService.instances[id]; | ||
} | ||
this.init(); | ||
LocalesStaticService.instances[id] = this; | ||
} | ||
static getInstance(id = "main") { | ||
return LocalesStaticService.instances[id]; | ||
} | ||
/** | ||
* Get file with all languages | ||
* @param themeID | ||
*/ | ||
async getAll(themeID) { | ||
return this.locales; | ||
} | ||
/** | ||
* Get file with all languages | ||
* @param themeID | ||
*/ | ||
async getAll( /*themeID?: number*/) { | ||
return this.locales; | ||
} | ||
} | ||
exports.LocalesStaticService = LocalesStaticService; | ||
LocalesStaticService.instances = {}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxlcy1zdGF0aWMuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXJ2aWNlcy9sb2NhbGVzLXN0YXRpYy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsaUVBQXlEO0FBRXpELE1BQWEsb0JBQXFCLFNBQVEsc0NBQWU7SUFvQnZELFlBQXNCLE9BQVksRUFBWSxFQUFXLEVBQUUsZ0NBQXlDLEtBQUssRUFBRSx5QkFBa0MsS0FBSztRQUNoSixLQUFLLENBQUMsNkJBQTZCLEVBQUUsc0JBQXNCLENBQUMsQ0FBQztRQUR6QyxZQUFPLEdBQVAsT0FBTyxDQUFLO1FBQVksT0FBRSxHQUFGLEVBQUUsQ0FBUztRQUV2RCxJQUFJLENBQUMsRUFBRSxFQUFFO1lBQ1AsRUFBRSxHQUFHLE1BQU0sQ0FBQztTQUNiO1FBRUQsSUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7UUFFdkIsSUFBSSxvQkFBb0IsQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLEVBQUU7WUFDdEMsT0FBTyxvQkFBb0IsQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLENBQUM7U0FDM0M7UUFFRCxJQUFJLENBQUMsSUFBSSxFQUFFLENBQUM7UUFDWixvQkFBb0IsQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLEdBQUcsSUFBSSxDQUFDO0lBQzVDLENBQUM7SUE1Qk0sTUFBTSxDQUFDLFdBQVcsQ0FBQyxLQUFhLE1BQU07UUFDM0MsT0FBTyxvQkFBb0IsQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDNUMs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MsU0FBUyxDQUFDLEVBQUUsQ0FBQyxHQUFHLElBQUksQ0FBQztJQUM1QyxDQUFDO0lBakNNLE1BQU0sQ0FBQyxXQUFXLENBQUMsRUFBRSxHQUFHLE1BQU07UUFDbkMsT0FBTyxvQkFBb0IsQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDNUMsQ0FBQztJQWlDRDs7O09BR0c7SUFDTyxLQUFLLENBQUMsTUFBTSxFQUFDLG9CQUFvQjtRQUN6QyxPQUFPLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDdEIsQ0FBQzs7QUE3Q2EsOEJBQVMsR0FFbkIsRUFBRSxDQUFDIn0= |
{ | ||
"name": "@ribajs/i18n", | ||
"description": "Internationalization module for Riba.js", | ||
"version": "1.9.0-beta.1", | ||
"version": "1.9.0-beta.2", | ||
"author": "Pascal Garber <pascal@artandcode.studio>", | ||
@@ -26,32 +26,38 @@ "url": "https://github.com/ribajs/riba/tree/master/packages/i18n", | ||
"build:module": "tsc", | ||
"packages:npm:link": "npm link @ribajs/core" | ||
"packages:npm:link": "npm link @ribajs/core", | ||
"clean": "rm -rf ./dist ./lib" | ||
}, | ||
"files": [ | ||
"/src", | ||
"/dist" | ||
], | ||
"devDependencies": { | ||
"@babel/cli": "^7.11.6", | ||
"@babel/core": "^7.11.6", | ||
"@babel/cli": "^7.12.0", | ||
"@babel/core": "^7.12.0", | ||
"@babel/plugin-proposal-class-properties": "^7.10.4", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.11.0", | ||
"@babel/preset-env": "^7.11.5", | ||
"@babel/preset-typescript": "^7.10.4", | ||
"@babel/runtime-corejs3": "^7.11.2", | ||
"@ribajs/eslint-config": "1.9.0-beta.1", | ||
"@ribajs/tsconfig": "1.9.0-beta.1", | ||
"@ribajs/webpack-config": "1.9.0-beta.1", | ||
"@typescript-eslint/eslint-plugin": "^3.10.1", | ||
"@typescript-eslint/parser": "^3.10.1", | ||
"@babel/preset-env": "^7.12.0", | ||
"@babel/preset-typescript": "^7.12.0", | ||
"@babel/runtime-corejs3": "^7.12.0", | ||
"@ribajs/eslint-config": "1.9.0-beta.2", | ||
"@ribajs/tsconfig": "1.9.0-beta.2", | ||
"@ribajs/webpack-config": "1.9.0-beta.2", | ||
"@types/jest": "^26.0.14", | ||
"@typescript-eslint/eslint-plugin": "^4.4.1", | ||
"@typescript-eslint/parser": "^4.4.1", | ||
"babel-loader": "^8.1.0", | ||
"babel-plugin-array-includes": "^2.0.3", | ||
"core-js": "^3.6.5", | ||
"eslint": "^7.8.1", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint": "^7.11.0", | ||
"eslint-config-prettier": "^6.12.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"prettier": "^2.1.1", | ||
"typescript": "^4.0.2", | ||
"webpack": "^5.0.0-beta.22", | ||
"webpack-cli": "^3.3.12" | ||
"prettier": "^2.1.2", | ||
"typescript": "^4.0.3", | ||
"webpack": "^5.1.2", | ||
"webpack-cli": "^4.0.0" | ||
}, | ||
"dependencies": { | ||
"@ribajs/bs4": "1.9.0-beta.1", | ||
"@ribajs/core": "1.9.0-beta.1", | ||
"@ribajs/utils": "1.9.0-beta.1" | ||
"@ribajs/bs4": "1.9.0-beta.2", | ||
"@ribajs/core": "1.9.0-beta.2", | ||
"@ribajs/utils": "1.9.0-beta.2" | ||
}, | ||
@@ -58,0 +64,0 @@ "bugs": { |
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
85
1
2
1
12
113396
23
60
2107
+ Added@ribajs/bs4@1.9.0-beta.2(transitive)
+ Added@ribajs/cache@1.9.0-beta.2(transitive)
+ Added@ribajs/core@1.9.0-beta.2(transitive)
+ Added@ribajs/extras@1.9.0-beta.2(transitive)
+ Added@ribajs/utils@1.9.0-beta.2(transitive)
- Removed@ribajs/bs4@1.9.0-beta.1(transitive)
- Removed@ribajs/cache@1.9.0-beta.1(transitive)
- Removed@ribajs/core@1.9.0-beta.1(transitive)
- Removed@ribajs/extras@1.9.0-beta.1(transitive)
- Removed@ribajs/utils@1.9.0-beta.1(transitive)
Updated@ribajs/bs4@1.9.0-beta.2
Updated@ribajs/core@1.9.0-beta.2
Updated@ribajs/utils@1.9.0-beta.2