Support » Developing with WordPress » What is the best way to translate static non-dinamic content?

  • Resolved snippet24

    (@snippet24)


    So I already have Bogo plugin for content managed dynamically from within WordPress, but what is the best option for translating non-changing static content of a theme? Do note it doesn’t have to be a WordPress plugin, cloud be for exampple a github library/script… I don’t mind having to refresh the page for content to be switched.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    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.

    Thread Starter snippet24

    (@snippet24)

    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.
    Moderator bcworkz

    (@bcworkz)

    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.

    Thread Starter snippet24

    (@snippet24)

    Thank you so much!! I will take a look into it, I only wish though it was simpler

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.