Skip to content

Commit

Permalink
Fix ARB @@Locale parsing to use locale, not tag
Browse files Browse the repository at this point in the history
Poedit incorrectly parsed the @@Locale value as a BCP47 tag and wrote it
as one too. This was incorrect, the value is indeed a locale, using '_'
and not '-' as language/country delimiter.
  • Loading branch information
vslavik committed Feb 15, 2024
1 parent 2fc2a34 commit 8768261
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/catalog_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ class FlutterCatalog : public JSONCatalog
void SetLanguage(Language lang) override
{
JSONCatalog::SetLanguage(lang);
m_doc["@@locale"] = lang.LanguageTag();
m_doc["@@locale"] = lang.Code();
}

void Parse() override
{
m_language = Language::FromLanguageTag(m_doc.value("@@locale", ""));
m_language = Language::TryParse(m_doc.value("@@locale", ""));

int id = 0;
ParseSubtree(id, m_doc, "");
Expand Down

0 comments on commit 8768261

Please sign in to comment.