auto_app_translate 0.1.3 copy "auto_app_translate: ^0.1.3" to clipboard
auto_app_translate: ^0.1.3 copied to clipboard

It is a library that translates apps into 80 languages and automates settings.

Auto App Translate #

It is a library that translates apps into 80 languages and automates settings.

"Buy Me A Coffee"

How to Use? #

1. Setup the config file #

dependencies:
  easy_localization: ^3.0.2-dev
  easy_localization_loader: ^1.0.0
  app_auto_translation: ^0.0.1
  
flutter:
  assets:
    - assets/localization.done.csv

2. Create the asset folder and insert the localization.csv file. #


lozalization.csv file download

3. Config easy_localization library. Please refer to the official documentation. #

import 'package:app_auto_translation/callable/core_my/my_language_code/entity/flutter_support_language_locale.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:easy_localization_loader/easy_localization_loader.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await EasyLocalization.ensureInitialized();
  runApp(
    EasyLocalization(
        supportedLocales: flutterLocalizeSupportLanguagesLocale,
        path: 'assets/localization.done.csv', 
        assetLoader: CsvAssetLoader(), // <- important option for translation
        fallbackLocale: const Locale('en', 'US'),
        child: const MyApp()
    ),
  );
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
            localizationsDelegates: context.localizationDelegates,
            supportedLocales: context.supportedLocales,
            locale: context.locale,
            home: MyHomePage()
    );
  }
}

4. Fill in the localization file. #

Fill in str for the key value and the standard language (start translate language) column.

5. Translate tr() #

import 'package:easy_localization/easy_localization.dart';

tr('hello world')

6. Create a dart file in your project and paste the code below. #

Location doesn't matter.

import 'package:auto_app_translate/auto_app_translate.dart';

main() {
  AutoAppTranslate.translateAppCsvFile(
    // start translate language
          startLanguageCode: 'ko',

          // language code to skip translation
          skipLanguageCodes: [],

          // str to skip translation
          skipStr: [],

          // csv file path
          appAssetsCsvPath: 'assets/localization.done.csv',

          // google translate api key (https://translatepress.com/docs/automatic-translation/generate-google-api-key/)
          apiKey: 'INPUT_YOUR_GOOGLE_TRANSLATE_API_KEY');
}

It works even if you don't put the Google Translate api key, but you will soon reach the free limit.
For a guide to getting the Google Translate api key, please refer to this document.

7. Run the file. The translation will be completed in the csv file. #

8. Check out apps translated into more than 80 languages :) #

32
likes
0
pub points
66%
popularity

Publisher

verified publisherjunelee.fun

It is a library that translates apps into 80 languages and automates settings.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

basic_utils, csv, dio, flutter, http, path, quiver

More

Packages that depend on auto_app_translate