/**
 * Zefext translation
 * 16 Febr 2009
 */

Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">'+lang.loading+'</div>';

if(Ext.View){
   Ext.View.prototype.emptyText = "";
}

if(Ext.grid.Grid){
   Ext.grid.Grid.prototype.ddText = "{0} "+lang.selected_row;
}

if(Ext.TabPanelItem){
   Ext.TabPanelItem.prototype.closeText = lang.close_tab;
}

if(Ext.form.Field){
   Ext.form.Field.prototype.invalidText = lang.invalid_field;
}

if(Ext.LoadMask){
    Ext.LoadMask.prototype.msg = lang.loading;
}

Date.monthNames = [
   lang.jan,
   lang.feb,
   lang.mar,
   lang.apr,
   lang.maj,
   lang.jun,
   lang.jul,
   lang.aug,
   lang.sep,
   lang.oct,
   lang.nov,
   lang.dec
];

Date.dayNames = [
   lang.sun,
   lang.mon,
   lang.tue,
   lang.wen,
   lang.thu,
   lang.fri,
   lang.sat
];

if(Ext.MessageBox){
   Ext.MessageBox.buttonText = {
      ok     : lang.ok,
      cancel : lang.cancel,
      yes    : lang.yes,
      no     : lang.no
   };
}

if(Ext.util.Format){
   Ext.util.Format.date = function(v, format){
      if(!v) return "";
      if(!(v instanceof Date)) v = new Date(Date.parse(v));
      return v.dateFormat(format || lang.date_format);
   };
}

if(Ext.DatePicker){
   Ext.apply(Ext.DatePicker.prototype, {
      todayText         : lang.today,
      minText           : lang.date_earlier,
      maxText           : lang.date_later,
      disabledDaysText  : "",
      disabledDatesText : "",
      monthNames        : Date.monthNames,
      dayNames          : Date.dayNames,
      nextText          : lang.next_month,
      prevText          : lang.prev_month,
      monthYearText     : lang.select_month,
      todayTip          : "{0} ("+lang.charspace+")",
      format            : lang.date_format,
      startDay          : 1
   });
}

if(Ext.PagingToolbar){
   Ext.apply(Ext.PagingToolbar.prototype, {
      beforePageText : lang.page,
      afterPageText  : lang.ptb1+" {0} "+lang.ptb2,
      firstText      : lang.first_page,
      prevText       : lang.prev_page,
      nextText       : lang.next_page,
      lastText       : lang.last_page,
      refreshText    : lang.refresh,
      displayMsg     : "{0} - {1} "+lang.the+" {2}-"+lang.from_it,
      emptyMsg       : lang.no_results_to_display
   });
}

if(Ext.form.TextField){
   Ext.apply(Ext.form.TextField.prototype, {
      minLengthText : lang.minimum+" {0} "+lang.character,
      maxLengthText : lang.maximum+" {0} "+lang.character,
      blankText     : lang.required,
      regexText     : "",
      emptyText     : null
   });
}

if(Ext.form.NumberField){
   Ext.apply(Ext.form.NumberField.prototype, {
      minText : lang.minimum+" "+lang.value+": {0}",
      maxText : lang.maximum+" "+lang.value+": {0}",
      nanText : "{0} "+lang.no_number
   });
}

if(Ext.form.DateField){
   Ext.apply(Ext.form.DateField.prototype, {
      disabledDaysText  : lang.disabled,
      disabledDatesText : lang.disabled,
      minText           : lang.date_must_later_than+": {0}",
      maxText           : lang.date_must_earlier_than+": {0}",
      invalidText       : "{0} "+lang.invalid_date+" "+lang.valid_format+": {1}",
      format            : lang.date_format
   });
}

if(Ext.form.ComboBox){
   Ext.apply(Ext.form.ComboBox.prototype, {
      loadingText       : lang.loading,
      valueNotFoundText : undefined
   });
}
/*
if(Ext.form.VTypes){
   Ext.apply(Ext.form.VTypes, {
      emailText    : 'A mező tartalma e-mail cím lehet, formátum: "user@domain.com"',
      urlText      : 'A mező tartalma webcím lehet, formátum: "http:/'+'/www.domain.com"',
      alphaText    : 'A mező csak betűket (a-z) és aláhúzás (_) karaktert tartalmazhat.',
      alphanumText : 'A mező csak betűket (a-z), számokat (0-9) és aláhúzás (_) karaktert tartalmazhat'
   });
}
*/

if(Ext.grid.GridView){
   Ext.apply(Ext.grid.GridView.prototype, {
      sortAscText  : lang.asc,
      sortDescText : lang.desc,
      lockText     : lang.lock_column,
      unlockText   : lang.unlock_column,
      columnsText  : lang.columns
   });
}

if(Ext.grid.PropertyColumnModel){
   Ext.apply(Ext.grid.PropertyColumnModel.prototype, {
      nameText   : lang.name,
      valueText  : lang.value,
      dateFormat : lang.date_format
   });
}

if(Ext.layout.BorderLayout.SplitRegion){
   Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, {
      splitTip            : lang.split_tip,
      collapsibleSplitTip : lang.collaps_tip
   });
}

