surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
902 stars 372 forks source link

Translations > 2nd language loses paragraph spacing and formatting. #5840

Closed GraemeLeightonIXO closed 1 month ago

GraemeLeightonIXO commented 2 months ago

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

Reporting a bug in Translations

What is the current behavior?

The second language, does not render in the survey correctly. HTML formatting appears in the preview display.

What is the expected behavior?

The translation should display with the same formatting, spacing, paragraphs as the original.

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

  1. Create a survey in https://surveyjs.io/create-free-survey
  2. Manually add translations for a second language second language (use a block of text that has two paragraphs)

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

Tested page URL: https://surveyjs.io/create-free-survey

Test code

{ "logoPosition": "right", "pages": [ { "name": "page1", "elements": [ { "type": "expression", "name": "question3", "title": "Test", "description": { "default": "How can ordinary citizens actively contribute to the preservation of Earth's orbits?\n\nBy participating in the certification process for the label, where you play a crucial role: you are responsible for gathering certification data, verifying it, and making the final decision on whether the label should be awarded!\n", "fr": "Comment agir concrètement pour la préservation des orbites terrestres en étant de simples citoyens ? /n/n En participant à la certification du label, dont vous êtes l'acteur principal : c'est en effet vous qui êtes responsables du recueil des données de certification, de leur vérification, et du vote final sur l'attribution ou non du label !" } } ] } ] }

your_code_here

{ "logoPosition": "right", "pages": [ { "name": "page1", "elements": [ { "type": "expression", "name": "question3", "title": "Test", "description": { "default": "How can ordinary citizens actively contribute to the preservation of Earth's orbits?\n\nBy participating in the certification process for the label, where you play a crucial role: you are responsible for gathering certification data, verifying it, and making the final decision on whether the label should be awarded!\n", "fr": "Comment agir concrètement pour la préservation des orbites terrestres en étant de simples citoyens ? /n/n En participant à la certification du label, dont vous êtes l'acteur principal : c'est en effet vous qui êtes responsables du recueil des données de certification, de leur vérification, et du vote final sur l'attribution ou non du label !" } } ] } ] }

Specify your

JaneSjs commented 1 month ago

Hello @GraemeLeightonIXO, SurveyJS Creator doesn't support HTML formatting by default. You need to enable this feature by registering a third-party Markdown-to-HTML processing library and implementing the survey.onTextMarkdown function. Please refer to the following demos for more information on how to handle markup in SurveyJS Form Library and Builder:

Should you have any further questions, please feel free to reach out to us at any time.