daisy / ace

Ace by DAISY, an Accessibility Checker for EPUB
MIT License
76 stars 22 forks source link

Localization: internal change - include the language name (expressed in that same language) in the locale's JSON resource #247

Open danielweck opened 5 years ago

danielweck commented 5 years ago

https://github.com/daisy/ace/blob/4c6f5627ffdf14190342a3854d49b82df28aee49/packages/ace-core/src/l10n/localize.js#L12-L15

=> would become:

    fr: {
        name: frJson.LOCALE_NAME,
        translation: frJson
    }

(LOCALE_NAME can be changed for any suitable well-defined key name, used consistently across all supported languages)

This internal change would mean that l10n contributions would include all translated labels inside the locale's JSON resource. For example, see this recent Pull Request:

https://github.com/daisy/ace/pull/246/files#diff-38adeefea9ae9024cab3ce220f321259

danielweck commented 5 years ago

A possible alternative is to expose the localized names of languages using: https://github.com/haliaeetus/iso-639 or: https://github.com/michaelwittig/node-i18n-iso-countries ...but to keep things simple, we can continue to display the name of each language, in their respective language (rather than in the current UI language).