{"id":13454198,"url":"https://github.com/niedev/RTranslator","last_synced_at":"2025-03-24T05:33:39.577Z","repository":{"id":200309181,"uuid":"251396732","full_name":"niedev/RTranslator","owner":"niedev","description":"Open source real-time translation app for Android that runs locally","archived":false,"fork":false,"pushed_at":"2025-01-12T13:03:40.000Z","size":27197,"stargazers_count":7447,"open_issues_count":17,"forks_count":579,"subscribers_count":54,"default_branch":"v2.00","last_synced_at":"2025-03-18T20:08:19.207Z","etag":null,"topics":["android","android-app","bluetooth-le","mobile-app","nllb","offline","onnx","onnxruntime","realtime-translator","sentencepiece","transformers","translation","translator","whisper"],"latest_commit_sha":null,"homepage":"","language":"C++","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/niedev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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":"2020-03-30T18:40:55.000Z","updated_at":"2025-03-18T07:22:14.000Z","dependencies_parsed_at":"2024-12-10T03:04:27.551Z","dependency_job_id":"670f721c-c0de-425e-b276-a8d55464d8d3","html_url":"https://github.com/niedev/RTranslator","commit_stats":{"total_commits":237,"total_committers":12,"mean_commits":19.75,"dds":0.4978902953586498,"last_synced_commit":"8a944b77719512e6456a6ca6f43b88fe6a11f761"},"previous_names":["niedev/rtranslator"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niedev%2FRTranslator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niedev%2FRTranslator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niedev%2FRTranslator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niedev%2FRTranslator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niedev","download_url":"https://codeload.github.com/niedev/RTranslator/tar.gz/refs/heads/v2.00","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217401,"owners_count":20579291,"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":["android","android-app","bluetooth-le","mobile-app","nllb","offline","onnx","onnxruntime","realtime-translator","sentencepiece","transformers","translation","translator","whisper"],"created_at":"2024-07-31T08:00:51.778Z","updated_at":"2025-03-24T05:33:39.549Z","avatar_url":"https://github.com/niedev.png","language":"C++","funding_links":["https://ko-fi.com/niedev","https://www.paypal.com/donate/?business=3VBKS3WC6AFHN\u0026no_recurring=0\u0026currency_code=EUR'"],"categories":["C++","Communication","精选文章","工具程式","Repos","🖥 Desktop apps for translation management","Apps","By Platform"],"sub_categories":["Other","翻译工具","Python","Automated translation","Android"],"readme":"\u003cimg src=\"https://github.com/niedev/RTranslator/blob/v2.00/images/logo_beta_cut.png\" width=\"280\"\u003e\n\nRTranslator is an (\u003ca href='https://github.com/niedev/RTranslator?tab=readme-ov-file#libraries-and-models'\u003ealmost\u003c/a\u003e) open-source, free, and offline real-time translation app for Android.\n\nConnect to someone who has the app, connect Bluetooth headphones, put the phone in your pocket and you can have a conversation as if the other person spoke your language.\n\u003cbr /\u003e\u003cbr /\u003e\n\n![Conversation mode](https://github.com/niedev/RTranslator/blob/v2.00/images/Conversation_image.png)\n\u003cbr /\u003e\u003cbr /\u003e\n![WalkieTalkie mode and Costs](https://github.com/niedev/RTranslator/blob/v2.00/images/TextTranslation_and_WalkieTalkie.png)\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003eConversation mode\u003c/h3\u003e\n\nThe Conversation mode is the main feature of RTranslator. In this mode, you can connect with another phone that uses this app. If the user accepts your connection request:\n\n- When you talk, your phone (or the **Bluetooth headset**, if connected) will capture the audio.\n\n- The audio captured will be converted into text and sent to the interlocutor's phone.\n\n- The interlocutors' phone will translate the text received into his language.\n\n- The interlocutors' phone will convert the translated text into audio and will reproduce it from its speaker (or by the Bluetooth headset of the interlocutor if connected to his phone). \n\nAll this in both directions.\n\nEach user can have more than one connected phone so that you can translate conversations between more than two people and in any combination.\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003eWalkieTalkie mode\u003c/h3\u003e\n\nIf conversation mode is useful for having a long conversation with someone, this mode instead is designed for quick conversations, such as asking for information on the street or talking to a shop assistant.\n\nThis mode only translates conversations between two people, it doesn't work with Bluetooth headsets, and you have to talk in turns. It's not a real simultaneous translation, but it can work with **only one phone**.\n\nIn this mode, the smartphone microphone will listen in two languages (selectable in the same screen of the walkie talkie mode) simultaneously. \u003cbr /\u003e\nThe app will detect in which language the interlocutor is speaking, translate the audio into the other language, convert the text into audio, and then reproduce it from the phone speaker. When the TTS has finished, it will automatically resume listening.\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003eText translation mode\u003c/h3\u003e\n\nThis mode is just a classic text translator, but always useful.\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003eGeneral\u003c/h3\u003e\n\nRTranslator uses \u003ca href=\"https://ai.meta.com/research/no-language-left-behind/\"\u003eMeta\\'s NLLB\u003c/a\u003e for translation and \u003ca href=\"https://openai.com/index/whisper/\"\u003eOpenAi\\'s Whisper\u003c/a\u003e for speech recognition, both are (\u003ca href='https://github.com/niedev/RTranslator?tab=readme-ov-file#libraries-and-models'\u003ealmost\u003c/a\u003e) open-source and state of the art AIs, have excellent quality and run directly on the phone, ensuring absolute privacy and the possibility of using RTranslator even offline without loss of quality.\n\nAlso, RTranslator works even in the background, with the phone on standby or when using other apps (only when you use Conversation or WalkieTalkie modes). However, some phones limit the power in the background so in that case it is better to avoid it and keep the app open with the screen on.\n\u003cbr /\u003e\n\n\u003ca href=\"https://www.producthunt.com/posts/rtranslator-2?embed=true\u0026utm_source=badge-featured\u0026utm_medium=badge\u0026utm_souce=badge-rtranslator\u0026#0045;2\" target=\"_blank\"\u003e\u003cimg src=\"https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=487672\u0026theme=light\" alt=\"RTranslator - Open\u0026#0045;source\u0026#0032;and\u0026#0032;offline\u0026#0032;simultaneous\u0026#0032;translator\u0026#0032;for\u0026#0032;Android | Product Hunt\" style=\"width: 250px; height: 54px;\" width=\"250\" height=\"54\" /\u003e\u003c/a\u003e\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003eDownload\u003c/h3\u003e\n\nTo install the app, download the latest version of the app apk file from https://github.com/niedev/RTranslator/releases/ and install it (ignore the other files, those will be downloaded automatically by the app on the first start).\n\n\u003ca href='https://github.com/niedev/RTranslator/releases'\u003e\u003cimg alt='Get it on GitHub' src='https://github.com/niedev/RTranslator/blob/v2.00/images/get_it_on_github.png' style=\"width: 180px; height: 58px;\" /\u003e\u003c/a\u003e\n\nOn the first launch, RTranslator will automatically download the models for translation and speech recognition (1.2GB) and once done you can start translating.\n\nThe initial download will get the models from GitHub, however \u003ca href=\"https://www.reddit.com/r/China/comments/v8fv0p/why_is_github_so_slow_in_china_recently/\"\u003ein some regions GitHub is very slow\u003c/a\u003e, those who have problems of this kind can download the models separately from a computer (or in general in whatever way they prefer) and insert them manually into the app following \u003ca href=\"https://github.com/niedev/RTranslator/blob/v2.00/Sideloading.md\"\u003ethis guide\u003c/a\u003e.\n\nIf you have a GitHub account and want to be notified when a new release comes out you can do so by clicking, at the top of the page, on \"Watch\" -\u003e \"Custom\" -\u003e \"Releases\" -\u003e \"Apply\".\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003eWhat's new in version 2.1\u003c/h3\u003e\n\n- **New GUI!** Designed by [Chiara Chindamo](https://www.linkedin.com/in/chiara-chindamo-946053234/).\n\n- Added speak and copy buttons to the text translation mode.\n\n- Added the option to manually control the mics in WalkieTalkie mode.\n\n- Added the option to use low-quality languages.\n\n- Fixed some bugs.\n\nFor the full list of changes see [here](https://github.com/niedev/RTranslator/releases/tag/2.1.0).\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003ePerformance requirements\u003c/h3\u003e\n\nI have optimized the AI models a lot to minimize RAM consumption and execution time, despite this however to be able to use the app without the risk of crashing you need a phone with at least **6GB of RAM**, and to have a good enough execution time you need a phone with a fast enough CPU.\n\nIf you have a pretty crappy phone (or if you want maximum speed) you can always use \u003ca href=\"https://github.com/niedev/RTranslator/tree/v1.00\"\u003eversion 1.0 of RTranslator\u003c/a\u003e (but since it uses Google APIs it's not free and needs some initial setup).\n\u003cbr /\u003e\u003cbr /\u003e\n\n\n\u003ch3\u003eSupported languages\u003c/h3\u003e\n\nThe languages supported are as follows:\n\nArabic, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Finnish, French, Galician,  German, Greek, Italian, Japanese, Korean, Macedonian, Polish, Portuguese, Romanian, Russian, Slovak, Spanish, Swedish, Tamil, Thai, Turkish, Ukrainian, Urdu, Vietnamese.\n\u003cbr /\u003e\u003cbr /\u003e\nIf your language is not on the list, from version 2.1 of RTranslator you can go into the settings and enable \"**Support low quality languages**\" to add the following languages (which have lower quality for translation and speech recognition):\n\nAfrikaans, Akan (only text), Amharic, Assamese, Bambara (only text), Bangla, Bashkir, Basque, Belarusian, Bosnian, Dzongkha (only text), Esperanto (only text), Estonian, Ewe (only text), Faroese, Fijian (only text), Georgian, Guarani (only text), Gujarati, Hausa, Hebrew, Hindi, Hungarian, Irish (only text), Javanese (only text), Kannada, Kashmiri (only text), Kazakh, Kikuyu (only text), Kinyarwanda (only text), Korean, Kyrgyz (only text), Lao, Limburghish (only text), Lingala, Lithuanian, Luxembourghish, Macedonian, Tagalog (only text), Tibetan.\n\u003cbr /\u003e\u003cbr /\u003e\n\n\n\u003ch3\u003eText To Speech\u003c/h3\u003e\n\nTo speak, RTranslator uses the system TTS of your phone, so the quality of the latter and the supported languages ​​depend on the system TTS of your phone.\n\nThe supported languages ​​seen above are all compatible with \u003ca href=\"https://play.google.com/store/apps/details?id=com.google.android.tts\u0026pcampaignid=web_share\"\u003eGoogle TTS\u003c/a\u003e, which is the recommended TTS (although you can use the TTS you want).\n\nTo change the system TTS (and therefore the TTS used by RTranslator), download the TTS you want to use from the Play Store, or from the source you prefer, and open RTranslator, then open its settings (top right) and, in the \"Output\" section, click on \"Text to Speech\", at this point the system settings will open in the section where you can select the preferred system TTS engine (among those installed), at this point, if you have changed the preferred engine, restart RTranslator to apply the changes.\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003ePrivacy\u003c/h3\u003e\n\nPrivacy is a fundamental right. That's why RTranslator does not collect any personal data (I don't even have a server). For more information, read the \u003ca href=\"https://github.com/niedev/RTranslator/blob/v2.00/privacy/Privacy_Policy_en.md\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eprivacy policy\u003c/a\u003e (for now is the same privacy policy of RTranslator 1.0, but I will update it in the future).\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003eLibraries and models\u003c/h3\u003e\n\nRTranslator code is completely open-source, but some of the external libraries it uses have less permissive licenses, these are all the external libraries used by the app (with the indication of their license):\n\n\u003ca href=\"https://github.com/niedev/BluetoothCommunicator\"\u003eBluetoothCommunicator\u003c/a\u003e (open-source): Used for Bluetooth LE communication between devices.\n\n\u003ca href=\"https://github.com/niedev/GalleryImageSelector\"\u003eGalleryImageSelector\u003c/a\u003e (open-source): Used for selecting and cropping the profile image from the gallery.\n\n[OnnxRuntime](https://github.com/microsoft/onnxruntime) (open-source): Used as an accelerator engine for the AI models.\n\n\u003ca href=\"https://github.com/google/sentencepiece\"\u003eSentencePiece\u003c/a\u003e (open-source): Used for tokenization of the input text for NLLB.\n\n\u003ca href=\"https://developers.google.com/ml-kit/language/identification\"\u003eMl Kit\u003c/a\u003e (closed-source): Used for the identification of the language in the WalkieTalkie mode.\n\u003cbr /\u003e\u003cbr /\u003e\nAnd the following AI models:\n\n\u003ca href=\"https://github.com/facebookresearch/fairseq/tree/nllb\"\u003eNLLB\u003c/a\u003e (open-source, but only for non-commercial use): The model used is NLLB-Distilled-600M with KV cache.\n\n\u003ca href=\"https://github.com/openai/whisper\"\u003eWhisper\u003c/a\u003e (open-source): The model used is Whisper-Small-244M with KV cache.\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003ePerformance of the models\u003c/h3\u003e\n\nI converted both NLLB and Whisper to onnx format and quantized them in int8 (excluding some weights to ensure almost zero quality loss), I also separated some parts of the models to reduce RAM consumption (without this separation some weights were duplicated at runtime consuming more RAM than expected) and done other optimizations to reduce execution time.\n\nHere are the results of my optimizations:\n\n|         | normal NLLB onnx model \u003cbr /\u003e(full int8, no kv-cache)  | RTranslator NLLB onnx model \u003cbr /\u003e (partial int8, with kv-cache, separated parts)  |\n|---------| ------------------------------------------- | ---------------------------------------------------------- |\n|RAM Consumption| 2.5 GB  | 1.3GB \u0026nbsp;\u0026nbsp;(1.9x improvement)  |\n|Execution time for 75 tokens| 8s  | 2s \u0026nbsp;\u0026nbsp;(4x improvement)  |\n\n|         | Whisper onnx model optimized with [Olive](https://github.com/microsoft/Olive) \u003cbr /\u003e (full int8, with kv-cache)  | RTranslator Whisper onnx model \u003cbr /\u003e (partial int8, with kv-cache, separated parts)  |\n|---------| -------------------------------------------------------------- | ------------------------------------------------------------- |\n|RAM Consumption| 1.4 GB  | 0.9 GB \u0026nbsp;\u0026nbsp;(1.5x improvement)|\n|Execution time for 11s audio| 1.9s  | 1.6s \u0026nbsp;\u0026nbsp;(1.2x improvement)|\n\n**N.B.** RTranslator Whisper model can also consume 0.5 GB of RAM but with an execution time of 2.1s (this mode is used for phones with less than 8 GB of RAM)\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003eDonations\u003c/h3\u003e\n\nThis is an open-source and completely ad-free app, I don't make any money from it.\n\nSo, if you like the app and want to say thank you and support the project, you can make a donation by clicking on one of the the buttons below (any amount is well accepted).\n\n[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/niedev)\n\n\u003ca href='https://www.paypal.com/donate/?business=3VBKS3WC6AFHN\u0026no_recurring=0\u0026currency_code=EUR'\u003e\u003cimg alt='Donate' src='https://raw.githubusercontent.com/niedev/RTranslator/v2.00/images/Paypal.png' style=\"width: 190px; height: 80px;\" /\u003e\u003c/a\u003e\n\nIn case you will donate, or just live a star, thank you :heart:\n\u003cbr /\u003e\u003cbr /\u003e\n\n\u003ch3\u003eBugs and problems\u003c/h3\u003e\nI remind you that the app is still in beta. The bugs found are the following:\n\n- Sometimes the Bluetooth connection drops.\n\nIf you have found any bug please report it by opening an issue, or by writing an email to contact.niedev@gmail.com\n\u003cbr /\u003e\u003cbr /\u003e\n\nEnjoy your simultaneous translator.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniedev%2FRTranslator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniedev%2FRTranslator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniedev%2FRTranslator/lists"}