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

@tappytaps/translation-tool

v1.6.1

Published

Generates platform specific string resources (iOS, Android and Web) from xlsx files.

Downloads

98

Readme

translation-tool

Generates platform specific string resources (iOS, Android and Web) from xlsx files.

Installation

npm i @tappytaps/translation-tool

How to use it?

Go to your project:

$ cd path/to/your/project

Create and define configuration file:

$ touch .stringsgenrc
$ code .stringsgenrc

Run strings generator:

$ stringsgen gen

Upload strings to OneSky:

$ stringsgen up

Download translated strings from OneSky:

$ stringsgen down

Check not used strings on OneSky:

$ stringsgen check

Configuration

You provide your configuration via .stringsgenrc file.

{
    "xlsxUrl": "your_url_for_xlsx_file",
    "platform": "ios",
    "idColumnName": "id",
    "keysColumnName": "key_ios",
    "valuesColumnName": "value",
    "allowDuplicatesColumnName": "allow_duplicates",
    "descriptionColumnName": "description",
    "isHtmlColumnName": "is_html",
    "isFinalColumnName": "is_final",
    "baseLanguage": "en",
    "outputDir": ".",
    "outputName": "Localizable.strings",
    "inputPlurals": "Localizable.stringsdict",
    "webParameterType": "value",
    "oneSky": {
        "secret": "TOP_SECRET",
        "apiKey": "YOUR_API_KEY",
        "projectId": "YOUR_PROJECT_ID"
    }
}
  • platform
    • values: ios, android, web
  • webParameterType
    • only for web
    • values: value, tag
    • default: value

If you want to split your strings into common and app specific OneSky projects:

{
    "appSpecificValuesColumnName": "value_APP_NAME",
    "oneSky": {
        "secret": "TOP_SECRET",
        "apiKey": "YOUR_API_KEY",
        "projects": [
            {
                "type": "common",
                "id": "COMMON_PROJECT_ID"
            },
            {
                "type": "app_specific",
                "id": "APP_SPECIFIC_PROJECT_ID"
            }
        ]
    }
}

Spreadsheet requirements

This tool works only with xlsx file format. The easiest way how to create and publish your spreadsheet is using Google Spreadsheet. In File/Publish to the web... you choose xlsx file format and put the link in your config file. You can make copy of sample spreadsheet here, just use File/Make a copy....

The sample spreadsheet contains prepared autoincrement id generator. If you want to use this id generator, go to Tools/Script editor, update script to respect your column and sheet names by changing values of idsColumnName, valuesColumnName and sheetNames variables. Then go to Current project's triggers (the clock icon in tool bar) and create a new trigger for event type On change (as function to run select onChange).

Sheet columns

  • First row of each sheet should define column names.
  • Column names should be same across all sheets.
  • idColumnName => Unique string identifier.
  • keysColumnName => String key. Must be unique, otherwise the strings generator will end with error.
  • valuesColumnName => String value. Doesn't has to be unique, but the strings generator will warn your if there are any duplicates.
  • appSpecificValuesColumnName => App specific string value. Required only if you want to split your strings in OneSky.
  • allowDuplicatesColumnName => If the column contains TRUE, the strings generator will not show warnings for duplicate in valuesColumnName column for given string.
  • descriptionColumnName => Description for string value, if needed.
  • isHtmlColumnName => If the column contains TRUE, the strings generator will handle a string value in special way (Android).