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

Imagepicker localized images broken #3287

Closed
SamMousa opened this issue Sep 8, 2021 · 4 comments
Closed

Imagepicker localized images broken #3287

SamMousa opened this issue Sep 8, 2021 · 4 comments
Assignees
Labels
Milestone

Comments

@SamMousa
Copy link
Contributor

SamMousa commented Sep 8, 2021

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

Bug

What is the current behavior?

It seems the image options are not changed when the survey language changes.

What is the expected behavior?

Since the imageLink properties are localizable strings it makes sense that localizing them shows the correct image.

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

Change the language to german.

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

Tested on versions 1.8.56 (which we use atm) and on the online creator which uses the latest version.

Test code

{
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "imagepicker",
     "name": "question1",
     "choices": [
      {
       "value": "1",
       "text": {
        "default": "foto1_ENG",
        "de": "foto1_DE"
       },
       "imageLink": {
        "default": "https://cdn1.collecthor.nl/organisation8/surveys/2923/Header_2835493_16.9-1024x574.jpg",
        "de": "https://cdn1.collecthor.nl/organisation8/surveys/2923/Niko%20Bellic.jpg"
       }
      }
     ],
     "imageHeight": 450,
     "imageWidth": 600
    }
   ]
  }
 ]
}

### Specify your

* browser: chrome
* browser version: latest 
* surveyjs platform (angular or react or jquery or knockout or vue): knockout
* surveyjs version: > 1.8.56
@andrewtelnov
Copy link
Member

@SamMousa We do not have this functionality and to be honest, I do not remember that somebody asked about it.
We localize strings only. We have "LocalizableString" and "LocalizableStrings" classes that we used for localization strings.
Implementing this functionality could take a while, since it takes way more time to introduce the functionality in a library than in a custom solution. It means that it is better to solve the issue on your project level instead of SurveyJS library.

Thank you,
Andrew

@andrewtelnov
Copy link
Member

However, after I looked at the code, I found that imageLink is actually a localizable string object.
We will take a look.

Thank you,
Andrew

@andrewtelnov andrewtelnov added bug and removed question labels Sep 9, 2021
@andrewtelnov andrewtelnov self-assigned this Sep 9, 2021
@SamMousa
Copy link
Contributor Author

SamMousa commented Sep 9, 2021

I think it used to work at some point, not 100% sure though.

@andrewtelnov andrewtelnov added this to the v1.8.66 milestone Sep 9, 2021
@andrewtelnov
Copy link
Member

@SamMousa I have fixed it by the commit above.

Thank you,
Andrew

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

No branches or pull requests

2 participants