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

Selected dropdown value won't change with survey.locale #9034

Open
jzju opened this issue Nov 11, 2024 · 5 comments · May be fixed by #9120
Open

Selected dropdown value won't change with survey.locale #9034

jzju opened this issue Nov 11, 2024 · 5 comments · May be fixed by #9120

Comments

@jzju
Copy link

jzju commented Nov 11, 2024

Steps to reproduce

<SurveyComponent :model="survey"/>
import { Model } from "survey-core";
const survey = new Model({});

function onChange() {
  survey.locale = lang.value;
}

{
  "choices": [
      {
          "text": {
              "default": "english",
              "ne": "notenglish"
          },
          "value": "one"
      }
  ],
  "name": "q1",
  "title": {
      "default": "english",
      "ne": "notenglish"
  },
  "type": "dropdown"
}

Start with survey.locale = "ne", select option one, change survey.locale to "en", everything becomes english except the selected value in dropdown.

Expected behavior
The dropdown should say english.

Screenshots
Screenshot_20241111_171748

Please complete the following information:

  • Browser: brave
  • JS framework/library: vue3
  • SurveyJS version: 1.11.13
  • Device: Ubuntu
@JaneSjs JaneSjs self-assigned this Nov 12, 2024
@JaneSjs
Copy link
Contributor

JaneSjs commented Nov 13, 2024

Hi @jzju,
Please upgrade your SurveyJS Form Library to the latest v1.12.9. I tested the following demo and confirmed that a selected Dropdown value is updated correctly.
View CodeSandbox

Let me know if this helps.

@jzju
Copy link
Author

jzju commented Nov 13, 2024

Screenshot_20241113_095902

Did you select the option before changein language?

@JaneSjs JaneSjs removed their assignment Nov 14, 2024
@jzju
Copy link
Author

jzju commented Nov 18, 2024

Found a workaround to this and and another bug where rating where lacking text. Call survey.fromJSON after changing language.

survey.locale = lang.value;
survey.fromJSON(yourjson);

@JaneSjs
Copy link
Contributor

JaneSjs commented Nov 19, 2024

Hello,

Did you select the option before changein language?

I tested the demo in various ways but did not reproduce any issues with improper translation. For me to move forward, I need to reproduce the issue on my end. Please share exact steps to reproduce the issue using the demo I shared earlier.

Thank you

and another bug where rating where lacking text. Call survey.fromJSON after changing language.

survey.locale = lang.value;
survey.fromJSON(yourjson);

I would also appreciate if you elaborate on this additional issue. Please share a relevant code/demo for research.

Thank you

@jzju
Copy link
Author

jzju commented Nov 19, 2024

This is from using your CodeSandbox

Screencast.2024-11-19.10.40.52.mp4

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

Successfully merging a pull request may close this issue.

4 participants