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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tapptic-spreadsheet-localize

v1.2.1

Published

Generate localization files for Android & iOS based on a Google Spreadsheet

Readme

Generate localization files for Android & iOS based on a Google Spreadsheet

Given a Google Spreadsheet, this script fetches keys & translations and generates localization files for both iOS & Android

Requirements

Service account

In order to use this tool, you'll need a Service Account. All the instructions are available here: https://theoephraim.github.io/node-google-spreadsheet/#/getting-started/authentication?id=service-account

Installation

$ sudo npm install -g tapptic-spreadsheet-localize

Updating

$ sudo npm update -g tapptic-spreadsheet-localize

Spreadsheet template

You should clone this template as you start a new iOS or Android project :

https://docs.google.com/spreadsheets/d/1kU8bMc6wbGUd8oO8PzzRyaKTFnI0OHapOusLhTmusz0/edit#gid=0

Make sure to publish (File -> Publish to the web) your spreadsheet before running the script.

Script template

localize.js

var Localize = require("tapptic-spreadsheet-localize");

var sheetId = "<YOUR SPREADSHEET KEY>";
var serviceAccountJsonPath = "<PATH TO JSON FILE>";
var sheets = '*'; // See "Advanced" below for more info

var transformer = Localize.fromGoogleSpreadsheet(require(serviceAccountJsonPath), sheetId, sheets);
transformer.setKeyCol('KEY');
transformer.save("values/strings.xml", { valueCol: "NL", format: "android" });
transformer.save("values-fr/strings.xml", { valueCol: "FR", format: "android" });
transformer.save("nl.lproj/Localizable.strings", { valueCol: "NL", format: "ios" });
transformer.save("fr.lproj/Localizable.strings", { valueCol: "FR", format: "ios" });

Usage

  1. Save or copy the localize.js script in your project's root folder
  2. Set your spreadsheet's key, localizaton files paths, languages key, ...
  3. Run it with node localize.js (assuming you are on the same working directory)

enter image description here

Advanced

You can decide to keep empty string in the generated files (to manage fallback per example)

transformer.save("fr.lproj/Localizable.strings", { valueCol: "FR", format: "ios", keepEmpty: true });

You can filter the worksheets to include with the second parameter of fromGoogleSpreadsheet in your localize.js script :

var sheets = '*'; // Every sheet
var sheets = ['HomeScreen', 'ContactScreen']); // Sheet's name
var sheets = [0, 2]); // 1st & 3rd sheet

In Xcode you can add a Run Script Phase (Build Phases) to automatically execute the script everytime you compile. Make sure you add it above the Compile Sources phase.

if [[ \"${CONFIGURATION}\" = \"Debug\" ]]; then
export NODE_PATH=/usr/local/lib/node_modules/
node localize.js
fi

Notes

The script will preserve everything that is above the tags: < !-- AUTO-GENERATED --> or // AUTO-GENERATED

FAQ

  • When I run the script I get this error : Error: Cannot find module 'tapptic-spreadsheet-localize'

Make sure your node path is set in your bash_profile. You can set it with the following commands:

$ echo "export NODE_PATH=/usr/local/lib/node_modules" >> ~/.bash_profile
$ source ~/.bash_profile