﻿// --------------------------------------------------------------------------------------------
// © Intelogie.com 2007
// 
// WARNING : This computer program is protected by copyright law and international treaties.
// Unauthorized reproduction or distribution of this program, or any porttion of it, may
// result in severe civil and criminal penalties, and will be prosecuted to the maximum extent
// possible under the law.
// --------------------------------------------------------------------------------------------
Beezilla.Translation = {
    currentLanguage : 1,
    items : new Array(),
    add : function (key, languageid, value) {
        if (!this.exists(key, languageid)) {
            var tk = new Beezilla.Translation.Item();
            tk.Key = key;
            tk.LanguageID = languageid;
            tk.value = value;
            this.items[this.items.length] = tk;
        }
    },
    exists : function (key, languageid) {
        for (i=0;i<this.items.length-1;i++) {
            if (this.items[i].Key == key && this.items[i].LanguageID == languageid ) {
                return true;
            }
        }
        return false;
    },
    getString : function(key) {
        var i;
        for (i=0;i<=this.items.length-1;i++) {
            if (this.items[i].Key == key && this.items[i].LanguageID == this.currentLanguage ) {
                return this.items[i].value;
            }
        }
        return key;
    }    
}

Beezilla.Translation.Item = function() {
    this.Key = '';
    this.LanguageID = 1;
    this.Value = '';
}

