Fix Weblate parsing error with strings outside any section

Given error:

  Could not parse translation base file: File contains no section
  headers. file: '<???>', line: 10 'display_name = English\n'

It looks like a known issue: https://github.com/WeblateOrg/weblate/issues/9702
This commit is contained in:
David Capello 2023-12-05 13:14:18 -03:00
parent d5a54d8de7
commit 609aedee12
2 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#
# https://aseprite.org/docs/extensions/languages/
#
[_]
display_name = English
[advanced_mode]

View File

@ -69,7 +69,7 @@ std::set<LangInfo> Strings::availableLanguages() const
// Load display name
cfg::CfgFile cfg;
if (cfg.load(path))
displayName = cfg.getValue("", "display_name", displayName.c_str());
displayName = cfg.getValue("_", "display_name", displayName.c_str());
result.insert(LangInfo(langId, path, displayName));
}