Skip to content
Browse files

hasTranslation -> hasPhrase

  • Loading branch information...
1 parent c0d9455 commit 9b07702b5b9abce458989cd74d53e819edead5c6 @ixti ixti committed Oct 15, 2012
Showing with 5 additions and 4 deletions.
  1. +1 −0 HISTORY.md
  2. +1 −1 browser/babelfish-runtime.js
  3. +2 −2 lib/babelfish.js
  4. +1 −1 lib/babelfish/runtime.js
View
1 HISTORY.md
@@ -3,6 +3,7 @@
* Refactor internal storage
* Fix flattenParams()
* Improved error reporting on missing params
+* Add hasPhrase()
0.1.0 / 2012-08-14
View
2 browser/babelfish-runtime.js
@@ -110,7 +110,7 @@ BabelFish.prototype.translate = function translate(locale, phrase, params) {
};
-BabelFish.prototype.hasTranslation = function hasTranslation(locale, phrase) {
+BabelFish.prototype.hasPhrase = function hasPhrase(locale, phrase) {
var translator = this.getCompiledData(locale, phrase);
return 'string' === translator.type || 'function' === translator.type;
};
View
4 lib/babelfish.js
@@ -374,13 +374,13 @@ BabelFish.prototype.translate = function translate(locale, phrase, params) {
/**
- * BabelFish#hasTranslation(locale, phrase) -> Boolean
+ * BabelFish#hasPhrase(locale, phrase) -> Boolean
* - locale (String): Locale of translation
* - phrase (String): Phrase ID, e.g. `app.forums.replies_count`
*
* Returns whenever or not there's a translation of a `phrase`.
**/
-BabelFish.prototype.hasTranslation = function hasTranslation(locale, phrase) {
+BabelFish.prototype.hasPhrase = function hasPhrase(locale, phrase) {
var translator = this.getCompiledData(locale, phrase);
return 'string' === translator.type || 'function' === translator.type;
};
View
2 lib/babelfish/runtime.js
@@ -90,7 +90,7 @@ BabelFish.prototype.translate = function translate(locale, phrase, params) {
};
-BabelFish.prototype.hasTranslation = function hasTranslation(locale, phrase) {
+BabelFish.prototype.hasPhrase = function hasPhrase(locale, phrase) {
var translator = this.getCompiledData(locale, phrase);
return 'string' === translator.type || 'function' === translator.type;
};

0 comments on commit 9b07702

Please sign in to comment.
Something went wrong with that request. Please try again.