Skip to content
Snippets Groups Projects
Commit c294c13e authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FEAT #15546 TIME 0:25 fix : css + generateMissingLang function

parent 11241bd9
No related branches found
No related tags found
No related merge requests found
...@@ -60,11 +60,10 @@ export class DevLangComponent implements OnInit { ...@@ -60,11 +60,10 @@ export class DevLangComponent implements OnInit {
this.currentLang = ev.detail.value; this.currentLang = ev.detail.value;
} }
generateMissingLang(ignoreToTranslate = false) { generateMissingLang(ignoreToTranslate: boolean) {
let newLang = {}; let newLang = {};
let mergedLang = this.allLang[this.currentLang]; let mergedLang = this.allLang[this.currentLang];
const regex = /__TO_TRANSLATE$/g; const regex = /__TO_TRANSLATE$/g;
this.missingLang[this.currentLang].forEach((element: any) => { this.missingLang[this.currentLang].forEach((element: any) => {
if (element.value.match(regex) === null && ignoreToTranslate) { if (element.value.match(regex) === null && ignoreToTranslate) {
newLang[element.id] = element.value; newLang[element.id] = element.value;
...@@ -72,8 +71,7 @@ export class DevLangComponent implements OnInit { ...@@ -72,8 +71,7 @@ export class DevLangComponent implements OnInit {
newLang[element.id] = element.value; newLang[element.id] = element.value;
} }
}); });
mergedLang = { ...mergedLang, ...newLang }; mergedLang.lang = {...mergedLang.lang, ...newLang};
this.http.put('../rest/languages', { langId: this.currentLang, jsonContent: mergedLang }).pipe( this.http.put('../rest/languages', { langId: this.currentLang, jsonContent: mergedLang }).pipe(
tap((data: any) => { tap((data: any) => {
Object.keys(newLang).forEach(keyLang => { Object.keys(newLang).forEach(keyLang => {
......
...@@ -31,7 +31,7 @@ export class DevToolComponent implements OnInit { ...@@ -31,7 +31,7 @@ export class DevToolComponent implements OnInit {
openLangTool() { openLangTool() {
const dialogRef = this.dialog.open(DevLangComponent, { const dialogRef = this.dialog.open(DevLangComponent, {
panelClass: 'maarch-modal', panelClass: 'maarch-modal',
height: '99%', height: '80%',
width: '80%', width: '80%',
data: { data: {
countMissingLang : this.countMissingLang countMissingLang : this.countMissingLang
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment