11.3.0 • Published 7 months ago

@talend/locales-tui-faceted-search v11.3.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

tui-faceted-search locales

This module contains i18n files for tui-faceted-search project.

How to install

yarn add @talend/locales-tui-faceted-search 

or

npm install @talend/locales-tui-faceted-search

How to use with i18next

Synchronous use

i18n.js

import i18n from 'i18next';

import merge from 'lodash/merge';

import { namespaces as tuifacetedsearchNamespaces } from '@talend/locales-tui-faceted-search/namespaces';
import { locales as tuifacetedsearchLocales } from '@talend/locales-tui-faceted-search/locales';

i18n
	.init({
		ns: [
			...tuifacetedsearchNamespaces,
			...myProjectNamespaces
		],
		resources: merge(tuifacetedsearchLocales, 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-faceted-search/locales', to: 'assets/locales' },
		]),
	]
}

i18n.js

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

import { namespaces as tuifacetedsearchNamespaces } from '@talend/locales-tui-faceted-search/namespaces';

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

export default i18n;
8.1.2

9 months ago

8.1.1

9 months ago

11.3.0

7 months ago

8.1.0

1 year ago

4.0.2

2 years ago

3.5.5

2 years ago

3.5.3

3 years ago

3.5.4

3 years ago

3.5.2

3 years ago

3.4.1

3 years ago

3.4.0

3 years ago

0.9.0

4 years ago