koudaiii / learn-microsoft-com-update-checker

Chrome extension to check and display the latest update date from the English version of Microsoft Learn pages when viewing the current language version.
https://chromewebstore.google.com/detail/learnmicrosoftcom-update/addjjinolilbffnlnfbaglljhngjminl
MIT License
1 stars 1 forks source link

languageLabels is a dictionary that maps message from language codes to the corresponding language #19

Closed koudaiii closed 1 month ago

koudaiii commented 1 month ago

This pull request includes changes to the src/content.js file to enhance language support by introducing a dictionary for language labels and updating the way update information is displayed based on the current language.

Enhancements to language support:

koudaiii commented 1 month ago
$ npm run test:e2e 

> jp-learn-microsoft-com-update-checker@1.2.0 test:e2e
> jest tests/e2e

 PASS  tests/e2e/content.e2e.test.js (11.944 s)
  JP Learn Microsoft.com Update Checker E2E Test
    ✓ should display English update date on Japanese Microsoft Learn page (1906 ms)
    ✓ should display English update date on zh-cn Microsoft Learn page (1461 ms)
    ✓ should display light theme when button[data-theme-to]=light and button[aria-pressed]=true (239 ms)
    ✓ should display dark theme when button[data-theme-to]=dark and button[aria-pressed]=true (199 ms)
    ✓ should display high-contrast theme when button[data-theme-to]=high-contrast and button[aria-pressed]=true (196 ms)
    ✓ should not run script on en-us pages on light theme (368 ms)
    ✓ should not run script on en-us pages on dark theme (197 ms)
    ✓ should not run script on en-us pages on high-contrast theme (171 ms)
    ✓ should run script with jp-learn-microsoft-com-update-checker-debug flag (190 ms)

Test Suites: 1 passed, 1 total
Tests:       9 passed, 9 total
Snapshots:   0 total
Time:        12.044 s, estimated 13 s
Ran all test suites matching /tests\/e2e/i.

👌