OSDN Git Service

Set default locale to Japanese
authoreagletmt <eagletmt@gmail.com>
Sat, 20 Oct 2012 11:21:16 +0000 (20:21 +0900)
committereagletmt <eagletmt@gmail.com>
Sat, 20 Oct 2012 11:51:57 +0000 (20:51 +0900)
CutenServer/app/controllers/achievements_controller.rb
CutenServer/app/views/home/index.html.haml
CutenServer/app/views/lectures/show.html.haml
CutenServer/app/views/users/profile.html.haml
CutenServer/config/application.rb
CutenServer/config/locales/en.yml
CutenServer/config/locales/ja.yml [new file with mode: 0644]

index f7ca416..0a86b5b 100644 (file)
@@ -129,7 +129,7 @@ class AchievementsController < ApplicationController
   end
 
   def unauthorized(exception)
-    error = I18n.t('auth.unauthorized')
+    error = I18n.t('achievement.unauthorized')
     respond_to do |format|
       format.html { redirect_to({ :action => 'index' }, :alert => error) }
       format.json { render :status => 401, :json => { :error => error } }
index c37a8d8..5d5c5ef 100644 (file)
@@ -15,7 +15,6 @@
 
 - if user_signed_in? and current_user.teacher
   %div
-    %p My lectures
     %ul
       - current_user.teacher.lectures.each do |lecture|
         %li= link_to lecture.name, lecture_path(lecture)
index c06ac69..288d86b 100644 (file)
@@ -13,4 +13,4 @@
   %ul
     - @lecture.tasks.each do |task|
       %li= task.name
-  = link_to 'Add new task', new_lecture_task_path(@lecture)
+  = link_to I18n.t('task.new_path'), new_lecture_task_path(@lecture)
index 122c0e2..71c6c14 100644 (file)
@@ -1,6 +1,6 @@
-%h1 Users#profile
+%h1 Profile
 
 %div
   %ul
     - [:email, :student_number, :authentication_token].each do |attr|
-      %li= "#{attr}: #{current_user.send attr}"
+      %li= "#{User.human_attribute_name attr}: #{current_user.send attr}"
index 6f25f7a..f877ed2 100644 (file)
@@ -31,7 +31,7 @@ module CutenServer
 
     # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
-    # config.i18n.default_locale = :de
+    config.i18n.default_locale = :ja
 
     # Configure the default encoding used in templates for Ruby 1.9.
     config.encoding = "utf-8"
index 9f1bdc0..3264746 100644 (file)
@@ -9,7 +9,7 @@ en:
   home:
     see_profile: "See profile"
     see_achievement: "See achievement"
-  auth:
+  achievement:
     unauthorized: "Unauthorized"
   lecture:
     created: "Lecture was successfully created"
@@ -21,6 +21,7 @@ en:
       success: "Task was successfully created"
       unauthorized: "You don't have permission to create a task of this lecture"
       noapk: file can't be blank
+    new_path: Add new task
 
   helpers:
     label:
diff --git a/CutenServer/config/locales/ja.yml b/CutenServer/config/locales/ja.yml
new file mode 100644 (file)
index 0000000..557292a
--- /dev/null
@@ -0,0 +1,64 @@
+ja:
+  devise:
+    sign_in: サインイン
+    sign_out: サインアウト
+    edit: profile を編集する
+    sessions:
+      user:
+        signed_in: サインインしました
+        signed_out: サインアウトしました
+    registrations:
+      user:
+        signed_up: サインアップしました
+    failure:
+      already_authenticated: ログイン済みです
+  home:
+    see_profile: profile を見る
+    see_achievement: 実績を見る
+  achievement:
+    unauthorized: この実績を見ることはできません
+  lecture:
+    created: 講義が追加されました
+    new_path: 講義を追加する
+  teacher:
+    not: 教師のみがこの操作を行えます
+  task:
+    create:
+      success: 課題が作成されました
+      unauthorized: この講義の課題を作成することはできません
+      noapk: が空です
+    new_path: 課題を追加する
+
+  helpers:
+    label:
+      task:
+        name: 課題名
+      apk:
+        name: クラス名
+        revision: リビジョン
+      apkfile:
+        file: apk フアイル
+
+  activerecord:
+    attributes:
+      user:
+        email: メールアドレス
+        password: パスワード
+        password_confirmation: パスワード (再入力)
+        student_number: 学籍番号
+        authentication_token: 認証トークン
+        remember_me: 次回から自動ログイン
+      lecture:
+        name: 講義名
+      task:
+        name: 課題名
+      apk:
+        name: クラス名
+        revision: リビジョン
+        apk: apk ファイル
+    errors:
+      messages:
+        blank: が空です
+
+  errors:
+    format: "%{attribute}%{message}"