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

@boost/translate

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boost/translate - npm Package Compare versions

Comparing version 5.0.0-alpha.1 to 5.0.0-alpha.2

2

mjs/createTranslator.d.ts

@@ -22,3 +22,3 @@ import { type InitOptions } from 'i18next';

*/
export declare function createTranslator(namespace: string[] | string, resourcePath: PortablePath | PortablePath[], options?: TranslatorOptions): Translator;
export declare function createTranslator(namespace: string[] | string, resourcePath: PortablePath | PortablePath[], options?: TranslatorOptions): Promise<Translator>;
//# sourceMappingURL=createTranslator.d.ts.map
{
"name": "@boost/translate",
"version": "5.0.0-alpha.1",
"version": "5.0.0-alpha.2",
"type": "module",

@@ -35,4 +35,4 @@ "release": "1651512178249",

"dependencies": {
"@boost/common": "^5.0.0-alpha.1",
"@boost/internal": "^5.0.0-alpha.1",
"@boost/common": "^5.0.0-alpha.2",
"@boost/internal": "^5.0.0-alpha.2",
"i18next": "^23.8.2",

@@ -59,3 +59,3 @@ "os-locale": "^6.0.2"

},
"gitHead": "8fd0f41cca47f7b6ce605eaca5cb2b4932fc89a5"
"gitHead": "60175188388d1667eb57d53e03b7bfefc092b67c"
}

@@ -13,3 +13,3 @@ # Translate - Boost

const msg = createTranslator(['common', 'errors'], '../path/to/resources');
const msg = await createTranslator(['common', 'errors'], '../path/to/resources');

@@ -16,0 +16,0 @@ msg('common:welcome', { name: 'Boost' }); // Hello Boost!

@@ -9,9 +9,2 @@ import { createInstance, type InitOptions } from 'i18next';

// istanbul ignore next
function handleError(error: Error | null) {
if (error) {
throw error;
}
}
export interface TranslatorOptions {

@@ -36,7 +29,7 @@ /** Automatically detect the locale from the environment. Defaults to `true`. */

*/
export function createTranslator(
export async function createTranslator(
namespace: string[] | string,
resourcePath: PortablePath | PortablePath[],
options: TranslatorOptions = {},
): Translator {
): Promise<Translator> {
const {

@@ -69,22 +62,19 @@ autoDetect = true,

void translator.init(
{
backend: {
format: resourceFormat,
paths: resourcePaths,
},
cleanCode: true,
debug: debugOpt,
defaultNS: namespaces[0],
fallbackLng: fallbackLocale,
initImmediate: false,
lng: locale,
load: lookupType,
lowerCaseLng: false,
ns: namespaces,
returnEmptyString: true,
returnNull: true,
await translator.init({
backend: {
format: resourceFormat,
paths: resourcePaths,
},
handleError,
);
cleanCode: true,
debug: debugOpt,
defaultNS: namespaces[0],
fallbackLng: fallbackLocale,
initImmediate: false,
lng: locale,
load: lookupType,
lowerCaseLng: false,
ns: namespaces,
returnEmptyString: true,
returnNull: true,
});

@@ -91,0 +81,0 @@ function msg(

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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