fix: don't allow users to have same base and target short langCode (#1854)

This commit is contained in:
ggurdin 2025-02-19 15:32:34 -05:00 committed by GitHub
parent 32d314c026
commit 05a046de63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,8 +73,9 @@ class SettingsLearningView extends StatelessWidget {
isL2List: false,
decorationText: L10n.of(context).myBaseLanguage,
validator: (lang) {
if (lang ==
controller.selectedTargetLanguage) {
if (lang?.langCodeShort ==
controller.selectedTargetLanguage
?.langCodeShort) {
return L10n.of(context)
.noIdenticalLanguages;
}
@ -93,8 +94,9 @@ class SettingsLearningView extends StatelessWidget {
isL2List: true,
decorationText: L10n.of(context).iWantToLearn,
validator: (lang) {
if (lang ==
controller.selectedSourceLanguage) {
if (lang?.langCodeShort ==
controller.selectedSourceLanguage
?.langCodeShort) {
return L10n.of(context)
.noIdenticalLanguages;
}