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

nuxt-i18n-utilities

v0.0.11

Published

A set of utilities for automatically collecting translation keys, and automatically translating these keys

Downloads

72

Readme

nuxtjs-i18n-utiltties

A set of utilities for automatically collecting translation keys, and automatically translating these keys

Installation

npm install nuxt-i18n-utilities --save-dev

Config

Add i18n-utilities.config.js to the project root.

const defineI18nUtilitiesConfig = require("nuxt-i18n-utilities/config");

module.exports = defineI18nUtilitiesConfig({
  // Default directories for searching translation keys.
  // In these directories, the parser will look for calls to the "$t('key')" function and collect keys for the translation dictionary.
  directories: ["./layouts", "./pages", "./components"],
  // Default files extensions
  files: ["*.vue", "*.js"],
  // Default localization in sources
  // Represents the short country code
  sourceLanguage: "en",
  langDir: 'lang',
  locales: [
    {
      code: 'en',
      file: 'en.json'
    },
    {
      code: 'ru',
      file: 'ru.json'
    },
  ],
  googleProjectId: null
});

or use bash script

npx i18nu-init

Usage

npx i18nu-parse

Will search for keys for translation and offer to write the result to the folder specified in the config in the "langDir" field under the name of the locale file specified in the configuration as "sourceLanguage". The utility only records json for now.

npx i18nu-translate

Will translate keys for all locales specified in the config and write the result to json files