Skip to content

Commit

Permalink
Component: Improve detection of existing language
Browse files Browse the repository at this point in the history
Avoid looking at text, because it can be part of existing language
object, better to look at ID which indicates whether it has been created
in the database.
  • Loading branch information
nijel committed Jun 25, 2020
1 parent 7238446 commit 6ef7bc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weblate/trans/models/component.py
Expand Up @@ -1865,7 +1865,7 @@ def clean_lang_codes(self, matches):
)
raise ValidationError({"filemask": message})
langs.add(code)
if "(generated)" not in lang.name:
if lang.id:
existing_langs.add(lang.code)

# No languages matched our definition
Expand Down

0 comments on commit 6ef7bc5

Please sign in to comment.