{"id":18035492,"url":"https://github.com/nstechbytes/mini-translator","last_synced_at":"2026-04-09T08:44:36.265Z","repository":{"id":260100551,"uuid":"871837683","full_name":"NSTechBytes/Mini-Translator","owner":"NSTechBytes","description":"**Mini Translator** is a Chrome extension that allows users to translate selected text on a webpage to their desired language and listen to the translated text via text-to-speech. It also provides a popup interface for manual text input translation.","archived":false,"fork":false,"pushed_at":"2024-10-13T04:48:39.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T07:45:19.678Z","etag":null,"topics":["chrome","chrome-extensions","css","extension","html","js","translator"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NSTechBytes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-10-13T04:40:15.000Z","updated_at":"2024-10-13T04:49:11.000Z","dependencies_parsed_at":"2024-10-29T15:09:42.004Z","dependency_job_id":null,"html_url":"https://github.com/NSTechBytes/Mini-Translator","commit_stats":null,"previous_names":["nstechbytes/mini-translator"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSTechBytes%2FMini-Translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSTechBytes%2FMini-Translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSTechBytes%2FMini-Translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSTechBytes%2FMini-Translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NSTechBytes","download_url":"https://codeload.github.com/NSTechBytes/Mini-Translator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247263445,"owners_count":20910406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["chrome","chrome-extensions","css","extension","html","js","translator"],"created_at":"2024-10-30T12:07:44.686Z","updated_at":"2026-04-09T08:44:36.215Z","avatar_url":"https://github.com/NSTechBytes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mini Translator\n\n**Mini Translator** is a Chrome extension that allows users to translate selected text on a webpage to their desired language and listen to the translated text via text-to-speech. It also provides a popup interface for manual text input translation.\n\n## Features\n\n- **Context Menu Translation**: Right-click on selected text and translate it into a chosen language.\n- **Popup Translation**: Manually input text in the popup and get an instant translation.\n- **Text-to-Speech**: Listen to the translated text with a voice that matches the target language.\n- **Language Selection**: Choose from various languages, and the extension will remember your choice.\n  \n## Installation\n\n1. Clone or download this repository:\n   ```bash\n   git clone https://github.com/NSTechBytes/Mini-Translator.git\n   ```\n   \n2. Open Chrome and go to `chrome://extensions/`.\n\n3. Enable **Developer mode** (toggle in the top-right corner).\n\n4. Click on **Load unpacked** and select the folder where you cloned/downloaded the repository.\n\n5. The extension will now be available in your Chrome toolbar.\n\n## Usage\n\n### 1. Translate Selected Text (Context Menu)\n- Select text on any webpage.\n- Right-click and choose \"Translate '%selected_text%'\" from the context menu.\n- The translation will be shown in the popup.\n\n### 2. Popup Translation\n- Click the Mini Translator icon in the Chrome toolbar.\n- Select your preferred target language from the dropdown menu.\n- Enter the text you want to translate and click the \"Translate\" button.\n- The translated text will be displayed, and you can click the \"Text-to-Speech\" button to listen to the translation.\n\n### 3. Text-to-Speech\n- After translation, click the **TTS** button to hear the translated text in the target language’s voice.\n\n## Screenshots\n![Extension Preview Light Mode]\n*Light mode view with media controls.*![Light](https://github.com/NSTechBytes/Projects-Templates/blob/main/Extensions/Mini%20Translator/Light.png)\n\n\n![Extension Preview Dark Mode]\n*Dark mode view with media controls.*![Dark](https://github.com/NSTechBytes/Projects-Templates/blob/main/Extensions/Mini%20Translator/Dark.png)\n\n\n\n\n## Code Overview\n\n### Manifest (`manifest.json`)\n\nThe manifest configures the extension by defining permissions, background scripts, action icons, and default popup:\n\n```json\n{\n  \"manifest_version\": 3,\n  \"name\": \"Mini Translator\",\n  \"version\": \"1.0\",\n  \"description\": \"Translate selected text and listen to the translation.\",\n  \"permissions\": [\n    \"contextMenus\",\n    \"storage\",\n    \"activeTab\",\n    \"scripting\"\n  ],\n  \"background\": {\n    \"service_worker\": \"background.js\"\n  },\n  \"action\": {\n    \"default_popup\": \"popup.html\",\n    \"default_icon\": \"icon.png\"\n  }\n}\n```\n\n### Background Script (`background.js`)\n\nThe background script listens for context menu clicks and performs the translation using the Google Translate API.\n\n```javascript\nchrome.contextMenus.create({\n    id: \"translateText\",\n    title: \"Translate '%s'\",\n    contexts: [\"selection\"]\n});\n\nchrome.contextMenus.onClicked.addListener((info, tab) =\u003e {\n    // Handle translation logic\n});\n```\n\n### Popup Script (`popup.js`)\n\nThe popup script handles text input translation and text-to-speech functionality.\n\n```javascript\ndocument.getElementById('translateBtn').addEventListener('click', () =\u003e {\n    // Handle translation and display in popup\n});\n```\n\n## Development\n\n### Prerequisites\n\n- [Google Chrome](https://www.google.com/chrome/)\n- Basic knowledge of JavaScript, HTML, and Chrome Extensions\n\n### Running the Project Locally\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/NSTechBytes/Mini-Translator.git\n   ```\n\n2. Load the extension in **Developer Mode** as described in the Installation section.\n\n### Files and Folders\n\n- **manifest.json**: Defines the extension's metadata.\n- **background.js**: Contains logic for the background service worker.\n- **popup.html**: The HTML structure for the popup UI.\n- **popup.js**: JavaScript for handling translations and interactions in the popup.\n- **styles.css**: Styles for the popup interface.\n\n## Known Issues\n\n- Some languages may not support text-to-speech (TTS).\n- Occasionally, the Google Translate API might limit requests if the quota is exceeded.\n\n## Contributing\n\nContributions are welcome! If you have suggestions or encounter issues, feel free to submit a pull request or open an issue.\n\n## License\n\nThis project is licensed under the Appache License. See the [LICENSE](LICENSE) file for more details.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnstechbytes%2Fmini-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnstechbytes%2Fmini-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnstechbytes%2Fmini-translator/lists"}