
Ask HN: Best way to programmatically translate strings? - indicud
I&#x27;m very unfamiliar with this area. What&#x27;s the best way to programmatically translate strings from English to, let&#x27;s say, Norwegian? By &#x27;best way&#x27;, I&#x27;m specifically interested in accuracy.
======
gregjor
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.

