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

multi-language-mobile

v1.0.1

Published

Tool for generating localization files for iOS and Android

Downloads

2

Readme

multi-language-mobile

This is a node app for generating iOS/Android localization files from local CSV or Google Doc. You can consider this as a solution for maintainning multiple languages in iOS/Android platform btween developers and whoever updates the wordings.

Install

Local(recommended): yarn add multi-language-mobile --dev Global: yarn global add multi-language-mobile or npm install multi-language-mobile --global

Usage

multi-language --output-dir './outputs' --input-path './resources/test.csv'

Or, add multi-language in your package.json and run multi-language at your root folder

"multi-language": {
    "googleCredential": "./google-credential.json",
    "googleFileId": "13PRkyoSfdpRJhTlY8xtyX8jrXuhzAZmS1iPL2c9L8Ek",
    "outputDir": "./PATH_TO_YOUR_DEST",
    "platforms": ["ios", "android"]
  },

The output looks like

List of options:

--output-dir <string>      | default: ./output
--platforms <string>       | default: ['ios', 'android']
--input-path <file>        | path to local csv
--google-file-id <string>  | google file id, should be sheet file
--google-credential <file> | path to google credentials.json

The tool currently onlys supports en and zh-Hans. Will support more in later phase. Please make sure you have the same column title as below for the sheet.

Example

Let's say your wordings are kept at https://docs.google.com/spreadsheets/d/1Ik0mRByqVFldbAjDvrwGFx_CrM6-fsEKN0IzZnAr7rI/edit?usp=sharing

You need to enable your google drive api at https://developers.google.com/drive/api/v3/quickstart/nodejs, make sure you enabled read access for the project you created on Google console. Download the credentials and rename it as google-credential.json

iOS

After install at your project root folder, add following section to your package.json

"multi-language": {
    "googleCredential": "./google-credential.json",
    "googleFileId": "1Ik0mRByqVFldbAjDvrwGFx_CrM6-fsEKN0IzZnAr7rI",
    "outputDir": "./PATH_TO_YOUR_DEST",
    "platforms": ["ios"]
  },

And run multi-language at your project root folder. You can add the localization files from Xcode now.

What's More For iOS?

You can combine it with R.swift, then use R.string.localizable.alert_ok() for localized string.

Wait... R.swift currently doesn't support in-app language switch well, but with this extension https://gist.github.com/jhonny-me/dd2edb43fb167d1f55f79021718507b7

you can do: R.string.localizable.alert_ok.localized()

What about params? I got you covered: R.string.localizable.count_number.localized().withInputs(2, 'piggets')

When you want to change language simply call StringResource.language = "zh-Hans"

Android

After install at your project root folder, add following section to your package.json

"multi-language": {
    "googleCredential": "./google-credential.json",
    "googleFileId": "1Ik0mRByqVFldbAjDvrwGFx_CrM6-fsEKN0IzZnAr7rI",
    "outputDir": "./PATH_TO_YOUR_DEST",
    "platforms": ["android"]
  },

And run multi-language at your project root folder. You can add the localization files from your IDE now.