Skip to content

Commit

Permalink
show languages selected choices on top.
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Nov 10, 2023
1 parent d83f0c6 commit a32e49f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion generators/languages/prompts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export async function askForLanguages({ control }) {
choices: () => {
const languageOptions = this.supportedLanguages;
const nativeLanguage = this.jhipsterConfigWithDefaults.nativeLanguage;
return languagesAsChoices(languageOptions.filter(l => l.languageTag !== nativeLanguage));
const choices = languagesAsChoices(languageOptions.filter(l => l.languageTag !== nativeLanguage));
const defaults = this.jhipsterConfigWithDefaults.languages ?? [];
return [...choices.filter(({ value }) => defaults.includes(value)), ...choices.filter(({ value }) => !defaults.includes(value))];
},
default: () => this.jhipsterConfigWithDefaults.languages,
},
Expand Down

0 comments on commit a32e49f

Please sign in to comment.