Cropster / ember-l10n

A GNU gettext based localization workflow for Ember
MIT License
15 stars 7 forks source link

Implement exists() function #6

Closed mydea closed 6 years ago

mydea commented 8 years ago

In order to achieve maximal compatibility with ember-i18n and make migration as easy as possible, I propose that we add a l10n.exists(key) function. Basically, this function should return true if the given key exists for the currently set locale, else false.

Concretely, this is used by https://github.com/jasonmit/ember-i18n-cp-validations/blob/master/addon/initialize.js, which I am porting over for ember-l10n. It's not super important, but I guess it would be nice and an easy addition. If that makes sense, I'll make a PR?

arm1n commented 8 years ago

Sounds good for me. Please also add the method in service's utility methods in README as long as we have no proper JSDOC from sources - thanks!