string_manager 0.0.2 copy "string_manager: ^0.0.2" to clipboard
string_manager: ^0.0.2 copied to clipboard

a flutter package for managing app strings in dart/flutter particularly internationalization.

a pure dart package for managing app strings in dart particularly internationalization

Features #

  • keep your project strings DRY
  • Translate all your project strings easily on the fly with one method call

Getting started #

add this to your pubspec.yaml file

dependencies:
 string_manager:

Usage #

import 'package:string_manager/string_manager.dart';

void main() async {
  StringManager stringManager = StringManager(language: 'en');

  ///you must initialize stringManager first
  await stringManager.initialize();

  ///register your project strings synchronously
  stringManager.reg('hello world');

  ///translate your strings to any language (Yoruba in this case) using google translate
  await stringManager.translate(to: 'yo');

  ///saves your strings using hive
  await stringManager.save();

  print(stringManager.stringResource.resources); //output: ["Mo ki O Ile Aiye"]

  await stringManager.close();
}

note that the stringManger.reg('yourString') method returns your registered string, ie:

    //...
    print(stringManger.reg('hello world')); //output: hello world
    //...

Additional information #

If you face any errors kindly create an issue, and if you wish to add a feature I will be more than happy to merge your PR

Enjoy your internationalization redefined. 😃 #

0
likes
120
pub points
0%
popularity

Publisher

unverified uploader

a flutter package for managing app strings in dart/flutter particularly internationalization.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

hive, intl, translator

More

Packages that depend on string_manager