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

Tweaks for next v2.0.0 release #7

Merged
merged 11 commits into from
Oct 4, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules

*.swp
*.backup
*.zip
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Pupeeter Dependencies
# CONTRIBUTING.md

https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-doesnt-launch-on-linux
https://help.accusoft.com/PrizmDoc/v12.2/HTML/Installing_Asian_Fonts_on_Ubuntu_and_Debian.html
You can raise a PR or an issue for any bugs, new features, feature requests and similar.

For any PRs the tests are expected to pass, and for any changes or additions to functionality
those need to be covered by changes or additions to the test coverage.

I might miss the GitHub notifications for a new PR/issue created, feel free to email me at
[email protected] if things are taking too long or even straight after opening a PR or
an issue.
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# Mandarin & Cantonese Pop-Up dictionary

A fork of the (https://github.com/cschiller/zhongwen)[Zhongwen] extension.
Support for Cantonese
(https://cantonese.org/download.html)[CC-Canto] dictionary and jyutping display
was added.
# Chinese-English Popup Dictionary - Mandarin & Cantonese

## Contributions

If you would like to contribute to the project feel free to open issues or,
even better, pull requests.
even better, pull requests. See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.

## Highlights

Expand Down Expand Up @@ -71,8 +66,7 @@ your experience.
* <kbd>Alt</kbd> + <kbd>3</kbd> takes you to [Dict.cn](https://dict.cn).
* <kbd>Alt</kbd> + <kbd>4</kbd> uses [iCIBA](https://www.iciba.com).
* <kbd>Alt</kbd> + <kbd>5</kbd> looks up the word in the [MDBG dictionary](https://mdbg.net).
* <kbd>Alt</kbd> + <kbd>6</kbd> takes you to [JuKuu](https://jukuu.com).
* <kbd>Alt</kbd> + <kbd>7</kbd> takes you to [MoeDict](https://moedict.tw).
* <kbd>Alt</kbd> + <kbd>6</kbd> takes you to [MoeDict](https://moedict.tw).
* <kbd>T</kbd> is for looking up example sentences at [Tatoeba](https://tatoeba.org).

### Misc
Expand All @@ -86,6 +80,18 @@ your experience.
- For Linux users the TTS is not available using Brave, Firefox, and Chromium, but should work with Google Chrome.
- To enable text to speech go to `Extensions` (the jigsaw icon on the top right) > `More actions` (three dots on the right of the `Mandarin + Cantonese` extension) > `Options`. On the `Options` page, scroll to the very bottom and check the box for the option `Enable text-to-speech`.

## Development

### Pupeeter Dependencies

https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#chrome-doesnt-launch-on-linux

### WSL Fonts for test cases

When running WSL you will need Chinese font to be available for the browser tests to pass, see below

https://help.accusoft.com/PrizmDoc/v12.2/HTML/Installing_Asian_Fonts_on_Ubuntu_and_Debian.html

## Legal
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand All @@ -103,5 +109,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

---

*Copyright (C) 2024 Michal Tusnio*

Original extension & documentation
*Copyright (C) 2019 Christian Schiller*
2 changes: 1 addition & 1 deletion browser_tests/options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ describe("the options page", function () {
await page.locator(targetSelector).hover();
const windowHTML = await utils.getZhongwenWindowContent(page)

expect(windowHTML).toEqual("<span class=\"w-hanzi\">有</span>&nbsp;<span class=\"w-pinyin tone3\">yǒu</span>&nbsp;&nbsp;&nbsp;<span class=\"w-pinyin\">jau5</span><br><span class=\"w-def\">to have/there is/there are/to exist/to be</span><br><br><span class=\"grammar\">Press \"g\" for grammar and usage notes.</span><br><br><span class=\"w-hanzi\">有</span>&nbsp;<span class=\"w-pinyin tone3\">yǒu</span>&nbsp;&nbsp;&nbsp;<span class=\"w-pinyin\">jau5</span><span style=\"float: right\" class=\"w-pinyin\">Cant.</span><br><span class=\"w-def\">has or have</span><br><span class=\"w-hanzi\">有</span>&nbsp;<span class=\"w-pinyin tone3\">yǒu</span>&nbsp;&nbsp;&nbsp;<span class=\"w-pinyin\">jau5</span><span style=\"float: right\" class=\"w-pinyin\">Cant.</span><br><span class=\"w-def\">to have/there is/there are/to exist/to be/being/a surname/to possess/to own/used in courteous phrases expressing causing trouble/to be betrothed/to be married/to be pregnant/many/to be rich/to have money/abundant/wealthy</span><br><span class=\"w-hanzi\">有</span>&nbsp;<span class=\"w-pinyin tone3\">yǒu</span>&nbsp;&nbsp;&nbsp;<span class=\"w-pinyin\">jau6</span><span style=\"float: right\" class=\"w-pinyin\">Cant.</span><br><span class=\"w-def\">also/again</span><br>")
expect(windowHTML).toEqual("<span class=\"w-hanzi\">有</span>&nbsp;<span class=\"w-pinyin tone3\">yǒu</span>&nbsp;&nbsp;&nbsp;<span class=\"w-pinyin\">jau5</span><br><span class=\"w-def\">to have; there is/(bound form) having; with; -ful; -ed; -al (as in 有意[you3yi4] intentional)</span><br><br><span class=\"grammar\">Press \"g\" for grammar and usage notes.</span><br><br><span class=\"w-hanzi\">有</span>&nbsp;<span class=\"w-pinyin tone3\">yǒu</span>&nbsp;&nbsp;&nbsp;<span class=\"w-pinyin\">jau5</span><span style=\"float: right\" class=\"w-pinyin\">Cant.</span><br><span class=\"w-def\">has or have</span><br><span class=\"w-hanzi\">有</span>&nbsp;<span class=\"w-pinyin tone3\">yǒu</span>&nbsp;&nbsp;&nbsp;<span class=\"w-pinyin\">jau5</span><span style=\"float: right\" class=\"w-pinyin\">Cant.</span><br><span class=\"w-def\">to have/there is/there are/to exist/to be/being/a surname/to possess/to own/used in courteous phrases expressing causing trouble/to be betrothed/to be married/to be pregnant/many/to be rich/to have money/abundant/wealthy</span><br><span class=\"w-hanzi\">有</span>&nbsp;<span class=\"w-pinyin tone3\">yǒu</span>&nbsp;&nbsp;&nbsp;<span class=\"w-pinyin\">jau6</span><span style=\"float: right\" class=\"w-pinyin\">Cant.</span><br><span class=\"w-def\">also/again</span><br>")
})
})
Loading