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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nestjs-i18n-google-sheet

v1.0.2

Published

NestJS I18n Google Sheet

Readme

Table of Contents

Description

Simplify your translation workflow!

Traditional i18n solutions often require code changes and redeployment for translation updates. With nestjs-i18n-google-sheet, your translations live in Google Sheets, enabling:

  • Real-time translation updates without deployment
  • Collaborative translation management
  • Non-technical team member participation
  • Version control and change history
  • Easy integration with existing translation workflows

Installation

Install the package using npm:

npm install nestjs-i18n-google-sheet

Example

Integrate nestjs-i18n-google-sheet into your NestJS application:

  1. Import the module into your AppModule:
import { I18nGoogleSheetModule } from 'nestjs-i18n-google-sheet';

@Module({
  imports: [
    I18nGoogleSheetModule.forRootAsync({
      googleSheetId: 'your-sheet-id',
      credentials: {
        // Your Google API credentials
      }
    }),
  ],
})
export class AppModule {}
  1. Use the translation service in your controllers or services:
import { I18nGoogleSheetService } from 'nestjs-i18n-google-sheet';

@Controller()
export class AppController {
  constructor(private readonly i18nService: I18nGoogleSheetService) {}

  @Get()
  async translate() {
    return this.i18nService.getMessagesV2({sheetName, issuer, langs}, refresh?);
  }
}

Configuration

The module accepts the following configuration options:

interface I18nGoogleSheetOptions {
  /**
   * Google API credentials
   */
  credentials: {
    private_key: string;
    client_email: string;
  };
  
  /**
   * Map of sheet names to their Google Sheet IDs
   * Example: { "main": "1abc...xyz", "marketing": "2def...uvw" }
   */
  spreadSheetIds: Record<string, string>;
  
  /**
   * List of supported language codes
   * Example: ["en", "zh", "ja", "ko"]
   * Optional
   */
  supportedLanguages?: string[];
  
  /**
   * Enable Redis caching
   * Optional, defaults to false
   */
  useRedis?: boolean;
  
  /**
   * Redis client instance
   * Required if useRedis is true
   */
  redis?: Redis;
}

Example configuration:

import { I18nGoogleSheetModule } from 'nestjs-i18n-google-sheet';
import Redis from 'ioredis';

@Module({
  imports: [
    I18nGoogleSheetModule.forRootAsync({
      credentials: {
        private_key: process.env.GOOGLE_PRIVATE_KEY,
        client_email: process.env.GOOGLE_CLIENT_EMAIL,
      },
      spreadSheetIds: {
        main: process.env.MAIN_SHEET_ID,
        marketing: process.env.MARKETING_SHEET_ID,
      },
      supportedLanguages: ['en', 'zh', 'ja', 'ko'],
      useRedis: true,
      redis: new Redis({
        host: 'localhost',
        port: 6379,
      }),
    }),
  ],
})
export class AppModule {}

Google Sheet Setup

  1. Create a new Google Sheet (you can use this template as a starting point)
  2. Share it with your service account email
  3. Get your spreadsheet ID from the URL:
    • Open your Google Sheet
    • The URL will look like: https://docs.google.com/spreadsheets/d/1bsbDPWfYWyfp6UOfG3hXMQSOtkygEZa2_J2ewO2vuBo/edit#gid=0
    • The spreadsheet ID is the long string between /d/ and /edit: 1bsbDPWfYWyfp6UOfG3hXMQSOtkygEZa2_J2ewO2vuBo
  4. Format your sheet with the following columns:
    • Overview (section name)
    • Note (additional context)
    • Key (translation keys)
    • Source text (EN)
    • Comments (context for translators)
    • Language columns (JP, KR, ID, VI, TH, etc.)

Example sheet structure from the template: | Overview | Note | Key | Source text (EN) | Comments | JP | KR | ID | VI | |----------|------|-----|------------------|----------|----|----|----|----| | Title | enhncr.title | AI Video Enhancer | Source text | Context | 日本語 | 한국어 | Bahasa | Tiếng Việt |

The template includes support for multiple languages and provides a structured format for managing translations efficiently.

Contact and Feedback

Feel free to reach out if you have any questions or suggestions.

License

This project is licensed under the MIT License - see the LICENSE file for details.