Topics

Follow-up to our news on making our site multilingual with the Google Cloud Translation API: Liberogic's trial and error

  • column

As announced in our news, the Liberogic website is now multilingual!

We currently support only six languages, but once you've done one, it's honestly pretty much the same, and you could say that supporting all the languages Google offers is also possible.

An experiment that started with "Let's just try translating it"

It started simply.
"With web accessibility getting more attention and more visitors coming from overseas, shall we try translating it?"
That was the casual vibe.
But doing it properly turns out to be harder than expected. Translation APIs, caching, builds, costs, cache updates... there were far more tangled details behind the scenes than we imagined.
So for this multilingual project, we used Google Cloud Translation API and adopted a system that automatically translates during the build.

How it works

During the build, scripts/translate-html-cache.mjs runs.
The cache (translate-cache.json) is checked first; if a translation already exists there, it is used. Otherwise, the Google Translation API is called to translate the text.
New translations are appended to the cache and reused from then on. However, cache changes are not reflected in automatically deployed environments, so the key is to build and push once locally.

This way, unnecessary API charges can be avoided. (In the early days, you'll end up staring at the Google billing screen quite a bit... lol)

Fighting the Quirks of Translation

As you try it out, you'll run into all sorts of translations with their own flavor.
"Liberogic Inc." sometimes came out as "Liberlogic Inc." and at other times as "Libelogic"....

Honestly, it's getting a bit chaotic! I also tried Google's Glossary feature, but it only works at the sentence level, so it's hard to control "Liberogic Inc." on its own.
So in the end, I built our own replacement logic.

en: [
  { from: /Liberlogic/g, to: 'Liberogic' },
  { from: /Libelogic/g, to: 'Liberogic' },
],
de: [
  { from: /Liberlogic/g, to: 'Liberogic' },
  { from: /Libelogic/g, to: 'Liberogic' },
],

I also connected it with a Google Sheet, so the rules registered there are applied automatically. This way, both "Liberogic" and "Liberozee" are protected.

How We Chose the Supported Languages

We started with English, Chinese (Traditional and Simplified), and French and Spanish. Since Japanese was already covered, that makes six languages.
On Slack, there was also this exchange.

"What about Russian? How about Korean and Thai?"

"Arabic can wait for later since the CSS is a hassle."

"No, let's skip Hindi for now, since it might cause a huge spike in traffic."

...And so we chose our languages in a fairly casual way.
That said, I've read somewhere that these six languages reportedly cover more than 75% of internet users worldwide.

Are we actually becoming more global than I thought?

Here are some example URLs as they currently stand:

We plan to expand to around 30 languages over time.
We also plan to take on Arabic, which is read right to left (RTL support), at some point.
Stay tuned!

Summary: Multilingual Made Easy

This approach is ideal for clients who want to "start by trying out translation!"
With the Google Cloud Translation API and cache-based operation, you can build a multilingual site at a relatively low cost.
It is also a great test phase before pursuing full-scale localization.

✳️ By the way

Some translated text or layout may feel a little off as we're still refining things. Thank you for your patience! (Since we prioritized the release, we'll fix the finer details with CSS later!)

🌏 A Quick Note

"Even if a translation isn't perfect, it can still reach the world."
With that spirit, Liberogic continues building for the web today. Even when it's not perfect, something can still get across. That's why we try things ourselves before showing them to our clients. Failure is part of the process, and experimentation comes first. Liberogic continues to test and refine at the forefront of the web today.
While we were saying all that, Google Translate kept evolving day by day! The end.

About the author

Though I'm the president, I'm always a hands-on counterpart. I take joy in understanding new technologies and in those moments when something becomes more convenient, and I love being completely absorbed in the work on the ground. I get excited about future technologies and want to keep enjoying new experiences no matter how old I get.

Tadanori Morimoto

Project Manager / Director / Founded 2007

View this staff member's articles

Reliable team structure and responsive support are our strengths

Liberogic's experienced staff actively drive projects forward, which has earned high praise from our clients.
We make sure to properly assign project managers and directors to keep the entire project running smoothly. Our style of allocating resources to the right people, rather than adding full-time commitment unnecessarily, helps prevent cost increases. We are also known for our speed, from understanding the scope of work to preparing and submitting estimates.

Note: Please be advised that we do not actively engage in SES-style on-site staffing assignments.

We support nearly all major project management and chat tools, including Slack, Teams, Redmine, Backlog, Asana, Jira, Notion, Google Workspace, Zoom, and Webex.

Have a web challenge? Let us know.

Case Studies