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

outdated

Unofficial WebLate SDK.

weblate_sdk #

Unofficial SDK to use Weblate service for a Web-based continuous localization;

Check Weblate documentation for more details.

Getting Started #

  1. Add package and localization support to your pubspec.yaml:
weblate_sdk: latest
flutter_localizations:
    sdk: flutter
  1. Add initialization to your main function:
 await WebLateSdk.initialize(
    accessKey: 'your_weblate_key',
    host: 'weblate_host',
    projectName: 'name of project',
    componentName: 'name of component',
    defaultLanguage: 'en', //optional
  );

Note: host should be without https:// (for example: weblate.company.link;

If defaultLanguage is set then if translation not found for current language then translation for defaultLanguage will be used instead;

  1. Add localization to MaterialApp:
supportedLocales: WebLateSdk.supportedLocales,
localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
        WebLateSdk.delegate,
      ]
  1. Use localized strings in your code:

context.localizedValueOf('key')

Note: Do not forgot to add internet permissions for you platforms

11
likes
0
points
205
downloads

Publisher

unverified uploader

Weekly Downloads

Unofficial WebLate SDK.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, http, plugin_platform_interface

More

Packages that depend on weblate_sdk