Spaces:
Building
Building
Update flare-ui/src/app/dialogs/project-edit-dialog/project-edit-dialog.component.ts
Browse files
flare-ui/src/app/dialogs/project-edit-dialog/project-edit-dialog.component.ts
CHANGED
@@ -92,7 +92,7 @@ export interface ProjectDialogData {
|
|
92 |
</mat-option>
|
93 |
}
|
94 |
@for (locale of availableLocales; track locale.code) {
|
95 |
-
<mat-option [value]="locale.
|
96 |
{{ locale.name }}
|
97 |
<span class="locale-code">{{ locale.code }}</span>
|
98 |
</mat-option>
|
@@ -200,7 +200,7 @@ export default class ProjectEditDialogComponent implements OnInit, OnDestroy {
|
|
200 |
icon: this.data.project.icon || 'folder',
|
201 |
description: this.data.project.description || '',
|
202 |
defaultLocale: this.data.project.default_locale || 'tr',
|
203 |
-
|
204 |
timezone: this.data.project.timezone || 'Europe/Istanbul',
|
205 |
region: this.data.project.region || 'tr-TR'
|
206 |
} : {
|
@@ -296,8 +296,38 @@ export default class ProjectEditDialogComponent implements OnInit, OnDestroy {
|
|
296 |
}
|
297 |
|
298 |
getLocaleName(code: string): string {
|
|
|
299 |
const locale = this.availableLocales.find(l => l.code === code);
|
300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
}
|
302 |
|
303 |
getErrorMessage(fieldName: string): string {
|
|
|
92 |
</mat-option>
|
93 |
}
|
94 |
@for (locale of availableLocales; track locale.code) {
|
95 |
+
<mat-option [value]="locale.code"> <!-- locale.name yerine locale.code -->
|
96 |
{{ locale.name }}
|
97 |
<span class="locale-code">{{ locale.code }}</span>
|
98 |
</mat-option>
|
|
|
200 |
icon: this.data.project.icon || 'folder',
|
201 |
description: this.data.project.description || '',
|
202 |
defaultLocale: this.data.project.default_locale || 'tr',
|
203 |
+
supportedLocales: this.data.project.supported_locales || ['tr'], // Düzeltildi: supportedLolcales -> supportedLocales
|
204 |
timezone: this.data.project.timezone || 'Europe/Istanbul',
|
205 |
region: this.data.project.region || 'tr-TR'
|
206 |
} : {
|
|
|
296 |
}
|
297 |
|
298 |
getLocaleName(code: string): string {
|
299 |
+
// Önce availableLocales'da ara
|
300 |
const locale = this.availableLocales.find(l => l.code === code);
|
301 |
+
if (locale) {
|
302 |
+
return locale.name;
|
303 |
+
}
|
304 |
+
|
305 |
+
// Bulamazsan fallback locale isimleri kullan
|
306 |
+
const localeNames: { [key: string]: string } = {
|
307 |
+
'tr': 'Türkçe',
|
308 |
+
'tr-TR': 'Türkçe',
|
309 |
+
'en': 'English',
|
310 |
+
'en-US': 'English',
|
311 |
+
'en-GB': 'English (UK)',
|
312 |
+
'de': 'Deutsch',
|
313 |
+
'de-DE': 'Deutsch',
|
314 |
+
'fr': 'Français',
|
315 |
+
'fr-FR': 'Français',
|
316 |
+
'es': 'Español',
|
317 |
+
'es-ES': 'Español',
|
318 |
+
'ar': 'العربية',
|
319 |
+
'ar-SA': 'العربية',
|
320 |
+
'ru': 'Русский',
|
321 |
+
'ru-RU': 'Русский',
|
322 |
+
'zh': '中文',
|
323 |
+
'zh-CN': '中文',
|
324 |
+
'ja': '日本語',
|
325 |
+
'ja-JP': '日本語',
|
326 |
+
'ko': '한국어',
|
327 |
+
'ko-KR': '한국어'
|
328 |
+
};
|
329 |
+
|
330 |
+
return localeNames[code] || code;
|
331 |
}
|
332 |
|
333 |
getErrorMessage(fieldName: string): string {
|