🙋‍♂️️About 📖 Writings

Posted on 5 Nov 2025 by Claudio Santini

With LLMs it has become much easier to generate localized versions of your application’s text.

On my NextJS projects, I typically use the next-intl module for localization.

Next-intl requires a folder with JSON files for each supported locale, e.g. en.json, es.json, fr.json etc. This script generates those files automatically starting from the en.json file, using the Gemini API to translate the text.

import {promises as fs} from 'fs';
import path from 'path';

const supportedLocales = ['en', 'es', 'fr', 'de', 'it', 'ja']; // Edit this list as needed

const googleGenAI = new GoogleGenAI({apiKey: process.env.GOOGLE_API_KEY});

fun...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help