Translating the user interface, repackaging, and releasing

I want to translate the interface of DMX into Chinese, and then repackage and release it. I don’t know how the official executable files are packaged. Can you teach me? Thank you!

Dear Liangbing,

your translation effort is appreciated!

To build DMX these tools are needed:

  • Java 8
  • Maven
  • Node.js
  • git

Building the DMX distribution (takes 3-5 minutes):

  1. git clone https://git.dmx.systems/dmx-platform/dmx-platform.git
  2. cd dmx-platform
  3. mvn clean install -P all,dist -DskipTests

The distro is then found in modules/dmx-distribution/target/dmx-5.0-beta-4-SNAPSHOT.zip

Translations might be needed in both places:

  • in modules, e.g. for type names (e.g. “Person”) see the JSON files in src/main/resources/migrations of the respective module
  • in node_modules, e.g. for GUI labels see .vue files in src/components of these 11 modules:
    • cytoscape-edge-connections
    • dm5
    • dm5-cytoscape-renderer
    • dm5-detail-panel
    • dm5-object-renderer
    • dm5-search-widget
    • dm5-topic-list
    • dm5-topicmap-panel
    • dm5-websocket
    • vue-font-awesome-search
    • vue-quill-minimum

Note that node_modules is created only while 1st build.

Once translations are made build the distro again by repeating step 3 above.

IMPORTANT: before building again you’re supposed to remove these lines from global pom.xml: https://git.dmx.systems/dmx-platform/dmx-platform/blob/master/pom.xml#L364-381
Otherwise your changes in node_modules will be lost when building again.

In principle this is the way how to translate the current SNAPSHOT version of DMX and redistribute it. In praxis however it will get more complex as you probably want not get stuck with the current DMX SNAPSHOT version, but as soon as DMX releases a new version you want to upgrade your one while keeping your translations. Possibly you can realize this by cloning the dmx-platform repo as well as the 11 Node.js module repos (as listed above) and merge our repos regularly in order to stay up-to-date.

Last but not least there is the legal aspect: the license used by DMX – the GPL – permits you to build a derived work, and to redistribute it. However you’re required to license that derived (translated) work under GPL as well, and to make all the source code public available.

Let me know if you need more info.

Thank you very much for your patience. Every reply is very professional. Let me learn new knowledge again. I will work according to the requirements of GPL license. I like DMX very much. I hope more people can participate in and use it.

Thank you again for your kindness! I wish you and your team all the best!

I have done most of the translation work according to the way you said, but there are still a few content can not find the corresponding place, as shown in the screenshot, but also trouble you to tell me where to find these content. Thank you very much!
QQ%E6%88%AA%E5%9B%BE20190707210458 QQ%E6%88%AA%E5%9B%BE20190707210521 QQ%E6%88%AA%E5%9B%BE20190707210542

For the missing words you have to check the .java files as well.

For “Administration” (line 23) and “System” (line 28) workspaces, and “Private Workspace” (line 33) see: https://git.dmx.systems/dmx-platform/dmx-platform/blob/master/modules/dmx-accesscontrol/src/main/java/systems/dmx/accesscontrol/AccessControlService.java

For “DMX” (line 17) workspace see: https://git.dmx.systems/dmx-platform/dmx-platform/blob/master/modules/dmx-workspaces/src/main/java/systems/dmx/workspaces/WorkspacesService.java

For “Topic Type” (line 501) and “Association Type” (line 503) see: https://git.dmx.systems/dmx-platform/dmx-platform/blob/master/modules/dmx-core/src/main/java/systems/dmx/core/impl/CoreServiceImpl.java

For “untitled” (line 17) see: https://git.dmx.systems/dmx-platform/dmx-platform/blob/master/modules/dmx-topicmaps/src/main/java/systems/dmx/topicmaps/TopicmapsService.java

That’s great you proceed with the translation!

Dear jri,thank you for your answer. I have basically completed the translation according to your instructions, but there are still three places where the corresponding documents are not found, as shown in the figure.

1.There is a “select” in the drop-down box when creating topic types.
QQ%E6%88%AA%E5%9B%BE20190713231916

2.“True” and “false” in view configuration:
QQ%E6%88%AA%E5%9B%BE20190713231512

  1. “Text” in data type:
    QQ%E6%88%AA%E5%9B%BE20190713231626
  1. A quick solution for “Select” would be to edit line 68 of node_modules/element-ui/lib/locale/lang/en.js
    There you’ll find placeholder: 'Select'

  2. “true” and “false” is not a matter of simple text replacement as these are Javascript values which are rendered directly. You have to write (very little) Javascript for this. In https://git.dmx.systems/nodejs-modules/dmx-object-renderer/blob/master/src/components/dm5-boolean-field.vue#L2 you find:

    {{object.value}}
    

    You have to change that to:

    {{object.value ? 'Chinese for true' : 'Chinese for false'}}
    
  3. For data type “Text” see line 514 of https://git.dmx.systems/dmx-platform/dmx-platform/blob/master/modules/dmx-core/src/main/java/systems/dmx/core/impl/CoreServiceImpl.java#L514
    There you’ll find new SimpleValue("Text")
    Just replace Text as usual.

Soon we could talk about how you can get up-to-date DMX code without loosing your translations. Basically you have to fork the dmx-platform repo (resp. deepamehta at GitHub) as well as the 11 Node.js module repos mentioned above (at least the ones which require translation), and pull the changes made by us at a regular basis. You could do so at GitHub.

Greetings,
Jörg

Dear jri:
Thank you for your patient answer, very detailed and professional. It’s really cool to be able to update software without losing translated content. Then I’ll try it the way you said. Thank you very much for your help!