Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colum.totalFormat in QuestionMatrixDropdown/Dynamic uses for default locale only #2050

Closed
divico opened this issue Mar 25, 2020 · 3 comments
Closed
Labels
Milestone

Comments

@divico
Copy link

@divico divico commented Mar 25, 2020

When using a question of type matrixdropdown, the strings defined for the total of the column through totalFormat are shown in default locale only.

Are you requesting a feature, reporting a bug or asking a question?

Reporting bug

What is the current behavior?

When changing the language, totalFormat is not translated and is always set to the default language

What is the expected behavior?

When changing the language, totalFormat should be set to the string defined by the chosen language

How would you reproduce the current behavior (if this is a bug)?

Use the JSON definition below and test it with surveyJS v1.5.17, try to switch bewteen english, french and german and observe how the string of the total of the columns are not translated.

Provide the test code and the tested page URL (if applicable)

Here is a miniaml working example

{
 "title": {
  "default": "Test survey",
  "fr": "Questionnaire de test",
  "de": "Testumfrage"
 },
 "pages": [
  {
   "name": "events",
   "elements": [
    {
     "type": "matrixdropdown",
     "name": "matrix_test",
     "title": {
      "default": "test Matrix",
      "fr": "Matrice de test",
      "de": "Testmatrize"
     },
     "isRequired": true,
     "columns": [
      {
       "name": "col1",
       "title": {
        "default": "Column 1",
        "fr": "Colonne 1",
        "de": "Spalt 1"
       },
       "cellType": "text",
       "isRequired": true,
       "validators": [
        {
         "type": "numeric",
         "minValue": 0,
         "maxValue": 300
        }
       ],
       "totalType": "sum",
       "totalFormat": {
        "default": "Total column 1: {0}",
        "de": "Total Spalt 1: {0}",
        "fr": "Total colonne 1: {0}"
       },
       "totalDisplayStyle": "decimal",
       "inputType": "number"
      },
      {
       "name": "col2",
       "title": {
        "default": "Column 2",
        "fr": "Colonne 2",
        "de": "Spalt 2"
       },
       "cellType": "text",
       "isRequired": true,
       "totalType": "sum",
       "totalFormat": {
        "default": "Total column 2: {0}",
        "fr": "Total colonne 2: {0}",
        "de": "Total Spalt 2: {0}"
       },
       "totalDisplayStyle": "decimal",
       "inputType": "number"
      },
      {
       "name": "col3",
       "title": {
        "default": "Column 3",
        "fr": "Colonne 3",
        "de": "Spalt 3"
       },
       "cellType": "text",
       "isRequired": true,
       "validators": [
        {
         "type": "numeric",
         "minValue": 0,
         "maxValue": 300
        }
       ],
       "totalType": "sum",
       "totalFormat": {
        "default": "Total column 3: {0}",
        "fr": "Total colonne 4: {0}",
        "de": "Total Spalt 3: {0}"
       },
       "totalDisplayStyle": "decimal",
       "inputType": "number"
      }
     ],
     "rows": [
      {
       "value": "one",
       "text": {
        "default": "One",
        "fr": " Un",
        "de": " Ein"
       }
      },
      {
       "value": "two",
       "text": {
        "default": "Two",
        "fr": "Deux",
        "de": "Zwei"
       }
      },
      {
       "value": "three",
       "text": {
        "default": "Three",
        "fr": "Trois",
        "de": "Drei"
       }
      }
     ]
    }
   ],
   "title": {
    "default": "Events",
    "fr": "Evénements",
    "de": "Veranstaltungen"
   }
  }
 ]
}

Specify your

  • browser: Firefox
  • browser version: 74.0
  • surveyjs platform (angular or react or jquery or knockout or vue): using https://surveyjs.io
  • surveyjs version: v1.5.17
@andrewtelnov andrewtelnov added the bug label Mar 26, 2020
@andrewtelnov

This comment has been minimized.

Copy link
Member

@andrewtelnov andrewtelnov commented Mar 26, 2020

@divico Yes, it is definately a bug. We will take a look.

Thank you,
Andrew

@andrewtelnov andrewtelnov changed the title totalFormat not translated colum.totalFormat in QuestionMatrixDropdown/Dynamic uses for default locale only Mar 26, 2020
andrewtelnov added a commit that referenced this issue Mar 26, 2020
@andrewtelnov andrewtelnov added the fixed label Mar 26, 2020
@andrewtelnov andrewtelnov added this to the v1.5.18 milestone Mar 26, 2020
@andrewtelnov

This comment has been minimized.

Copy link
Member

@andrewtelnov andrewtelnov commented Mar 26, 2020

@divico I have fixed the bug by adding a new unit test. The fix will be available in v1.5.18 that we are going to release next week.

Thank you,
Andrew
SurveyJS Team

@divico

This comment has been minimized.

Copy link
Author

@divico divico commented Mar 26, 2020

That's so great. Thank you one more time Andrew for fixing this so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.