Validate private use language tags

Fixes #9119
This commit is contained in:
Joe Mooring
2021-11-07 07:06:48 -08:00
committed by Bjørn Erik Pedersen
parent 93572e5318
commit 58adbeef88
2 changed files with 12 additions and 4 deletions

View File

@@ -93,6 +93,11 @@ func addTranslationFile(bundle *i18n.Bundle, r source.File) error {
lang := paths.Filename(name)
tag := language.Make(lang)
if tag == language.Und {
try := artificialLangTagPrefix + lang
_, err = language.Parse(try)
if err != nil {
return _errors.Errorf("%q %s.", try, err)
}
name = artificialLangTagPrefix + name
}