Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] AspectModelDocumentationGenerator - languages are ignored and only English is used all the time. #681

Open
ext-ivan-begunov opened this issue Nov 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ext-ivan-begunov
Copy link

Describe the bug

There is a code in AspectModelDocumentationGenerator to get target languages:

final Set<Locale> targetLanguages = config.locale() == null
      ? LanguageCollector.collectUsedLanguages( aspect() )
      : Set.of( Locale.ENGLISH );

So aspect languages are used only if configuration locale is null.
And if it's not null, ENGLISH is used.

But in DocumentationGenerationConfig locale can't be null:

@RecordBuilder
public record DocumentationGenerationConfig(
      Locale locale,
      String stylesheet
) implements GenerationConfig {
   public DocumentationGenerationConfig {
      if ( locale == null ) {
         locale = Locale.ENGLISH;
      }
   }
}

As a result - if we create configuration with any locale, in generator it will be changed to Locale.ENGLISH.
If we create configuration without locale, default Locale.ENGLISH will be assigned in DocumentationGenerationConfig.

Where
esmf-aspect-model-document-generators:2.9.8
AspectModelDocumentationGenerator, DocumentationGenerationConfig

@ext-ivan-begunov ext-ivan-begunov added the bug Something isn't working label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant