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

super-lang-editor

v1.5.1

Published

Edit language files like a boss!!

Downloads

18

Readme

SuperLangEditor (SLE)

CLI editor using for edit multi language files. Start SuperLangEditor at the root folder in your project, it will scans all of language files. Now you can modify those files by features below.

  • Auto scan language files (ISO6391 standard or JSON extension)(v1.4.1).
  • Supports edit, remove, add new language key with autocomplete hint.
  • Show change logs after modified.
  • Supports Nesting and Inline format (v1.1.6)
  • Sort by key name (v1.2.0)
  • Rename/Move key (v1.3.0)
  • Search by key name (v1.4.2)
  • Naming convention converter (v1.4.0)
Features
  • Search by key
  • Edit values
  • Rename/move key
  • Remove key
  • Add new key/values
  • Sort by key
  • Key naming convention converter

Screenshot

  ____                                  _                             
 / ___|   _   _   _ __     ___   _ __  | |       __ _   _ __     __ _ 
 \___ \  | | | | | '_ \   / _ \ | '__| | |      / _` | | '_ \   / _` |
  ___) | | |_| | | |_) | |  __/ | |    | |___  | (_| | | | | | | (_| |
 |____/   \__,_| | .__/   \___| |_|    |_____|  \__,_| |_| |_|  \__, |
                 |_|                                            |___/ 
  Version: 1.5.0 by lnquy065
  JSON Format: nesting
======================================================================
? Select action:  (Use arrow keys)
❯ [🔍] Search by key 
  [➕] Add new key/values 
  [🔧] Edit values 
  [🔨] Rename/move key 
  [💥] Remove key 
  [🔃] Sort by key 
  [🔠] Key naming convention converter 
(Move up and down to reveal more choices)

Installation

npm install super-lang-editor -g

Usage

At the root folder of your project. Start it from terminal

super-lang

  • At start screen, please choose i18next format that you are using first.
? Select JSON format:  (Use arrow keys)
❯ Nesting (The parent key and the child key are nested) 
  Inline (The parent key and the child key are separated by a ".") 

Nesting format

{
    "home": {
        "hello": "Hello",
        "world": "World"
        }
}

Inline format

{
    "home.hello": "Hello",
    "home.world": "World"
}
  • SuperLang will scans all language files. Please choose files that you want to modify.
  ? Select language files:  (Press <space> to select, <a> to toggle all, <i> to invert selection)
  ❯◉ dist/locales/en.json - (English)
   ◉ dist/locales/vi.json - (Vietnamese)
   ◉ public/locales/en.json - (English)
   ◉ public/locales/vi.json - (Vietnamese)
  • Now we can select action
? Select action:  (Use arrow keys)
❯ [🔍] Search by key 
  [➕] Add new key/values 
  [🔧] Edit values 
  [🔨] Rename/move key 
  [💥] Remove key 
  [🔃] Sort by key 
  [🔠] Key naming convention converter 
(Move up and down to reveal more choices)

Features

[🔍] Search by key

Alt text

Support search by language key name. All nested object will be flatted to one level, it will be combined by dot. Let's search "newsTitle" that was nested in "pages":

? Select action:  Search by key
? Select language key name to view values: newsTitle
❯ pages.newsTitle
? Select action:  Search by key
? Select language key name to view values: pages.newsTitle
[English - en.json] pages.newsTitle: News
[Vietnamese - vi.json] pages.newsTitle: Tin tuc
? Enter to back!: 

Or search with multiple keyword

? Select action:  Search by key
? Select language key name to view values:  page setting title
❯ page.setting.account.title 
  page.setting.password.title 
  page.setting.information.title 

[🔧] Edit values

Alt text

Now we will edit "pages.homeTitle" to:

en.json
pages: {
    homeTitle: "Home Page"
}
vi.json
pages: {
    homeTitle: "Trang chu moi"
}
  • Input language key name need to edit value. All key name will be listed below for, select key need to edit
? Select action:  Edit values [Press 'ESC' to back to main menu]
? Input language key name to edit: pages.home
❯ pages.homeTitle
  • After input key name, SLE will shows questions for input new value for each languages file with default value.
? Select action:  Edit
? Input language key name to edit: pages.homeTitle
? [English - en.json] pages.homeTitle: Home page
? [Vietnamese - vi.json] pages.homeTitle: Trang chu moi

[➕] Add new key/values

Alt text We will add new object to "pageComponents" for all language files:

  • Before
"pageComponents": {
    "news": "news",
    "home": {
        "title": "Home Page"
    }
}
  • After
"pageComponents": {
    "news": "news",
    "home": {
        "title": "Home Page"
    },
    "about": {
        "title": "About
    }
}

[💥] Remove key

You can use this feature for remove value of a key or remove an object.

  • Input name of key that you want to remove:
? Select action:  Remove key [Press 'ESC' to back to main menu]
? Input language key name to remove: 
❯ pageComponents.news
  pageComponents.home.title
  pageComponents.about.title

Note: If you input "pageComponents.about.title", nested key is "title" will be remove. But if you input "pageComponents.about", "pageComponents.about" object will flies away.

- When remove "pageComponents.about.title"
en.json
{
    "pageComponents": {
        "news": "news",
        "home": {
            "title": "Home Page"
        },
        "about": {}
    }
}

- When remove "pageComponents.about"
en.json
{
    "pageComponents": {
        "news": "news",
        "home": {
            "title": "Home Page"
        }
    }
}

[🔨] Rename/move key

Rename

Alt text We will rename "page" to "pageComponents", "pageComponents.newsTitle" to "pageComponents.news"

  • Before
    page: {
        newsTitle: "News",
        homeTitle: "Home title"
    }
  • After
 pageComponents: {
        news: "News",
        homeTitle: "Home title"
    }
Move

Alt text Now, we will move "buttons" into "pageComponents"

  • Before
{
    buttons: {
        okLabel: "Ok",
        cancelLabel: "Cancel"
    },
    pageComponents: {
          news: "News",
          homeTitle: "Home title"
    }
}
  • After
{
    pageComponents: {
          news: "News",
          homeTitle: "Home title",
         buttons: {
                okLabel: "Ok",
                cancelLabel: "Cancel"
            }
    }
}
  • Or we can separate object like this Alt text

[🔃] Sort by key

Alt text

  • All language files will be sorted by key name (A-Z | Z-A)

[🔠] Key naming convention converter

Alt text

SLE support 3 of naming conventions

? Convert all language key name to: (Use arrow keys)
❯ Camel case 
  Kebab case 
  Snake case 
- Camel case
{
  "profile": {
    "home": {
      "hello": "Say hello",
      "myWorld": "World"
    },
    "myName": "My Name"
  }
}
- Kebab case
{
  "profile": {
    "home": {
      "hello": "Say hello",
      "my-world": "World"
    },
    "my-name": "My Name"
  }
}
- Snake case
{
  "profile": {
    "home": {
      "hello": "Say hello",
      "my_world": "World"
    },
    "my_name": "My Name"
  }
}

Show change logs

  • Change logs table will shows up after language files were modified. From this table, you can double click into language key to select and copy new language key, then you paste into your code.
Change logs: 
╔════════╤═════════════╤════════════════╤════════════════╗
║ Action │ Lang Key    │ assets/en.json │ assets/vi.json ║
╟────────┼─────────────┼────────────────┼────────────────╢
║ Edit   │ home.hello  │ Say hello      │ Say hello      ║
╟────────┼─────────────┼────────────────┼────────────────╢
║ Add    │ home.myName │ My Name        │ My Name        ║
╟────────┼─────────────┼────────────────┼────────────────╢
║ Remove │ home.myName │                │                ║
╟────────┼─────────────┼────────────────┼────────────────╢
║ Add    │ home.myName │ My Name        │ My Name        ║
╟────────┼─────────────┼────────────────┼────────────────╢
║ Rename │ home.myName │ profile.myName │ profile.myName ║
╟────────┼─────────────┼────────────────┼────────────────╢
║ Rename │ home.world  │ home.myWorld   │ home.myWorld   ║
╟────────┼─────────────┼────────────────┼────────────────╢
║ Rename │ home        │ profile.home   │ profile.home   ║
╟────────┼─────────────┼────────────────┼────────────────╢
║ Sort   │ A-Z         │ Sorted         │ Sorted         ║
╟────────┼─────────────┼────────────────┼────────────────╢
║ Sort   │ Z-A         │ Sorted         │ Sorted         ║
╚════════╧═════════════╧════════════════╧════════════════╝

Version change logs

1.4.2:
  • Improve search feature, allow multiple keywords.
  • Change input to select for edit values feature.
1.5.0:
  • Now you can cancel any action by use 'ESC' key or 'back' option.
  • Add icons.