News for hackers. Stuff that matters.
Re:Ask HN: Best way to programmatically translate strings? by gregjor on Friday November 16, 2018 @03:31AM (#18467396)
The best way is to get the text professionally translated. You can use the gettext utilities and library to switch languages based on locale, or look them up from a database. I use gettext on a few websites to extract text strings, send them for translation in .po format (find a translator who can use POEdit), then display the translations on locale/language switch.

You can use the Google Translate API to do it on the fly but accuracy may suffer.