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

[l10n] Improve Chinese (zh-HK) locale #13289

Merged
merged 2 commits into from
Aug 16, 2024
Merged

Conversation

yeeharn
Copy link
Contributor

@yeeharn yeeharn commented May 29, 2024

Copy link
Member

@LukasTy LukasTy 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 for your contribution! 🙏

@@ -65,7 +65,7 @@ const zhHKPickers: Partial<PickersLocaleText<any>> = {
value !== null && utils.isValid(value)
? `選擇時間,已選擇${utils.format(value, 'fullTime')}`
: '選擇時間',
// fieldClearLabel: 'Clear value',
fieldClearLabel: '清除',
Copy link
Member

Choose a reason for hiding this comment

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

The suggested translation seems to mean "Clear" in English.
Are you sure it is enough in this case or would it be better to use 明确的价值 instead? 🤔

Suggested change
fieldClearLabel: '清除',
fieldClearLabel: '明确的价值',

Copy link
Member

@oliviertassinari oliviertassinari Aug 16, 2024

Choose a reason for hiding this comment

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

I guess it's OK, it's what Simplified Chinese already uses:

fieldClearLabel: '清除',


Actually, this label feels too specific in the original en-US version. I could see clear date, clear birthday, "value" feels too generic and unnecessary. It's implicit that it's a value. It's also inconsistent with the combobox. I think that we can fix this: #14243.

SCR-20240817-brju

https://mui.com/material-ui/react-autocomplete/#combo-box

SCR-20240817-brla

https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value

SCR-20240817-bswp

https://www.google.com/

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for the insight. 👍
This is the discussion regarding this decision: #9095 (comment)
If we go with only Clear, I'd say that we need to explore adding an aria relationship with the "Field" label to have something like Clear Birth date, button on screen readers. 💡 🤔

Copy link
Member

@oliviertassinari oliviertassinari Aug 19, 2024

Choose a reason for hiding this comment

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

This is the discussion regarding this decision: #9095 (comment)

Interesting, but why is the clear button reachable with Tab? I would expect the same as in the autocomplete: mui/material-ui#30815

https://react-spectrum.adobe.com/react-aria/ComboBox.html#state uses "Clear" only. https://react-select.com/home makes it unreachable.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting, but why is the clear button reachable with Tab? I would expect the same as in the autocomplete: mui/material-ui#30815

Why would we hide it? 🤔
It is a functional part of the component, I don't see a reason to forbid its usage on screen readers (or with a keyboard). 🙈

https://react-spectrum.adobe.com/react-aria/ComboBox.html#state uses "Clear" only. https://react-select.com/home makes it unreachable.

So does the clearable date picker. 👍
However, they don't even provide a title. In this regard I do not agree, I feel that title is a superior attribute to aria-label, which should be used when the title doesn't make sense.

Copy link
Member

@oliviertassinari oliviertassinari Aug 19, 2024

Choose a reason for hiding this comment

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

Why would we hide it?

The WAI-ARIA Authoring guide recommends it: mui/material-ui#30815 (comment). In mui/material-ui#30815 (comment) I tried to justify the rational behind why I built the Autocomplete this way.

Copy link
Member

Choose a reason for hiding this comment

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

I feel like we are comparing different things—autocomplete/select has a different keyboard behavior to the Pickers/Field.
It is way easier to remove a value with a keyboard from the autocomplete as compared to a Pickers Field. 🤔

Copy link
Member

@oliviertassinari oliviertassinari Aug 19, 2024

Choose a reason for hiding this comment

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

I don't know, on a keyboard clearing a date picker feels slightly simpler than on autocomplete, either:

  • I tab into it. In both cases, everything is selected, so pressing delete once empties the field.
  • I have just selected a value. In both cases, I select all + press delete
  • I have just selected a value. I spam the delete key, the autocomplete usually has more characters to remove, so is a bit slower.

Copy link
Member

@oliviertassinari oliviertassinari Sep 11, 2024

Choose a reason for hiding this comment

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

@LukasTy LukasTy added l10n localization component: pickers This is the name of the generic UI component, not the React module! labels May 29, 2024
@mui-bot
Copy link

mui-bot commented May 29, 2024

Localization writing tips ✍️

Seems you are updating localization 🌍 files.

Thank you for contributing to the localization! 🎉 To make your PR perfect, here is a list of elements to check: ✔️

  • Verify if the PR title respects the release format. Here are two examples (depending if you update or add a locale file)

    [l10n] Improve Swedish (sv-SE) locale
    [l10n] Add Danish (da-DK) locale

  • Update the documentation of supported locales by running pnpm l10n
  • Clean files with pnpm prettier.

Deploy preview: https://deploy-preview-13289--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 2560cae

@LukasTy LukasTy changed the title Update zhHK.ts [l10n] Improve Chinese (zh-HK) locale May 29, 2024
yeeharn and others added 2 commits August 17, 2024 00:39
Signed-off-by: yeeharn <yh.teh@outlook.com>
@oliviertassinari oliviertassinari merged commit 0cb2044 into mui:master Aug 16, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! l10n localization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants