Question T15125
Visible to All Users

Survey translation exporting all languages

created a year ago

Hello! We would like to check if this is possible in the current UI of SurveyJS.
From what I understand, the Export to CSV will only export the languages that were checked in the Languages section from the right side panel. E.g. if there are 8 languages checked, this means that SurveyJS will export those 8 languages selected. Clipboard-File-1.png

But in our case, we may have more than 8 languages in the survey. Is it possible to export all the languages?

If I understand this correctly, this is also achievable via code https://github.com/surveyjs/survey-creator/issues/3764. But we would like to check first if this can be done in the current UI.

Thanks!

Answers approved by surveyjs Support

created a year ago

Hello,
Thank you for contacting us. The default export option actually downloads only those translations which are currently selected in UI. If you wish to download all translation strings which are available within a survey, you can implement a custom action which would run the code shared by Andrew.

JavaScript
import { Action, ComputedUpdater } from "survey-core"; import { Translation } from "survey-creator-core"; creator.toolbar.actions.push( new Action({ id: "export-all", title: "Download All", iconName: "icon-download", action: () => { const translation = new Translation(creator.survey); const data = translation.exportToCSV(); const fileName = "surveyTranslation.csv"; var blob = new Blob([data], { type: "text/csv" }); if (window.navigator["msSaveOrOpenBlob"]) { window.navigator["msSaveBlob"](blob, fileName); } else { var elem = window.document.createElement("a"); elem.href = window.URL.createObjectURL(blob); elem.download = fileName; document.body.appendChild(elem); elem.click(); document.body.removeChild(elem); } }, visible: new ComputedUpdater(() => creator.activeTab === "translation"), enabled: true })

View CodeSandbox

Please let us know if you have any further questions.

We hope you enjoyed the level of service you received. If so, we would love if you could leave your feedback on SurveyJS page at g2.com. As we’re building our business, every review helps build credibility for future customers and your feedback would be greatly appreciated.

    Comments (2)

      This is awesome! Thanks Jane!

        You're always welcome! Please feel free to contact us if you have any further questions.