Skip to content

Commit

Permalink
CLDR-17544 Adjust tool to suppress Mn Ms differences
Browse files Browse the repository at this point in the history
See #3913
  • Loading branch information
macchiati authored and Squash Bot committed Jul 30, 2024
1 parent 5646783 commit a47a993
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
4 changes: 2 additions & 2 deletions common/dtd/ldml.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -2042,7 +2042,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic

<!ELEMENT decimal ( #PCDATA ) >
<!ATTLIST decimal alt NMTOKENS #IMPLIED >
<!--@MATCH:literal/variant-->
<!--@MATCH:literal/variant, us, official-->
<!ATTLIST decimal draft (approved | contributed | provisional | unconfirmed | true | false) #IMPLIED >
<!--@METADATA-->
<!--@DEPRECATED:true, false-->
Expand All @@ -2053,7 +2053,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic

<!ELEMENT group ( #PCDATA ) >
<!ATTLIST group alt NMTOKENS #IMPLIED >
<!--@MATCH:literal/variant-->
<!--@MATCH:literal/variant, us, official-->
<!ATTLIST group draft (approved | contributed | provisional | unconfirmed | true | false) #IMPLIED >
<!--@METADATA-->
<!--@DEPRECATED:true, false-->
Expand Down
15 changes: 13 additions & 2 deletions common/main/en_ZA.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,20 @@ CLDR data files are interpreted according to the LDML specification (http://unic
</dates>
<numbers>
<symbols numberSystem="latn">
<decimal>↑↑↑</decimal>
<group>↑↑↑</group>
<decimal>,</decimal>
<decimal alt="official">,</decimal>
<decimal alt="us">.</decimal>
<group> </group>
<group alt="official"> </group>
<group alt="us">,</group>
</symbols>
<currencyFormats numberSystem="latn">
<currencyFormatLength>
<currencyFormat type="standard">
<pattern alt="alphaNextToNumber">¤#,##0.00</pattern>
</currencyFormat>
</currencyFormatLength>
</currencyFormats>
<currencies>
<currency type="ZAR">
<symbol>R</symbol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
import org.unicode.cldr.util.XPathParts;

public class ShowInconsistentAvailable {
private static final boolean SHOW_ORDERING = true;
private static final boolean SHOW_ROOT = false;

private static final CLDRConfig CONFIG = CLDRConfig.getInstance();
static boolean INCLUDE_ERA = true;
static boolean SHOW_PROGRESS_RAW = false;
Expand Down Expand Up @@ -377,8 +374,22 @@ static void showInconsistenciesInLocale(String locale) {
final SimplePattern skeletonSP = entry.getKey();
// if the multimap has multiple keys, then we have a problem
// that means that similar skeletons map to dissimilar values
boolean inconsistentValues = entry.getValue().keySet().size() > 1;
final Set<SimplePattern> valueSet = entry.getValue().keySet();
boolean inconsistentValues = valueSet.size() > 1;

// allow Ms to match Mn, if all else equal
// common with Slavics
if (inconsistentValues) {
Set<String> neuteredMonths = new TreeSet<>();
for (SimplePattern p : valueSet) {
neuteredMonths.add(p.toString().replace("Mⁿ", "Mˢ"));
}
if (neuteredMonths.size() == 1) {
inconsistentValues = false;
}
}

// show the errors
for (Entry<SimplePattern, Collection<PatternData2>> entry2 :
entry.getValue().asMap().entrySet()) {
final SimplePattern valueSP = entry2.getKey();
Expand Down

0 comments on commit a47a993

Please sign in to comment.