-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Learner audio updates #3705
Learner audio updates #3705
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tjiang11 -- looks great! A few small comments.
return Boolean(getCurrentAudioTranslation()); | ||
}; | ||
|
||
$scope.isCurrentAudioTranslationNeedingUpdate = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: doesCurrentAudioTranslationNeedUpdate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return getCurrentAudioTranslation().needsUpdate; | ||
}; | ||
|
||
$scope.audioNotAvailableMessage = 'Not available in ' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this would work for i18n of the tooltip text? angular-translate/angular-translate#163 (comment)
If we want to do that, maybe maintain $scope.currentAudioLanguage instead of retrieving it each time, and update it on-change. If all this is not straightforward, though, feel free to punt on it (but please file an issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried this out, but ptal
@@ -73,15 +91,10 @@ oppia.directive('audioControls', [ | |||
}; | |||
|
|||
var loadAndPlayAudioTranslation = function() { | |||
var currentAudioLanguageCode = | |||
AudioTranslationManagerService.getCurrentAudioLanguageCode(); | |||
|
|||
// TODO(tjiang11): If audio translation is not available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
tooltip="<[!isAudioAvailableInCurrentLanguage() ? audioNotAvailableMessage : '']>" | ||
tooltip-append-to-body="true"></i> | ||
</div> | ||
<span ng-if="extraAudioControlsAreShown && isAudioAvailableInCurrentLanguage() && isCurrentAudioTranslationNeedingUpdate()" class="audio-message" translate="I18N_PLAYER_AUDIO_MIGHT_NOT_MATCH_TEXT"></span> | ||
|
||
<style> | ||
.audio-control-button-icon { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefix all these rules with audio-controls
, since that's the name of the tag. Prevents the CSS from "leaking out" into other parts of the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
|
||
.audio-message { | ||
float:right; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add space after colon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
assets/i18n/en.json
Outdated
@@ -306,6 +306,7 @@ | |||
"I18N_MODAL_CANCEL_BUTTON": "Cancel", | |||
"I18N_ONE_SUBSCRIBER_TEXT": "You have 1 subscriber.", | |||
"I18N_PLAYER_AUDIO_LANGUAGE": "Language", | |||
"I18N_PLAYER_AUDIO_MIGHT_NOT_MATCH_TEXT": "Audio might not match text", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "Audio might not fully match text"? (Otherwise it seems to raise the question of why we're putting a completely non-matching audio track there at all.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Also, the UI looks good to me, thanks @tjiang11! |
Codecov Report
@@ Coverage Diff @@
## develop #3705 +/- ##
===========================================
- Coverage 45.07% 45.04% -0.03%
===========================================
Files 264 264
Lines 20408 20421 +13
Branches 3173 3173
===========================================
Hits 9199 9199
- Misses 11209 11222 +13
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tjiang11! LGTM, only one note to address before merge.
ng-class="{'fa-volume-off': !AudioPlayerService.isPlaying(), 'fa-volume-up': AudioPlayerService.isPlaying(), 'audio-not-available': !isAudioAvailableInCurrentLanguage()}" | ||
tooltip="<[!isAudioAvailableInCurrentLanguage() ? audioNotAvailableMessage : '']>" | ||
ng-class="{'fa-volume-off': !AudioPlayerService.isPlaying(), 'fa-volume-up': AudioPlayerService.isPlaying(), 'audio-controls-audio-not-available': !isAudioAvailableInCurrentLanguage()}" | ||
tooltip="<[!isAudioAvailableInCurrentLanguage() ? ('I18N_PLAYER_AUDIO_NOT_AVAILABLE_IN' | translate) + ' ' + currentAudioLanguageDescription : '']>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way you can make "currentAudioLanguageDescription" a parameter of the I18N thing, similar to how I18N_FORMS_TYPE_NUMBER_AT_LEAST handles minValue? In other languages, currentAudioLanguageDescription may not always appear at the end.
If not, let's just not i18n it for now. I'm not sure how to do this sort of thing in tooltips, it might be the first time we've had to handle it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't we have to define translations for every audio language we have then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or is it okay to just leave the languages themselves in English
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Language descriptions will actually be in that language itself. So it's OK to just use that description directly.
Btw backend tests seem to be failing...
* upstream/develop: (39 commits) Add a one-off job to list which explorations use gadgets; remove old fallbacks job. (oppia#3717) Fix oppia#2998 implement collection skills update commands (oppia#3710) Improvements and bug fixes to changes introduced by PR oppia#3671 (oppia#3684) Fix oppia#3688: refactoring ExplorationStatusHandler to remove unpublish and publicize functionality as it is not called from frontend. (oppia#3715) fix oppia#3698: Shift exception handling for NotLoggedInException so that it does not generate log errors. (oppia#3714) Revert "Fix oppia#3707 Change text of collection learner view "start here"" (oppia#3713) Fix oppia#3701 Fixed Continue button name issue (oppia#3711) Fix oppia#3467: Introduce re-training and add_to_training_queue methods (oppia#3650) Fix oppia#3707 Change text of collection learner view "start here" (oppia#3700) Audio fixes: make audio download URL safe; don't show flagging modal if all translations are flagged; use templateUrl for modals. (oppia#3709) Learner audio updates (oppia#3705) Move hint button to left corner for supplemental cards (oppia#3702) Make the representation of the learner's 'Continue' answer more conversational. (oppia#3675) Add editor for audio translations (oppia#3692) Fix oppia#3686 fixed text overflow for contributors list (oppia#3697) Fix oppia#3551: Manually set cookie value during language change (oppia#3622) Learner view audio translations (oppia#3681) The sixth milestone of the learner dashboard. (oppia#3680) Routine update of translations. (oppia#3685) SiteWide ACL Refactor: Milestone 3.1 (oppia#3682) ...
* upstream/develop: (28 commits) Preloading of audio and bandwidth confirmation (oppia#3727) Fix oppia#3693: Deprecate ClassifierDataModel and update ClassifierTrainingJobModel (oppia#3734) Fix part of oppia#3453: Removed jinja template in editor_navigation_directive (oppia#3732) Eliminates stray tick mark (oppia#3731) Fix oppia#3453: Removed jinja template in collection editor navigation bar directive (oppia#3723) Fix oppia#3726: prevent graph SVG from overlapping modal footer buttons. (oppia#3728) address sean review comments Add a one-off job to list which explorations use gadgets; remove old fallbacks job. (oppia#3717) fix linting remove jinja template in create_activity_modal Fix oppia#2998 implement collection skills update commands (oppia#3710) Improvements and bug fixes to changes introduced by PR oppia#3671 (oppia#3684) Fix oppia#3688: refactoring ExplorationStatusHandler to remove unpublish and publicize functionality as it is not called from frontend. (oppia#3715) fix oppia#3698: Shift exception handling for NotLoggedInException so that it does not generate log errors. (oppia#3714) Revert "Fix oppia#3707 Change text of collection learner view "start here"" (oppia#3713) Fix oppia#3701 Fixed Continue button name issue (oppia#3711) Fix oppia#3467: Introduce re-training and add_to_training_queue methods (oppia#3650) Fix oppia#3707 Change text of collection learner view "start here" (oppia#3700) Audio fixes: make audio download URL safe; don't show flagging modal if all translations are flagged; use templateUrl for modals. (oppia#3709) Learner audio updates (oppia#3705) ...
Address some of the learner components of #3704.