Rob van der Woude's Scripting Pages

BirdName

Version 3.07

 

 

Translate animal species' (chordata) names from one supported language to another with this program.

This program uses Wikipedia to translate a species' "common name" (also known as "popular name") to its scientific name, and from the scientific name to the "common name" in three languages.
Supported languages are all languages that have at least 1000 articles on Wikipedia.

BirdName 3.07 Screenshot

Usage:

 

How it works:

The program first retrieves a list of supported languages on Wikipedia (languages with at least 1000 articles on Wikipedia).
If it fails to open the list, it will use a set of cached lists instead, or if those aren't available, a set of embedded lists.
Unless you use only (embedded) species lists, you can't use the program in a meaningful way without access to Wikipedia, but you will at least have access to the settings and help file.

Let's assume you selected for the animal class, for the input language, and entered .
Since a species list for English is embedded, the program will use that species list.
Without (embedded) species list available, the program would try and open the Wikipedia page en.wikipedia.org/wiki/House_sparrow.
After clicking , the program will search the species list or the Wikipedia page for the scientific name ("Passer domesticus"), which will then be displayed in the "Scientific name" input field.
Likewise, to find the common names in the "output" languages, the program tries to open the (embedded) species lists if available, or the Wikipedia pages for the scientific name in each of these languages (e.g. dk.wikipedia.org/wiki/Passer_domesticus for Danish), and uses a number of regular expressions to search these pages for the common names.

 

Configuration:

BirdName 3.07 Settings Screenshot

Use the button to change the program settings interactively.
This will open a second window, which allows you to select the default class, the program interface language, input language, output languages, window magnification factor (for the visually challenged), debug mode, whether or not to (HTML) escape text before sending it to the clipboard, and whether to display all language names in English or each in its own "local" language.

Click to save your choices to a configuration file.
Click to delete the configuration file, thereby restoring the program's default settings.
Click to ignore the changes.
Note that after clicking any of these buttons, the program will be restarted immediately with the (new) configuration, so any result in the main window will be lost.

 

The program can also be configured using the following optional command line switches:

/? show this help
/c:dc default Class selection (where dc can be "All", "Actinopterygii", "Amphibia", "Aves", "Chondrichthyes", "Mammalia" or "Reptilia")
/d enable Debug mode: dialogs will pop up showing the resulting settings
/-d disable Debug mode (command line only)
/e use English language names (default: display each language name in its own language)
/-e do not use English language names (command line only)
/i:xx Input language selection
/m Magnify window and fonts to twice their default size and use higher contrast colors
/m:nn like /m but witch custom magnification factor nn (1..10, limited to fit screen if necessary)
/-m disable Magnification and high contrast (command line only)
/p:xx Program interface language selection
/s (html) eScape text before sending it to the clipboard
/-s disable html eScaping (command line only)
/t1:xx language selection for Translation #1
/t2:xx language selection for Translation #2
/t3:xx language selection for Translation #3

All command line switches are optional and case insensitive.
Command line switches can be saved in an optional configuration file (BirdName.cfg, located in the program's parent folder) which will be interpreted before the command line is interpreted.
Command line options always override configuration file options.

For language selections: xx must be a valid language code for a supported language.
Supported languages are all languages with more than 1000 articles on Wikipedia.
See meta.wikimedia.org/wiki/List_of_Wikipedias for the list of supported languages and their language codes.

To create your own language file, run the command BirdName /P:xx (where xx is a valid language code).
If BirdName.xx doesn't exist in the program's parent folder, it will be created by the program.
The newly created file will contain all captions as key=value pairs, e.g. Aves=Birds, with the caption values in the currently active program interface language.
Open the file in a plain text editor, e.g. Notepad, translate each caption, and save the file.
Next time you run BirdName /P:xx your translations will be used for the program interface.

A language file for Dutch (BirdName.nl) is embedded in the program.
This file will be used when you select Dutch (Nederlands) for the program interface language — unless a valid language file BirdName.nl already exists!

If a caption is missing from the language file, the program will use the English text for that particular caption.
If an error occurs while reading the language file, the program will try to delete the invalid language file, and either recreate a new "template" language file, that you need to translate yourself again, or restore the original file from an embedded resource (at the moment of writing: for Dutch language file only).
So, if you have any custom language file, make sure to back it up before running the program.

If the program doesn't show any captions at all, the automatic recovery procedure failed; rename or remove your language file and let the program recreate it as described here.

 

Program updates:

BirdName update message

Each time the program is started, it will check online if an update is available.
If there is, a dialog box will pop up, asking you if you want to download the latest version.
Click to open the download page in your default browser.

 

Help files:

The program comes with English and Dutch PDF help files embedded.
Each time help is requested, either by clicking the button or by pressing the F1 key, the embedded PDF help file will overwrite any existing file with the same name in the program's parent folder.

 

Limitations and work-arounds:

The program has been tested with western alphabet languages only.
A quick test with Arabic and Russion revealed that the program is not up to this challenge.
Sorry, there is no work-around available at this moment.

The names entered in the input fields must match the names on the Wikipedia pages (not case sensitive).
The Wikipedia pages must adhere to certain layout standards, which most of them do, though not all.
These standards sometimes change, in which case the program may fail.
Since the program can never be tested for all possible combinations of languages and species, some of these combinations may fail.

If you are familiar with regular expressions, you may try and add custom regular expressions to make the program accept these "non-standard" pages.
Custom regular expressions can be added to an optional file named BirdName.patterns, located in the program's parent folder.

A custom regular expression might look like this:

<b>(?<LocalName>[^<\d]+)</b>(?:.*?)<i><b>{0}</b></i>

where (?<LocalName>[^<\d]+) is the expression for the common name we are looking for, and {0} will be replaced by the species' scientific name.

The program first uses its "embedded" list of regular expressions; if none of these result in a match, it will try the custom regular expressions.

 

Notes:

This program can be used without installing it — it is a true portable application.
Most of its helper files are either embedded or are created on the fly when required.

This program is the successor of the old Birdname.hta.
Development of the HTA version has been stopped.

Though some of the helper files use the same file names as the old HTA version did, they are not interchangeable!
If you intend to use the old HTA version as well as this compiled version on the same computer, make sure the HTA and executable are not in the same folder.

 

Credits:

Code to decode Unicode characters by Adam Sills on StackOverflow.com:
stackoverflow.com/a/1615860

Code to open the embedded PDF help file based on code by Dan Ergis on StackOverflow.com:
stackoverflow.com/a/8609599

Code to detect the minimum required .NET Framework version based on code by Fernando Gonzalez Sanchez on StackOverflow.com:
stackoverflow.com/a/18623516

 

Change History

Version Release Date
(yyyy-mm-dd)
Changes
3.07 2018-12-06
  • Improved detection of the required .NET Framework version in Debug Mode.
  • Update check now uses a secure connection.
3.06 2018-11-30
  • Added icons to copy results to the clipboard.
  • Added option to (HTML) escape results before copying them to the clipboard.
  • In Debug Mode (/D), you will be prompted to view the list of supported languages if and only if a language cache file is found.
  • Due to the new icons and setting, the minimum window width had to be increased from 550 to 600 pixels.
3.05 2018-09-20
  • Fixed a bug in escaping translated captions.
  • In Debug Mode (/D), if captions are missing, the program will list the missing captions, then prompt to add them to the language file, and finally prompt to open the language file in Notepad.
    This change required many new captions, so if you use a custom language file you may want to run the program in Debug Mode right after the update.
3.04 2018-09-18
  • Fixed a bug where choosing "All" for the default class would not be remembered
  • The program no longer deletes incomplete language files, but instead uses the English texts for missing captions
3.03 2018-09-17
  • Added a Default class selection to the interactive settings and to the command line and configuration file (optional command line switch /C)
3.02 2018-05-04
3.01.1 2018-04-25
  • Recompiled for any CPU (32-bit as well as 64-bit) with Visual Studio 2017
  • No changes in functionality
3.01 2016-09-20
  • The regular expressions used to extract the local name were fine tuned to reject numbers
3.00 2016-09-06
  • Complete rewrite and make-over in C#


Versions published before 3.00 are the old HTA version of

the program, which is still available but no longer maintained.


 

Download BirdName 3.07:

 

Checksums:
File: birdname.zip
MD5: 058cd49c68fc95170cb73694c359e132
SHA1: f4d9073d9c9347f6f0fa41203c531b6c35e93745

 

Make a donation:

page last modified: 2024-04-25; loaded in 0.0027 seconds