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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ti-i18n

v0.6.0

Published

CLI to manage internationalizing your Titanium app

Readme

Titanium i18n

Titanium i18n (ti-i18n) is both a pluggable Titanium CLI 3.2+ command and stand-alone CLI for managing your app's internationalization. It replaces the soon to be deprecated alloy extract-i18n and works on both Alloy and Classic projects.

1. Get it npm

ti-i18n is built on Node.js. Once you have Node.js installed you can use the included NPM package manager to install ti-i18n via the following command:

sudo npm install -g jasonkneen/ti-i18n

Optionally plug as Titanium CLI 3.2.0 command

If you already run the upcoming Titanium CLI 3.2.0, you can let ti-i18n plug itself as a command under the Titanium CLI:

ti-i18n plug

Once, you've done this. The following (note the -) do exactly the same:

ti-i18n extract
ti i18n extract

ti-i18n will be further developped to be a worthy command, listen to the global flags like --no-colors and read any relevant defaults from the CLI config. Use ti-i18n plugged and ti-i18n unplug to check if ti-i18n is plugged or unplug.

Or use it as a module

You can also use ti-18n as an dependency of your NodeJS project. The same options apply, just use the full names and make sure options like --project-dir are camel-cased to projectDir.

import i18n from 'ti-i18n';

i18n.extract({
	language: 'nl',
	apply: true
});

2. Use it

Extract

As demonstrated by the test on the files in test/source, ti-i18n is able to extract i18n strings from XML, TSS and JS source code. Just don't use composed strings like L('error_' + code);.

By default ti-i18n scans the i18n directory for languages and reads and writes to all of them. You can choose a specific language by passing it as the first argument after the extract command.

Use the -a or --apply flag to actually append the missing strings to the files. In both cases, ti-i18n will display a table with the exact changes (to be) made.

Usage: extract [options]
Example: ti-i18n extract -a -l nl
Options:
    -a, --apply               append to the strings.xml files (default: no)
    -d, --project-dir <path>  Project directory (default: current)
    -l, --language <ln>       single language to compare with and write to (default: all)

Sync

The sync command makes sure all languages have the same strings. If a file doesn't have a string present in one of the other languages, it will be appended to it.

Use the -a or --apply flag to actually append the missing strings to the files. In both cases, ti-i18n will display a table with the exact changes (to be) made.

Usage: sync [options]
Example: ti-i18n sync -a
Options:
    -a, --apply               append to the strings.xml files (default: no)
    -d, --project-dir <path>  Project directory (default: current)

Merge

Once you've had the strings translated, you can merge the translated XML with the one in your project. Existing string values will be updated and new strings added but if during translation your strings.xml file has grown, the new ones will be preserved.

Usage: merge [options]
Example: ti-i18n merge -s ~/translated.xml -l nl -a
    -a, --apply               overwrite the strings.xml file (default: no)
    -d, --project-dir <path>  Project directory (default: current)
    -s, --source <path>       Source strings.xml file to merge from
    -l, --language <ln>       language to compare with and merge to

Sort

You can sort the strings in all language files of a project using the sort command.

Usage: sort [options]
Example: ti-i18n sort
Options:
    -d, --project-dir <path>  Project directory (default: current)

Global options

Option | Availability | Description ------- | ----------- | ----------- -h, --help|both|output usage information -v, --version|stand-alone|output the version number (as a hook, this will output the Titanium CLI version)

Testing

The test folder contains a single unit-test you can use, e.g. with mocha:

sudo npm install -g mocha
mocha test/test.js

Roadmap

  • ~~Rewrite extract to search through XML, TSS (JSON) and JS (AST).~~
  • Option to remove second hint-argument from L and use it in strings.xml.
  • Add validate to validate strings.xml for UTF-8, CDATA, duplicates etc.
  • Add clean to comment out any strings not found in source.
  • ~~Add merge to merge translated file back into project.~~
  • ~~Add peer to make sure all language have same strings.~~
  • Add name to create/update XML for internationalized app names.

License