Hello Arches developers. We’ve heard from a few members of the community that they would like Arches to support multiple languages so that their users can interact with resource information in languages other than English.
Generally, localization of an application simply involves translating the user interface. In Arches this is complicated by the fact that the application contains a mixture of both static strings as well as dynamically created strings (such as those created as part of model and card configuration). Translating static strings is accomplished by using standard .po files and well understood text replacement logic. Translating dynamically defined strings is a bit trickier.
Adding to the complexity, is the fact that users might want to edit resource instances in multiple languages, which is another kind of dynamic string that needs to be localizable. Finally, RTL (right-to-left) languages need to be considered (eg: Arabic, Hebrew, etc...), which is another non-trivial task.
We’ve spent a bit of time identifying (at a high level) portions of the Arches code that would need to be updated to support multiple languages. These include:
> All static labels in the UI
> Arches Designer (Dynamic labels and UI)
- nodes
- cards
- widgets
- help files
- String data types (e.g.: string, domain, boolean)
> Data import/export
- graph import
- any localized elements should be importable
- all language codes should be preserved (even those not currently in the system)
- old style graphs should be importable (backward compatibility)
- graph export
- exported graph should include all translations of all localized elements
> Arches Data
- all different localized strings need to reference the same resource instance (for search)
- users would like to see if there is data in alternate languages (need api)
- backward compatibility?
- data migration from old datatype
- update primary descriptor function
- refactor to be an external overridable function
- update/add unit tests
- jsonld import
- use lang attribute on json nodes
- jsonld export
- search
- remove term index and port to resource index (compatible with new RDM)
- use search-as-you-type datatype for string data
- add “languageid” to strings property in resource index
- update term search filter component
- add language filter search component (within new “advanced filters” expandable section)
> RTL integration
- confirm images make sense in RTL
- html templates need to be confirmed
- confirrm 3rd party modules (eg: dropzone, chosen, select2, moment, etc...) work in RTL
- absolutely positioned elements in UI need to be updated
- css floats
> Documentation/Testing
- documentation of how to implement internationalization for users and developers
- general testing/QA
- QA
- testing
> When considering possible technical solutions it would be nice if they had the following attributes:
- Minimize the use of database migrations
- Be backward compatible with existing Arches instances and datafacts like exported graphs and datafiles(csv, json, etc..)
- Minimize the impact on any custom components that users have already created
- Be able to easily add or remove languages
> We’ve started testing some possible technical approaches to address these issues, including:
- Using well known django packages that address translating dyanmic strings
- relies on updating the database schema with additional columns suffixed with the language bidi
- presents a single language to the UI
- JSONField not supported by default - this would need to be patched
- relies on updating the database schema with additional columns suffixed with the language bidi
- presents a single language to the UI
- Creating our own system of translating dynamic strings
- We've already tested a system of using a single JSONField to replace the dyanmic field
- Stores localized data in a single json object keyed with the languages bidi
- Can present the json object to the UI or can be configured to present a single language to the UI
- Database migrations might not be reqired when languages are added
However, we would really like to open the discussion of how to implement support for multiple languages up to the full developer community. Please let us know how you have dealt with internationalization in other projects, pros and cons to specific patterns, and libraries that you feel might help in supporting mutlitple languages in Arches. We are also very interested in hearing how you have solved the data representation, import/export, and indexing issues in your work.
Finally, we would definitely benefit from specfic use cases for multi-language Arches applcations. If you have real-world requirements for multiple languages, please share them with us!
Thanks in advance for any input that you might have in supporting multiple languages in Arches.