Skip to content

Commit a934a1d

Browse files
Canario5Blarc
authored andcommitted
fix(locale): ensure correct locale selection in settings dropdown
Fixes an issue where the locale dropdown would incorrectly display the first alphabetical locale (e.g., "Afrikaans" for English) instead of the actual default locale (e.g., "English"). This happened when a user first installs the plugin or didn't set locale directly before.
1 parent 29f940b commit a934a1d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/kotlin/com/github/blarc/ai/commits/intellij/plugin/settings/AppSettingsConfigurable.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ class AppSettingsConfigurable(val project: Project, cs: CoroutineScope) : BoundC
100100

101101
comboBox(locales, AICommitsListCellRenderer())
102102
.widthGroup("input")
103-
.bindItem(getter = { projectSettings.locale }, setter = { setActiveLocale(it)} )
103+
.bindItem(
104+
getter = { locales.find { it.language == projectSettings.locale.language } ?: Locale.ENGLISH },
105+
setter = { setActiveLocale(it)}
106+
)
104107

105108
contextHelp(message("settings.locale.contextHelp"))
106109

0 commit comments

Comments
 (0)