Description:
fixed locale files, changed config sample to application.rb.SAMPLE
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r329:98ffa91f8394 - - 8 files changed: 129 inserted, 227 deleted

@@ -0,0 +1,63
1 + require File.expand_path('../boot', __FILE__)
2 +
3 + require 'rails/all'
4 +
5 + if defined?(Bundler)
6 + # If you precompile assets before deploying to production, use this line
7 + Bundler.require(*Rails.groups(:assets => %w(development test)))
8 + # If you want your assets lazily compiled in production, use this line
9 + # Bundler.require(:default, :assets, Rails.env)
10 + end
11 +
12 + module CafeGrader
13 + class Application < Rails::Application
14 + # Settings in config/environments/* take precedence over those specified here.
15 + # Application configuration should go into files in config/initializers
16 + # -- all .rb files in that directory are automatically loaded.
17 +
18 + # Custom directories with classes and modules you want to be autoloadable.
19 + # config.autoload_paths += %W(#{config.root}/extras)
20 +
21 + # Only load the plugins named here, in the order given (default is alphabetical).
22 + # :all can be used as a placeholder for all plugins not explicitly named.
23 + # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24 +
25 + # Activate observers that should always be running.
26 + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27 +
28 + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29 + # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30 + config.time_zone = 'UTC'
31 +
32 + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33 + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34 + #config.i18n.default_locale = :en
35 + config.i18n.default_locale = :th
36 +
37 + # Configure the default encoding used in templates for Ruby 1.9.
38 + config.encoding = "utf-8"
39 +
40 + # Configure sensitive parameters which will be filtered from the log file.
41 + config.filter_parameters += [:password]
42 +
43 + # Enable escaping HTML in JSON.
44 + config.active_support.escape_html_entities_in_json = true
45 +
46 + # Use SQL instead of Active Record's schema dumper when creating the database.
47 + # This is necessary if your schema can't be completely dumped by the schema dumper,
48 + # like if you have constraints or database-specific column types
49 + # config.active_record.schema_format = :sql
50 +
51 + # Enforce whitelist mode for mass assignment.
52 + # This will create an empty whitelist of attributes available for mass-assignment for all models
53 + # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
54 + # parameters by using an attr_accessible or attr_protected declaration.
55 + config.active_record.whitelist_attributes = false
56 +
57 + # Enable the asset pipeline
58 + config.assets.enabled = true
59 +
60 + # Version of your assets, change this if you want to expire all your assets
61 + config.assets.version = '1.0'
62 + end
63 + end
@@ -0,0 +1,5
1 + # Load the rails application
2 + require File.expand_path('../application', __FILE__)
3 +
4 + # Initialize the rails application
5 + CafeGrader::Application.initialize!
@@ -1,4 +1,4
1 - environment.rb
1 + application.rb
2 2 database.yml
3 3 tasks.yml
4 4
@@ -63,96 +63,96
63 63
64 64 registration:
65 65 title: "New user registration"
66 66
67 67 description: "Please enter your information below. Please make sure your e-mail is correct, because you will have to confirm the registration through an e-mail we send to that e-mail address."
68 68
69 69 successful_title: "Registration successful"
70 70
71 71 login_guide: "Only a-z, A-Z, 0-9 and _. Can be at most 20 characters long"
72 72 email_guide: "Please make sure that your e-mail is correct.<br/>You'll need to verify your account by email."
73 73 register: "Register"
74 74
75 - email_body: "Hello {{full_name}},
75 + email_body: "Hello %{full_name},
76 76
77 - You have registered for {{contest_name}}
77 + You have registered for %{contest_name}
78 78
79 - Your login is: {{login}}
79 + Your login is: %{login}
80 80
81 - Your password is: {{password}}
81 + Your password is: %{password}
82 82
83 83 Please follow the link:
84 84
85 - {{activation_url}}
85 + %{activation_url}
86 86
87 87 to activate your user account.
88 88
89 89 If you did not register, please ignore this e-mail
90 - and report this event to {{admin_email}}.
90 + and report this event to %{admin_email}.
91 91
92 92 Thanks!"
93 93
94 94 email_sent: "We have sent a confimation message to your e-mail. (Please also check the Junk mail box."
95 - email_verify_at: "Please check at {{email}} and confirm."
95 + email_verify_at: "Please check at %{email} and confirm."
96 96
97 97 activation_sucessful_title: "User activated"
98 98 account_activated: "Your account has been activated."
99 99
100 100 activation_failed_title: "Activation failed"
101 101
102 102 errors:
103 103 header: "Errors occured during registration"
104 104 email:
105 105 title: "Errors in sending registration confirmation"
106 106 expl: "<h2>Your user account has been created, but the system cannot send you the confirmation e-mail.</h2>
107 - Maybe there's a problem in the configuration. Please report the admin at {{email}}.<br/>Thank you!"
107 + Maybe there's a problem in the configuration. Please report the admin at %{email}.<br/>Thank you!"
108 108 activation:
109 109 email_exists: "A user with this E-mail exists."
110 110 invalid: "Your activation code is invalid. Please check again."
111 111
112 112 password_retrieval:
113 113 header: "Password retrieval"
114 114 instructions: "Please enter the e-mail address that you used to register."
115 115 button_label: "Request new password"
116 116 no_email: "No user with that e-mail address."
117 - email_body: "Hello {{full_name}},
117 + email_body: "Hello %{full_name},
118 118
119 - You have requested for new password for {{contest_name}}. We have generated it for you:
119 + You have requested for new password for %{contest_name}. We have generated it for you:
120 120
121 - user name: {{login}}
122 - password: {{password}}
121 + user name: %{login}
122 + password: %{password}
123 123
124 124 If you didn't ask for new password or you're not the person who registered,
125 - please ignore this e-mail and inform {{admin_email}} of this mistake.
125 + please ignore this e-mail and inform %{admin_email} of this mistake.
126 126
127 127 Thanks!"
128 128
129 129 contest:
130 130 notification:
131 - email_subject: "[{{contest_title_name}}] You have been upgraded to {{contest_name}}"
132 - email_body: "Congratulations {{full_name}},
131 + email_subject: "[%{contest_title_name}] You have been upgraded to %{contest_name}"
132 + email_body: "Congratulations %{full_name},
133 133
134 - You have advanced to contest {{contest_name}} in {{contest_title_name}}.
134 + You have advanced to contest %{contest_name} in %{contest_title_name}.
135 135
136 136 You can now log-in and start participating in that contest.
137 137
138 138 Cheers!
139 - -{{contest_title_name}} Admin"
139 + -%{contest_title_name} Admin"
140 140
141 141 help:
142 142 how_to_submit: "How to submit"
143 143 must_specify_language: "You <b>must</b> specify the language you are using in your program header. You can optionally specify the task you are submitting to."
144 144 list_available_language: "The possible language options are <tt>C</tt>, <tt>C++</tt>, and <tt>Pascal</tt>. The follow are examples."
145 145 accept_only_language_specified: "The server <b>will not</b> accept your submission, if you do not specify the language."
146 146 specifying_task: "Optionally, you can also specify the task with <tt>TASK:</tt> <i>taskname</i>. On the first page, the taskname for each task is shown in parentheses."
147 147 example_cpp: "For example, suppose you are using <tt>C++</tt> to write task <b>mobiles</b>, you put the following on top of your source code."
148 148 example_pas: "If you are using <tt>Pascal</tt> to write the same task, you'll use"
149 - ask_questions_at_messages: "If you have any problems, you can ask at [<a href=\"{{url}}\">{{message_link_name}}</a>]."
149 + ask_questions_at_messages: "If you have any problems, you can ask at [<a href=\"%{url}\">%{message_link_name}</a>]."
150 150
151 151 activerecord:
152 152 attributes:
153 153 user:
154 154 login: "login"
155 155 full_name: "full name"
156 156 email: "e-mail"
157 157 province: "province"
158 158
@@ -1,12 +1,13
1 + # -*- coding: utf-8 -*-
1 2 # Thai translation for Ruby on Rails
2 3 # original by Prem Sichanugrist (s@sikachu.com/sikandsak@gmail.com)
3 4 # activerecord keys fixed by Jittat Fakcharoenphol (jittat@gmail.com)
4 5
5 6 {
6 7 :'th' => {
7 8 :date => {
8 9 :formats => {
9 10 :default => lambda { |date| "%d-%m-#{date.year+543}" },
10 11 :short => "%e %b",
11 12 :long => lambda { |date| "%e %B #{date.year+543}" },
12 13 :long_ordinal => lambda { |date| "%e %B #{date.year+543}" },
@@ -32,36 +33,36
32 33 :default => lambda { |time| "%Y-%m-%d %H:%M:%S #{time.formatted_offset(false, 'UTC')}" }
33 34 }
34 35 },
35 36 :am => '',
36 37 :pm => ''
37 38 },
38 39 :datetime => {
39 40 :formats => {
40 41 :default => "%Y-%m-%dT%H:%M:%S%Z"
41 42 },
42 43 :distance_in_words => {
43 44 :half_a_minute => 'ครึ่งนาทีที่ผ่านมา',
44 - :less_than_x_seconds => 'น้อยกว่า {{count}} วินาที',
45 - :x_seconds => '{{count}} วินาที',
46 - :less_than_x_minutes => 'น้อยกว่า {{count}} วินาที',
47 - :x_minutes => '{{count}} นาที',
48 - :about_x_hours => 'ประมาณ {{count}} ชั่วโมง',
49 - :x_hours => '{{count}} ชั่วโมง',
50 - :about_x_days => 'ประมาณ {{count}} วัน',
51 - :x_days => '{{count}} วัน',
52 - :about_x_months => 'ประมาณ {{count}} เดือน',
53 - :x_months => '{{count}} เดือน',
54 - :about_x_years => 'ประมาณ {{count}} ปี',
55 - :over_x_years => 'เกิน {{count}} ปี'
45 + :less_than_x_seconds => 'น้อยกว่า %{count} วินาที',
46 + :x_seconds => '%{count} วินาที',
47 + :less_than_x_minutes => 'น้อยกว่า %{count} วินาที',
48 + :x_minutes => '%{count} นาที',
49 + :about_x_hours => 'ประมาณ %{count} ชั่วโมง',
50 + :x_hours => '%{count} ชั่วโมง',
51 + :about_x_days => 'ประมาณ %{count} วัน',
52 + :x_days => '%{count} วัน',
53 + :about_x_months => 'ประมาณ %{count} เดือน',
54 + :x_months => '%{count} เดือน',
55 + :about_x_years => 'ประมาณ %{count} ปี',
56 + :over_x_years => 'เกิน %{count} ปี'
56 57 }
57 58 },
58 59
59 60 # numbers
60 61 :number => {
61 62 :format => {
62 63 :precision => 3,
63 64 :separator => '.',
64 65 :delimiter => ','
65 66 },
66 67 :currency => {
67 68 :format => {
@@ -84,43 +85,43
84 85 :gb => "GB",
85 86 :tb => "TB",
86 87 }
87 88 }
88 89 },
89 90 },
90 91
91 92 # Active Record
92 93 :activerecord => {
93 94 :errors => {
94 95 :template => {
95 96 :header => {
96 - :one => "ไม่สามารถบันทึก {{model}} ได้เนื่องจากเกิดข้อผิดพลาด",
97 - :other => "ไม่สามารถบันทึก {{model}} ได้เนื่องจากเกิด {{count}} ข้อผิดพลาด"
97 + :one => "ไม่สามารถบันทึก %{model} ได้เนื่องจากเกิดข้อผิดพลาด",
98 + :other => "ไม่สามารถบันทึก %{model} ได้เนื่องจากเกิด %{count} ข้อผิดพลาด"
98 99 },
99 100 :body => "โปรดตรวจสอบข้อมูลที่คุณกรอกในช่องต่อไปนี้:"
100 101 },
101 102 :messages => {
102 103 :inclusion => "ไม่ได้อยู่ในลิสต์",
103 104 :exclusion => "ถูกจองเอาไว้แล้ว",
104 105 :invalid => "ไม่ถูกต้อง",
105 106 :confirmation => "ไม่ตรงกับการยืนยัน",
106 107 :accepted => "ต้องอยู่ในรูปแบบที่ยอมรับ",
107 108 :empty => "ต้องไม้เว้นว่างเอาไว้",
108 109 :blank => "ต้องไม่เว้นว่างเอาไว้",
109 - :too_long => "ยาวเกินไป (ต้องไม่เกิน {{count}} ตัวอักษร)",
110 - :too_short => "สั้นเกินไป (ต้องยาวกว่า {{count}} ตัวอักษร)",
111 - :wrong_length => "มีความยาวไม่ถูกต้อง (ต้องมีความยาว {{count}} ตัวอักษร)",
110 + :too_long => "ยาวเกินไป (ต้องไม่เกิน %{count} ตัวอักษร)",
111 + :too_short => "สั้นเกินไป (ต้องยาวกว่า %{count} ตัวอักษร)",
112 + :wrong_length => "มีความยาวไม่ถูกต้อง (ต้องมีความยาว %{count} ตัวอักษร)",
112 113 :taken => "ถูกใช้ไปแล้ว",
113 114 :not_a_number => "ไม่ใช่ตัวเลข",
114 - :greater_than => "ต้องมากกว่า {{count}}",
115 - :greater_than_or_equal_to => "ต้องมากกว่าหรือเท่ากับ {{count}}",
116 - :equal_to => "ต้องเท่ากับ {{count}}",
117 - :less_than => "ต้องน้อยกว่า {{count}}",
118 - :less_than_or_equal_to => "ต้องน้อยกว่าหรือเท่ากับ {{count}}",
115 + :greater_than => "ต้องมากกว่า %{count}",
116 + :greater_than_or_equal_to => "ต้องมากกว่าหรือเท่ากับ %{count}",
117 + :equal_to => "ต้องเท่ากับ %{count}",
118 + :less_than => "ต้องน้อยกว่า %{count}",
119 + :less_than_or_equal_to => "ต้องน้อยกว่าหรือเท่ากับ %{count}",
119 120 :odd => "ต้องเป็นเลขคี่",
120 121 :even => "ต้องเป็นเลขคู่"
121 122 }
122 123 }
123 124 }
124 125 }
125 126 }
126 127
@@ -62,96 +62,96
62 62 disabled_at_end_announcement: "<b>หมายเหตุ:</b> ระบบทดสอบโปรแกรมจะหยุดทำงานในช่วงเวลา 30 นาทีสุดท้ายของการแข่งขัน"
63 63
64 64 registration:
65 65 title: "ลงทะเบียนผู้ใช้ใหม่"
66 66 description: "ในการลงทะเบียน ให้ผู้สนใจเข้าร่วมการแข่งขันกรอกข้อมูลด้านล่าง จากนั้นระบบจะส่ง e-mail ไปยัง e-mail ที่ระบุเพื่อให้ยืนยันตัวตนและเปิดใช้บัญชีผู้ใช้<br/>ในกรณีที่ผู้เข้าแข่งขันเป็นนักเรียน รบกวนช่วยให้ข้อมูลเกี่ยวกับโรงเรียนและจังหวัดด้วย"
67 67
68 68 successful_title: "การลงทะเบียนเสร็จเรียบร้อย"
69 69
70 70 login_guide: "ใช้ได้เฉพาะ a-z, A-Z, 0-9 และ _ ความยาวไม่เกิน 20 ตัวอักษร"
71 71 email_guide: "กรุณาตรวจสอบ e-mail ที่ใส่ให้ถูกต้อง<br/>คุณจะต้องยืนยันการลงทะเบียนผ่านทางข้อมูลที่จะส่งให้ทาง e-mail"
72 72 register: "ลงทะเบียน"
73 73
74 - email_body: "สวัสดีครับ {{full_name}},
74 + email_body: "สวัสดีครับ %{full_name},
75 75
76 - คุณได้ลงทะเบียนเข้าร่วมการแข่งขัน {{contest_name}}
76 + คุณได้ลงทะเบียนเข้าร่วมการแข่งขัน %{contest_name}
77 77
78 - บัญชีเข้าใช้ของคุณคือ: {{login}}
78 + บัญชีเข้าใช้ของคุณคือ: %{login}
79 79
80 - รหัสผ่านคือ: {{password}}
80 + รหัสผ่านคือ: %{password}
81 81
82 82 กรุณาเข้าลิงก์ต่อไปนี้:
83 83
84 - {{activation_url}}
84 + %{activation_url}
85 85
86 86 เพื่อเปิดใช้งานบัญชีของคุณ
87 87
88 88 ถ้าคุณไม่ใช่คนที่ลงทะเบียน กรุณาละทิ้ง e-mail ฉบับนี้
89 - และแจ้งความผิดพลาดนี้กับ {{admin_email}} ด้วย
89 + และแจ้งความผิดพลาดนี้กับ %{admin_email} ด้วย
90 90
91 91 ขอบคุณมาก!"
92 92
93 93 email_sent: "เราได้ส่งข้อมูลสำหรับยืนยันไปให้คุณแล้ว (โปรดอย่าลืมตรวจดูในส่วน Junk mail ด้วย)"
94 - email_verify_at: "กรุณาตรวจสอบที่ {{email}} พร้อมทั้งยืนยัน"
94 + email_verify_at: "กรุณาตรวจสอบที่ %{email} พร้อมทั้งยืนยัน"
95 95
96 96 activation_sucessful_title: "บัณชีผู้ใช้ได้รับการยืนยันแล้ว"
97 97 account_activated: "บัญชีผู้ใช้ของคุณพร้อมใช้งานแล้ว"
98 98
99 99 activation_failed_title: "การยืนยันล้มเหลว"
100 100
101 101 errors:
102 102 header: 'การลงทะเบียนมีข้อผิดพลาด'
103 103 email:
104 104 title: "เกิดปัญหาระหว่างการส่ง e-mail เพื่อยืนยันการสมัคร"
105 105 expl: "<h2>บัญชีผู้ใช้ของคุณถูกสร้างขึ้นแล้ว แต่ระบบไม่สามารถส่ง e-mail เพื่อยืนยันการสมัครได้</h2>
106 - อาจเกิดปัญหาในการตั้งค่าเริ่มต้นของระบบ กรุณาช่วยติดต่อผู้ดูแลระบบด้วยที่ {{email}}<br/>ขอขอบคุณจากทีมงาน"
106 + อาจเกิดปัญหาในการตั้งค่าเริ่มต้นของระบบ กรุณาช่วยติดต่อผู้ดูแลระบบด้วยที่ %{email}<br/>ขอขอบคุณจากทีมงาน"
107 107 activation:
108 108 email_exists: "มีผู้ใช้ที่ใช้ e-mail นี้แล้ว"
109 109 invalid: "รหัสสำหรับยืนยันผิดพลาด กรุณาตรวจสอบอีกครั้ง"
110 110
111 111 password_retrieval:
112 112 header: "การขอรหัสผ่านใหม่"
113 113 instructions: "กรุณากรอก e-mail ที่ลงทะเบียน"
114 114 button_label: "ขอรหัสผ่านใหม่"
115 115 no_email: "ไม่มีบัญชีผู้ใช้ที่ใช้ e-mail ดังกล่าว"
116 - email_body: "สวัสดีครับ {{full_name}},
116 + email_body: "สวัสดีครับ %{full_name},
117 117
118 - คุณได้ร้องขอรหัสผ่านใหม่ สำหรับการแข่งขัน {{contest_name}} ซึ่งเราได้สร้างให้คุณแล้ว ดังนี้
118 + คุณได้ร้องขอรหัสผ่านใหม่ สำหรับการแข่งขัน %{contest_name} ซึ่งเราได้สร้างให้คุณแล้ว ดังนี้
119 119
120 - บัญชีเข้าใช้ของคุณคือ: {{login}}
121 - รหัสผ่านคือ: {{password}}
120 + บัญชีเข้าใช้ของคุณคือ: %{login}
121 + รหัสผ่านคือ: %{password}
122 122
123 123 ถ้าคุณไม่ได้ขอรหัสผ่านใหม่ หรือไม่ใช่คนที่ลงทะเบียน กรุณาละทิ้ง e-mail ฉบับนี้
124 - และแจ้งความผิดพลาดนี้กับ {{admin_email}} ด้วย
124 + และแจ้งความผิดพลาดนี้กับ %{admin_email} ด้วย
125 125
126 126 ขอบคุณมาก!"
127 127
128 128 contest:
129 129 notification:
130 - email_subject: "[{{contest_title_name}}] คุณได้รับการเลื่อนขั้นสู่ระดับ {{contest_name}}"
131 - email_body: "ขอแสดงความยินดีด้วย คุณ{{full_name}}
130 + email_subject: "[%{contest_title_name}] คุณได้รับการเลื่อนขั้นสู่ระดับ %{contest_name}"
131 + email_body: "ขอแสดงความยินดีด้วย คุณ%{full_name}
132 132
133 - คุณได้รับการเลื่อนขั้นให้สามารถแข่งขันในการแข่งขันระดับ {{contest_name}} ของ {{contest_title_name}} แล้ว
133 + คุณได้รับการเลื่อนขั้นให้สามารถแข่งขันในการแข่งขันระดับ %{contest_name} ของ %{contest_title_name} แล้ว
134 134
135 - คุณสามารถเข้าสู่ระบบเพื่อทำโจทย์ได้ทันที คุณสามารถแข่งในระดับ {{contest_name}} ได้จนกระทั่งการแข่งขันรอบนี้สิ้นสุดลง
135 + คุณสามารถเข้าสู่ระบบเพื่อทำโจทย์ได้ทันที คุณสามารถแข่งในระดับ %{contest_name} ได้จนกระทั่งการแข่งขันรอบนี้สิ้นสุดลง
136 136
137 - -ทีมงาน {{contest_title_name}}"
137 + -ทีมงาน %{contest_title_name}"
138 138
139 139
140 140 help:
141 141 how_to_submit: "วิธีการส่งโปรแกรม"
142 142 must_specify_language: "คุณ<b>ต้อง</b>ระบุภาษาโปรแกรมที่ใช้ที่ตอนต้นของรหัสโปรแกรม (source code) นอกจากนี้คุณอาจจะระบุโจทย์ที่ต้องการส่งได้ด้วย"
143 143 list_available_language: "ภาษาโปรแกรมที่สามารถระบุได้คือ <tt>C</tt>, <tt>C++</tt>, และ <tt>Pascal</tt> ด้านล่างแสดงตัวอย่างของการระบุสำหรับภาษาต่าง ๆ"
144 144 accept_only_language_specified: "ระบบจะ<b>ไม่รับ</b>โปรแกรมที่ส่งถ้าคุณไม่ได้ระบุภาษาที่ใช้"
145 145 specifying_task: "นอกจากนี้ คุณยังสามารถระบุชื่อของโจทย์ที่ต้องการส่งเพิ่มเติมได้ ในการระบุให้ใส่ <tt>TASK:</tt> <i>taskname</i> คุณสามารถตรวจสอบชื่อของโจทย์ได้ โดยจะแสดงในวงเล็บหลังชื่อภาษาไทยของโจทย์"
146 146 example_cpp: "ยกตัวอย่างเช่น ถ้าคุณใช้ภาษา <tt>C++</tt> สำหรับเขียนโจทย์ <tt>mobiles</tt> ตอนต้นโปรแกรมคุณจะใส่ดังนี้"
147 147 example_pas: "ถ้าคุณใช้ภาษา <tt>Pascal</tt> เพื่อเขียนโจทย์ข้อเดียวกัน คุณจะระบุ"
148 - ask_questions_at_messages: "ถ้ามีปัญหาในการใช้งานสามารถสอบถามได้ที่หน้า<a href=\"{{url}}\">{{message_link_name}}</a>"
148 + ask_questions_at_messages: "ถ้ามีปัญหาในการใช้งานสามารถสอบถามได้ที่หน้า<a href=\"%{url}\">%{message_link_name}</a>"
149 149
150 150 activerecord:
151 151 attributes:
152 152 user:
153 153 login: "ชื่อเข้าใช้ระบบ"
154 154 full_name: "ชื่อเต็ม"
155 155 email: "e-mail"
156 156 province: "จังหวัด"
157 157
deleted file
deleted file
You need to be logged in to leave comments. Login now