Skip to content

ohnekopf/zhongwen

 
 

Repository files navigation

花花 Huahua

This is my fork of the Zhongwen browser extension!

Now with cherrypicking! Hit P once to activate picking, press again to save the selected terms.

image

A Chinese Pop-Up Dictionary and Learning Tool

This browser extension allows you to translate Chinese characters and words by simply hovering over them with the mouse.
It also contains useful features for learners of the Chinese language.

Highlights

  • Supports both traditional and simplified characters.
  • Includes a recent version of the widely used CEDICT Chinese English dictionary.
  • Displays Hanyu Pinyin along both the simplified and traditional characters, however only showing either simplified or traditional characters can be configured as an option.
  • As a learning aid it uses different colors for displaying the Pinyin syllables, depending on the tone of the Chinese character.
  • Can be turned on and off with a single mouse-click.
  • Highlights the characters whose translation is displayed in the pop-up window.
  • Also supports keyboard navigation for translating the next character, the next word, or the previous character.
  • Allows you to add words to a built-in word list. Words from this list can be exported to a text file for further processing, such as importing the words into Anki.
  • Includes links to grammar and usage notes on the Chinese Grammar Wiki.
  • Supports exporting words to the Skritter vocabulary queue.

Installation

Firefox

$ git checkout fun
$ git archive --format=zip --output huahua.zip  fun

Install huahua.zip through firefox' addons page.

How Does It Work?

Once Huahua is installed on your computer you'll see a little icon showing the Huahua logo near the upper right-hand corner of your browser. By clicking on this icon you can turn the extension on and off. Click on it and wait until you see the word "On" displayed in red and white on top of the icon. This tells you that the dictionary is active. If you want to turn it off again, just click on the icon again and the red "On" label disappears. So with a single mouse-click you can activate or deactivate the dictionary.

Once Huahua has been turned on, showing the red "On" label on the icon, you can go to a web page in Chinese and point your mouse at some Chinese characters. A pop-up window opens up automatically showing you the translation of the word you were pointing at.

Huahua can translate both simplified characters as well as traditional characters.

What Information Does It Show?

By default, the pop-up window shows the following pieces of information:

  • The Chinese characters forming the word you're pointing at with your mouse. If the simplified and the traditional forms differ, then both forms are shown.
  • The corresponding Pinyin. The individual Pinyin syllables are shown in different colors (see below).
  • The English translation. Sometimes, Huahua finds more than one matching entry in its dictionary. In this case it shows you all of the matching entries.

Zhuyin

If you want to see Zhuyin, a.k.a. Bopomofo, you can enable it via the options page.

Chinese Grammar Wiki

Huahua also allows you to learn more about Chinese grammar and usage. If Huahua knows that there's an entry at the Chinese Grammar Wiki for the entry you're just looking at, it will show you the following text at the bottom of the pop-up window: 'Press "g" for grammar and usage notes.' If you then press G on your keyboard, a new tab will open in your browser and it will take you directly to the corresponding page in the Chinese Grammar Wiki.

Why Is Pinyin Shown in Different Colors?

If you're learning Chinese, Huahua helps you remember the tone of each character by displaying it in a different color. By default it uses the following color scheme for showing Pinyin syllables:

  • First tone syllables are shown in red.
  • Second tone syllables are shown in orange.
  • Third tone syllables are shown in green.
  • Forth tone syllables are shown in blue.

Keyboard Navigation

Some users don't use Huahua to look up individual words, they want to read an entire paragraph or article. In this case, rather than having to trace all the words with the mouse, you can use Huahua's built-in keyboard navigation support: You can move from character to character or from word to word by pressing keys on your keyboard:

  • Pressing N on the keyboard takes you to the next word.
  • Pressing B takes you back one character.
  • Pressing M moves to the next character. (This is different from pressing N if you're currently over a word that consists of two or more characters.)
  • Sometimes the pop-up window is hiding the text you're looking at. You can move it out of the way using X and Y on the keyboard (this moves the pop-up window up or down), or hit A once or twice to move it to an altogether different location.

Built-in Word List

So now that you can look up all those words when reading Chinese web sites, wouldn't it be nice to add the new words you want to remember to some list that you can use for studying? Huahua let's you do that, too! It has a built- in word list feature. You just need to press R (short for "remember") on your keyboard and the entries you're looking at in the currently opened pop-up window will be added to the built-in word list. How do you get to see this list? It's easy, you need to use press the Alt and the W key on your keyboard (Alt + W). The word list will then open in a new tab.

If you want to cherrypick one of many entries, press P, tick the boxes for the entries you want to save, and then press P again to save them.

Can I export the dictionary entries into a spreadsheet or import them into Anki?

Yes, if you want to copy the current dictionary entry, including the Chinese characters, Pinyin, and the English translation, to the clipboard, just hit C on the keyboard to copy to the clipboard. (Note: This is different from using Ctrl + C on a PC or ⌘ Command + C on a Mac, which only copies the Chinese characters without the translation.) When you paste the clipboard into Excel or an OpenOffice spreadsheet, the individual components of the entry are nicely put in different columns and rows. From there you can also import them into Anki. (See the Anki manual for further details.)

Skritter Support

If you're studying Chinese characters using Skritter you can easily add Chinese words to your vocabulary queue: just hit S on the keyboard. This opens up a new tab that takes you to the Skritter web site. If you're not logged into Skritter you'll see the login page. After you're logged in, the word is automatically added to your study queue.

Context Menu Items

When Huahua is enabled, you can right-click on a page to open the browser's context menu. There will be a menu item for Huahua which you can use to access a new tab showing a helpful summary of all the keyboard shortcuts. Another menu item can be used for opening the word list as an alternative to the Alt + W keyboard shortcut.

What Built-In Dictionary Does It Use?

Huahua comes with a recent release of the CC-CEDICT dictionary. This dictionary is constantly updated, and each Huahua release will include an updated version of the dictionary.

Support for Online Dictionaries

Sometimes, in addition to looking at the translation in the pop-up window, you might want to look up a word in one of the freely available online dictionaries. Huahua lets you quickly do that by some simple keyboard shortcuts.

  • Alt + 1 looks up the selected word using LINE Dict.
  • Alt + 2 lets you look up the pronunciation on Forvo.
  • Alt + 3 takes you to Dict.cn.
  • Alt + 4 uses iCIBA.
  • Alt + 5 looks up the word in the MDBG dictionary.
  • Alt + 6 takes you to Reverso.
  • Alt + 7 takes you to MoeDict.
  • T is for looking up example sentences at Tatoeba.

Your browser will open a new tab and the word that was shown in the pop-up window will be looked up in the corresponding online dictionary listed above.

More Options

Huahua also has an options page which allows you to configure certain aspects of its behavior. In order to get there just right-click on the Huahua logo in the upper right-hand corner of the browser and choose "Options". A new tab will open showing you all the available options with a brief explanation of each one.

Legal

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.


Copyright (C) 2023 former POTUS Richard Nixon

About

Huahua, my fork of Zhongwen

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 77.2%
  • HTML 17.5%
  • CSS 4.7%
  • Shell 0.6%