define( function() {

    var fallbackLanguage = "en-us",
        texts = {
    "player": {
        "navigation": {
            "button": {
                "pause": {
                    "et-ee": "Paus",
                    "bg-bg": "Пауза",
                    "cs-cz": "Pøerušení",
                    "da-dk": "Pause",
                    "de-de": "Pause",
                    "en-us": "Pause",
                    "es-es": "Pausa",
                    "es-ar": "Pausa",
                    "fi-fi": "Tauko",
                    "fr-fr": "Pause",
                    "el-gr": "Παύση",
                    "hi-in": "विराम करें",
                    "hr-hr": "Stanka",
                    "hu-hu": "Szünet",
                    "it-it": "Pausa",
                    "ja-jp": "一時停止",
                    "ko-kr": "잠시 멈춤",
                    "lt-lt": "Pauzė",
                    "mk-mk": "Пауза",
                    "mn-mn": "Түр зогсоох",
                    "ms-id": "Jeda",
                    "nl-nl": "Pauze",
                    "no-no": "Pause",
                    "pl-pl": "Pauza",
                    "pt-pt": "Pausa",
                    "pt-br": "Pausa",
                    "ro-ro": "Pauză",
                    "ru-ru": "Пауза",
                    "sk-sk": "Preruši",
                    "sl-si": "Premor",
                    "sr-rs": "Pauza",
                    "sv-se": "Paus",
                    "th-th": "หยุดชั่วคราว",
                    "tr-tr": "Ara",
                    "zh-tw": "暫停",
                    "zh-cn": "暂停",
                    "de-at": "Pause",
                    "de-ch": "Pause",
                    "eo-de": "Pause",
                    "nl-be": "Pauze",
                    "en-ie": "Pause",
                    "en-gb": "Pause",
                    "eo-en": "Pause",
                    "fr-be": "Pause"
                }
            }
        }
    }
};

    /**
     * Gets data from a nested object
     *
     * @private
     * @param {string} key - a dot separated representation of the objectstructure e.g.("cmi.core.lesson_status")
     * @param {object|string} data - the data object where the value should be got from
     */
    function getData( key, data ) {

        var parts = key.split("."),
            i = 0,
            parent = data;

        for(; i < parts.length; ++i) {
            if (!parent[parts[i]]) {
                return null;
            }
            parent = parent[parts[i]];
        }

        return parent;
    }

    // revealing public API
    return {

        /**
         * Gets a text in a given language
         * If the text is not defined in the given language, the text in teh fallback "en-us" is used, otherwise "null".
         *
         * @public
         * @param {string} key - a dot separated representation of the resource e.g.("quiz.evaluate")
         * @param {string} [language] - the language for the text e.g.("en-us")
         */
        get : function( key, language ){

            var text = getData( key, texts );
            if( text ){
                return getData( language, text ) || getData( fallbackLanguage, text );
            }

            return null;
        }
    }
});