Code Monkey home page Code Monkey logo

fcc-american-british-translator's Introduction

freeCodeCamp - Quality Assurance 5: American / British English Translator

Run on Repl.it

User stories:

  1. I can enter a simple sentence into the text area and select whether to translate to British or American English from the dropdown menu.
  2. When the "Translate" button is pressed, append the translated sentence to the translated-sentence div. See the JavaScript files in /public for the different spelling and terms your application should translate.
  3. Your application should handle the way time is written in American and British English. For example, ten thirty is written as "10.30" in British English and "10:30" in American English.
  4. Your application should also handle the way titles/honorifics are abbreviated in American and British English. For example, Doctor Wright is abbreviated as "Dr Wright" in British English and "Dr. Wright" in American English. See /public/american-to-british-titles.js for the different titles your application should handle.
  5. Wrap any translated spelling or terms with <span class="highlight">...</span> tags so they appear in green.
  6. If the sentence in the text area has no spelling or terms that should be translated, append the message "Everything looks good to me!" to the translated-sentence div.
  7. If there is no text in the text area, append the message "Error: No text to translate." to the error-msg div so the text appears in red.
  8. I can press the "Clear Input" button to remove all text from the text area and the translated-sentence div.
  9. All 20 unit tests are complete and passing. See /tests/1_unit-tests.js for the sentences you should write tests for.
  10. All 4 functional tests are complete and passing. See /tests/2_functional-tests.js for the functionality you should write tests for.

Testing and additional notes

  • All logic can go into public/translator.js.
  • Create all of the unit/functional tests in tests/1_unit-tests.js and tests/2_functional-tests.js.
  • To run the tests on Repl.it, set NODE_ENV to test without quotes in the .env file.
  • To run the tests in the console, use the command npm run test. To open the Repl.it console, press Ctrl+Shift+P (Cmd if on a Mac) and type "open shell".

fcc-american-british-translator's People

Contributors

benmepham avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.