New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@talend/locales-tui

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@talend/locales-tui

This module contains i18n files for TUI project.

6.15.0
Source
npm
Version published
Weekly downloads
6
-25%
Maintainers
1
Weekly downloads
 
Created
Source

TUI locales

This module contains i18n files for TUI project.

How to install

yarn add @talend/locales-tui 

or

npm install @talend/locales-tui

How to use with i18next

Synchronous use

i18n.js

import i18n from 'i18next';

import merge from 'lodash/merge';

import { namespaces as tuiNamespaces } from '@talend/locales-tui/namespaces';
import { locales as tuiLocales } from '@talend/locales-tui/locales';

i18n
	.init({
		ns: [
			...tuiNamespaces,
			...myProjectNamespaces
		],
		resources: merge(tuiLocales, myProjectLocales),
	});

export default i18n;

Asynchronous use

For async load, you need to copy the i18n files to the location you want to serve them

webpack.config.js

const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
	plugins: [
		new CopyWebpackPlugin([
			{ from: 'node_modules/@talend/locales-tui/locales', to: 'assets/locales' },
		]),
	]
}

i18n.js

import i18n from 'i18next';
import XHR from 'i18next-xhr-backend';

import { namespaces as tuiNamespaces } from '@talend/locales-tui/namespaces';

i18n
	.use(XHR)
	.init({
		ns: [
			...tuiNamespaces,
			...myProjectNamespaces
		],
		backend: {
			loadPath: '/assets/locales/{{lng}}/{{ns}}.json',
		},
	});

export default i18n;

FAQs

Package last updated on 02 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts