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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/data/date-pickers/localization/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"languageTag": "zh-HK",
"importName": "zhHK",
"localeName": "Chinese (Hong Kong)",
"missingKeysCount": 1,
"missingKeysCount": 0,
"totalKeysCount": 50,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/zhHK.ts"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers/src/locales/zhHK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.


// Table labels
timeTableLabel: '選擇時間',
Expand Down