Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ribajs/i18n

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ribajs/i18n - npm Package Compare versions

Comparing version 0.17.2 to 0.18.0

src/binders/index.ts

2

package.json
{
"name": "@ribajs/i18n",
"description": "Internationalization extension for Riba.js",
"version": "0.17.2",
"version": "0.18.0",
"author": "Pascal Garber <pascal@jumplink.eu>",

@@ -6,0 +6,0 @@ "url": "https://github.com/ribajs/riba/tree/master/packages/i18n",

@@ -1,3 +0,3 @@

import { Utils, ITwoWayBinder, BinderWrapper, Debug, View, JQuery as $ } from '@ribajs/core';
import { ALocalesService } from '../../services/locales.service';
import { Utils, ITwoWayBinder, BinderWrapper, JQuery as $ } from '@ribajs/core';
import { ALocalesService } from '../../services/locales-base.service';

@@ -81,9 +81,8 @@ // see star.binder.ts

langcode = this.customData.i18n.getLangcode();
if (!langcode) {
console.error('Langcode is requred', langcode);
return;
}
}
if (!langcode) {
console.error('Langcode is requred', langcode);
return;
}
// translate by using the already translated language variable

@@ -167,3 +166,3 @@ if (this.customData.langVars && this.customData.langVars[langcode]) {

if (this.customData.i18n.ready) {
this.customData.initOnReady(this.customData.i18n.getLangcode(), this.customData.i18n.currentLangcode !== this.customData.i18n.initalLangcode);
this.customData.initOnReady(this.customData.i18n.getLangcode(), this.customData.i18n.currentLangcode !== this.customData.i18n.initalLangcode || !localesService.doNotTranslateDefaultLanguage);
} else {

@@ -170,0 +169,0 @@ this.customData.i18n.event.on('ready', this.customData.initOnReady);

@@ -1,3 +0,3 @@

import { Debug } from '@ribajs/core';
import { ALocalesService } from '../services/locales.service';
import { Debug, IModuleFormatterWrapper } from '@ribajs/core';
import { ALocalesService } from '../services/locales-base.service';

@@ -8,2 +8,5 @@ const translate = async (translateMePathString: string, localesService: ALocalesService, langcode?: string) => {

langcode = localesService.getLangcode();
if (!langcode) {
return null;
}
}

@@ -21,3 +24,3 @@ return localesService.get([langcode, ...properties]/*, vars */)

export const i18nFormatterWrapper = (localesService: ALocalesService) => {
export const tFormatterWrapper = (localesService: ALocalesService): IModuleFormatterWrapper => {
return {

@@ -24,0 +27,0 @@ name: 't',

@@ -1,15 +0,23 @@

// import * as interfaces from './interfaces/interfaces';
// import * as binders from './binders/i18n.binders';
// import * as formatters from './formatters/i18n.formatters';
// import * as services from './services/i18n.services';
// export {
// binders,
// services,
// formatters,
// interfaces,
// };
import { IRibaModule } from '@ribajs/core';
export * from './binders/i18n.binders';
export * from './formatters/i18n.formatters';
export * from './services/i18n.services';
export * from './interfaces/interfaces';
export * from './binders';
export * from './components';
export * from './formatters';
export * from './interfaces';
export * from './services';
import bindersWrapper from './binders';
import componentsWrapper from './components';
import formattersWrapper from './formatters';
import * as services from './services';
export const i18nModule = (localesService: services.ALocalesService): IRibaModule => {
return {
binders: bindersWrapper(localesService),
components: componentsWrapper(localesService),
formatters: formattersWrapper(localesService),
services,
};
};
export default i18nModule;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc