ruby-i18n/ruby-cldr

Export `alt` attribute consistently

Opened this issue · 0 comments

CLDR has an alt attribute that can be used to indicate a different things:

  • alt=proposed\d* and alt=#{variantname}-proposed\d* indicate proposed values that will replace the non-alt version of the value. They will always have a draft attribute, since as soon as they get the accepted status, the non-alt version is replaced.
  • alt=#{variantname} indicates an alternative value that really ought to be used in specific conditions.

Currently, ruby-cldr filters out values with an alt attribute in some places using the Base#alt? method. However, it's inconsistently applied.

We might want to export data with alt=#{variantname} style attributes, perhaps using a separate key name. cldr-json does this:

Upstream CLDR XML:

<language type="en_US">Engels (VSA)</language>
<language type="en_US" alt="short">Engels (VSA)</language>

gets exported as:

"en-US": "Engels (VSA)",
"en-US-alt-short": "Engels (VSA)",