{"id":17100901,"url":"https://github.com/mityax/learning_translate","last_synced_at":"2025-07-24T08:36:55.008Z","repository":{"id":191639445,"uuid":"450585998","full_name":"mityax/learning_translate","owner":"mityax","description":"Flutter MLKit on-device translation","archived":false,"fork":false,"pushed_at":"2022-01-21T18:31:48.000Z","size":141,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-15T15:22:58.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mityax.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2022-01-21T17:43:51.000Z","updated_at":"2022-08-11T22:25:40.000Z","dependencies_parsed_at":"2023-08-30T22:35:55.757Z","dependency_job_id":null,"html_url":"https://github.com/mityax/learning_translate","commit_stats":null,"previous_names":["mityax/learning_translate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mityax%2Flearning_translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mityax%2Flearning_translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mityax%2Flearning_translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mityax%2Flearning_translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mityax","download_url":"https://codeload.github.com/mityax/learning_translate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227425168,"owners_count":17775426,"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":[],"created_at":"2024-10-14T15:23:01.225Z","updated_at":"2024-11-30T20:25:08.211Z","avatar_url":"https://github.com/mityax.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ML Translate\n\nThe easy way to use ML Kit for on-device text translation in Flutter. With ML Kit's on-device Translation, you can dynamically translate text between more than 50 languages.\n\n\u003cimg src=\"https://github.com/salkuadrat/learning/raw/master/packages/learning_translate/screenshot.jpg\" alt=\"universe\" width=\"280\"\u003e\n\n## Limitations\n\nOn-device translation is intended for casual and simple translations. The translation quality depends on the source and target languages. We recommend that you evaluate the quality of the translations for your specific use case. \n\nAlso, ML Kit's translation models are trained to translate to and from English. When you translate between non-English languages, English is used as an intermediate translation, which can affect quality.\n\n## Getting Started\n\nAdd dependency to your flutter project:\n\n```\n$ flutter pub add learning_translate\n```\n\nor\n\n```yaml\ndependencies:\n  learning_translate: ^0.0.3+1\n```\n\nThen run `flutter pub get`.\n\n## Usage\n\n```\nimport 'package:learning_translate/learning_translate.dart';\n```\n\n### Translate Text\n\n```dart\nString text = 'Baby, you light up my world like nobody else';\nTranslator translator = Translator(from: ENGLISH, to: INDONESIAN);\nString translatedText = await translator.translate(text);\nprint(translatedText);\n```\n\n### Dispose\n\n```dart\ntranslator.dispose();\n```\n\n### Translation Model Management\n\nWhen we translate text using `Translator`, ML Kit automatically downloads language-specific translation models to the device. But we can explicitly manage the translation models to be available on the device by using `TranslationModelManager`. This can be useful if you want to prepare the models ahead of time, or delete unnecessary models from the device.\n\nGet list of downloaded translation models.\n\n```dart\nList\u003cString\u003e models = await TranslationModelManager.list();\nprint(models);\n```\n\nDownload a translation model.\n\n```dart\nawait TranslationModelManager.download(KOREAN);\n```\n\nCheck availability of a translation model (downloaded or not).\n\n```dart\n// exist will true if the model is already downloaded before\nbool isDownloaded = await TranslationModelManager.check(KOREAN);\nprint('Is model downloaded: $isDownloaded');  \n```\n\nDelete a translation model.\n\n```dart\nawait TranslationModelManager.delete(KOREAN);\n```\n\n### Supported Languages\n\nHere is language model variables you can use in learning_translate.\n\n```dart\nconst AFRIKAANS = \"af\";\nconst ALBANIAN = \"sq\";\nconst ARABIC = \"ar\";\nconst BELARUSIAN = \"be\";\nconst BENGALI = \"bn\";\nconst BULGARIAN = \"bg\";\nconst CATALAN = \"ca\";\nconst CHINESE = \"zh\";\nconst CROATIAN = \"hr\";\nconst CZECH = \"cs\";\nconst DANISH = \"da\";\nconst DUTCH = \"nl\";\nconst ENGLISH = \"en\";\nconst ESPERANTO = \"eo\";\nconst ESTONIAN = \"et\";\nconst FINNISH = \"fi\";\nconst FRENCH = \"fr\";\nconst GALICIAN = \"gl\";\nconst GEORGIAN = \"ka\";\nconst GERMAN = \"de\";\nconst GREEK = \"el\";\nconst GUJARATI = \"gu\";\nconst HAITIAN_CREOLE = \"ht\";\nconst HEBREW = \"he\";\nconst HINDI = \"hi\";\nconst HUNGARIAN = \"hu\";\nconst ICELANDIC = \"is\";\nconst INDONESIAN = \"id\";\nconst IRISH = \"ga\";\nconst ITALIAN = \"it\";\nconst JAPANESE = \"ja\";\nconst KANNADA = \"kn\";\nconst KOREAN = \"ko\";\nconst LATVIAN = \"lv\";\nconst LITHUANIAN = \"lt\";\nconst MACEDONIAN = \"mk\";\nconst MALAY = \"ms\";\nconst MALTESE = \"mt\";\nconst MARATHI = \"mr\";\nconst NORWEGIAN = \"no\";\nconst PERSIAN = \"fa\";\nconst POLISH = \"pl\";\nconst PORTUGUESE = \"pt\";\nconst ROMANIAN = \"ro\";\nconst RUSSIAN = \"ru\";\nconst SLOVAK = \"sk\";\nconst SLOVENIAN = \"sl\";\nconst SPANISH = \"es\";\nconst SWAHILI = \"sw\";\nconst SWEDISH = \"sv\";\nconst TAGALOG = \"tl\";\nconst TAMIL = \"ta\";\nconst TELUGU = \"te\";\nconst THAI = \"th\";\nconst TURKISH = \"tr\";\nconst UKRAINIAN = \"uk\";\nconst URDU = \"ur\";\nconst VIETNAMESE = \"vi\";\nconst WELSH = \"cy\";\n```\n\n## Example Project\n\nYou can learn more from example project [here](example).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmityax%2Flearning_translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmityax%2Flearning_translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmityax%2Flearning_translate/lists"}