Skip to content

Commit

Permalink
Merge pull request #9082 from surveyjs/features/setup-locale
Browse files Browse the repository at this point in the history
Features/setup locale
  • Loading branch information
andrewtelnov authored Nov 22, 2024
2 parents b1b8aec + a3fe9c9 commit 73e454b
Show file tree
Hide file tree
Showing 54 changed files with 158 additions and 156 deletions.
2 changes: 1 addition & 1 deletion packages/survey-core/entries/chunks/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export { Cover, CoverCell } from "../../src/header";

export { dxSurveyService } from "../../src/dxSurveyService";
export { englishStrings } from "../../src/localization/english";
export { surveyLocalization, surveyStrings, getLocaleString } from "../../src/surveyStrings";
export { surveyLocalization, surveyStrings, getLocaleString, setupLocale } from "../../src/surveyStrings";
// export { cultureInfo } from "../../src/cultureInfo";
export {
QuestionCustomWidget,
Expand Down
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/arabic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var arabicSurveyStrings = {
pagePrevText: "السابق",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var arabicSurveyStrings = {
cancel: "إلغاء الأمر"
};

surveyLocalization.setupLocale("ar", arabicSurveyStrings, "العربية", "Arabic", "rtl");
setupLocale({ localeCode: "ar", strings: arabicSurveyStrings, nativeName: "العربية", englishName: "Arabic", rtl: true });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand Down Expand Up @@ -143,5 +143,5 @@ surveyLocalization.setupLocale("ar", arabicSurveyStrings, "العربية", "Ara
// cancel: "Cancel" => "إلغاء الأمر"
// refuseItemText: "Refuse to answer" => "رفض الإجابة"
// dontKnowItemText: "Don't know" => "لا أعرف"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "ردك يتجاوز 64 كيلوبايت. يرجى تقليل حجم الملف (الملفات) والمحاولة مرة أخرى أو الاتصال بمالك الاستطلاع."
// signaturePlaceHolderReadOnly: "No signature" => "لا يوجد توقيع"// tabTitlePlaceholder: "New Panel" => "لوحة جديدة"// deselectAllItemText: "Deselect all" => "إلغاء تحديد الكل"
// signaturePlaceHolderReadOnly: "No signature" => "لا يوجد توقيع"// tabTitlePlaceholder: "New Panel" => "لوحة جديدة"// deselectAllItemText: "Deselect all" => "إلغاء تحديد الكل"
// textNoDigitsAllow: "Numbers are not allowed." => "الأرقام غير مسموح بها."
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/basque.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var basqueSurveyStrings = {
pagePrevText: "Aurrekoa",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var basqueSurveyStrings = {
cancel: "Ezeztatu"
};

surveyLocalization.setupLocale("eu", basqueSurveyStrings, "euskara", "Basque");
setupLocale({ localeCode: "eu", strings: basqueSurveyStrings, nativeName: "euskara", englishName: "Basque" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand All @@ -136,5 +136,5 @@ surveyLocalization.setupLocale("eu", basqueSurveyStrings, "euskara", "Basque");
// cancel: "Cancel" => "Ezeztatu"
// refuseItemText: "Refuse to answer" => "Erantzuteari uko egin"
// dontKnowItemText: "Don't know" => "Ez dakit"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "Erantzuna 64 KB-tik gorakoa da. Murriztu artxiboaren tamaina, eta berriro saiatu edo jarri harremanetan inkesta baten jabearekin."
// signaturePlaceHolderReadOnly: "No signature" => "Sinadurarik gabe"// tabTitlePlaceholder: "New Panel" => "Panel berria"// deselectAllItemText: "Deselect all" => "Guztiaren aukeraketa bertan behera utzi"
// signaturePlaceHolderReadOnly: "No signature" => "Sinadurarik gabe"// tabTitlePlaceholder: "New Panel" => "Panel berria"// deselectAllItemText: "Deselect all" => "Guztiaren aukeraketa bertan behera utzi"
// textNoDigitsAllow: "Numbers are not allowed." => "Ezin da zenbakirik egin."
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/bulgarian.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var bulgarianStrings = {
pagePrevText: "Назад",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var bulgarianStrings = {
cancel: "Отмени"
};

surveyLocalization.setupLocale("bg", bulgarianStrings, "български", "Bulgarian");
setupLocale({ localeCode: "bg", strings: bulgarianStrings, nativeName: "български", englishName: "Bulgarian" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand Down Expand Up @@ -143,5 +143,5 @@ surveyLocalization.setupLocale("bg", bulgarianStrings, "български", "Bu
// cancel: "Cancel" => "Отмени"
// refuseItemText: "Refuse to answer" => "Отказва да отговори"
// dontKnowItemText: "Don't know" => "Не знам"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "Вашият отговор надхвърля 64KB. Намалете размера на вашите файлове и опитайте отново или се свържете със собственика на проучването."
// signaturePlaceHolderReadOnly: "No signature" => "Няма подпис"// tabTitlePlaceholder: "New Panel" => "Нов панел"// deselectAllItemText: "Deselect all" => "Премахване на избора на всички"
// signaturePlaceHolderReadOnly: "No signature" => "Няма подпис"// tabTitlePlaceholder: "New Panel" => "Нов панел"// deselectAllItemText: "Deselect all" => "Премахване на избора на всички"
// textNoDigitsAllow: "Numbers are not allowed." => "Номерата не са позволени."
7 changes: 4 additions & 3 deletions packages/survey-core/src/localization/catalan.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var catalanSurveyStrings = {
pagePrevText: "Anterior",
Expand Down Expand Up @@ -110,7 +110,8 @@ export var catalanSurveyStrings = {
cancel: "Cancel·lar"
};

surveyLocalization.setupLocale("ca", catalanSurveyStrings, "català", "Catalan");
setupLocale({ localeCode: "ca", strings: catalanSurveyStrings, nativeName: "català", englishName: "Catalan" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
// previewText: "Preview" => "Preestrena"
Expand Down Expand Up @@ -182,5 +183,5 @@ surveyLocalization.setupLocale("ca", catalanSurveyStrings, "català", "Catalan")
// cancel: "Cancel" => "Cancel·lar"
// refuseItemText: "Refuse to answer" => "Negar-se a respondre"
// dontKnowItemText: "Don't know" => "No sé"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "La teva resposta supera els 64KB. Reduïu la mida dels fitxers i torneu-ho a provar o poseu-vos en contacte amb el propietari de l'enquesta."
// signaturePlaceHolderReadOnly: "No signature" => "Sense signatura"// tabTitlePlaceholder: "New Panel" => "Nou Panell"// deselectAllItemText: "Deselect all" => "Desselecciona-ho tot"
// signaturePlaceHolderReadOnly: "No signature" => "Sense signatura"// tabTitlePlaceholder: "New Panel" => "Nou Panell"// deselectAllItemText: "Deselect all" => "Desselecciona-ho tot"
// textNoDigitsAllow: "Numbers are not allowed." => "No es permeten números."
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/croatian.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var croatianStrings = {
pagePrevText: "Prethodni",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var croatianStrings = {
cancel: "Otkazati"
};

surveyLocalization.setupLocale("hr", croatianStrings, "hrvatski", "Croatian");
setupLocale({ localeCode: "hr", strings: croatianStrings, nativeName: "hrvatski", englishName: "Croatian" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand Down Expand Up @@ -141,5 +141,5 @@ surveyLocalization.setupLocale("hr", croatianStrings, "hrvatski", "Croatian");
// cancel: "Cancel" => "Otkazati"
// refuseItemText: "Refuse to answer" => "Odbijte odgovoriti"
// dontKnowItemText: "Don't know" => "Ne znam"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "Vaš odgovor premašuje 64KB. Smanjite veličinu datoteka i pokušajte ponovno ili se obratite vlasniku upitnika."
// signaturePlaceHolderReadOnly: "No signature" => "Bez potpisa"// tabTitlePlaceholder: "New Panel" => "Nova ploča"// deselectAllItemText: "Deselect all" => "Poništite odabir svega"
// signaturePlaceHolderReadOnly: "No signature" => "Bez potpisa"// tabTitlePlaceholder: "New Panel" => "Nova ploča"// deselectAllItemText: "Deselect all" => "Poništite odabir svega"
// textNoDigitsAllow: "Numbers are not allowed." => "Brojevi nisu dopušteni."
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/czech.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var czechSurveyStrings = {
pagePrevText: "Předchozí",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var czechSurveyStrings = {
cancel: "Zrušit"
};

surveyLocalization.setupLocale("cs", czechSurveyStrings, "čeština", "Czech");
setupLocale({ localeCode: "cs", strings: czechSurveyStrings, nativeName: "čeština", englishName: "Czech" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand Down Expand Up @@ -143,5 +143,5 @@ surveyLocalization.setupLocale("cs", czechSurveyStrings, "čeština", "Czech");
// cancel: "Cancel" => "Zrušit"
// refuseItemText: "Refuse to answer" => "Odmítnout odpovědět"
// dontKnowItemText: "Don't know" => "Nevím"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "Vaše odpověď překračuje 64 kB. Zmenšete prosím velikost svých souborů a zkuste to znovu nebo kontaktujte vlastníka průzkumu."
// signaturePlaceHolderReadOnly: "No signature" => "Bez podpisu"// tabTitlePlaceholder: "New Panel" => "Nový panel"// deselectAllItemText: "Deselect all" => "Zrušit výběr všech"
// signaturePlaceHolderReadOnly: "No signature" => "Bez podpisu"// tabTitlePlaceholder: "New Panel" => "Nový panel"// deselectAllItemText: "Deselect all" => "Zrušit výběr všech"
// textNoDigitsAllow: "Numbers are not allowed." => "Čísla nejsou povolena."
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/danish.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var danishSurveyStrings = {
pagePrevText: "Tilbage",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var danishSurveyStrings = {
cancel: "Aflyse"
};

surveyLocalization.setupLocale("da", danishSurveyStrings, "dansk", "Danish");
setupLocale({ localeCode: "da", strings: danishSurveyStrings, nativeName: "dansk", englishName: "Danish" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand Down Expand Up @@ -143,5 +143,5 @@ surveyLocalization.setupLocale("da", danishSurveyStrings, "dansk", "Danish");
// cancel: "Cancel" => "Aflyse"
// refuseItemText: "Refuse to answer" => "Nægt at svare"
// dontKnowItemText: "Don't know" => "Ved ikke"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "Dit svar overstiger 64 KB. Reducer størrelsen på din(e) fil(er), og prøv igen, eller kontakt en undersøgelsesejer."
// signaturePlaceHolderReadOnly: "No signature" => "Ingen underskrift"// tabTitlePlaceholder: "New Panel" => "Nyt panel"// deselectAllItemText: "Deselect all" => "Fravælg alle"
// signaturePlaceHolderReadOnly: "No signature" => "Ingen underskrift"// tabTitlePlaceholder: "New Panel" => "Nyt panel"// deselectAllItemText: "Deselect all" => "Fravælg alle"
// textNoDigitsAllow: "Numbers are not allowed." => "Numre er ikke tilladt."
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/dutch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var dutchSurveyStrings = {
pagePrevText: "Vorige",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var dutchSurveyStrings = {
cancel: "Annuleren"
};

surveyLocalization.setupLocale("nl", dutchSurveyStrings, "nederlands", "Dutch");
setupLocale({ localeCode: "nl", strings: dutchSurveyStrings, nativeName: "nederlands", englishName: "Dutch" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand Down Expand Up @@ -141,5 +141,5 @@ surveyLocalization.setupLocale("nl", dutchSurveyStrings, "nederlands", "Dutch");
// cancel: "Cancel" => "Annuleren"
// refuseItemText: "Refuse to answer" => "Weiger te antwoorden"
// dontKnowItemText: "Don't know" => "Weet niet"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "Uw antwoord is groter dan 64 kB. Verklein de grootte van uw bestand(en) en probeer het opnieuw of neem contact op met een enquête-eigenaar."
// signaturePlaceHolderReadOnly: "No signature" => "Geen handtekening"// tabTitlePlaceholder: "New Panel" => "Nieuw paneel"// deselectAllItemText: "Deselect all" => "Alles deselecteren"
// signaturePlaceHolderReadOnly: "No signature" => "Geen handtekening"// tabTitlePlaceholder: "New Panel" => "Nieuw paneel"// deselectAllItemText: "Deselect all" => "Alles deselecteren"
// textNoDigitsAllow: "Numbers are not allowed." => "Nummers zijn niet toegestaan."
4 changes: 2 additions & 2 deletions packages/survey-core/src/localization/english.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Uncomment the line below if you create a custom dictionary
// import { surveyLocalization } from "survey-core";
// import { setupLocale } from "survey-core";

export var englishStrings = {
pagePrevText: "Previous",
Expand Down Expand Up @@ -114,4 +114,4 @@ export var englishStrings = {
// Uncomment the lines below if you create a custom dictionary.
// Replace "en" with a custom locale code (for example, "fr" or "de"),
// Replace `englishStrings` with the name of the variable that contains the custom dictionary.
//surveyLocalization.setupLocale("en", englishStrings, "English", "English");
//setupLocale({ localeCode: "en", strings: englishStrings, nativeName: "English", englishName: "English" });
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/estonian.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var estonianSurveyStrings = {
pagePrevText: "Tagasi",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var estonianSurveyStrings = {
cancel: "Tühistama"
};

surveyLocalization.setupLocale("et", estonianSurveyStrings, "eesti keel", "Estonian");
setupLocale({ localeCode: "et", strings: estonianSurveyStrings, nativeName: "eesti keel", englishName: "Estonian" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand Down Expand Up @@ -143,5 +143,5 @@ surveyLocalization.setupLocale("et", estonianSurveyStrings, "eesti keel", "Eston
// cancel: "Cancel" => "Tühistama"
// refuseItemText: "Refuse to answer" => "Keeldu vastamast"
// dontKnowItemText: "Don't know" => "Ei tea"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "Teie vastus ületab 64 KB. Vähendage faili(de) mahtu ja proovige uuesti või võtke ühendust uuringu omanikuga."
// signaturePlaceHolderReadOnly: "No signature" => "Allkiri puudub"// tabTitlePlaceholder: "New Panel" => "Uus paneel"// deselectAllItemText: "Deselect all" => "Kõigi valiku tühistamine"
// signaturePlaceHolderReadOnly: "No signature" => "Allkiri puudub"// tabTitlePlaceholder: "New Panel" => "Uus paneel"// deselectAllItemText: "Deselect all" => "Kõigi valiku tühistamine"
// textNoDigitsAllow: "Numbers are not allowed." => "Numbrid ei ole lubatud."
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/finnish.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var finnishSurveyStrings = {
pagePrevText: "Edellinen",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var finnishSurveyStrings = {
cancel: "Perua"
};

surveyLocalization.setupLocale("fi", finnishSurveyStrings, "suomi", "Finnish");
setupLocale({ localeCode: "fi", strings: finnishSurveyStrings, nativeName: "suomi", englishName: "Finnish" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand All @@ -131,5 +131,5 @@ surveyLocalization.setupLocale("fi", finnishSurveyStrings, "suomi", "Finnish");
// cancel: "Cancel" => "Perua"
// refuseItemText: "Refuse to answer" => "Kieltäydy vastaamasta"
// dontKnowItemText: "Don't know" => "Ei tiedä"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "Vastauksesi ylittää 64 kt. Pienennä tiedostojesi kokoa ja yritä uudelleen tai ota yhteyttä kyselyn omistajaan."
// signaturePlaceHolderReadOnly: "No signature" => "Ei allekirjoitusta"// tabTitlePlaceholder: "New Panel" => "Uusi paneeli"// deselectAllItemText: "Deselect all" => "Poista kaikkien valinta"
// signaturePlaceHolderReadOnly: "No signature" => "Ei allekirjoitusta"// tabTitlePlaceholder: "New Panel" => "Uusi paneeli"// deselectAllItemText: "Deselect all" => "Poista kaikkien valinta"
// textNoDigitsAllow: "Numbers are not allowed." => "Numerot eivät ole sallittuja."
6 changes: 3 additions & 3 deletions packages/survey-core/src/localization/french.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { surveyLocalization } from "survey-core";
import { setupLocale } from "survey-core";

export var frenchSurveyStrings = {
pagePrevText: "Précédent",
Expand Down Expand Up @@ -110,7 +110,7 @@ export var frenchSurveyStrings = {
cancel: "Annuler"
};

surveyLocalization.setupLocale("fr", frenchSurveyStrings, "français", "French");
setupLocale({ localeCode: "fr", strings: frenchSurveyStrings, nativeName: "français", englishName: "French" });

// The following strings have been translated by a machine translation service
// Remove those strings that you have corrected manually
Expand All @@ -131,5 +131,5 @@ surveyLocalization.setupLocale("fr", frenchSurveyStrings, "français", "French")
// cancel: "Cancel" => "Annuler"
// refuseItemText: "Refuse to answer" => "Refuser de répondre"
// dontKnowItemText: "Don't know" => "Sais pas"// savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner." => "Votre réponse dépasse 64 Ko. Veuillez réduire la taille de votre ou vos fichiers et réessayer ou contacter un propriétaire de sondage."
// signaturePlaceHolderReadOnly: "No signature" => "Pas de signature"// tabTitlePlaceholder: "New Panel" => "Nouveau panneau"// deselectAllItemText: "Deselect all" => "Désélectionner tout"
// signaturePlaceHolderReadOnly: "No signature" => "Pas de signature"// tabTitlePlaceholder: "New Panel" => "Nouveau panneau"// deselectAllItemText: "Deselect all" => "Désélectionner tout"
// textNoDigitsAllow: "Numbers are not allowed." => "Les numéros ne sont pas autorisés."
Loading

0 comments on commit 73e454b

Please sign in to comment.