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

poeditor-cli

v1.1.1

Published

Command line tool for managing translation terms for POEditor.com

Downloads

29

Readme

poeditor-cli

As a developer it's really annoying to open the POEditor.com website just to add a few new translations terms or change existing ones. With this command line tool, that will not be neccessary anymore (mostly).

The naming conventions for the commands are inspired by git.

Configuration

There are two ways to configure the commandline tool. A global configuration and a local configuration. The local configuration refers to the .poeditor-config file in the current working directory (e.g. the directory poeditor is being executed in).

You can either use the command poeditor config to set a specific configuration, or simply edit the configuration file manually (the config is saved as JSON).

The following configuration options are available:

  • targetDir - The target directory, where the downloaded translations should be written to [default: ./]
  • apiToken - The API-Token to access your POEditor.com account
  • projectId - The id of the project you want to manage as a default
  • projectLanguages - An array of languages that should be managed (must exist in the project)
  • defaultLanguage - The default language for the project on POEditor.com [default: en-us]
  • exportType - The downloaded translations from POEditor.com can be saved in a few different filetypes. Currently json, json-properties and properties are supported. A custom exporter can also be provided, see below. [default: properties]
  • exportSingleFileTarget - You can either save all the downloaded translations in the defined exportType in a single file or in multiple files, where each file is for a different translation language [default: false]

On the first run in a specific working directory, you will be asked by to provide a few configurations like the API-Token, that will already put a few configurations into your .poeditor-config file.

Export types

  • json - This export type just saves the downloaded translations as json in either a single file or multiple files
  • properties - Saves all the downloaded translations into multiple .property files

You can also provide your own custom exporter. For that you only need to provide the exporter js file path starting at the working directory. That javascript file should export a function that takes three parameters config, files and callback. config contains the configuration for the current execution or poeditor, files contains the downloaded translations and callback is a function that should be called by the exporter as soon as it is done writing to the target directory.

How to use

Install

npm install -g poeditor-cli

Run

You should now be able to use the command line tool by typing poeditor [command].

Commands

Usage: poeditor [options] [command]

Commands:

pull                                   Download translations from POEditor
push                                   Upload newly added/staged translations to POEditor
config                                 Perform some configurations
add <term> <defaultTranslation>        Add new translation term with a key and the default translation
reset                                  Clears POEditor staging area
projects                               Displays the available projects for the given API-Token
status                                 Displays the current staging are, e.g. Terms that still have to be pushed to the POEditor server
statistics                             Displays the current projects completition statistics
help [cmd]                             display help for [cmd]

Options:

-h, --help     output usage information
-V, --version  output the version number