Skip to content

Commit

Permalink
Show header in the first matrix in the translation edit dialog fix #5355
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov committed Mar 28, 2024
1 parent 20c5136 commit b0eea10
Show file tree
Hide file tree
Showing 31 changed files with 174 additions and 39 deletions.
21 changes: 17 additions & 4 deletions packages/survey-creator-core/src/components/tabs/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1459,11 +1459,12 @@ export class TranslationEditor {
this.translation.stringsHeaderSurvey.getAllQuestions().forEach(
q => this.updateMatrixColumns(<QuestionMatrixDropdownModel>q)
);
this.translation.stringsSurvey.getAllQuestions().forEach(
q => this.updateMatrixColumns(<QuestionMatrixDropdownModel>q)
);
const questions = this.translation.stringsSurvey.getAllQuestions();
for(let i = 0; i < questions.length; i ++) {
this.updateMatrixColumns(<QuestionMatrixDropdownModel>questions[i], i === 0);
}
}
private updateMatrixColumns(matrix: QuestionMatrixDropdownModel): void {
private updateMatrixColumns(matrix: QuestionMatrixDropdownModel, updateHeader: boolean = false): void {
const colIndex = 1;
if (matrix.columns.length === 3) {
matrix.columns.splice(colIndex, 1);
Expand All @@ -1474,6 +1475,18 @@ export class TranslationEditor {
column.readOnly = true;
matrix.columns.splice(colIndex, 0, column);
}
if(updateHeader) {
matrix.showHeader = matrix.columns.length > 2;
if(matrix.showHeader) {
const cols = matrix.columns;
cols[0].title = this.translation.getLocaleName("");
cols[1].title = this.getHeaderTitle("translationSource", cols[1].name);
cols[2].title = this.getHeaderTitle("translationTarget", cols[2].name);
}
}
}
private getHeaderTitle(strName: string, locale: string): string {
return editorLocalization.getString("ed." + strName) + this.translation.getLocaleName(locale);
}
private fillFromLocales(): void {
this.fromLocales = [];
Expand Down
8 changes: 6 additions & 2 deletions packages/survey-creator-core/src/localization/arabic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export var arStrings = {
translationDialogTitle: "النصوص غير المترجمة",
translationMergeLocaleWithDefault: "Merge {0} with default locale",
translationPlaceHolder: "Translation...",
translationSource: "مصدر: ",
translationTarget: "هدف: ",
themeExportButton: "تصدير",
themeImportButton: "استورد",
surveyJsonExportButton: "تصدير",
Expand Down Expand Up @@ -827,7 +829,7 @@ export var arStrings = {
minWidth_placeholder: "مثال: 600px",
maxWidth_placeholder: "مثال: 50٪",
imageHeight_placeholder: "تلقائي",
imageWidth_placeholder: "تلقائي",
imageWidth_placeholder: "تلقائي"
},
// Property values
pv: {
Expand Down Expand Up @@ -2428,4 +2430,6 @@ editorLocalization.locales["ar"] = arStrings;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "رمز يستخدم لفصل أرقام عدد كبير إلى مجموعات من ثلاثة."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "يحد من عدد الأرقام التي سيتم الاحتفاظ بها بعد الفاصلة العشرية لرقم معروض."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "رمز واحد أو عدة رموز ليتم عرضها قبل القيمة."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "رمز واحد أو عدة رموز ليتم عرضها بعد القيمة."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "رمز واحد أو عدة رموز ليتم عرضها بعد القيمة."
// ed.translationSource: "Source: " => "مصدر: "
// ed.translationTarget: "Target: " => "هدف: "
6 changes: 5 additions & 1 deletion packages/survey-creator-core/src/localization/bulgarian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export var bgStrings = {
translationDialogTitle: "Непреведени низове",
translationMergeLocaleWithDefault: "Обединение {0} с локалната стойност по подразбиране",
translationPlaceHolder: "Превод...",
translationSource: "Източник: ",
translationTarget: "Цел: ",
themeExportButton: "Износ",
themeImportButton: "Внос",
surveyJsonExportButton: "Износ",
Expand Down Expand Up @@ -2079,4 +2081,6 @@ editorLocalization.locales["bg"] = bgStrings;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "Символ, използван за разделяне на цифрите на голямо число в групи от по три."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "Ограничава колко цифри да се запазят след десетичната запетая за показваното число."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "Един или няколко символа, които трябва да бъдат показани преди стойността."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Един или няколко символа, които трябва да се покажат след стойността."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Един или няколко символа, които трябва да се покажат след стойността."
// ed.translationSource: "Source: " => "Източник: "
// ed.translationTarget: "Target: " => "Цел: "
6 changes: 5 additions & 1 deletion packages/survey-creator-core/src/localization/croatian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export var hrStrings = {
translationDialogTitle: "Neprevedeni nizovi",
translationMergeLocaleWithDefault: "Spajanje {0} sa zadanim lokalomwith default locale.",
translationPlaceHolder: "Prevođenje...",
translationSource: "Izvor: ",
translationTarget: "Cilj: ",
themeExportButton: "Izvoz",
themeImportButton: "Uvoz",
surveyJsonExportButton: "Izvoz",
Expand Down Expand Up @@ -2512,4 +2514,6 @@ editorLocalization.locales["hr"] = hrStrings;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "Simbol koji se koristi za odvajanje znamenki velikog broja u grupe od tri."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "Ograničava broj znamenki koje treba zadržati nakon decimalnog zareza za prikazani broj."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "Jedan ili više simbola koji će se prikazati prije vrijednosti."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Jedan ili više simbola koji će se prikazati nakon vrijednosti."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Jedan ili više simbola koji će se prikazati nakon vrijednosti."
// ed.translationSource: "Source: " => "Izvor: "
// ed.translationTarget: "Target: " => "Cilj: "
6 changes: 5 additions & 1 deletion packages/survey-creator-core/src/localization/czech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export var czStrings = {
translationDialogTitle: "Nepřeložené řetězce",
translationMergeLocaleWithDefault: "Sloučit {0} s výchozím lokálem",
translationPlaceHolder: "Překlad...",
translationSource: "Zdroj: ",
translationTarget: "Cíl: ",
themeExportButton: "Vývoz",
themeImportButton: "Dovoz",
surveyJsonExportButton: "Vývoz",
Expand Down Expand Up @@ -2082,4 +2084,6 @@ editorLocalization.locales["cs"] = czStrings;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "Symbol používaný k oddělení číslic velkého čísla do skupin po třech."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "Omezuje, kolik číslic se má zachovat za desetinnou čárkou zobrazeného čísla."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "Jeden nebo více symbolů, které mají být zobrazeny před hodnotou."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Jeden nebo více symbolů, které se zobrazí za hodnotou."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Jeden nebo více symbolů, které se zobrazí za hodnotou."
// ed.translationSource: "Source: " => "Zdroj: "
// ed.translationTarget: "Target: " => "Cíl: "
6 changes: 5 additions & 1 deletion packages/survey-creator-core/src/localization/danish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export var danishStrings = {
translationDialogTitle: "Uoversatte strenge",
translationMergeLocaleWithDefault: "Flet {0} med standardsprog",
translationPlaceHolder: "Oversættelse...",
translationSource: "Kilde: ",
translationTarget: "Mål: ",
themeExportButton: "Eksport",
themeImportButton: "Import",
surveyJsonExportButton: "Eksport",
Expand Down Expand Up @@ -2703,4 +2705,6 @@ editorLocalization.locales["da"] = danishStrings;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "Et symbol, der bruges til at adskille cifrene i et stort tal i grupper på tre."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "Begrænser, hvor mange cifre der skal bevares efter decimaltegnet for et vist tal."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "Et eller flere symboler, der skal vises før værdien."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Et eller flere symboler, der skal vises efter værdien."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Et eller flere symboler, der skal vises efter værdien."
// ed.translationSource: "Source: " => "Kilde: "
// ed.translationTarget: "Target: " => "Mål: "
6 changes: 5 additions & 1 deletion packages/survey-creator-core/src/localization/dutch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export var nlStrings = {
translationDialogTitle: "Onvertaalde tekenreeksen",
translationMergeLocaleWithDefault: "Voeg {0} samen met de standaardlandinstelling",
translationPlaceHolder: "Vertaling...",
translationSource: "Bron: ",
translationTarget: "Doel: ",
themeExportButton: "Exporteren",
themeImportButton: "Importeren",
surveyJsonExportButton: "Exporteren",
Expand Down Expand Up @@ -2498,4 +2500,6 @@ editorLocalization.locales["nl"] = nlStrings;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "Een symbool dat wordt gebruikt om de cijfers van een groot getal in groepen van drie te scheiden."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "Hiermee beperkt u het aantal cijfers dat moet worden behouden na de komma voor een weergegeven getal."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "Een of meer symbolen die vóór de waarde moeten worden weergegeven."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Een of meer symbolen die na de waarde moeten worden weergegeven."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Een of meer symbolen die na de waarde moeten worden weergegeven."
// ed.translationSource: "Source: " => "Bron: "
// ed.translationTarget: "Target: " => "Doel: "
2 changes: 2 additions & 0 deletions packages/survey-creator-core/src/localization/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ export var enStrings = {
translationDialogTitle: "Untranslated strings",
translationMergeLocaleWithDefault: "Merge {0} with default locale",
translationPlaceHolder: "Translation...",
translationSource: "Source: ",
translationTarget: "Target: ",
themeExportButton: "Export",
themeImportButton: "Import",
surveyJsonExportButton: "Export",
Expand Down
6 changes: 5 additions & 1 deletion packages/survey-creator-core/src/localization/finnish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export var fiStrings = {
translationDialogTitle: "Kääntämättömät merkkijonot",
translationMergeLocaleWithDefault: "Yhdistä {0} oletuskielellä",
translationPlaceHolder: "Käännös...",
translationSource: "Lähde: ",
translationTarget: "Kohde: ",
themeExportButton: "Vienti",
themeImportButton: "Tuoda",
surveyJsonExportButton: "Vienti",
Expand Down Expand Up @@ -2518,4 +2520,6 @@ editorLocalization.locales["fi"] = fiStrings;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "Symboli, jota käytetään erottamaan suuren luvun numerot kolmen ryhmiin."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "Rajoittaa näytettävän luvun desimaalipilkun jälkeen säilytettävien numeroiden määrää."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "Yksi tai useampi symboli, joka näytetään ennen arvoa."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Yksi tai useampi symboli, joka näytetään arvon jälkeen."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Yksi tai useampi symboli, joka näytetään arvon jälkeen."
// ed.translationSource: "Source: " => "Lähde: "
// ed.translationTarget: "Target: " => "Kohde: "
6 changes: 5 additions & 1 deletion packages/survey-creator-core/src/localization/french.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ var frenchTranslation = {
translationDialogTitle: "Chaînes non traduites",
translationMergeLocaleWithDefault: "Fusionner {0} avec langue par défaut",
translationPlaceHolder: "Traduction...",
translationSource: "Source: ",
translationTarget: "Cible: ",
themeExportButton: "Exportation",
themeImportButton: "Importation",
surveyJsonExportButton: "Exportation",
Expand Down Expand Up @@ -2578,4 +2580,6 @@ editorLocalization.locales["fr"] = frenchTranslation;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "Symbole utilisé pour séparer les chiffres d’un grand nombre en groupes de trois."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "Limite le nombre de chiffres à conserver après la virgule décimale pour un nombre affiché."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "Un ou plusieurs symboles à afficher avant la valeur."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Un ou plusieurs symboles à afficher après la valeur."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Un ou plusieurs symboles à afficher après la valeur."
// ed.translationSource: "Source: " => "Source: "
// ed.translationTarget: "Target: " => "Cible: "
7 changes: 5 additions & 2 deletions packages/survey-creator-core/src/localization/german.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ var germanTranslation = {
translationDialogTitle: "Nicht übersetzte Zeichenketten",
translationMergeLocaleWithDefault: "Verschmelze {0} mit der Standardsprache",
translationPlaceHolder: "Übersetzung ...",
translationSource: "Quelle: ",
translationTarget: "Ziel: ",
themeExportButton: "Exportieren",
themeImportButton: "Importieren",
surveyJsonExportButton: "Exportieren",
Expand All @@ -170,7 +172,6 @@ var germanTranslation = {
imageChooseImage: "Bild auswählen",
addNewTypeQuestion: "Add {0}", //{0} is localizable question type
chooseLogoPlaceholder: "[LOGO]",
auto: "automatisch",
choices_Item: "Artikel ",
lg: {
addNewItem: "Neue Regel hinzufügen",
Expand Down Expand Up @@ -2225,4 +2226,6 @@ editorLocalization.locales["de"] = germanTranslation;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "Ein Symbol, das verwendet wird, um die Ziffern einer großen Zahl in Dreiergruppen zu unterteilen."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "Schränkt die Anzahl der Nachkommastellen für eine angezeigte Zahl ein."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "Ein oder mehrere Symbole, die vor dem Wert angezeigt werden sollen."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Ein oder mehrere Symbole, die nach dem Wert angezeigt werden sollen."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Ein oder mehrere Symbole, die nach dem Wert angezeigt werden sollen."
// ed.translationSource: "Source: " => "Quelle: "
// ed.translationTarget: "Target: " => "Ziel: "
7 changes: 5 additions & 2 deletions packages/survey-creator-core/src/localization/hebrew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export var hebrewStrings = {
translationDialogTitle: "מחרוזות לא מתורגמות",
translationMergeLocaleWithDefault: "מזג {0} עם הגדרות ברירת המחדל",
translationPlaceHolder: "תרגום...",
translationSource: "מקור: ",
translationTarget: "יעד: ",
themeExportButton: "ייצא",
themeImportButton: "ייבא",
surveyJsonExportButton: "ייצא",
Expand All @@ -170,7 +172,6 @@ export var hebrewStrings = {
imageChooseImage: "בחר תמונה",
addNewTypeQuestion: "הוסף {0}", //{0} is localizable question type
chooseLogoPlaceholder: "[לוגו]",
auto: "אוטומטי",
choices_Item: "פריט ",
lg: {
addNewItem: "הוספת כלל חדש",
Expand Down Expand Up @@ -2083,4 +2084,6 @@ editorLocalization.locales["he"] = hebrewStrings;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "סמל המשמש להפרדת הספרות של מספר גדול לקבוצות של שלושה."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "מגביל את מספר הספרות שיש לשמור אחרי הנקודה העשרונית עבור מספר מוצג."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "סימן אחד או יותר שיוצגו לפני הערך."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "סימן אחד או יותר שיוצגו לאחר הערך."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "סימן אחד או יותר שיוצגו לאחר הערך."
// ed.translationSource: "Source: " => "מקור: "
// ed.translationTarget: "Target: " => "יעד: "
6 changes: 5 additions & 1 deletion packages/survey-creator-core/src/localization/hungarian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export var huStrings = {
translationDialogTitle: "Lefordítatlan karakterláncok",
translationMergeLocaleWithDefault: "{0} összefűzése az alapértelmezett szöveggel.",
translationPlaceHolder: "Fordítás...",
translationSource: "Forrás: ",
translationTarget: "Cél: ",
themeExportButton: "Kivitel",
themeImportButton: "Importál",
surveyJsonExportButton: "Kivitel",
Expand Down Expand Up @@ -2671,4 +2673,6 @@ editorLocalization.locales["hu"] = huStrings;
// numericmask.thousandsSeparator: "A symbol used to separate the digits of a large number into groups of three." => "Egy szimbólum, amely nagy szám számjegyeit három csoportba sorolja."
// numericmask.precision: "Limits how many digits to retain after the decimal point for a displayed number." => "Korlátozza, hogy hány számjegy maradjon meg a megjelenített szám tizedesvesszője után."
// currencymask.prefix: "One or several symbols to be displayed before the value." => "Egy vagy több szimbólum jelenik meg az érték előtt."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Egy vagy több szimbólum jelenik meg az érték után."
// currencymask.suffix: "One or several symbols to be displayed after the value." => "Egy vagy több szimbólum jelenik meg az érték után."
// ed.translationSource: "Source: " => "Forrás: "
// ed.translationTarget: "Target: " => "Cél: "

0 comments on commit b0eea10

Please sign in to comment.