Translate between American English and British English
npm install american-british-english-translatorNow online at: https://codewordsolver.com/american-british-english-translator
Reads in a text and identifies words that differ in usage between American English and British English, including:
1. Words with alternative spellings ("cozy" / "cosy")
2. Words with different meanings in each of the two dialects ("pants")
3. Words typically used in only one of the dialects ("ladybug" / "ladybird")
Existing solutions only notice the first category of words, thus failing to prevent the most embarrassing mistakes, such as a British person asking an American colleague for a "rubber".
``bash`
$ npm install -g american-british-english-translator
This will install the command english-translate globally, so it will be added automatically to your PATH.
The command line interface can be used in three different ways:
Pipe stdin:
`bash`
$ echo "That was a right bodge job" | english-translate
Analyze a file:
`bash`
$ english-translate American\ Psycho.txt
Prompt:
`bash`
$ english-translate
By default english-translate outputs almost everything it can*, but it's possible to refine the output and thus speed up the program by using some command line options:
`bashOnly identify Americanisms
$ english-translate file.txt --american
* Common words with tiny subtleties in meaning, such as 'can' or 'through', are ignored by default. These words are configured in data/ignore_list.json. If you want to include them then pass the
--showall flag.Usage (from Node.js)
Include it in your script and call the
translate() method:`javascript
var translator = require('american-british-english-translator');var data = "I was gobsmacked";
var options = {
british: true
};
console.log(JSON.stringify(translator.translate(data, options)));
``Uses modified versions of the following lists:
- List of words having different meanings in American and British English: A-L
- List of words having different meanings in American and British English: M-Z
- Glossary of American terms not widely used in the United Kingdom
- Glossary of British terms not widely used in the United States
- Comprehensive list of American and British spelling differences