/*
 * Japanese translation
 * By tyama
 * 04-08-2007, 05:49 AM
 */

Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">読み込み中...</div>';

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

if(Ext.grid.Grid){
  Ext.grid.Grid.prototype.ddText = "{0} 行選択";
}

if(Ext.TabPanelItem){
  Ext.TabPanelItem.prototype.closeText = "このタブを閉じる";
}

if(Ext.form.Field){
  Ext.form.Field.prototype.invalidText = "フィールドの値が不正です。";
}

if(Ext.LoadMask){
    Ext.LoadMask.prototype.msg = "読み込み中...";
}

Date.monthNames = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月','11月','12月'];

Date.dayNames = [
 "日",
 "月",
 "火",
 "水",
 "木",
 "金",
 "土"];

if(Ext.MessageBox){
  Ext.MessageBox.buttonText = {
    ok : "OK",
    cancel : "キャンセル",
    yes : "はい",
    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 || "Y/m/d");
  };
}

if(Ext.DatePicker){
  Ext.apply(Ext.DatePicker.prototype, {
     todayText         : "今日",
     minText           : "選択した日付は最小値以下です。",
     maxText           : "選択した日付は最大値以上です。",
     disabledDaysText  : "",
     disabledDatesText : "",
     monthNames	       : Date.monthNames,
     dayNames	       : Date.dayNames,
     nextText          : '次月へ (コントロール+右)',
     prevText          : '前月へ (コントロール+左)',
     monthYearText     : '月選択 (コントロール+上/下で年移動)',
     todayTip          : "{0} (スペースキー)",
     format            : "Y/m/d"
  });
}

if(Ext.PagingToolbar){
  Ext.apply(Ext.PagingToolbar.prototype, {
     beforePageText : "ページ",
     afterPageText  : "/ {0}",
     firstText      : "最初のページ",
     prevText       : "前のページ",
     nextText       : "次のページ",
     lastText       : "最後のページ",
     refreshText    : "更新",
     displayMsg     : "{2} 件中 {0} - {1} を表示",
     emptyMsg       : '表示するデータがありません。'
  });
}

if(Ext.form.TextField){
  Ext.apply(Ext.form.TextField.prototype, {
     minLengthText : "このフィールドの最小値は {0} です。",
     maxLengthText : "このフィールドの最大値は {0} です。",
     blankText     : "必須項目です。",
     regexText     : "",
     emptyText     : null
  });
}

if(Ext.form.NumberField){
  Ext.apply(Ext.form.NumberField.prototype, {
     minText : "このフィールドの最小値は {0} です。",
     maxText : "このフィールドの最大値は {0} です。",
     nanText : "{0} は数値ではありません。"
  });
}

if(Ext.form.DateField){
  Ext.apply(Ext.form.DateField.prototype, {
     disabledDaysText  : "無効",
     disabledDatesText : "無効",
     minText           : "このフィールドの日付は、 {0} 以降の日付に設定してください。",
     maxText           : "このフィールドの日付は、 {0} 以前の日付に設定してください。",
     invalidText       : "{0} は間違った日付入力です。 - 入力形式は「{1}」です。",
     format            : "Y/m/d"
  });
}

if(Ext.form.ComboBox){
  Ext.apply(Ext.form.ComboBox.prototype, {
     loadingText       : "読み込み中...",
     valueNotFoundText : undefined
  });
}

if(Ext.form.VTypes){
  Ext.apply(Ext.form.VTypes, {
     emailText    : 'メールアドレスを"user@domain.com"の形式で入力してください。',
     urlText      : 'URLを"http:/'+'/www.domain.com"の形式で入力してください。',
     alphaText    : '半角英字と"_"のみです。',
     alphanumText : '半角英数と"_"のみです。'
  });
}

if(Ext.grid.GridView){
  Ext.apply(Ext.grid.GridView.prototype, {
     sortAscText  : "昇順",
     sortDescText : "降順",
     lockText     : "カラムロック",
     unlockText   : "カラムロック解除",
     columnsText  : "Columns"
  });
}

if(Ext.grid.PropertyColumnModel){
  Ext.apply(Ext.grid.PropertyColumnModel.prototype, {
     nameText   : "名称",
     valueText  : "値",
     dateFormat : "Y/m/d"
  });
}

if(Ext.layout.BorderLayout.SplitRegion){
  Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, {
     splitTip            : "ドラッグするとリサイズできます。",
     collapsibleSplitTip : "ドラッグでリサイズ。 ダブルクリックで隠す。"
  });
}

if(Ext.form.HtmlEditor){
  Ext.apply(Ext.form.HtmlEditor.prototype, {
    createLinkText : 'リンク先のURLを入力してください。',
    buttonTips : {
      bold : {
        title: '太字 (Ctrl+B)',
        text: '選択されたテキストを太字にします。',
        cls: 'x-html-editor-tip'
      },
      italic : {
        title: '斜体 (Ctrl+I)',
        text: '選択されたテキストを斜体にします。',
        cls: 'x-html-editor-tip'
      },
      underline : {
        title: '下線 (Ctrl+U)',
        text: '選択されたテキストに下線を付けます。',
        cls: 'x-html-editor-tip'
      },
      increasefontsize : {
        title: '大きく',
        text: 'フォントサイズを大きくします。',
        cls: 'x-html-editor-tip'
      },
      decreasefontsize : {
        title: '小さく',
        text: 'フォントサイズを小さくします。',
        cls: 'x-html-editor-tip'
      },
      backcolor : {
        title: '背景色',
        text: '選択されたテキストの背景色を変更します。',
        cls: 'x-html-editor-tip'
      },
      forecolor : {
        title: '文字色',
        text: '選択されたテキストの文字色を変更します。',
        cls: 'x-html-editor-tip'
      },
      justifyleft : {
        title: '左揃え',
        text: 'テキストを左揃えにします。',
        cls: 'x-html-editor-tip'
      },
      justifycenter : {
        title: '中央揃え',
        text: 'テキストを中央揃えにします。',
        cls: 'x-html-editor-tip'
      },
      justifyright : {
        title: '右揃え',
        text: 'テキストを右揃えにします。',
        cls: 'x-html-editor-tip'
      },
      insertunorderedlist : {
        title: '箇条書き',
        text: '箇条書きを作成します。',
        cls: 'x-html-editor-tip'
      },
      insertorderedlist : {
        title: '段落番号',
        text: '段落番号を作成します。',
        cls: 'x-html-editor-tip'
      },
      createlink : {
        title: 'ハイパーリンク',
        text: '選択されたテキストにリンクを張ります。',
        cls: 'x-html-editor-tip'
      },
      sourceedit : {
        title: 'ソース',
        text: 'ソース編集モードにします。',
        cls: 'x-html-editor-tip'
      }
    }
  });
}
