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

ct-lingohub

v1.4.0

Published

This is i18n file importer to lingohub. It supports the process of continous translations for projects based on i18n json files.

Downloads

4

Readme

ct-lingohub i18n to lingohub

This is command line interface for accessing and managing i18n files in LingoHub. It's crafted for special requirements we had and it shouldn't be treated as a generic universal solution.

Installation

$ npm install -g ct-lingohub

After that you should have on your path avai

Getting Started

The typical scenio looks like this:

Step 1 Login (only once)

Before we start we need to save our login credentials.

$ ct-lingohub login -t "XXXXXXX3cfff12d3a6400f4eXXXXX" -a "YOURACCOUNTNAME"
Login successfuly. Your credentials are saved in ~/.ct-import.auth

Operation login saves creditentials in file ~/.ct-import.auth.

Step 2 Push the current status of the project to remote repo:

In the push command we need to provide name of the project. In the example below we are working with project linguatest.

The push operation gets all i18n files for predefined languages in Lingohub system and upload the data.

$ ct-lingohub push -p linguatest
Successfully pushed all local files to lingohub linguatest:

{ lang: 'pl', path: 'i18n/pl.i18n.json', error: 'OK' }
{ lang: 'ja', path: 'i18n/ja.i18n.json', error: 'OK' }
{ lang: 'en', path: 'i18n/en.i18n.json', error: 'OK' }

Step 3 Pull current translations from lingohub

The next process in the flow is to download the current status of the translation. Command pull gets data from Lingohub and override existing file in default directory

$ ct-lingohub pull -p linguatest
Successfully pulled translations for project linguatest:

{ lang: 'en', path: 'i18n/en.i18n.json', error: 'OK' }
{ lang: 'pl', path: 'i18n/pl.i18n.json', error: 'OK' }
{ lang: 'ja', path: 'i18n/ja.i18n.json', error: 'OK' }

Available commands

There are avilable the following commands:

  • login
  • logout
  • projects
  • project-info
  • locals
  • download
  • upload
  • pull
  • push

login

$ ct-lingohub login --help
usage: ct-lingohub login [-h] -t TOKEN -a ACCOUNT

Login to lingohub and stores login token in ~/.ct-import.auth file

Optional arguments:
  -h, --help            Show this help message and exit.
  -t TOKEN, --token TOKEN
                        token to be used for accessing Lingogub API
  -a ACCOUNT, --account ACCOUNT
                        account name to be used together with TOKEN

logout

$ ./ct-lingohub logout --help
usage: ct-lingohub logout [-h]

Logout from lingohub. It removes login token from ~/.ct-import.auth file

Optional arguments:
  -h, --help  Show this help message and exit.

projects

$ ./ct-lingohub projects --help
usage: ct-lingohub projects [-h] [-t TOKEN] [-a ACCOUNT] [-j] [-n]

List all projects registered in the system

Optional arguments:
  -h, --help            Show this help message and exit.
  -t TOKEN, --token TOKEN
                        token to be used for accessing Lingogub API
  -a ACCOUNT, --account ACCOUNT
                        account name to be used together with TOKEN
  -j, --json            Print results in json format only
  -n, --no-header       Do not print any headers for the results - just data

project-info

$ ./ct-lingohub project-info --help
usage: ct-lingohub project-info [-h] [-t TOKEN] [-a ACCOUNT] [-j] -p PROJECT
                                [-n]
                                

Get detailed inforamtion about a particular project

Optional arguments:
  -h, --help            Show this help message and exit.
  -t TOKEN, --token TOKEN
                        token to be used for accessing Lingogub API
  -a ACCOUNT, --account ACCOUNT
                        account name to be used together with TOKEN
  -j, --json            Print results in json format only
  -p PROJECT, --project PROJECT
                        project name to displayed information about
  -n, --no-header       Do not print any headers for the results - just data

locals

$ ./ct-lingohub locals --help      
usage: ct-lingohub locals [-h] [-t TOKEN] [-a ACCOUNT] [-j] [-n] -p PROJECT

List all destination languages defined in a particular project

Optional arguments:
  -h, --help            Show this help message and exit.
  -t TOKEN, --token TOKEN
                        token to be used for accessing Lingogub API
  -a ACCOUNT, --account ACCOUNT
                        account name to be used together with TOKEN
  -j, --json            Print results in json format only
  -n, --no-header       Do not print any headers for the results - just data
  -p PROJECT, --project PROJECT
                        project name to displayed information about

download

$ ./ct-lingohub download --help
usage: ct-lingohub download [-h] [-t TOKEN] [-a ACCOUNT] [-j] [-n] -p PROJECT
                            -l LANG [-f PATH]
                            

get a translation file for a project

Optional arguments:
  -h, --help            Show this help message and exit.
  -t TOKEN, --token TOKEN
                        token to be used for accessing Lingogub API
  -a ACCOUNT, --account ACCOUNT
                        account name to be used together with TOKEN
  -j, --json            Print results in json format only
  -n, --no-header       Do not print any headers for the results - just data
  -p PROJECT, --project PROJECT
                        project name to displayed information about
  -l LANG, --lang LANG  language code for the expected translation i.e.:es or 
                        ar-AE
  -f PATH, --path PATH  save translation file under path. If not provided 
                        default it will save to ./i18n/#{lang}.i18n.json                       

upload

$ ./ct-lingohub upload --help  
usage: ct-lingohub upload [-h] [-t TOKEN] [-a ACCOUNT] [-j] [-n] -p PROJECT -l
                          LANG [-f PATH]
                          

upload a source file to lingohub

Optional arguments:
  -h, --help            Show this help message and exit.
  -t TOKEN, --token TOKEN
                        token to be used for accessing Lingogub API
  -a ACCOUNT, --account ACCOUNT
                        account name to be used together with TOKEN
  -j, --json            Print results in json format only
  -n, --no-header       Do not print any headers for the results - just data
  -p PROJECT, --project PROJECT
                        project name to displayed information about
  -l LANG, --lang LANG  language code for the expected translation i.e.:es or 
                        ar-AE
  -f PATH, --path PATH  save translation file under to path. If not provided 
                        default it will save to ./i18n/#{lang}.i18n.json

pull

$ ./ct-lingohub pull --help  
usage: ct-lingohub pull [-h] [-t TOKEN] [-a ACCOUNT] [-j] [-n] -p PROJECT
                        [-f PATH]
                        

pull entire project translation status

Optional arguments:
  -h, --help            Show this help message and exit.
  -t TOKEN, --token TOKEN
                        token to be used for accessing Lingogub API
  -a ACCOUNT, --account ACCOUNT
                        account name to be used together with TOKEN
  -j, --json            Print results in json format only
  -n, --no-header       Do not print any headers for the results - just data
  -p PROJECT, --project PROJECT
                        project name to displayed information about
  -f PATH, --path PATH  save translation file under to path. If not provided 
                        default it will save to ./i18n/#{lang}.i18n.json

push

$ ./ct-lingohub push --help
usage: ct-lingohub push [-h] [-t TOKEN] [-a ACCOUNT] [-j] [-n] -p PROJECT
                        [-f PATH]
                        

push all translations files into LinguHubs system.

Optional arguments:
  -h, --help            Show this help message and exit.
  -t TOKEN, --token TOKEN
                        token to be used for accessing Lingogub API
  -a ACCOUNT, --account ACCOUNT
                        account name to be used together with TOKEN
  -j, --json            Print results in json format only
  -n, --no-header       Do not print any headers for the results - just data
  -p PROJECT, --project PROJECT
                        project name to displayed information about
  -f PATH, --path PATH  save translation file under to path. If not provided 
                        default it will save to ./i18n/#{lang}.i18n.json