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

zh-cn: update the explanations within "Using the Web Speech API" #21832

Merged
merged 7 commits into from
Jul 6, 2024

Conversation

AlphaHinex
Copy link
Contributor

Description

Update the explanation of populateVoiceList part and others.

Motivation

Regarding the explanation of using the populateVoiceList function to fill in the list of available voices in different browsers, the previous Chinese version of the translation is still somewhat unclear. Therefore, an attempt is made to provide a clearer description of this part, and to synchronize some other details in the Speech synthesis section with the English version.

Additional details

Related issues and pull requests

@AlphaHinex AlphaHinex requested a review from a team as a code owner June 22, 2024 04:23
@AlphaHinex AlphaHinex requested review from yin1999 and removed request for a team June 22, 2024 04:23
@github-actions github-actions bot added the l10n-zh Issues related to Chinese content. label Jun 22, 2024
Copy link
Contributor

github-actions bot commented Jun 22, 2024

Preview URLs

Flaws (18)

URL: /zh-CN/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API
Title: 使用 Web Speech API
Flaw count: 18

  • macros:
    • /zh-CN/docs/Web/API/SpeechRecognition does not exist but fell back to /en-US/docs/Web/API/SpeechRecognition
    • /zh-CN/docs/Web/API/SpeechRecognition/SpeechRecognition does not exist but fell back to /en-US/docs/Web/API/SpeechRecognition/SpeechRecognition
    • /zh-CN/docs/Web/API/SpeechGrammarList/SpeechGrammarList does not exist but fell back to /en-US/docs/Web/API/SpeechGrammarList/SpeechGrammarList
    • /zh-CN/docs/Web/API/Window/speechSynthesis does not exist but fell back to /en-US/docs/Web/API/Window/speechSynthesis
    • /zh-CN/docs/Web/API/SpeechSynthesisVoice does not exist but fell back to /en-US/docs/Web/API/SpeechSynthesisVoice
    • and 7 more flaws omitted
  • broken_links:
    • Can't resolve /zh-CN/docs/Web/API/SpeechRecognition/onresult
    • Can't resolve /zh-CN/docs/Web/API/SpeechRecognition/onspeechend
    • Can't resolve /zh-CN/docs/Web/API/SpeechRecognition/onnomatch
    • Can't resolve /zh-CN/docs/Web/API/SpeechRecognition/onerror
    • Can't resolve /zh-CN/docs/Web/API/SpeechRecognitionError/error
    • and 1 more flaws omitted
External URLs (2)

URL: /zh-CN/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API
Title: 使用 Web Speech API

(comment last updated: 2024-07-06 07:54:55)

Copy link
Member

@yin1999 yin1999 left a comment

Choose a reason for hiding this comment

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

Thank you @AlphaHinex. I've left some comments on this PR :)

Comment on lines 207 to 209
### 浏览器兼容性

Web Speech API 语音合成部分在各浏览器中还是在发展,还不成熟,现在有以下几个限制点:

- Firefox 桌面版和移动版在 Gecko 42+(Windows)/44+ 支持,但是没有前缀,可以通过将`media.webspeech.synth.enabled`标志在`about:config`中转为`true`来启用。
- Firefox OS 2.5+ 支持,但是默认的,不需要任何权限。
- Chrome 桌面版和安卓版自 33 版以来都支持,但是没有前缀
[api.SpeechSynthesis](/zh-CN/docs/Web/API/Web_Speech_API#api.speechsynthesis)
Copy link
Member

Choose a reason for hiding this comment

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

I could not see this section in en-US, please remove it instead of updating it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed

Comment on lines 289 to 291
早期版本的浏览器不支持 {{domxref("SpeechSynthesis.voiceschanged_event", "voiceschanged")}} 事件,只有当 {{domxref("SpeechSynthesis.getVoices()")}} 被触发时才返回语音列表。
而其他浏览器,比如 Chrome 中,你必须等待 `voiceschanged` 事件触发后才能获得可用语音列表。
为了兼容这两种情况,我们运行如下代码:
Copy link
Member

Choose a reason for hiding this comment

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

Do not break lines, which will introduce spaces.

Suggested change
早期版本的浏览器不支持 {{domxref("SpeechSynthesis.voiceschanged_event", "voiceschanged")}} 事件,只有当 {{domxref("SpeechSynthesis.getVoices()")}} 被触发时才返回语音列表。
而其他浏览器,比如 Chrome 中,你必须等待 `voiceschanged` 事件触发后才能获得可用语音列表。
为了兼容这两种情况,我们运行如下代码:
早期版本的浏览器不支持 {{domxref("SpeechSynthesis.voiceschanged_event", "voiceschanged")}} 事件,只有当 {{domxref("SpeechSynthesis.getVoices()")}} 被触发时才返回语音列表。而其他浏览器,比如 Chrome 中,你必须等待 `voiceschanged` 事件触发后才能获得可用语音列表。为了兼容这两种情况,我们运行如下代码:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The English version looks good with multiple lines. Is there any possibility to remove the spaces from the rendering engine? Having all contents in one line makes the markdown file difficult to maintain.

Copy link
Member

Choose a reason for hiding this comment

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

No, it is markdown spec for line breaks to introduce whitespace. Doing this is not correct.

@yin1999 yin1999 changed the title Update the explanation of populateVoiceList part and others Jul 6, 2024
Copy link
Member

@yin1999 yin1999 left a comment

Choose a reason for hiding this comment

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

Thank you @AlphaHinex. I'm a bit busy those days. Sorry for the delay.

@yin1999 yin1999 merged commit 52f434f into mdn:main Jul 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n-zh Issues related to Chinese content.
2 participants