Skip to content
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

update edge supported locales for voice search #1519

Merged
merged 1 commit into from
Aug 19, 2021

Conversation

oshi97
Copy link
Contributor

@oshi97 oshi97 commented Aug 18, 2021

Ran my codepen that brute force checks locales on edge, which works by
by turning on speech recognition for 10s, and adding the locale
to a list if a 'network' occurs. After 10s, the speech recognition
is aborted and a 'no-speech' error is expected.

Also added a zh-cn and zh-tw to the supported locales list, even
though they're not currently locales the SDK has built in, in case
a user manually supplies these locales.

J=SLAP-1532
TEST=manual,auto

manually test a number of the locales (~a third of them)

Ran my codepen that brute force checks locales on edge, which works by
by turning on speech recognition for 10s, and adding the locale
to a list if a 'network' occurs. After 10s, the speech recognition
is aborted and a 'no-speech' error is expected.

Also added a zh-cn and zh-tw to the supported locales list, even
though they're not currently locales the SDK has built in, in case
a user manually supplies these locales.

J=SLAP-1532
TEST=manual,auto

manually test a number of the locales (~a third of them)
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 60.484% when pulling eaa0ce1 on dev/update-edge-supported-locales into 3731781 on feature/chinese-i18n.

'pt-br',
'pt-pt',
'sv-se',
'zh-hans-cn',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just confirming 'zh-hans-sg` and 'zh-hant-mo' aren't supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are not, you can very quickly test them here https://codepen.io/oshi97/pen/RwVKKzB

Copy link
Contributor Author

@oshi97 oshi97 Aug 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or by hacking the searchbar's SpeechRecognition instance through dev tools with ANSWERS.components._activeComponents.find( // find the searchbar and go through its instance variables

Comment on lines +23 to +25
if (modifier) {
return formatLocaleForEdge(language, modifier);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a locale isn't in the compatibility list but it has a modifier, we return it? I would expect that if the locale isn't in the compatibility list, we return just the language, not a language and modifier.

Copy link
Contributor Author

@oshi97 oshi97 Aug 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If zh-hans-bob isn't supported, we can return zh-hans instead of just zh
by default edge will interpret zh on its own as zh-hans, so this only matters for zh-hant-[unsupported-region]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright, got it

@oshi97 oshi97 requested a review from cea2aj August 19, 2021 14:06
@oshi97 oshi97 merged commit df94463 into feature/chinese-i18n Aug 19, 2021
@oshi97 oshi97 deleted the dev/update-edge-supported-locales branch August 19, 2021 14:47
oshi97 added a commit that referenced this pull request Aug 19, 2021
Ran my codepen that brute force checks locales on edge, which works by
by turning on speech recognition for 10s, and adding the locale
to a list if a 'network' occurs. After 10s, the speech recognition
is aborted and a 'no-speech' error is expected.

Also added a zh-cn and zh-tw to the supported locales list, even
though they're not currently locales the SDK has built in, in case
a user manually supplies these locales.

J=SLAP-1532
TEST=manual,auto

manually test a number of the locales (~a third of them)
@oshi97 oshi97 mentioned this pull request Aug 19, 2021
oshi97 added a commit that referenced this pull request Aug 19, 2021
chinese i18n tweaks

update edge supported locales for voice search (#1519)
rename zh-CN to zh-Hans and zh-TW to zh-Hant (#1517)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants