How-to

levelsio 用 AI 给 Hotelist 加 9 种语言 i18n,只花 10 分钟

Why we picked it

levelsio 让 AI 10 分钟给 Hotelist 加了 9 种语言,彻底绕开 t() 翻译函数那套老办法,做独立产品的不妨参考。

独立开发者 levelsio 在 X 上分享,他用 AI 给自己的酒店网站 Hotelist 添加了国际化支持,全程只花 10 分钟。过去他嫌 i18n 需要把每个词包进 t('cinnamon rolls','pt-br') 这类翻译函数、让代码难以阅读,所以一直没做过。现在他不再自己读代码或做 code review,直接让 AI 处理。Holist 目前支持英、西、德、法、意、葡(葡萄牙/巴西)、简繁中文共 9 个语言版本,本地化页面还可能带来 SEO 收益。

Original · Pieter Levels

🌎 I always hated internationalization (i18n) of my websites, it always involved some hacky solutions and making my codebase unreadable

Wrapping every single word in some translation function like

> t('cinnamon rolls','pt-br')

So I never ever did it!

With AI however, I never read my code base anymore, nor do code review, so it doesn't matter anymore

So I've added i8n to Hotelist, it may possibly have some benefits for SEO to as it's localized

This took 10 minutes btw to do! 😍

Right now I have: - 🇬🇧 English: https://t.co/jbe10CFiE8 - 🇪🇸 Spanish: https://t.co/8k0yk6g3kA - 🇩🇪 German: https://t.co/An9kIdPAKC - 🇫🇷 French: https://t.co/GHbHCqdcqQ - 🇮🇹 Italian: https://t.co/srZjCWeRJd - 🇵🇹 Portuguese (Portugal): https://t.co/VJidvhM0ix - 🇧🇷 Portuguese (Brazil): https://t.co/kcAgBjaNS3 - 🇨🇳 Chinese (Simplified) https://t.co/Z9qeYG1Ciu - 🇹🇼 Chinese (Traditional) https://t.co/qE2nSBSs7v