Skip to content

Commit

Permalink
Added localization to the encoding upload selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
akrassikov committed Nov 28, 2011
1 parent a2e0847 commit 37dbe65
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/models/grade_entry_form.rb
Expand Up @@ -241,7 +241,7 @@ def self.parse_csv(grades_file, grade_entry_form, invalid_lines, encoding)
if encoding != nil
grades_file = StringIO.new(Iconv.iconv('UTF-8', encoding, grades_file.read).join)
end

# Parse the question names
FasterCSV.parse(grades_file.read) do |row|
if !FasterCSV.generate_line(row).strip.empty?
Expand Down
4 changes: 2 additions & 2 deletions app/views/annotation_categories/index.html.erb
Expand Up @@ -116,7 +116,7 @@
<p><%= file_field_tag :annotation_category_list_csv, :size => 0 %>
</p>
<p>
Encoding:
<%=h I18n.t("encoding") %>
<%= select_tag(:encoding, options_for_select([['Unicode', 'Unicode'], ['ISO-8859-1', 'ISO-8859-1']])) %>
<br />
<br />
Expand All @@ -129,7 +129,7 @@
<p><%= file_field_tag :annotation_category_list_yml, :size => 0 %>
</p>
<p>
Encoding:
<%=h I18n.t("encoding") %>
<%= select_tag(:encoding, options_for_select([['Unicode', 'UTF-8'], ['ISO-8859-1', 'ISO-8859-1']])) %>
<br />
<br />
Expand Down
4 changes: 4 additions & 0 deletions app/views/flexible_criteria/index.html.erb
Expand Up @@ -109,6 +109,10 @@
<p><%= f.file_field :flexible %></p>
<%= t('flexible_criteria.upload.format_html') %>
<%= t('csv_special_characters_html') %>
<%=h I18n.t("encoding") %>
<%= select_tag(:encoding, options_for_select([['Unicode', 'UTF-8'], ['ISO-8859-1', 'ISO-8859-1']])) %>
<br />
<br />
<p>
<%= f.submit t(:upload), :disable_with => t(:uploading_please_wait) %>
<input type="reset" value="<%= t(:cancel) %>" onclick="modalUpload.close();">
Expand Down
2 changes: 1 addition & 1 deletion app/views/grade_entry_forms/grades.html.erb
Expand Up @@ -185,7 +185,7 @@
<p><%= f.file_field :grades_file %></p>
<%= t('grade_entry_forms.csv.upload_format_html') %>
<p>
Encoding:
<%=h I18n.t("encoding") %>
<%= select_tag(:encoding, options_for_select([['Unicode', 'UTF-8'], ['ISO-8859-1', 'ISO-8859-1']])) %>
<br />
<br />
Expand Down
4 changes: 2 additions & 2 deletions app/views/rubrics/index.html.erb
Expand Up @@ -124,7 +124,7 @@
<%= t('csv_special_characters_html') %>
<br />
<br />
Encoding:
<%=h I18n.t("encoding") %>
<%= select_tag(:encoding, options_for_select([['Unicode', 'Unicode'], ['ISO-8859-1', 'ISO-8859-1']])) %>
<br />
<br />
Expand All @@ -143,7 +143,7 @@
<%= t('rubric_criteria.upload.format_yml_html') %>
<br />
<br />
Encoding:
<%=h I18n.t("encoding") %>
<%= select_tag(:encoding, options_for_select([['Unicode', 'UTF-8'], ['ISO-8859-1', 'ISO-8859-1']])) %>
<br />
<br />
Expand Down
2 changes: 1 addition & 1 deletion app/views/students/index.html.erb
Expand Up @@ -175,7 +175,7 @@ document.observe("dom:loaded", function(){
<input type="file" name="userlist" id="userlist"/>
<br />
<br />
Encoding:
<%=h I18n.t("encoding") %>
<%= select_tag(:encoding, options_for_select([['Unicode', 'UTF-8'], ['ISO-8859-1', 'ISO-8859-1']])) %>
<br />
<br />
Expand Down
2 changes: 1 addition & 1 deletion app/views/tas/index.html.erb
Expand Up @@ -89,7 +89,7 @@ document.observe("dom:loaded", function(){
<input type="file" name="userlist" id="userlist"/>
<br />
<br />
Encoding:
<%=h I18n.t("encoding") %>
<%= select_tag(:encoding, options_for_select([['Unicode', 'UTF-8'], ['ISO-8859-1', 'ISO-8859-1']])) %>
<br />
<br />
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Expand Up @@ -214,6 +214,7 @@ en:
preview: "Preview"
invalid_grouping: "(invalid)"
validate: "Validate"
encoding: "Encoding:"

marks_released_notice: "The marks have been released. You cannot change the grades."
past_due_date_edit_warning: "WARNING: The due date you have selected is in the past."
Expand Down
1 change: 1 addition & 0 deletions config/locales/fr.yml
Expand Up @@ -214,6 +214,7 @@ fr:
preview: "Prévisualisation"
invalid_grouping: "(invalide)"
validate: "Valider"
encoding: "Codage :"

marks_released_notice: "Les notes sont maintenant affichées. Vous ne pouvez plus les changer."
past_due_date_edit_warning: "ATTENTION ! La date de retour que vous avez choisie est antérieure à la date actuelle."
Expand Down

0 comments on commit 37dbe65

Please sign in to comment.