[Multilingual Component] [Multilingual mobile component] - multiple translation files allowed?

Forge Component
(16)
Published on 20 May by OutSystems R&D
16 votes
Published on 20 May by OutSystems R&D

Does the application assume a single translation file per locale?  

We're building a mobile app.  Our customer provided multiple jsons per user journey.  So for example the user details page has a different translation file than the main menu.  We've added the translations to OnInitialize events for now, using the journey and locale as inputs to find the right file.  All of the text objects have data-trans attributes.

Now, it works fine for the main screen - but the left hand menu is not translated.  Am I right in thinking that because the menu translations are in a different file, the app's active translations are effectively replaced every time the screen changes?

I think our options are - 

1. Combine all translations into a single file per locale (pasting the menu translations into every file seems wrong) 

2. Bite the bullet, switch to a database, and give them a web app to manage their translations instead of dozens of jsons!

Any other options?

Andy


Hi Andy Borthwick,

This component depends on the JSON file which we upload as a resource under the project.

And no matter how any locales you want to use, it's just a matter of adding one more array for each new locale we required.

[
  {
    "locale": "pl",
    "isRightToLeft": false,
    "translations": {
      "08e142ce-dc09-4cbc-ad57-b925a5f7b700": "Nie masz zadan do wykonania. Mozesz isc nkawe.",

    } 
  },
  {
    "locale": "pt",
    "isRightToLeft": false,
    "translations": {
      "08e142ce-dc09-4cbc-ad57-b925a5f7b700": "Está tudo feito! Vá tomar um café.",
    } 
  },
  {
    "locale": "ar",
    "isRightToLeft": true,
    "translations": {
      "08e142ce-dc09-4cbc-ad57-b925a5f7b700": "?? ??? ??? ?????? ??. ???? ????? ??? ??????",
    } 
  }
]


If in case you want a different translation for the same text then it's just a matter of declaring that translation with different GUID.

you can use this Web Forge to manage the Multilingual Translation JSON.

https://www.outsystems.com/forge/component-overview/4667/mobile-translations

Hope it helps,

Assif

Thanks for getting back to me - we had a scenario where a customer was maintaining separate translation files for each user journey / epic - meaning that for a given screen with reusable bits like menus and so on, we would have multiple JSONs to reference, for the same language.  I'm moving to a database-driven approach so they can have better visibility of which text elements are missing translations in each language.


assif_tiger wrote:

<snip>