function TextResource() {
    this.textJSON = undefined;

    TextResource.prototype.set = function(textJSON) {
        this.textJSON = textJSON;
    }

    TextResource.prototype.get = function(key) {
        if (!this.textJSON) {
            internalError('Resource text is yet undefined! Key: ' + key);
            return '~' + key;
        } else {
            var t = this.textJSON[key];

            if (!t) {
                internalError('Key "' + key + '" not found!');
                return '~' + key;
            } else {
                return t;
            }
        }
    }
}

var text = new TextResource();
