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

locale specific to Simplified Chinese and Taiwanese Mandarin not translating as expected #4388

Closed
1 task done
padmavemulapati opened this issue Mar 27, 2024 · 2 comments · Fixed by #4396 · 4 remaining pull requests
Closed
1 task done

locale specific to Simplified Chinese and Taiwanese Mandarin not translating as expected #4388

padmavemulapati opened this issue Mar 27, 2024 · 2 comments · Fixed by #4396 · 4 remaining pull requests
Assignees
Labels
fix Bug fixes

Comments

@padmavemulapati
Copy link

Product

axe-core

Product Version

4.9.0

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

With the generated axe.zh_CN.min.js and axe.zh_TW.min.js (generated using npm run build -- --lang=zh_CN and npm run build -- --lang=zh_TW) source snippet , unable to see the descriptions in respective translations

Actual

In Simplified Chinese and Taiwanese Mandarin should be traslated

How to Reproduce

  1. Created a test file for the 4.9.0 Change - aria-hiddden-body tag added wcag131
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+ARIA 1.0//EN" "http://www.w3.org/WAI/ARIA/schemata/html4-aria-1.dtd">
<html lang="en">
  <head>
    <title>aria-hidden on body Test</title>
 <body aria-hidden="true">
    <h2>Some title.</h2>
    <a href="http://www.deque.com">Deque</a>
    <div id="mocha"></div>
    
  </body>
 </head>
 </html> 
  1. Run the axe-core with npm run build
  2. With the axe-core_4.9.0.min.js source snippet run axe using await axe.run()
  3. Seeing the expected violations
  4. Created the traslation files for Greek , Italian, Simplified Chinese, Taiwanese Mandarin using
npm run build -- --lang=el
npm run build -- --lang=it
npm run build -- --lang=zh_CN
npm run build -- --lang=zh_TW

respectively.
6. I am able to the proper translations for Greek and Italian
7. Unable to see the trnasaltions for Chinese and Taiwanese

Recording:

9c211487-230a-4604-9fe0-3ab00b3c9197.mp4
@straker
Copy link
Contributor

straker commented Apr 3, 2024

Found the problem. In our rule configure build script we generate the lang/locale from looking at the file name using a regex. The regex only looks at lowercase alpha characters of length 2 or 3, so a lang like pt works but a lang of pt_BR is not matched and so defaults to english as the locale.

@straker straker added fix Bug fixes and removed ungroomed Ticket needs a maintainer to prioritize and label labels Apr 3, 2024
@straker straker self-assigned this Apr 3, 2024
straker added a commit that referenced this issue Apr 10, 2024
Figured a simple `split` would do the job without needing to write a
complicated regex to do it. Otherwise we'd need something like
`/\.([a-zA-Z_]+)\.js$/`

Closes: #4388
@padmavemulapati
Copy link
Author

Verified with the latest axe-core-dev branch code base, now with the fix able to translate Chinese and Taiwanese locale and getting the respective translated a11y issues.

Results for Simplified Chinese:

image

Results for Taiwanese Mandarin:

image

Environment:

Label Value
Product axe-core
Version 4.9.0(Dev Branch Code base
OS-Details _MAC- Intel Core i7 - 11.6.8 _
BrowserDetails Chrome Version 124.0.6367.119 (Official Build) (64-bit)

WilcoFiers added a commit that referenced this issue May 6, 2024
###
[4.9.1](v4.9.0...v4.9.1)
(2024-05-06)

### Bug Fixes

- Prevent errors when loading axe in a page with prototype.js
- **aria-allowed-attr:** allow meter role allowed aria-\* attributes on
meter element
([#4435](#4435))
([7ac6392](7ac6392))
- **aria-allowed-role:** add gridcell, separator, slider and treeitem to
allowed roles of button element
([#4398](#4398))
([4788bf8](4788bf8))
- **aria-roles:** correct abstract roles (types) for
aria-roles([#4421](#4421))
- **aria-valid-attr-value:** aria-controls & aria-haspopup incomplete
([#4418](#4418))
- fix building axe-core translation files with region locales
([#4396](#4396))
([5c318f3](5c318f3)),
closes [#4388](#4388)
- **invalidrole:** allow upper and mixed case role names
([#4358](#4358))
([105016c](105016c)),
closes [#2695](#2695)
- **isVisibleOnScreen:** account for position: absolute elements inside
overflow container
([#4405](#4405))
([2940f6e](2940f6e)),
closes [#4016](#4016)
- **label-content-name-mismatch:** better dismiss and wysiwyg symbolic
text characters
([#4402](#4402))
- **region:** Decorative images ignored by region rule
([#4412](#4412))
- **target-size:** ignore descendant elements in shadow dom
([#4410](#4410))
([6091367](6091367))
- **target-size:** pass for element that has nearby elements that are
obscured ([#4422](#4422))
([3a90bb7](3a90bb7)),
closes [#4387](#4387)


This PR was opened by a robot 🤖 🎉 (And updated by @WilcoFiers
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment