OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Improve i18n support and add missing translations

Open neubig opened this issue 1 year ago • 3 comments

This PR improves the internationalization (i18n) support in the frontend by:

  1. Adding missing translations for all supported languages (zh-CN, zh-TW, ko-KR, de, no, it, pt, es, ar, fr, tr) for:

    • Workspace labels and titles
    • Project and terminal status messages
    • Time-related messages
  2. Adding i18n test utilities and translation tests:

    • Added test to verify all translation keys have translations for all supported languages
    • Added test to detect duplicate translation keys
    • Added test utilities for i18n testing
  3. Updating UI components to use translations consistently

Fixes #6066 Fixes #4280

Here are examples of the localized screens. I have confirmed that all settings menus, etc. are localized. Screenshot 2025-01-07 at 9 40 02 PM Screenshot 2025-01-07 at 9 39 23 PM Screenshot 2025-01-07 at 9 38 57 PM Screenshot 2025-01-07 at 9 37 25 PM Screenshot 2025-01-07 at 9 37 07 PM


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:8236300-nikolaik   --name openhands-app-8236300   docker.all-hands.dev/all-hands-ai/openhands:8236300

neubig avatar Jan 06 '25 07:01 neubig

The localization is very incomplete. For instance, look at these two screens when Japanese is selected as a language:

Screenshot 2025-01-06 at 6 30 14 PM Screenshot 2025-01-06 at 6 28 56 PM

Only one part of the screen is actually translated in the two main screens. All of the English should be converted into the appropriate language when a different language is selected.

neubig avatar Jan 06 '25 09:01 neubig

@amanape , apologies that this is a huge PR but hopefully the logic is relatively straightforward.

neubig avatar Jan 07 '25 13:01 neubig

OK @amanape , I think this is ready for review again!

neubig avatar Jan 11 '25 16:01 neubig