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

vue-google-translation-sheets

v1.0.9

Published

A **free** Package for importing key values from google sheets to the application (for development and can only be used with vue-i18n package)

Downloads

5

Readme

google-translate-for-vue

A free Package for importing key values from google sheets to the application (for development and can only be used with vue-i18n package)

Install

npm install --save vue-google-translation-sheets

Usage

Read all values from google sheets and create separate json for each language

Configuration

Google Api

  • head to https://console.developers.google.com/
  • create a new project
  • Make sure to activate Sheet Api for the project
    • Navigate to "Library"
    • Search "Google Sheets API" > Click on "Google Sheets API"
    • Click "Enable"
  • Create a Service Account and credentials
    • Navigate to "Credentials"
    • Click "Create credentials"
    • choose "Service Account key"
    • Choose A "New Service Account" in the "Service account" select
    • Choose a name. (ie. This is the name that will show up in the Spreadsheet history operations), "Editor" as role and "JSON" for the key type.
    • Save the credentials to root folder. (You can choose another name/folder if you want in your application folder)
    • Make sure to write down the service account email, you will need it later for the package configuration.

Spreadsheet

Required configuration

In your .env file (Create .env file in root folder)

# Path to the downloaded service account credentials file (in root folder)
GOOGLE_SERVICE_ACCOUNT_CREDENTIALS = "../../LanguageTransalation-dce184a223e3.json"

# The ID of the spreadsheet that we will be using for translation
SPREADSHEET_ID= "1LlU6SRjPCR1WQ2S2gP4KiHhcDuEoXxgSgmFEx_PiiwI"

#path to store transalation files
PATH = "./src/lang"

# The locales of the application (separated by comma) 
LOCALES=en,no,pl,sw

npm script

Add this script to your package.json to pull sheets

"scripts": {
    "translate": "node node_modules/vue-google-translation-sheets/index.js"
  },

Usage

Run script

This need to be done only once.

$ npm run translate