7.1.0 • Published 3 months ago

@transifex/i18next v7.1.0

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

Transifex Native SDK: i18next backend plugin

An i18next backend plugin, to load translations over-the-air using Transifex Native.

Related packages:

Learn more about Transifex Native in the Transifex Developer Hub.

Quick starting guide

Install the library using:

npm install @transifex/i18next --save

Webpack

import { TransifexI18next } from '@transifex/i18next';
const txBackend = new TransifexI18next({
  token: 'public token',
  // other options from @transifex/native init function
});

// add plugin to i18next
i18next.use(txBackend).init(...);

Node.js

const { TransifexI18next } = require('@transifex/i18next');
const txBackend = new TransifexI18next({
  token: 'public token',
  // other options from @transifex/native init function
});

// add plugin to i18next
i18next.use(txBackend).init(...);

Browser

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@transifex/i18next/dist/browser.i18next.min.js"></script>
<script type="text/javascript">
  const TransifexI18next = TxNativeI18next.TransifexI18next;
  const txBackend = new TransifexI18next({
    token: 'public token',
    // other options from @transifex/native init function
  });

  // add plugin to i18next
  i18next.use(txBackend).init(...);
</script>

Uploading phrases for translation

You can use @transifex/cli to push i18next JSON files for translation. First step is to install the CLI tool into the project using the command:

npm i @transifex/cli --save

Then, given that you have generated a source i18next JSON v4, use the following command to upload to Transifex for translation.

npx txjs-cli push source.json --parser=i18next

That's it. Given that the content is translated, translations will be downloaded over-the-air using the Transifex i18next backend.

Known limitations

CLI does NOT parse and push the following key types:

  • keyWithArrayValue
  • keyWithObjectValue

License

Licensed under Apache License 2.0, see LICENSE file.

7.1.0

3 months ago

7.0.0

4 months ago

7.0.1

4 months ago

6.0.2

5 months ago

5.4.0

10 months ago

6.0.1

7 months ago

6.0.0

8 months ago

5.3.0

11 months ago

5.3.0-alpha.0

11 months ago

5.2.0

1 year ago

5.1.1

1 year ago

5.1.0

1 year ago

5.0.7

1 year ago

5.0.6

1 year ago

5.0.5

1 year ago

5.0.4

1 year ago

5.0.3

1 year ago

5.0.2

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

4.3.0

1 year ago

4.2.5

2 years ago

4.2.2

2 years ago

4.2.4

2 years ago

4.2.1

2 years ago

4.2.0

2 years ago

4.1.0

2 years ago

4.1.0-alpha.0

2 years ago