fix: Suppress diagram translation warning on initial load, add home-ai locale stubs
- interactive-diagram.js: Only warn about missing translations when i18n has already initialized (not during initial race before i18n completes) - Add empty home-ai.json locale files (en/de/fr) to prevent console warning on /home-ai.html page Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
45e74fd5d5
commit
42219f6799
4 changed files with 10 additions and 1 deletions
|
|
@ -21,7 +21,10 @@ class InteractiveDiagram {
|
|||
// If no translations available, use English fallback
|
||||
const hasTranslations = diagram && Object.keys(diagram).length > 0;
|
||||
if (!hasTranslations) {
|
||||
console.warn('[InteractiveDiagram] No translations loaded, using English fallback');
|
||||
// Only warn if i18n has already initialized (otherwise this is expected on first load)
|
||||
if (window.i18nTranslations && Object.keys(window.i18nTranslations).length > 0) {
|
||||
console.warn('[InteractiveDiagram] No diagram translations in loaded locale, using English fallback');
|
||||
}
|
||||
this.loadFallbackData();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
2
public/locales/de/home-ai.json
Normal file
2
public/locales/de/home-ai.json
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
||||
2
public/locales/en/home-ai.json
Normal file
2
public/locales/en/home-ai.json
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
||||
2
public/locales/fr/home-ai.json
Normal file
2
public/locales/fr/home-ai.json
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue