Details
-
Suggestion
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15.7
-
None
-
macOS.
-
86b930f07 (dev), 68249352a (6.4), ac0dc01c4 (6.5), 1dfa714ae (tqtc/lts-6.2), 713e7a4d0 (tqtc/lts-5.15)
Description
In strings_??.qm translation files, some translators may make mistakes that putting ampersanded shortcuts into full-width brackets as follows:
This won't render the shortcut ineffective on Windows but will render it incorrectly on macOS. (See the screenshot I posted in my 2nd reply towards this ticket.)
The following is the format that translators are expected to do:
While this appears to the duty of translators, there are two difficulties:
- Some translators are outsourced workers for a company, and the company may have extremely-limited human resources devotable to improving the i18n experience of their products.
- "Using full-width brackets for ampersanded shortcuts" is something already-tolerated in Windows app localization industry in (at least) Mainland China for dozens of years, and these translators are likely to have no awareness that they have to use half-width brackets in case of translating Qt apps for macOS.
Since only Qt (at this moment) requires half-width brackets in the strings_??.qm files, here's my suggestion:
When parsing raw strings from strings_??.qm files, use Regex to match ampersanded shortcut letters bracketed by full-width brackets or mixed-width brackets (like "(&A)" or "(&A)"). If matched, replace all full-width brackets in the matched range to half-width brackets. So does possible full-width ampersand symbols for shortcuts, converting such symbols to half-width.
$ EOF.