Skip to content

Expose "draft status" as a CLI option; clean up #73

@movermeyer

Description

@movermeyer

Question: Is it the case that thor cldr:export should never export draft data?
Right now it seems to export draft data in some places, which may indicate a bug.


CLDR has a hierarchy of 4 values for the "draft" attribute that represent how far through the approval process the data is.

Currently, some of the data exposed through ruby-cldr is guarded by checks to draft?:

def draft?(node)
  draft = node.attribute('draft')
  draft && draft.value == 'unconfirmed'
end

But there are also places where this check is not being done (Example) and draft information is getting exported. For example, thor cldr:export exports:

---
se:
  currencies:
    DKK:
      symbol: Dkr
      narrow_symbol: kr

Even though the narrow_symbol value is marked as draft="unconfirmed" in CLDR


Related: I believe that checking for the draft attribute at the leaf is insufficient. According to this, draft attributes can be inherited from parents.

That said, it does mention that this generally should not be the case:

However, normally the draft attributes should be canonicalized, which means they are pushed down to leaf nodes as described in Section 5.6 Canonical Form. If an LDML file does has draft attributes that are not on leaf nodes, the file should be interpreted as if it were the canonicalized version of that file.

So I'm not sure that this is a problem in practice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions