From e2332bf0c479637cd549387f3575031026477334 Mon Sep 17 00:00:00 2001 From: "Textor Andreas (BCI/ESW17)" Date: Tue, 10 Dec 2024 10:00:48 +0100 Subject: [PATCH 1/2] Reintroduce automatic language selection in documentation generator --- .../generator/docu/DocumentationGenerationConfig.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/DocumentationGenerationConfig.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/DocumentationGenerationConfig.java index 0a425a29f..1cc8a9c5a 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/DocumentationGenerationConfig.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/DocumentationGenerationConfig.java @@ -28,9 +28,4 @@ public record DocumentationGenerationConfig( Locale locale, String stylesheet ) implements GenerationConfig { - public DocumentationGenerationConfig { - if ( locale == null ) { - locale = Locale.ENGLISH; - } - } } From 710733565f081fa6de2643550c280767d9557234 Mon Sep 17 00:00:00 2001 From: "Textor Andreas (BCI/ESW17)" Date: Tue, 10 Dec 2024 10:30:51 +0100 Subject: [PATCH 2/2] Use language from configuration --- .../generator/docu/AspectModelDocumentationGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGenerator.java b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGenerator.java index 045710730..16989c257 100644 --- a/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGenerator.java +++ b/core/esmf-aspect-model-document-generators/src/main/java/org/eclipse/esmf/aspectmodel/generator/docu/AspectModelDocumentationGenerator.java @@ -99,7 +99,7 @@ public Stream generate() { logMissingTranslations( aspect(), language ); templateContext.put( "i18n", new I18nLanguageBundle( language ) ); final TemplateEngine templateEngine = new TemplateEngine( templateContext, engineConfiguration ); - final String artifactName = "%s_%s.html".formatted( aspect().getName(), config.locale().toLanguageTag() ); + final String artifactName = "%s_%s.html".formatted( aspect().getName(), language.toLanguageTag() ); String source = templateEngine.apply( DOCU_ROOT_DIR + "/templates/html/aspect-model-documentation" ); source = insertAspectModelDiagram( source, language ); source = insertStaticPlaceholders( source );