{"id":26235813,"url":"https://github.com/sub-dev/freecodecamp_american-british-english-translator","last_synced_at":"2026-04-27T14:30:59.831Z","repository":{"id":279477056,"uuid":"936791561","full_name":"Sub-Dev/freecodecamp_american-british-english-translator","owner":"Sub-Dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-25T18:47:39.000Z","size":132,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-29T14:15:31.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Sub-Dev.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-21T17:36:31.000Z","updated_at":"2025-02-25T18:47:43.000Z","dependencies_parsed_at":"2025-02-26T00:15:31.739Z","dependency_job_id":null,"html_url":"https://github.com/Sub-Dev/freecodecamp_american-british-english-translator","commit_stats":null,"previous_names":["sub-dev/freecodecamp_american-british-english-translator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sub-Dev/freecodecamp_american-british-english-translator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sub-Dev%2Ffreecodecamp_american-british-english-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sub-Dev%2Ffreecodecamp_american-british-english-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sub-Dev%2Ffreecodecamp_american-british-english-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sub-Dev%2Ffreecodecamp_american-british-english-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sub-Dev","download_url":"https://codeload.github.com/Sub-Dev/freecodecamp_american-british-english-translator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sub-Dev%2Ffreecodecamp_american-british-english-translator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32341447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-03-13T03:18:03.574Z","updated_at":"2026-04-27T14:30:59.825Z","avatar_url":"https://github.com/Sub-Dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗣️ American/British Translator\n\nConstrução de um aplicativo Full Stack JavaScript para tradução entre inglês americano e britânico, funcionalmente similar a este: [American British Translator](https://american-british-translator.freecodecamp.rocks/).\n\n## 📌 Tecnologias Utilizadas\n\n- ![Node.js](https://img.shields.io/badge/Node.js-339933?style=for-the-badge\u0026logo=node.js\u0026logoColor=white) **Node.js**\n- ![Express](https://img.shields.io/badge/Express-000000?style=for-the-badge\u0026logo=express\u0026logoColor=white) **Express.js**\n- ![Chai](https://img.shields.io/badge/Chai-A30701?style=for-the-badge\u0026logo=chai\u0026logoColor=white) **Chai.js**\n- ![Mocha](https://img.shields.io/badge/Mocha-8D6748?style=for-the-badge\u0026logo=mocha\u0026logoColor=white) **Mocha.js**\n\n## 🚀 Como executar o projeto\n\n### 1️⃣ Clonar o repositório\n\n```bash\ngit clone https://github.com/Sub-Dev/freecodecamp_american-british-english-translator\ncd freecodecamp_american-british-english-translator\n```\n\n### 2️⃣ Instalar dependências\n\n```bash\nnpm install\n\n```\n\n### 3️⃣ Configurar variáveis de ambiente\n\nCrie um arquivo `.env` na raiz do projeto e configure:\n\n```\nPORT=3000\nNODE_ENV=test\n```\n\n### 4️⃣ Rodar o servidor\n\n```bash\nnpm start\n```\n\n### 5️⃣ Executar testes\n\n```bash\nnpm run test\n```\n\n## 🛠️ Funcionalidades Implementadas\n\n### ✨ Endpoints da API\n\n`POST /api/translate`\n\nRecebe um objeto contendo:\n\n- **text: o texto a ser traduzido.**\n- **locale: a direção da tradução, que pode ser american-to-british ou british-to-american.**\n\nRetorna:\n\n- **Se algum campo estiver ausente: { error: 'Required field(s) missing' }**\n- **Se o texto for enviado mas estiver vazio (após remover espaços): { error: 'No text to translate' }**\n- **Se o campo locale tiver um valor inválido: { error: 'Invalid value for locale field' }**\n- **Caso contrário, retorna um objeto contendo o texto original e a tradução. As partes traduzidas são envolvidas por span class=\"highlight\"\u003e...\u003c/span. Se nenhuma tradução for necessária, retorna \"Everything looks good to me!\".**\n\n### ✅ Testes Implementados\n\n#### Testes de Unidade (24 casos):\n\n1. Translate \"Mangoes are my favorite fruit.\" to British English\n2. Translate \"I ate yogurt for breakfast.\" to British English\n3. Translate \"We had a party at my friend's condo.\" to British English\n4. Translate \"Can you toss this in the trashcan for me?\" to British English\n5. Translate \"The parking lot was full.\" to British English\n6. Translate \"Like a high tech Rube Goldberg machine.\" to British English\n7. Translate \"To play hooky means to skip class or work.\" to British English\n8. Translate \"No Mr. Bond, I expect you to die.\" to British English\n9. Translate \"Dr. Grosh will see you now.\" to British English\n10. Translate \"Lunch is at 12:15 today.\" to British English\n11. Translate \"We watched the footie match for a while.\" to American English\n12. Translate \"Paracetamol takes up to an hour to work.\" to American English\n13. Translate \"First, caramelise the onions.\" to American English\n14. Translate \"I spent the bank holiday at the funfair.\" to American English\n15. Translate \"I had a bicky then went to the chippy.\" to American English\n16. Translate \"I've just got bits and bobs in my bum bag.\" to American English\n17. Translate \"The car boot sale at Boxted Airfield was called off.\" to American English\n18. Translate \"Have you met Mrs Kalyani?\" to American English\n19. Translate \"Prof Joyner of King's College, London.\" to American English\n20. Translate \"Tea time is usually around 4 or 4.30.\" to American English\n21. Highlight translation in \"Mangoes are my favorite fruit.\"\n22. Highlight translation in \"I ate yogurt for breakfast.\"\n23. Highlight translation in \"We watched the footie match for a while.\"\n24. Highlight translation in \"Paracetamol takes up to an hour to work.\"\n\n#### Testes Funcionais:\n\n- Verificação de tradução com texto e locale válidos.\n- Retorno dos erros para campos faltantes, texto vazio ou locale inválido.\n\n## 🔗 Links Importantes\n\n- 📂 **Código-Fonte:** [GitHub Repo](https://github.com/Sub-Dev/freecodecamp_american-british-english-translator)\n\n---\n\n## 👥 Autor\n\n\u003ctable\u003e\n \u003ctr\u003e\n \u003ctd alinhar=\"centro\"\u003e\n \u003ca href=\"https://github.com/Sub-Dev\" target=\"_blank\"\u003e\n \u003cimg src=\"https://avatars.githubusercontent.com/u/68450692?v=4\" alt=\"Anthony-Marin\" height=\"30\" width=\"30\"/\u003e\n \u003c/a\u003e\n \u003c/td\u003e\n \u003ctd\u003e\n \u003cstrong\u003eAnthony Marin\u003c/strong\u003e (Sub-Dev) - \u003ca href=\"https://github.com/Sub-Dev\"\u003ePerfil no GitHub\u003c/a\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsub-dev%2Ffreecodecamp_american-british-english-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsub-dev%2Ffreecodecamp_american-british-english-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsub-dev%2Ffreecodecamp_american-british-english-translator/lists"}