Skip to content

Commit

Permalink
suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tjiang11 committed Aug 10, 2017
1 parent 858a78a commit d05292b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/i18n/qqq.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
"I18N_PLAYER_BACK": "Text read to users with screenreaders when they navigate through an exploration. - This labels the leftward-pointing arrow that is used to go backward by one card in the exploration.\n{{Identical|Back}}",
"I18N_PLAYER_BACK_TO_COLLECTION": "Text shown to users after they complete an exploration in a collection. - This labels the link that is used to return back to the home page of the collection the user is currently exploring",
"I18N_PLAYER_BANDWIDTH_USAGE_WARNING_MODAL_BODY": "Text displayed in the body of the modal shown when the user clicks to play audio for the first time asking if they would like to use bandwidth to download audio.",
"I18N_PLAYER_BANDWIDTH_USAGE_WARNING_MODAL_DOWNLOAD_ALL_AUDIO": "Text displayed by the checkbox of the modal shown when the user clicks to play audio for the first time asking if they would like to use bandwidth to download audio. Checking the assoicated checkbox signifies that the user intends to predownload all audio translation in the exploration of the selected language.",
"I18N_PLAYER_BANDWIDTH_USAGE_WARNING_MODAL_DOWNLOAD_ALL_AUDIO": "Text displayed by the checkbox of the modal shown when the user clicks to play audio for the first time asking if they would like to use bandwidth to download audio. Checking the assoicated checkbox signifies that the user intends to predownload all audio translations in the exploration of the selected language.",
"I18N_PLAYER_BANDWIDTH_USAGE_WARNING_MODAL_TITLE": "Text displayed at the top of the modal shown when the user clicks to play audio for the first time asking if they would like to use bandwidth to download audio.",
"I18N_PLAYER_CARD_NUMBER_TOOLTIP": "Text displayed when the user is playing an exploration. - On top of the player there are buttons that allow the user to navigate to the previous cards he has completed. This text is shown as a part of the tooltip of this button.\n{{Identical|Card}}",
"I18N_PLAYER_COMMUNITY_EDITABLE_TOOLTIP": "Text displayed as a tooltip when the user views a dialog with information about the exploration. - This labels the globe icon that indicates that an exploration is editable by the community.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,13 @@ oppia.factory('ExplorationObjectFactory', [

Exploration.prototype.getAllAudioTranslationsFileSizeMB =
function(languageCode) {
var NUM_BYTES_IN_MB = 1 << 20;
var totalFileSizeBytes = 0;
var totalFileSizeMB = 0;
var allAudioTranslations =
this.states.getAllAudioTranslations(languageCode);
allAudioTranslations.map(function(audioTranslation) {
totalFileSizeBytes += audioTranslation.fileSizeBytes;
totalFileSizeMB += audioTranslation.getFileSizeMB();
});
return totalFileSizeBytes / NUM_BYTES_IN_MB;
return totalFileSizeMB;
};

Exploration.prototype.getLanguageCode = function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ oppia.directive('audioControls', [
// immediately start playing the newly requested audio.
loadAndPlayAudioTranslation();
}
}
}
};

var isRequestForSameAudioAsLastTime = function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ oppia.factory('AudioPreloaderService', [
function($modal, explorationContextService, AssetsBackendApiService,
ExplorationPlayerStateService, UrlInterpolationService,
AudioTranslationManagerService) {
// Mapping from language code to boolean indicating if it has
// been preloaded.
// List of languages that have been preloaded in the exploration.

This comment has been minimized.

Copy link
@seanlip

seanlip Aug 10, 2017

Member

Sorry, just realized this -- but, languages, or language codes? If the latter, this should be _preloadedLanguageCodes.

This comment has been minimized.

Copy link
@tjiang11

tjiang11 Aug 10, 2017

Author Contributor

done

var _preloadedLanguages = [];

// This is a file to exclude while preloading all audio translations
Expand Down Expand Up @@ -98,7 +97,7 @@ oppia.factory('AudioPreloaderService', [
}]
}).result.then(function(result) {
if (result.shouldOpenSettingsModal) {
// If the user selected to choose a different language, open
// If the user elected to choose a different language, open
// the settings modal (later can isolate to a language-only
// modal), and on the callback re-open the bandwidth confirmation
// modal if the file for the new language hasn't been loaded.
Expand Down

0 comments on commit d05292b

Please sign in to comment.