{"id":28974838,"url":"https://github.com/plcoster/fcc_qa_project5","last_synced_at":"2026-05-19T09:02:32.766Z","repository":{"id":299016101,"uuid":"536269044","full_name":"PLCoster/fcc_qa_project5","owner":"PLCoster","description":"FreeCodeCamp Quality Assurance Project 5: American-British Translator","archived":false,"fork":false,"pushed_at":"2022-09-13T22:23:19.000Z","size":322,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T14:16:51.165Z","etag":null,"topics":["express","mocha-chai"],"latest_commit_sha":null,"homepage":"https://fcc-qa-project5.plcoster.repl.co/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PLCoster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-13T18:56:18.000Z","updated_at":"2022-09-13T19:25:52.000Z","dependencies_parsed_at":"2025-06-14T06:33:01.513Z","dependency_job_id":"226b50a9-e868-4cae-b79d-517473e7779b","html_url":"https://github.com/PLCoster/fcc_qa_project5","commit_stats":null,"previous_names":["plcoster/fcc_qa_project5"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PLCoster/fcc_qa_project5","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PLCoster","download_url":"https://codeload.github.com/PLCoster/fcc_qa_project5/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_qa_project5/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33209406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T07:54:09.561Z","status":"ssl_error","status_checked_at":"2026-05-19T07:54:08.508Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","mocha-chai"],"created_at":"2025-06-24T12:07:08.226Z","updated_at":"2026-05-19T09:02:32.733Z","avatar_url":"https://github.com/PLCoster.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Free Code Camp: Quality Assurance Project 5 - American British Translator\n\n## American-British English Translator\n\nThe aim of this project was to build a small web app with functionality similar to: https://american-british-translator.freecodecamp.rocks/\n\nThe project was built using the following technologies:\n\n- **HTML**\n- **JavaScript** with **[Node.js](https://nodejs.org/en/) / [NPM](https://www.npmjs.com/)** for package management.\n- **[Express](https://expressjs.com/)** web framework to build the web API.\n- **[Bootstrap](https://getbootstrap.com/)** for styling with some custom **CSS**.\n- **[FontAwesome](https://fontawesome.com/)** for icons.\n- **[Mocha](https://mochajs.org/)** test framework with **[Chai](https://www.chaijs.com/)** assertions for testing.\n- **[nodemon](https://nodemon.io/)** for automatic restarting of server during development.\n\n### Project Requirements\n\n- **User Story #1:** You can `POST` to `/api/translate` with a body containing `text` with the text to translate and `locale` with either `american-to-british` or `british-to-american`. The returned object should contain the submitted `text` and `translation` with the translated text.\n- **User Story #2:** The `/api/translate` route 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. The `span` element should wrap the entire time string, i.e. `\u003cspan class=\"highlight\"\u003e10:30\u003c/span\u003e`.\n- **User Story #3:** The `/api/translate` route 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.\n- **User Story #4:** Wrap any translated spelling or terms with `\u003cspan class=\"highlight\"\u003e...\u003c/span\u003e` tags so they appear in green.\n- **User Story #5:** If one or more of the required fields is missing, return `{ error: 'Required field(s) missing' }`.\n- **User Story #6:** If `text` is empty, return `{ error: 'No text to translate' }`\n- **User Story #7:** If `locale` does not match one of the two specified locales, return `{ error: 'Invalid value for locale field' }`.\n- **User Story #8:** If `text` requires no translation, return `\"Everything looks good to me!\"` for the translation value.\n- **User Story #9:** All of the 24 following unit tests are complete and passing for Translator.translate:\n\n  - Translator.translate returns correct plaintext translation of `Mangoes are my favorite fruit.` to British English\n  - Translator.translate returns correct plaintext translation of `I ate yogurt for breakfast.` to British English\n  - Translator.translate returns correct plaintext translation of `We had a party at my friend's condo.` to British English\n  - Translator.translate returns correct plaintext translation of `Can you toss this in the trashcan for me?` to British English\n  - Translator.translate returns correct plaintext translation of `The parking lot was full.` to British English\n  - Translator.translate returns correct plaintext translation of `Like a high tech Rube Goldberg machine.` to British English\n  - Translator.translate returns correct plaintext translation of `To play hooky means to skip class or work.` to British English\n  - Translator.translate returns correct plaintext translation of `No Mr. Bond, I expect you to die.` to British English\n  - Translator.translate returns correct plaintext translation of `Dr. Grosh will see you now.` to British English\n  - Translator.translate returns correct plaintext translation of `Lunch is at 12:15 today.` to British English\n  - Translator.translate returns correct plaintext translation of `We watched the footie match for a while.` to American English\n  - Translator.translate returns correct plaintext translation of `Paracetamol takes up to an hour to work.` to American English\n  - Translator.translate returns correct plaintext translation of `First, caramelise the onions.` to American English\n  - Translator.translate returns correct plaintext translation of `I spent the bank holiday at the funfair.` to American English\n  - Translator.translate returns correct plaintext translation of `I had a bicky then went to the chippy.` to American English\n  - Translator.translate returns correct plaintext translation of `I've just got bits and bobs in my bum bag.` to American English\n  - Translator.translate returns correct plaintext translation of `The car boot sale at Boxted Airfield was called off.` to American English\n  - Translator.translate returns correct plaintext translation of `Have you met Mrs Kalyani?` to American English\n  - Translator.translate returns correct plaintext translation of `Prof Joyner of King's College, London.` to American English\n  - Translator.translate returns correct plaintext translation of `Tea time is usually around 4 or 4.30.` to American English\n  - Translator.translate returns correctly highlighted translation of `Mangoes are my favorite fruit.`\n  - Translator.translate returns correctly highlighted translation of `I ate yogurt for breakfast.`\n  - Translator.translate returns correctly highlighted translation of `We watched the footie match for a while.`\n  - Translator.translate returns correctly highlighted translation of `Paracetamol takes up to an hour to work.`\n\n- **User Story #10:** All of the 6 following following functional tests for API routes are complete and passing:\n  - Translation with text and locale fields: `POST` request to `/api/translate`\n  - Translation with text and invalid locale field: `POST` request to `/api/translate`\n  - Translation with missing text field: `POST` request to `/api/translate`\n  - Translation with missing locale field: `POST` request to `/api/translate`\n  - Translation with empty text: `POST` request to `/api/translate`\n  - Translation with text that needs no translation: `POST` request to `/api/translate`\n\n### Project Writeup\n\nThe fifth Free Code Camp: Quality Assurance Project is an American/British English Translator App and API. Users can:\n\n- Request the translation of a text from American to British English (or vice-versa) by submitting the form on the app homepage, or by sending a POST request to `/api/solve` with a body containing url encoded fields of `text` (the sentence to be translated) and `locale` (the type of translation to perform, `'american-to-british'` or `'british-to-american'`).\n\nTwo test suites have been written for the app:\n\n- `tests/1_unit-tests.js` contains unit tests for the `Translator` class.\n- `tests/2_functional-tests.js` contains functional tests of the application API route (`/api/translate`) with a variety of valid and invalid inputs.\n\n### Project Files\n\n- `server.js` - the main entry point of the application, an express web server handling the routes defined in the specification.\n\n- `/routes/api.js` - contains the major API route for the express web app.\n\n- `/components` - contains the `Translator` class with methods to aid translating text, as well as several dictionary files containing keys of words in one language and corresponding values of their translation.\n\n- `public/` - contains static files for the web app (stylesheet, logo, favicons etc), served by express using `express.static()`.\n\n  - `index.js` contains functions for handling updates to the UI view of the app, and is loaded by `index.html`.\n\n- `views/` - contains the single html page for the web app, `index.html`, which is served by express on `GET` requests to `/`\n\n- `tests/` - contains the test suite for the application.\n\n### Usage:\n\nRequires Node.js / NPM in order to install required packages. After downloading the repo, install required dependencies with:\n\n`npm install`\n\nA development mode (with auto server restart on file save), can be started with:\n\n`npm run dev`\n\nThe application can then be viewed at `http://localhost:3000/` in the browser.\n\nTo start the server without auto-restart on file save:\n\n`npm start`\n\n# American British Translator BoilerPlate\n\nThe initial boilerplate for this app can be found at https://github.com/freeCodeCamp/boilerplate-project-american-british-english-translator/\n\nInstructions for building the project can be found at https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-projects/american-british-translator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplcoster%2Ffcc_qa_project5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplcoster%2Ffcc_qa_project5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplcoster%2Ffcc_qa_project5/lists"}