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

supabase-lingo

v0.1.1

Published

Auto-translate your Supabase database content in real-time using Lingo.dev

Readme

supabase-lingo 🌍

npm version License: MIT Powered by Lingo.dev Supabase

Auto-translate your Supabase database content in real-time using Lingo.dev. Mark any column as @translatable — the rest is automatic.


The Problem

Your app is perfectly translated. UI is in Japanese. But your database content — product names, descriptions, blog posts, categories — is still English.

Japanese user opens your "translated" app:

Product Name → "Running Shoes Pro Max"     ← still English
Description  → "Best shoes for marathon"   ← still English  
Category     → "Sports & Outdoors"         ← still English

Every e-commerce app, marketplace, and content platform has this problem. Until now.


The Solution

npx supabase-lingo init

That's it. Mark your columns. Everything else is automatic.

-- Mark any column as translatable
COMMENT ON COLUMN products.name IS '@translatable';
COMMENT ON COLUMN products.description IS '@translatable';

Now when you insert a row:

INSERT INTO products (name, description) 
VALUES ('Running Shoes', 'Best shoes for marathon');

supabase-lingo automatically:

  1. 🔍 Detects the new row
  2. 🌍 Calls Lingo.dev to translate into 10 languages
  3. 💾 Saves all translations instantly
  4. ✅ Your app serves the right language to every user

How It Works

You insert English data
        ↓
Supabase Postgres Trigger fires
        ↓
Supabase Edge Function runs
        ↓
Lingo.dev CLI translates to 10 languages
        ↓
Translations saved to shadow table
        ↓
Your app queries the right language

Your original data is never touched. Always safe. Always the source of truth.


Installation

npm install supabase-lingo

1. Initialize

npx supabase-lingo init

This will:

  • Scan your Supabase DB for @translatable columns
  • Auto-create a translations shadow table
  • Deploy a Supabase Edge Function
  • Set up Postgres triggers on your tables
  • Configure Lingo.dev CLI as the translation engine

2. Mark Your Columns

COMMENT ON COLUMN products.name IS '@translatable';
COMMENT ON COLUMN products.description IS '@translatable';
COMMENT ON COLUMN blog_posts.content IS '@translatable';

3. Configure

Create supabase-lingo.config.ts in your project root:

import { defineConfig } from 'supabase-lingo';

export default defineConfig({
  supabaseUrl: process.env.SUPABASE_URL!,
  supabaseKey: process.env.SUPABASE_SERVICE_KEY!,
  lingoApiKey: process.env.LINGO_API_KEY!,
  locales: ['ja', 'ar', 'hi', 'de', 'fr', 'es', 'zh', 'ko', 'pt', 'ru'],
  sourceLocale: 'en',
});

4. Query Translations

Use our query helper to get content in any language:

import { createLingoClient } from 'supabase-lingo';

const lingo = createLingoClient(supabase);

// Get products in Japanese
const products = await lingo
  .from('products')
  .select('*')
  .locale('ja');

// Returns:
// { name: 'ランニングシューズ', description: 'マラソンに最適なシューズ' }

What Gets Created

Shadow Translations Table (auto-created)

CREATE TABLE _lingo_translations (
  id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  table_name  TEXT NOT NULL,
  row_id      TEXT NOT NULL,
  column_name TEXT NOT NULL,
  locale      TEXT NOT NULL,
  value       TEXT NOT NULL,
  created_at  TIMESTAMPTZ DEFAULT NOW(),
  updated_at  TIMESTAMPTZ DEFAULT NOW()
);

Your original tables are never modified.


Real-World Example

Before supabase-lingo

🇯🇵 Japanese user sees:
  Product: "Wireless Headphones"
  Price: "$99"
  Description: "Crystal clear sound quality"

After supabase-lingo

🇯🇵 Japanese user sees:
  Product: "ワイヤレスヘッドフォン"
  Price: "$99"
  Description: "クリスタルクリアな音質"

Supported Lingo.dev Tools

| Tool | Used For | |---|---| | Lingo.dev CLI | Core translation engine | | Lingo.dev CI/CD | Re-translate on content updates | | i18n.json config | Locale configuration |


Architecture

┌─────────────────────────────────────────┐
│           Your Application              │
│                                         │
│  INSERT INTO products (name, desc)      │
│         VALUES ('Shoes', 'Great')       │
└────────────────┬────────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────────┐
│         Postgres Trigger                │
│      (auto-created by supabase-lingo)   │
└────────────────┬────────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────────┐
│      Supabase Edge Function             │
│   supabase-lingo/translate-handler      │
└────────────────┬────────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────────┐
│           Lingo.dev CLI                 │
│   Translates to 10 languages via AI    │
└────────────────┬────────────────────────┘
                 │
                 ▼
┌─────────────────────────────────────────┐
│       _lingo_translations table         │
│  ja: ランニングシューズ                    │
│  ar: أحذية الجري                        │
│  hi: रनिंग शूज़                          │
│  de: Laufschuhe                         │
│  ... 6 more locales                     │
└─────────────────────────────────────────┘

CLI Commands

# Initialize supabase-lingo in your project
npx supabase-lingo init

# Scan and list all @translatable columns
npx supabase-lingo scan

# Manually trigger translation for a table
npx supabase-lingo translate --table products

# Check translation status
npx supabase-lingo status

# Remove supabase-lingo from your project
npx supabase-lingo teardown

Why Lingo.dev?

Unlike Google Translate or DeepL, Lingo.dev understands context. It knows the difference between translating a product name vs a full blog post. It preserves formatting, handles pluralization, and produces translations that feel native — not robotic.


Demo

🎬 Demo video coming soon


🌍 Live Demo: https://supabase-lingo-demo.vercel.app

Built With


Contributing

PRs welcome! See CONTRIBUTING.md for guidelines.


License

MIT © Shivam Chavan