DEV Community

Aleksey Razbakov
Aleksey Razbakov

Posted on

1

i18n + Google Spreadsheet = ♥️

I created a CLI tool to synchronise translations from Google Spreadsheet to yaml/json files.

I was using it already for couple projects and today was starting a new one and realised that I better do it configurable and publish on npm to make it easier.

https://github.com/razbakov/sourcy

Installation

yarn add @razbakov/sourcy -D
Enter fullscreen mode Exit fullscreen mode

Add to package.json:

{
  "scripts": {
    "sourcy": "sourcy"
  }
}
Enter fullscreen mode Exit fullscreen mode

Create sourcy.config.js in project root:

module.exports = {
  sources: [
    {
      spreadsheetId: "spreadsheet id",
      range: "sheet name",
      output: "./locales/",
      transformer: "i18n",
      format: "yaml", // or json
    },
  ],
};
Enter fullscreen mode Exit fullscreen mode

Execute and follow instructions:

yarn sourcy
Enter fullscreen mode Exit fullscreen mode

Transformer: i18n

Input:

key en de es ru
home.title Home Startseite Página inicial Главная

Output:

en.yml
    home.title: Home

de.yml
    home.title: Startseite

es.yml
    home.title: Página inicial

ru.yml
    home.title: Главная
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay