From 2d47f8039176284621bed25707d2125556aa932d Mon Sep 17 00:00:00 2001 From: louyihua Date: Mon, 6 Apr 2015 01:28:06 +0800 Subject: [PATCH] Fix i18n breaking in some js and underscore files 1. Spliting strings inside the call to `gettext()` in javascript breaks the string extraction process, so the string should kept in one line. 2. Using escape string inside a string in `gettext()` may cause the extractor to misunderstand the escape string, so that it will escape this escape string. --- cms/static/js/views/paging_header.js | 12 ++++-------- .../messages/transcripts-import.underscore | 2 +- .../transcripts/metadata-videolist-entry.underscore | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cms/static/js/views/paging_header.js b/cms/static/js/views/paging_header.js index 4209d7229c..204270dc98 100644 --- a/cms/static/js/views/paging_header.js +++ b/cms/static/js/views/paging_header.js @@ -37,13 +37,11 @@ define(["underscore", "gettext", "js/views/baseview"], function(_, gettext, Base if (this.view.collection.sortDirection === 'asc') { // Translators: sample result: // "Showing 0-9 out of 25 total, filtered by Images, sorted by Date Added ascending" - message = gettext('Showing %(current_item_range)s out of %(total_items_count)s, ' + - 'filtered by %(asset_type)s, sorted by %(sort_name)s ascending'); + message = gettext('Showing %(current_item_range)s out of %(total_items_count)s, filtered by %(asset_type)s, sorted by %(sort_name)s ascending'); } else { // Translators: sample result: // "Showing 0-9 out of 25 total, filtered by Images, sorted by Date Added descending" - message = gettext('Showing %(current_item_range)s out of %(total_items_count)s, ' + - 'filtered by %(asset_type)s, sorted by %(sort_name)s descending'); + message = gettext('Showing %(current_item_range)s out of %(total_items_count)s, filtered by %(asset_type)s, sorted by %(sort_name)s descending'); } asset_type = this.filterNameLabel(); } @@ -51,13 +49,11 @@ define(["underscore", "gettext", "js/views/baseview"], function(_, gettext, Base if (this.view.collection.sortDirection === 'asc') { // Translators: sample result: // "Showing 0-9 out of 25 total, sorted by Date Added ascending" - message = gettext('Showing %(current_item_range)s out of %(total_items_count)s, ' + - 'sorted by %(sort_name)s ascending'); + message = gettext('Showing %(current_item_range)s out of %(total_items_count)s, sorted by %(sort_name)s ascending'); } else { // Translators: sample result: // "Showing 0-9 out of 25 total, sorted by Date Added descending" - message = gettext('Showing %(current_item_range)s out of %(total_items_count)s, ' + - 'sorted by %(sort_name)s descending'); + message = gettext('Showing %(current_item_range)s out of %(total_items_count)s, sorted by %(sort_name)s descending'); } } diff --git a/cms/templates/js/video/transcripts/messages/transcripts-import.underscore b/cms/templates/js/video/transcripts/messages/transcripts-import.underscore index 9354a5be32..8cc3aac9af 100644 --- a/cms/templates/js/video/transcripts/messages/transcripts-import.underscore +++ b/cms/templates/js/video/transcripts/messages/transcripts-import.underscore @@ -1,6 +1,6 @@
<%= gettext("No EdX Timed Transcript") %>

-<%= gettext("EdX doesn\'t have a timed transcript for this video in Studio, but we found a transcript on YouTube. You can import the YouTube transcript or upload your own .srt transcript file.") %> +<%= gettext("EdX doesn't have a timed transcript for this video in Studio, but we found a transcript on YouTube. You can import the YouTube transcript or upload your own .srt transcript file.") %>

- <%= gettext('To be sure all students can access the video, we recommend providing both an .mp4 and a .webm version of your video. Click below to add a URL for another version. These URLs cannot be YouTube URLs. The first listed video that\'s compatible with the student\'s computer will play.') %> + <%= gettext("To be sure all students can access the video, we recommend providing both an .mp4 and a .webm version of your video. Click below to add a URL for another version. These URLs cannot be YouTube URLs. The first listed video that's compatible with the student's computer will play.") %>