For static UI strings WP uses the gettext system. There are a number of translation functions like __()
to convert a static string into another language. See
https://developer.wordpress.org/themes/functionality/internationalization/
If your theme is accepted into the WP repository, the Polyglots team will help you develop translations into multiple languages. Otherwise you need to compile your own language files.
Thank you! Question: how does this method compare versus just adding custom fields for every string and then setting them with Bogo translate plugin? Perhaps one difference is that publishers can’t change those strings in gettext system? And in terms of speed and how easier to set up for a dev?
-
This reply was modified 1 month, 2 weeks ago by
snippet24.
I’ve no experience with Bogo. Based on your brief description, I’d say Bogo is easier to use and more understandable of what’s going on. Gettext is a little esoteric if you need to compile your own translation files. The process involves some command line tools. But if your plugin goes into the WP repository, the Polyglots team will handle this for you, you merely need to use the correct functions in your code. Since the scheme is native to WP, no added plugin is needed. It’s a big advantage for plugins in the repository.
Thank you so much!! I will take a look into it, I only wish though it was simpler