Last active
December 15, 2015 07:29
-
-
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 = {})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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