-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(Multiple Languages): Show ProjectLanguageChooser in AT #1550
feat(Multiple Languages): Show ProjectLanguageChooser in AT #1550
Conversation
emit selected Language as output. This will let us reuse this component in the AT.
TopBarComponent. Update options when author changes them in the Project info view
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.
Mostly works but I found one issue.
In the Authoring Tool, if you have set the language in the top bar to one of the additional languages and then go to the Unit Info view and change the default language or add/delete an additional language, the language in the top bar changes back to the default language.
I think how we should handle this is if the author is in the Unit Info view and changes the default language or additional languages, the top bar language should not change. The top bar language should only change to the default language if the language that is currently selected in the top bar is removed from the additional languages.
option is no longer available (i.e., removed by author), or this is the first time the component is displayed
@geoffreykwan Good catch. We now set selected language to the default language only when the previously-selected option is no longer available (i.e., removed by author), or this is the first time that the component is displayed. PTAL. |
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.
Looks good. I have some minor suggestions.
src/app/common/project-language-chooser/project-language-chooser.component.ts
Outdated
Show resolved
Hide resolved
src/app/common/project-language-chooser/project-language-chooser.component.spec.ts
Outdated
Show resolved
Hide resolved
src/app/common/project-language-chooser/project-language-chooser.component.spec.ts
Outdated
Show resolved
Hide resolved
setProjectLocale(new ProjectLocale({ default: 'en_US', supported: ['ja', 'es'] })); | ||
}); | ||
|
||
it('shows available languages and selects the default language', async () => { |
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.
Should this be wrapped in a describe that describes the initial state like describe('when the language chooser is first loaded')
or something.
expect(await options[0].isSelected()).toBeTrue(); | ||
}); | ||
|
||
it('keeps selected language option when language option changes', async () => { |
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.
Should this be wrapped in a describe that describes the action like describe('when the language options change')
or something.
Note
[field].i18n = { id: "abc123", "modified": 123 }
project format for this PR and all future PR's.Changes
ProjectLocale
as@Input
Language
as@Output
Test AT
*Note: nothing should happen we switch the language option in the ProjectLanguageChooserComponent atm. We'll handle that in a future PR.
Test Student VLE