How to translate the UI in any language

Nice products, thanks!

How can I translate interface of openboxes to another language?

Thank you!

@wishmaster Thank you. What language were you looking to use?

Hi,
I am looking for russian language.

OpenBoxes supports a ton of locales (languages) out of the box, but they’re not all available for the user to choose. We can add a new locale (language) to the application by modifying openboxes.locale.supportedLocales. I will add Russian as one of the default locales to the next release.

If you have your own server you can add the following properties above to the openboxes-config.groovy file.

openboxes.locale.custom.enabled = true
openboxes.locale.defaultLocale = 'en'
openboxes.locale.supportedLocales = ['ar', 'en', 'fr', 'de', 'it', 'es' , 'pt', 'ru']

To see how this will work, you can log into the demo server and can click on the following link. This will immediately change your current locale to Russian.

https://demo.openboxes.com/openboxes/user/updateAuthUserLocale?locale=ru&targetUri=%2Fdashboard%2Findex%3F&lang=ru

However, as you’ll notice not many of the labels have been translated to Russian yet (just the languages and months).

So how do you translate all of the labels? Unfortunately, it’s a bit time-consuming.

  1. The first option is to copy the messages.properties file under https://github.com/openboxes/openboxes/tree/develop/grails-app/i18n, save the file as messages_ru.properties and just start translating as best as you can. When you’re done, send me the translations and I’ll add them to the next release.
  1. A second option (which is similarly arduous, but a little more fun) is to enter all of these translations into the database using our Translation Mode (NOTE: This is not enabled on demo.openboxes.com, but I could do that tomorrow if you’re interested in testing it out).
    a. Enable translation mode

    b. Choose a locale
    Pick%20Locale
    c. Click on any of the green or red icons next to any word on the page
    png
    d. Create a new localization entry for any label on the page

    e. Refresh the megamenu to view the change
    megamenu-translated
  1. A third option (which requires some development) would be to implement crowd-sourced translations through an API like Transifex (https://www.transifex.com/). I’ve been hoping to work on this at some point in the not-so-distant future, but would be happy to have someone else with experience take it on.

Hey, I was looking for Chinese version, could this be added in the future?

Hey Rahul

Yeah I’ll create a ticket to add the localization configuration for Chinese (zh). I’ve recorded a few videos to explain how to add translations but have yet to publish them to our tutorials page. I’ll do that as part of the ticket. I’ve also been trying to figure out the best way to crowd source translations but don’t have a solution yet. If you have any ideas please let me know.

Thanks for the recommendation.

Justin

Here’s the ticket. I should be able to get it done this week.

@jmiranda Thanks for the quick response and especially appreciate that you can get Chinese locale added. Almost my entire customer base is Chinese and most of them are unable to read and understand English so this feature basically allows me to use it for my business.

One thing to note … it’s pretty easy for us to add a new supported locale / language. The hard part will be doing the actual translations for all of the localized messages (2700 and counting). We could probably throw the translation file through Google Translate (or a similar service) to get started but the translation process is not as straightforward / user-friendly as I would like.

Hey @techfourk I just created a branch for the Chinese locale. I’m going to create a PR today or tomorrow, but I might not be able to merge until later next week. Here’s quick video demonstration.

https://drive.google.com/file/d/14HxLFmyidhkp0vUl2rXkXr0H4dYWXEsy/view

@techfourk Here’s the PR I just pushed for the ticket https://github.com/openboxes/openboxes/issues/1839.

You can find the Chinese translation file here.

Here’s a video demonstrating a quick and dirty way of translating all known localized messages in the system. It doesn’t seem to cover as much as I expected so we might need to do a few passes to translate the whole system.

https://drive.google.com/file/d/1ZkQFISMcf5aNEV4uQgL4Km1WjICdSxs9/view

Cheers @jmiranda, will get to work on getting the content translated.

Also a quick suggestion, could we run the clear cache function immediately after the locale change function has finished? Ie. When a different locale is selected, it would automatically refresh cache once finished.

@techfourk Ah yeah I meant to add that in. Thanks for the reminder.