npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

arb-convert

v1.2.1

Published

Convert Application Resource Bundle (ARB) translation files to other translation formats and back

Downloads

40

Readme

arb-convert

Build Status NPM version Coverage Status Package dependencies GitHub license

Tool to convert JSON-based Application Resource Bundle (ARB) localization format by Google to another format and back.

npm install -g arb-convert

Background

ARB is the format of choice when using the Dart intl package to localize Flutter apps. It has not seen wide adoption by translation providers however. Since December 2019, Google shut down its Translator Toolkit that has natively supported the ARB format. So now Flutter devs can either migrate to another library and format, edit files by hand or convert to another format. This project aims to aid with the latter.

Supported formats

  • XLIFF 1.2/2.0/2.1
  • GNU gettext
  • ... add your format, PRs welcome

Please note that ICU placeholders and plural notations are not converted.

Node.js

const arbConvert = require('arb-convert');
const { convertFromArb, parseToArb } = arbConvert;

const xmlString = convertFromArb('xliff-1.2', {
    source: '{ "@@locale": "en-US", ... }',
    target: '{ "@@locale": "de-DE", ... }', // optional
    original: 'namespace', // optional
    sourceLanguage: 'en-US', // optional (override)
    targetLanguage: 'de-DE', // optional (override)
});

const result = parseToArb('xliff', {
    content: xmlString,
});
// { source, target, original, sourceLanguage, targetLanguage }

Binaries

arb2xliff

Usage: arb2xliff [options]

Options:
  --sourcefile <filename>  source ARB file (required)
  --targetfile <filename>  target ARB file
  --original <value>       where the translations come from
  --sourcelang <locale>    source locale override, e.g. en-US, in case it cannot be determined from file content or file name
  --targetlang <locale>    target locale override, e.g. de-DE, in case it cannot be determined from file content or file name
  --outversion <version>   XLIFF version, e.g. 1.2 (default) or 2.0/2.1
  --out <filename>         write XLIFF to file if given or stdout if omitted
  -h, --help               output usage information

xliff2arb

Usage: xliff2arb [options]

Options:
  --file <filename>       source XLIFF file (required)
  --sourceout <filename>  write source ARB to file if given or stdout if omitted
  --targetout <filename>  write target ARB to file if given
  -h, --help              output usage information

arb2po

Usage: arb2po [options]

Options:
  --sourcefile <filename>  source ARB file (required)
  --targetfile <filename>  target ARB file
  --original <value>       where the translations come from
  --sourcelang <locale>    source locale override, e.g. en-US, in case it cannot be determined from file content or file name
  --targetlang <locale>    target locale override, e.g. de-DE, in case it cannot be determined from file content or file name
  --out <filename>         write PO to file if given or stdout if omitted
  -h, --help               output usage information

po2arb

Usage: po2arb [options]

Options:
  --file <filename>       source PO file (required)
  --sourceout <filename>  write source ARB to file if given or stdout if omitted
  --targetout <filename>  write target ARB to file if given
  -h, --help              output usage information