Skip to content

Instantly share code, notes, and snippets.

@cfv1984
Last active December 15, 2015 07:29
Show Gist options
  • Save cfv1984/5224082 to your computer and use it in GitHub Desktop.
Save cfv1984/5224082 to your computer and use it in GitHub Desktop.
This is how you alias Pomo.getText(msg_id, options = {}) to __(msg_id, options = {})
var __ = (function(){
var _ = !!window.Pomo? window.Pomo : (!!window.__Pomo? window.__Pomo: false); //is Pomo there? get it
var gettext_wrap = function(word, options){return _.getText(word, options)}; // aliases getText
gettext_wrap = !!_? gettext_wrap: false; //if Pomo can be found, alias it
if(!gettext_wrap){
throw new "Pomo can't be found";
}
return gettext_wrap;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment