Resolves: tdf#148792 Add Portuguese (Mozambique) {pt-MZ} locale and data

Basically copies pt_PT.xml but replaces translated with
untranslated keywords (AA,AAAA => YY,YYYY), hence no ref="pt_PT"
for LC_FORMAT (and LC_CTYPE).

Also use sort-formats.awk -v group=1 to sort FormatElement by usage
group and formatIndex as those went quite wild over time..

Change-Id: Iececac0ebdd0317fd14ab65f32c08501f3ce32c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143398
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx
index 5204b21..c5259a5 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -674,6 +674,8 @@ IsoLanguageCountryEntry const aImplIsoLangEntries[] =
    { LANGUAGE_USER_KLINGON,               "tlh", ""  , k0    },
    { LANGUAGE_USER_ENGLISH_ISRAEL,         "en", "IL", k0    },
    { LANGUAGE_USER_PENNSYLVANIA_DUTCH,    "pdc", "US", k0    },
    { LANGUAGE_USER_PORTUGUESE_MOZAMBIQUE,  "pt", "MZ", k0    },
    // Add new languages ^^^ there.
    { LANGUAGE_MULTIPLE,                   "mul", ""  , k0    },    // multiple languages, many languages are used
    { LANGUAGE_UNDETERMINED,               "und", ""  , k0    },    // undetermined language, language cannot be identified
    { LANGUAGE_NONE,                       "zxx", ""  , k0    },    // added to ISO 639-2 on 2006-01-11: Used to declare the absence of linguistic information
diff --git a/i18npool/Library_localedata_euro.mk b/i18npool/Library_localedata_euro.mk
index 069809b..b2f6ce5 100644
--- a/i18npool/Library_localedata_euro.mk
+++ b/i18npool/Library_localedata_euro.mk
@@ -86,6 +86,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,localedata_euro,\
	CustomTarget/i18npool/localedata/localedata_oc_FR_lengadoc \
	CustomTarget/i18npool/localedata/localedata_pl_PL \
	CustomTarget/i18npool/localedata/localedata_pt_BR \
	CustomTarget/i18npool/localedata/localedata_pt_MZ \
	CustomTarget/i18npool/localedata/localedata_pt_PT \
	CustomTarget/i18npool/localedata/localedata_ro_RO \
	CustomTarget/i18npool/localedata/localedata_rue_SK \
diff --git a/i18npool/source/localedata/data/pt_MZ.xml b/i18npool/source/localedata/data/pt_MZ.xml
new file mode 100644
index 0000000..db4ef68
--- /dev/null
+++ b/i18npool/source/localedata/data/pt_MZ.xml
@@ -0,0 +1,282 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Locale SYSTEM 'locale.dtd'>
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<Locale versionDTD="2.0.3" allowUpdateFromCLDR="no" version="1.2">
  <LC_INFO>
    <Language>
      <LangID>pt</LangID>
      <DefaultName>Portuguese</DefaultName>
    </Language>
    <Country>
      <CountryID>MZ</CountryID>
      <DefaultName>Mozambique</DefaultName>
    </Country>
  </LC_INFO>
  <LC_CTYPE unoid="generic">
    <Separators>
      <DateSeparator>-</DateSeparator>
      <ThousandSeparator> </ThousandSeparator>
      <DecimalSeparator>,</DecimalSeparator>
      <TimeSeparator>:</TimeSeparator>
      <Time100SecSeparator>,</Time100SecSeparator>
      <ListSeparator>;</ListSeparator>
      <LongDateDayOfWeekSeparator>, </LongDateDayOfWeekSeparator>
      <LongDateDaySeparator> de </LongDateDaySeparator>
      <LongDateMonthSeparator> de </LongDateMonthSeparator>
      <LongDateYearSeparator> </LongDateYearSeparator>
    </Separators>
    <Markers>
      <QuotationStart>‘</QuotationStart>
      <QuotationEnd>’</QuotationEnd>
      <DoubleQuotationStart>“</DoubleQuotationStart>
      <DoubleQuotationEnd>”</DoubleQuotationEnd>
    </Markers>
    <TimeAM>AM</TimeAM>
    <TimePM>PM</TimePM>
    <MeasurementSystem>Metric</MeasurementSystem>
  </LC_CTYPE>
  <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$MTn-8416]">
    <DateAcceptancePattern>D-M</DateAcceptancePattern>
    <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER"  formatindex="0">
      <FormatCode>Geral</FormatCode>
    </FormatElement>
    <FormatElement msgid="FixedFormatskey2" default="true" type="short" usage="FIXED_NUMBER"  formatindex="1">
      <FormatCode>0</FormatCode>
    </FormatElement>
    <FormatElement msgid="FixedFormatskey3" default="false" type="medium" usage="FIXED_NUMBER"  formatindex="2">
      <FormatCode>0,00</FormatCode>
    </FormatElement>
    <FormatElement msgid="FixedFormatskey4" default="false" type="short" usage="FIXED_NUMBER"  formatindex="3">
      <FormatCode># ##0</FormatCode>
    </FormatElement>
    <FormatElement msgid="FixedFormatskey5" default="false" type="medium" usage="FIXED_NUMBER"  formatindex="4">
      <FormatCode># ##0,00</FormatCode>
    </FormatElement>
    <FormatElement msgid="FixedFormatskey6" default="false" type="medium" usage="FIXED_NUMBER"  formatindex="5">
      <FormatCode># ###,00</FormatCode>
    </FormatElement>
    <FormatElement msgid="FixedFormatskey9" default="false" type="medium" usage="FIXED_NUMBER" formatindex="101">
      <FormatCode>[NatNum12 cardinal]0</FormatCode>
    </FormatElement>
    <FormatElement msgid="FixedFormatskey10" default="false" type="medium" usage="FIXED_NUMBER" formatindex="102">
      <FormatCode>[NatNum12 capitalize cardinal]0</FormatCode>
    </FormatElement>
    <FormatElement msgid="FixedFormatskey12" default="false" type="medium" usage="FIXED_NUMBER" formatindex="104">
      <FormatCode>[NatNum12 upper cardinal]0</FormatCode>
    </FormatElement>
    <FormatElement msgid="ScientificFormatskey1" default="false" type="medium" usage="SCIENTIFIC_NUMBER"  formatindex="6">
      <FormatCode>0,00E+000</FormatCode>
    </FormatElement>
    <FormatElement msgid="ScientificFormatskey2" default="true" type="medium" usage="SCIENTIFIC_NUMBER"  formatindex="7">
      <FormatCode>0,00E+00</FormatCode>
    </FormatElement>
    <FormatElement msgid="ScientificFormatskey3" default="false" type="medium" usage="SCIENTIFIC_NUMBER" formatindex="84">
      <FormatCode>##0,00E+00</FormatCode>
    </FormatElement>
    <FormatElement msgid="PercentFormatskey1" default="true" type="short" usage="PERCENT_NUMBER"  formatindex="8">
      <FormatCode>0%</FormatCode>
    </FormatElement>
    <FormatElement msgid="PercentFormatskey2" default="true" type="long" usage="PERCENT_NUMBER"  formatindex="9">
      <FormatCode>0,00%</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey1" default="true" type="short" usage="CURRENCY" formatindex="12">
      <FormatCode># ##0 [CURRENCY];-# ##0 [CURRENCY]</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey2" default="false" type="medium" usage="CURRENCY" formatindex="13">
      <FormatCode># ##0,00 [CURRENCY];-# ##0,00 [CURRENCY]</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey3" default="false" type="medium" usage="CURRENCY" formatindex="14">
      <FormatCode># ##0 [CURRENCY];[RED]-# ##0 [CURRENCY]</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey4" default="true" type="medium" usage="CURRENCY" formatindex="15">
      <FormatCode># ##0,00 [CURRENCY];[RED]-# ##0,00 [CURRENCY]</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey5" default="false" type="medium" usage="CURRENCY" formatindex="16">
      <FormatCode># ##0,00 CCC</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey6" default="false" type="medium" usage="CURRENCY" formatindex="17">
      <FormatCode># ##0,-- [CURRENCY];[RED]-# ##0,-- [CURRENCY]</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey9" default="false" type="medium" usage="CURRENCY" formatindex="105">
      <FormatCode>[NatNum12 CURRENCY]0</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey10" default="false" type="medium" usage="CURRENCY" formatindex="106">
      <FormatCode>[NatNum12 CURRENCY]0,00</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey11" default="false" type="medium" usage="CURRENCY" formatindex="107">
      <FormatCode>[NatNum12 upper CURRENCY]0</FormatCode>
    </FormatElement>
    <FormatElement msgid="CurrencyFormatskey12" default="false" type="medium" usage="CURRENCY" formatindex="108">
      <FormatCode>[NatNum12 upper CURRENCY]0,00</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey1" default="true" type="short" usage="DATE" formatindex="18">
      <FormatCode>DD-MM-YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey9" default="true" type="long" usage="DATE" formatindex="19">
      <FormatCode>NNNND "de" MMMM "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey8" default="false" type="medium" usage="DATE" formatindex="20">
      <FormatCode>DD-MM-YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey7" default="true" type="medium" usage="DATE" formatindex="21">
      <FormatCode>DD-MM-YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey10" default="false" type="long" usage="DATE" formatindex="22">
      <FormatCode>D "de" MMM "de" YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey11" default="false" type="long" usage="DATE" formatindex="23">
      <FormatCode>D "de" MMM "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey16" default="false" type="long" usage="DATE" formatindex="24">
      <FormatCode>D. MMM "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey12" default="false" type="long" usage="DATE" formatindex="25">
      <FormatCode>D "de" MMMM "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey17" default="false" type="long" usage="DATE" formatindex="26">
      <FormatCode>D. MMMM "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey13" default="false" type="long" usage="DATE" formatindex="27">
      <FormatCode>NN, D "de" MMM "de" YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey2" default="false" type="medium" usage="DATE" formatindex="28">
      <FormatCode>NN, DD-MMM-YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey14" default="false" type="long" usage="DATE" formatindex="29">
      <FormatCode>NN, D "de" MMMM "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey15" default="false" type="long" usage="DATE" formatindex="30">
      <FormatCode>NNNND "de" MMMM "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey18" default="false" type="short" usage="DATE" formatindex="31">
      <FormatCode>MM-DD</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey19" default="false" type="medium" usage="DATE" formatindex="32">
      <FormatCode>YY-MM-DD</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey20" default="false" type="medium" usage="DATE" formatindex="33">
      <FormatCode>YYYY-MM-DD</FormatCode>
      <DefaultName>ISO 8601 (EN 28601)</DefaultName>
    </FormatElement>
    <FormatElement msgid="DateFormatskey3" default="false" type="medium" usage="DATE" formatindex="34">
      <FormatCode>MM-YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey4" default="false" type="medium" usage="DATE" formatindex="35">
      <FormatCode>DD-MMM</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey5" default="false" type="medium" usage="DATE" formatindex="36">
      <FormatCode>MMMM</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey6" default="false" type="medium" usage="DATE" formatindex="37">
      <FormatCode>QQ "de" YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey21" default="false" type="medium" usage="DATE" formatindex="38">
      <FormatCode>WW</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey22" default="false" type="medium" usage="DATE" formatindex="66">
      <FormatCode>QQ "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey23" default="false" type="medium" usage="DATE" formatindex="67">
      <FormatCode>Q "de" YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey24" default="false" type="medium" usage="DATE" formatindex="68">
      <FormatCode>Q "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey25" default="false" type="medium" usage="DATE" formatindex="69">
      <FormatCode>DD-MMM-YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey26" default="false" type="medium" usage="DATE" formatindex="70">
      <FormatCode>DD-MMM-YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey27" default="false" type="medium" usage="DATE" formatindex="72">
      <FormatCode>MMMM-YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey28" default="false" type="medium" usage="DATE" formatindex="73">
      <FormatCode>MMM-YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey29" default="false" type="medium" usage="DATE" formatindex="74">
      <FormatCode>MMMM-YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey30" default="false" type="medium" usage="DATE" formatindex="75">
      <FormatCode>MMM-YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey31" default="false" type="medium" usage="DATE" formatindex="76">
      <FormatCode>D-MMMM-YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey32" default="false" type="medium" usage="DATE" formatindex="77">
      <FormatCode>D-MMMM-YY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey33" default="false" type="long" usage="DATE" formatindex="78">
      <FormatCode>MMMM "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateFormatskey34" default="false" type="long" usage="DATE" formatindex="79">
      <FormatCode>MMM "de" YYYY</FormatCode>
    </FormatElement>
    <FormatElement msgid="TimeFormatskey1" default="true" type="short" usage="TIME"  formatindex="39">
      <FormatCode>HH:MM</FormatCode>
    </FormatElement>
    <FormatElement msgid="TimeFormatskey2" default="true" type="medium" usage="TIME"  formatindex="40">
      <FormatCode>HH:MM:SS</FormatCode>
    </FormatElement>
    <FormatElement msgid="TimeFormatskey3" default="false" type="short" usage="TIME"  formatindex="41">
      <FormatCode>HH:MM AM/PM</FormatCode>
    </FormatElement>
    <FormatElement msgid="TimeFormatskey4" default="false" type="medium" usage="TIME"  formatindex="42">
      <FormatCode>HH:MM:SS AM/PM</FormatCode>
    </FormatElement>
    <FormatElement msgid="TimeFormatskey5" default="false" type="medium" usage="TIME"  formatindex="43">
      <FormatCode>[HH]:MM:SS</FormatCode>
    </FormatElement>
    <FormatElement msgid="TimeFormatskey6" default="false" type="short" usage="TIME"  formatindex="44">
      <FormatCode>MM:SS,00</FormatCode>
    </FormatElement>
    <FormatElement msgid="TimeFormatskey7" default="false" type="medium" usage="TIME"  formatindex="45">
      <FormatCode>[HH]:MM:SS,00</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateTimeFormatskey1" default="true" type="medium" usage="DATE_TIME"  formatindex="46">
      <FormatCode>DD-MM-YY HH:MM</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateTimeFormatskey2" default="false" type="medium" usage="DATE_TIME"  formatindex="47">
      <FormatCode>DD-MM-YYYY HH:MM:SS</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateTimeFormatskey3" default="false" type="medium" usage="DATE_TIME"  formatindex="50">
      <FormatCode>DD-MM-YYYY HH:MM</FormatCode>
    </FormatElement>
    <FormatElement msgid="DateTimeFormatskey4" default="false" type="medium" usage="DATE_TIME"  formatindex="71">
      <FormatCode>YYYY-MM-DD HH:MM</FormatCode>
    </FormatElement>
  </LC_FORMAT>
  <LC_COLLATION ref="pt_PT"/>
  <LC_SEARCH ref="pt_PT"/>
  <LC_INDEX ref="pt_PT"/>
  <LC_CALENDAR ref="pt_PT"/>
  <LC_CURRENCY>
    <Currency default="true" usedInCompatibleFormatCodes="true">
      <CurrencyID>MZN</CurrencyID>
      <CurrencySymbol>MTn</CurrencySymbol>
      <BankSymbol>MZN</BankSymbol>
      <CurrencyName>metical moçambicano</CurrencyName>
      <DecimalPlaces>2</DecimalPlaces>
    </Currency>
  </LC_CURRENCY>
  <LC_TRANSLITERATION ref="pt_PT"/>
  <LC_MISC ref="pt_PT"/>
  <LC_NumberingLevel ref="pt_PT"/>
  <LC_OutLineNumberingLevel ref="pt_PT"/>
</Locale>
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index 8bf2bbc..4291df4 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -142,8 +142,9 @@ const struct {
    { "nb_NO",  lcl_DATA_EURO },
    { "nds_DE", lcl_DATA_EURO },
    { "pl_PL",  lcl_DATA_EURO },
    { "pt_BR",  lcl_DATA_EURO },
    { "pt_PT",  lcl_DATA_EURO },
    { "pt_BR",  lcl_DATA_EURO },  // needs to be in EURO because inherits from pt_PT
    { "pt_MZ",  lcl_DATA_EURO },  // needs to be in EURO because inherits from pt_PT
    { "ru_RU",  lcl_DATA_EURO },
    { "tr_TR",  lcl_DATA_EURO },
    { "tt_RU",  lcl_DATA_EURO },
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index 0e4c6d2..158a7c7f 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -774,6 +774,7 @@ namespace o3tl
#define LANGUAGE_USER_INTERSLAVIC_LATIN     LanguageType(0x06AD)
#define LANGUAGE_USER_INTERSLAVIC_CYRILLIC  LanguageType(0x06AE)
#define LANGUAGE_USER_PENNSYLVANIA_DUTCH    LanguageType(0x06AF)
#define LANGUAGE_USER_PORTUGUESE_MOZAMBIQUE LanguageType(0x8416)  /* makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_PORTUGUESE)) */


/* XXX Add new user defined LCIDs ^^^ there.
diff --git a/svtools/inc/langtab.hrc b/svtools/inc/langtab.hrc
index cb23437..5d1ed4a 100644
--- a/svtools/inc/langtab.hrc
+++ b/svtools/inc/langtab.hrc
@@ -438,7 +438,8 @@ const std::pair<TranslateId, LanguageType> STR_ARR_SVT_LANGUAGE_TABLE[] =
    { NC_("STR_ARR_SVT_LANGUAGE_TABLE", "English (Israel)") , LANGUAGE_USER_ENGLISH_ISRAEL },
    { NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Interslavic Latin") , LANGUAGE_USER_INTERSLAVIC_LATIN },
    { NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Interslavic Cyrillic") , LANGUAGE_USER_INTERSLAVIC_CYRILLIC },
    { NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Pennsylvania Dutch") , LANGUAGE_USER_PENNSYLVANIA_DUTCH }
    { NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Pennsylvania Dutch") , LANGUAGE_USER_PENNSYLVANIA_DUTCH },
    { NC_("STR_ARR_SVT_LANGUAGE_TABLE", "Portuguese (Mozambique)") , LANGUAGE_USER_PORTUGUESE_MOZAMBIQUE }
};