dmn-js icon indicating copy to clipboard operation
dmn-js copied to clipboard

fix(i18n): complete missing translations

Open ptyin opened this issue 3 years ago • 1 comments

Hi there👋, I'm currently working on a project that utilizes dmn-js to build an online DMN modeler. The code of dmn-js is organized in a clear and concise manner. Thanks for your fantastic works.

However, the project that I'm working on is oriented towards Chinese users, and I found the full coverage of i18n for dmn-js is still not implemented. Thus I have written this pr to address the problem (Closes #88).

The newly added translations are listed at the bottom of this pr.

Except for code modification to add translations, I have also modified packages/dmn-js/test/spec/TabbingSpec.js to enable check for missing translations. You can use the following command to check:

TEST_BROWSERS=Chrome;SINGLE_START=translation npm run dev -- dmn-js

Every text is shown as tr(xxx) if it's translatable:

image

ADDED TRANSLATIONS

DRD

  • Definition Properties
    • Title for Decision Name
    • Title for Decision ID
    • DecisionIdEdit Error Message

Decision Table

  • Decision Table Properties
    • Title for Decision Name
  • Hit Policy
    • Label
    • Value
    • Explanation
    • Options
  • Table Head
    • Input Cell
      • Type Ref
    • Input Cell Context Menu
      • Placeholder for Enter Expression
    • Output Cell
      • Type Ref
    • Allowed Values Editing
      • Placeholder for Predefined Values
      • Label for Nonempty Predefined Values
    • Type Ref Cell Context Menu
      • Options for Type Ref
  • Simple Mode Button
    • Title
  • Simple Boolean Edit
    • Heading
    • Options
    • Placeholder
    • Error Message
  • Simple Date Edit
    • Heading
    • Options
    • Validation
  • Simple Date Time Edit
    • Heading
    • Options
    • Validation
  • Simple Duration Edit
    • Heading
    • Options
    • Validation
  • Simple Number Edit
    • Heading
    • Options
    • Validation
  • Simple String Edit
    • Input Options (match one / match none)
    • Label for Predefined Values
    • Label for Custom Values
    • Placeholder for Adding Values or Setting Value
  • Simple Time Edit
    • Heading
    • Options
    • Validation
  • View Drd Button
    • Button Text

Literal Expression

  • Literal Expression Properties
    • Label for Variable Name
    • Label for Variable Type
    • Options for Variable Type Ref
    • Label for Expression Language
  • View Drd Button
    • Button Text

ptyin avatar Aug 13 '22 15:08 ptyin

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 13 '22 15:08 CLAassistant

Let's add the test line you mentioned as a new script to the package.json:

"scripts": {
  ...
  "start:translate": "cross-env SINGLE_START=translate npm run dev -- dmn-js",
  ...
}

nikku avatar Aug 18 '22 06:08 nikku

THX, I have modified the commit according to suggestions except for the colon one. About the colon inclusion problem, please read my comment above.

ptyin avatar Aug 18 '22 13:08 ptyin

Released with v12.3.0. Thanks again :clap:

nikku avatar Aug 18 '22 18:08 nikku