var Dictionary = { words:{}, add: function(obj){ for( key in obj ) this.words[key] = obj[key]; }, translate: function(key){ return (this.words[key] !== undefined) ? this.words[key] : key; } }; Dictionary.add({ 'lang_check_nonempty': 'Required field is empty', 'lang_check_int': 'Wrong integer number format', 'lang_check_float': 'Wrong floating-point number format', 'lang_check_email': 'Wrong e-mail', 'lang_check_multiemail': 'Invalid e-mail format. This field can contain one or more e-mail addresses separated by commas.', 'lang_check_login': 'Wrong format (string of numbers or latin symbols without spaces)', 'lang_check_alphastring': 'Wrong format (string of latin symbols)', 'lang_check_date': 'Wrong date format (DD.MM.YYYY)', 'lang_check_time': 'Wrong time format (HH:MM)', 'lang_check_datetime': 'Wrong date/time format (DD.MM.YYYY HH:MM)', 'lang_check_datetime_full': 'Wrong date/time format (DD.MM.YYYY HH:MM:SS)', 'lang_check_no_variant': 'None of the variants is selected' });