FLUTTER ECOSYSTEM

MuwaffaqImam/bye-bye-localization

一个简单的 Text 小部件,可使用即时设备翻译 AI 模型将任何文本翻译成任何语言。您只需提供文本,该小部件就会自动进行翻译,因此您无需指定本地化文件或手动输入翻译。该小部件会为您完成所有工作。

再见-本地化 项目封面
Stars
6
Forks
3
最近推送(UTC)
2021年12月14日
项目状态
未归档
MuwaffaqImam GitHub avatar
GITHUB User

MuwaffaqImam ↗

语言DartHTMLRubySwiftKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 3 项
  • flutter{"sdk":"flutter"}
  • google_ml_kit^0.6.0
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

Bye Bye Localization 👋

Its just a simple Text widget that will provide automatic fast translation for any text. it supports 59 languages.

No more boring Localization configuration files, all you have to do is change your old Text() widget to TranslatedText() and enjoy the sweet sweet life without Localization

PS: the translation will be fast as it uses translation model deployed to the device under the hood.

Demo 📹

Demo

How to use ?

Step 1: All you have to do is call the widget

TranslatedText('your text')

Step2: don't forget to call init the widget using the Manager

 Future<bool> initWidget() async {
   return await TranslationManager().init(
     originLanguage: Languages.ENGLISH,
     translateToLanguage: Languages.ARABIC,
   );
 } 

Step 3: Buy me Coffee 🙂! ☕️

Buy Me a Coffee

coffee

Quick example ⚡️

Widget buildWidget(){
    return FutureBuilder(
      future: initTranslation(),
      builder: (context, snapshot) {
        if (snapshot.hasError) {
          return Text('${snapshot.error}');
        }
        if (snapshot.connectionState == ConnectionState.done) {
          return TranslatedText('I am a text that will be translated always');
        }
        return CircularProgressIndicator();
      },
    );
  }
  Future<bool> initWidget() async {
    return await TranslationManager().init(
      originLanguage: Languages.ENGLISH,
      /// Change here the language to change the translation, and re run.
      /// For example Languages.RUSSIAN.
      translateToLanguage: Languages.ARABIC,
    );
  }

Live Demo 🔆

below you will find a link to APK contains live demo

Download APK

Author ✍️

Muwaffaq Imam

  • Edu email : m.imam@innopolis.university
  • Telegram : moofiy