From 17f75954aa899dab904893899b0728794b96976d Mon Sep 17 00:00:00 2001 From: JT Olds Date: Fri, 10 Jun 2011 10:05:45 -0600 Subject: [PATCH] getting started i18n Change-Id: I46273d11738a5fe74174017f78adc9658757233b Reviewed-on: https://gerrit.instructure.com/4153 Tested-by: Hudson Reviewed-by: Cody Cutrer --- app/controllers/getting_started_controller.rb | 6 +- app/views/courses/course_details.html.erb | 41 +-------- app/views/getting_started/_student.html.erb | 10 +-- .../_wizard_secondary_nav.html.erb | 22 ++--- .../getting_started/assignments.html.erb | 40 ++++----- .../getting_started/authorization_code.erb | 9 +- app/views/getting_started/name.html.erb | 42 ++++----- app/views/getting_started/setup.html.erb | 49 +++++----- app/views/getting_started/students.html.erb | 89 ++++--------------- .../getting_started/teacherless.html.erb | 14 ++- app/views/shared/_email_lists.html.erb | 46 ++++++++++ public/javascripts/email_lists.js | 18 ++-- 12 files changed, 159 insertions(+), 227 deletions(-) create mode 100644 app/views/shared/_email_lists.html.erb diff --git a/app/controllers/getting_started_controller.rb b/app/controllers/getting_started_controller.rb index b9c67c04b50..08b37537fdf 100644 --- a/app/controllers/getting_started_controller.rb +++ b/app/controllers/getting_started_controller.rb @@ -29,12 +29,13 @@ class GettingStartedController < ApplicationController def require_course_creation_auth if params[:getting_started_code] && (auth_code = @domain_root_account.authorization_codes.find_by_authorization_code(params[:getting_started_code])) session[:course_creation_auth] = true + # TODO i18n session[:course_creation_account_id] = auth_code.associated_account_id || @domain_root_account.sub_accounts.find_or_create_by_name("Manually-Created Courses").id rescue nil end if session[:course_creation_auth] != true && @domain_root_account.require_authorization_code respond_to do |format| format.html { render :action => "authorization_code" } - format.json { render :json => {:errors => {:base => "Unauthorized"}}.to_json } + format.json { render :json => {:errors => {:base => t(:unauthorized, "Unauthorized")}}.to_json } end return false end @@ -81,7 +82,7 @@ class GettingStartedController < ApplicationController redirect_to course_url(@context) else session[:return_to] = course_url(@context) - flash[:notice] = "Course created! You'll need to log in or register to claim this course." + flash[:notice] = t :course_created_notice, "Course created! You'll need to log in or register to claim this course." redirect_to course_url(@context) end end @@ -104,6 +105,7 @@ class GettingStartedController < ApplicationController def set_course # create_unique finds or creates, but always returns a context session[:course_uuid] = nil if params[:fresh] + # TODO i18n @context = Course.create_unique(session[:course_uuid], session[:course_creation_account_id] || @domain_root_account.sub_accounts.find_or_create_by_name("Manually-Created Courses").id, @domain_root_account.id) if session[:course_uuid] != @context.uuid && @current_user if params[:teacherless] diff --git a/app/views/courses/course_details.html.erb b/app/views/courses/course_details.html.erb index 3d035b15fd1..1392d2620df 100644 --- a/app/views/courses/course_details.html.erb +++ b/app/views/courses/course_details.html.erb @@ -487,46 +487,7 @@
If you invite a teacher and they accept, you will give up administrative priveleges for this course.
-
- -
- Copy and paste a list of email addresses to add users to this course. - -
- -
+ <%= render :partial => 'shared/email_lists' %> <% unless @context.available? %>
Since the course hasn't been published, students and TA's will be added, but won't be diff --git a/app/views/getting_started/_student.html.erb b/app/views/getting_started/_student.html.erb index e983df08f89..d2f11f8758f 100644 --- a/app/views/getting_started/_student.html.erb +++ b/app/views/getting_started/_student.html.erb @@ -1,23 +1,23 @@
  • " id="student_<%= student ? student.id : "blank" %>" class="student">
    - " title="Student Name"/> + " title="<%= t :student_name_title, "Student Name" %>"/>
    - <%= student && student.name ? student.name : "New Student" %> + "><%= student && student.name ? student.name : t(:new_student_name, "New Student") %>
    - <> + <>
  • diff --git a/app/views/getting_started/_wizard_secondary_nav.html.erb b/app/views/getting_started/_wizard_secondary_nav.html.erb index 7518b8b5490..6163cf4476d 100644 --- a/app/views/getting_started/_wizard_secondary_nav.html.erb +++ b/app/views/getting_started/_wizard_secondary_nav.html.erb @@ -3,29 +3,29 @@ %> @@ -37,4 +37,4 @@ $("#wizard-steps").chevronCrumbs(); }); -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/getting_started/assignments.html.erb b/app/views/getting_started/assignments.html.erb index d314808732a..cf761dd6732 100644 --- a/app/views/getting_started/assignments.html.erb +++ b/app/views/getting_started/assignments.html.erb @@ -1,33 +1,30 @@ -<% content_for :page_title do %>Try It: Assignments<% end %> +<% content_for :page_title do %><%= before_label :try_it_title, "Try It" %> <%= t "#titles.assignments", "Assignments" %><% end %> <%= render :partial => 'wizard_secondary_nav', :locals => {:view => 'assignments'} %> <% content_for :right_side do %>
    -

    Not ready to create your assignments? Feel free to skip this step, you can - always come back to it later after your course is set up. +

    <%= t :skip_assignments_notice, "Not ready to create your assignments? Feel free to skip this step, you can always come back to it later after your course is set up." %>

    +

    + <%= t :how_do_i, "How Do I...?" %>

    - How Do I...? -

    -

    - - Add Assignment - to + <% ot :add_assignment_link, "*Add Assignment* to %{group_name}", :group_name => capture { %> + <% }, :wrapper => "\\1" %>
    - Add Assignment Group + <%= t :add_assignment_group_link, "Add Assignment Group" %>

    <%= render :partial => 'assignments/group_weights', :locals => {:editable => can_do(@context, @current_user, :manage_grades)} %>
    <% end %> @@ -35,7 +32,7 @@
    /> - +
    @@ -43,21 +40,16 @@
    <% if @groups.length == 1 %> <% if @context.teacherless? %> -

    Nicely done. Next you'll want to define the - assignments for your course. Most classes base grades either on straight - points, or points according to types (50% of your grade is from tests, 20% - is from papers, etc.). In Canvas you add assignments, quizzes, or whatever - into groups and optionally weight those groups. Build your Canvas - course to match the grading scheme of your actual course, and we'll take - care of computing your final grade for you. +

    <%= t :grade_groups_notice, "Nicely done. Next you'll want to define the assignments for your course. Most classes base grades either on straight points, or points according to types (50% of your grade is from tests, 20% is from papers, etc.). In Canvas you add assignments, quizzes, or whatever into groups and optionally weight those groups. Build your Canvas course to match the grading scheme of your actual course, and we'll take care of computing your final grade for you." %>

    <% else %> -

    Now we're getting somewhere! Next you'll want to add +

    + <%= t :default_group_notice, "*Now we're getting somewhere!* Next you'll want to add your course assignments. Assignments are organized into groups (quizzes, papers, etc.), and each group can be weighted to count as a percentage of the final score. We've added a default group above to get you started. You can add assignments to it by clicking the plus icon, - or use the links to the right to create your own groups.

    + or use the links to the right to create your own groups.", :wrapper => "\1" %>

    <% end %> -

    Confused? Click the "How Do I...?" link to the right for more help.

    +

    <%= t :confused_notice, "Confused? Click the \"How Do I...?\" link to the right for more help." %>

    <% end %> <%= render :partial => "shared/assignment_group", :object => nil %> <%= render :partial => "shared/assignment", :object => nil %> diff --git a/app/views/getting_started/authorization_code.erb b/app/views/getting_started/authorization_code.erb index 0084216687a..66c6c969109 100644 --- a/app/views/getting_started/authorization_code.erb +++ b/app/views/getting_started/authorization_code.erb @@ -1,17 +1,16 @@ -<% content_for :page_title do %>Try It: Enter Code<% end %> +<% content_for :page_title do %><%= before_label :try_it_title, "Try It" %> <%= t "#titles.enter_code", "Enter Code" %><% end %> <%= render :partial => 'wizard_secondary_nav' %>
    -

    Authorization Code

    - Before you can continue, you need to enter your authorization code. You should - have been given this code either by Instructure or by your administrator. +

    <%= t "#titles.authorization_code", "Authorization Code" %>

    + <%= t :authorization_code_notice, "Before you can continue, you need to enter your authorization code. You should have been given this code either by Instructure or by your administrator." %>
    - +
    diff --git a/app/views/getting_started/name.html.erb b/app/views/getting_started/name.html.erb index 96ef4bee398..a7a8facd373 100644 --- a/app/views/getting_started/name.html.erb +++ b/app/views/getting_started/name.html.erb @@ -1,21 +1,18 @@ -<% content_for :page_title do %>Try It: Choose a Course Name<% end %> +<% content_for :page_title do %><%= before_label :try_it_title, "Try It" %> <%= t "#titles.choose_course_name", "Choose Course Name" %><% end %> <% content_for :right_side do %>
    <% if @context.teacherless? %> -

    First thing's first, tell us the name of the course you'd like to - track.

    +

    <%= t :course_name_notice, "First thing's first, tell us the name of the course you'd like to + track." %>

    <% else %> -

    Right, then. Let's get this course set up! It should only take a - few minutes for the whole process. First off - come up with a name for your course. Then you'll add your - assignments and students. Shouldn't take too long at all. +

    <%= t :course_name_notice_longer, "Right, then. Let's get this course set up! It should only take a few minutes for the whole process. First off come up with a name for your course. Then you'll add your assignments and students. Shouldn't take too long at all." %>

    <% end %>
    - - Save & Skip the Rest + + <%= t :save_and_skip, "Save & Skip the Rest" %>
    <% end %> <% js_block do %> @@ -39,29 +36,34 @@ $(function(){ <% form_for @context, :html => { :id => 'setup_course_form' } do |form| %>
    <% if @context.teacherless? %> -

    You can use Canvas to keep track of how you're doing in all your courses, - whether they're using Canvas or not. Just tell us how your - course's grading policy is set up and then enter your scores manually. You can - also invite your classmates to use the course you set up so they can track - their grades, too!

    +

    <%= t :teacherless_grades_notice, "You can use Canvas to keep track of how you're doing in all your courses, whether they're using Canvas or not. Just tell us how your course's grading policy is set up and then enter your scores manually. You can also invite your classmates to use the course you set up so they can track their grades, too!" %>

    <% end %>
    - <%= form.label :name, "Enter a name for your course:", :style => "font-weight: bold; font-size: 1.2em; display: block;" %> + <%= form.blabel :name, :en => "Enter a name for your course", :style => "font-weight: bold; font-size: 1.2em; display: block;" %> <%= form.text_field :name, :style => "font-size: 2.0em; border: 2px solid #aaa; padding: 2px;" %>
    - <%= form.label :course_code, "And a shorter reference code:", :style => "margin-top: 25px;font-weight: bold; font-size: 1.2em; display: block;" %> + <%= form.blabel :course_code, :en => "And a shorter reference code", :style => "margin-top: 25px;font-weight: bold; font-size: 1.2em; display: block;" %> <%= form.text_field :course_code, :style => "font-size: 1.5em; border: 2px solid #aaa; padding: 2px; width: 250px;" %>
    - (something like BIO 100, ENG 315, etc.) + <%= t :course_code_example, "(something like BIO 100, ENG 315, etc.)" %>
    - <%= form.label :license, "License for course content:", :style => "font-weight: bold; font-size: 1.2em; display: block;" %> - <%= form.select :license, [['Private (Copyrighted)', 'private'], ['CC Attribution Non-Commercial No Derivatives', 'cc_by_nc_nd'], ['CC Attribution Non-Commercial Share Alike', 'cc_by_nc_sa'], ['CC Attribution Non-Commercial', 'cc_by_nc'], ['CC Attribution No Derivatives', 'cc_by_nd'], ['CC Attribution Share Alike', 'cc_by_sa'], ['CC Attribution', 'cc_by'], ['Public Domain', 'public_domain']], {}, :style => "font-size: 1.3em; border: 2px solid #aaa;" %> + <%= form.blabel :license, :en => "License for course content", :style => "font-weight: bold; font-size: 1.2em; display: block;" %> + <%= form.select :license, [ + [t("#cc.private", 'Private (Copyrighted)'), 'private'], + [t("#cc.by_nc_nd", 'CC Attribution Non-Commercial No Derivatives'), 'cc_by_nc_nd'], + [t("#cc.by_nc_sa", 'CC Attribution Non-Commercial Share Alike'), 'cc_by_nc_sa'], + [t("#cc.by_nc", 'CC Attribution Non-Commercial'), 'cc_by_nc'], + [t("#cc.by_nd", 'CC Attribution No Derivatives'), 'cc_by_nd'], + [t("#cc.by_sa", 'CC Attribution Share Alike'), 'cc_by_sa'], + [t("#cc.by", 'CC Attribution'), 'cc_by'], + [t("#cc.public_domain", 'Public Domain'), 'public_domain'] + ], {}, :style => "font-size: 1.3em; border: 2px solid #aaa;" %> <%= license_help_link %>
    <%= form.check_box :is_public, :class => "is_public_checkbox" %> <%= form.label :is_public, "Make this course publicly visible", :style => "font-size: 1.3em;" %> -
    (student data will remain private)
    +
    <%= t :student_data_privacy, "(student data will remain private)" %>
    <% if @domain_root_account == Account.default %>
    diff --git a/app/views/getting_started/setup.html.erb b/app/views/getting_started/setup.html.erb index 429b28c63df..1119823e0eb 100644 --- a/app/views/getting_started/setup.html.erb +++ b/app/views/getting_started/setup.html.erb @@ -3,16 +3,13 @@ <% content_for :right_side do %> <% unless @context.teacherless? %>
    -

    Don't worry, this course will stay visible to just you until you publish it. - When you publish, your course will become active and students will be notified that - it's has been created and they are enrolled. You can publish at any time - from the course's main page.

    +

    <%= t :unpublished_notice, "Don't worry, this course will stay visible to just you until you publish it. When you publish, your course will become active and students will be notified that it's has been created and they are enrolled. You can publish at any time from the course's main page." %>

    <% end %>
    <% form_tag getting_started_finalize_url, {:id => "publish_course_url"} do %> - " class="previous_step_button button small-button">Previous - + " class="previous_step_button button small-button"><%= t "#buttons.previous", "Previous" %> + <% end %>
    <% end %> @@ -34,37 +31,35 @@ <%= render :partial => 'wizard_secondary_nav', :locals => {:view => 'setup'} %> -

    Review and Save

    -

    That's it! You're done! Here's the summary of everything you put in. Feel free to click any section - to go back and edit the information there. When you're sure you've got everything right, click the save - button to go to your course page. +

    <%= t "#titles.review_and_save", "Review and Save" %>

    +

    <%= t :summary_notice, "*That's it! You're done!* Here's the summary of everything you put in. Feel free to click any section to go back and edit the information there. When you're sure you've got everything right, click the save button to go to your course page.", :wrapper => "\1" %>

    - + - +
    <%= link_to "Course Name:", :action => 'name' %><%= link_to before_label(:course_name, "Course Name"), :action => 'name' %> <%= @context.name %>
    <%= link_to "Assignments:", :action => 'assignments' %><%= link_to t(:assignments, "Assignments"), :action => 'assignments' %> - <%= @assignments && !@assignments.empty? ? @assignments.length.to_s + " Total Assignments" : "No Assignments Created" %> + <%= @assignments && !@assignments.empty? ? t(:total_assignment_count, { :one => "1 Assignment Total", :other => "%{count} Assignments Total" }, :count => @assignments.length) : t(:no_assignments, "No Assignments Created") %> <% if @assignments && !@assignments.empty? %> - Show + <%= t "#buttons.show", "Show" %>