https://github.com/rootsoft/localazy_sdk
A Flutter OTA implementation for Localazy
https://github.com/rootsoft/localazy_sdk
Last synced: over 1 year ago
JSON representation
A Flutter OTA implementation for Localazy
- Host: GitHub
- URL: https://github.com/rootsoft/localazy_sdk
- Owner: RootSoft
- License: bsd-3-clause
- Created: 2024-08-14T16:16:42.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-13T10:49:04.000Z (over 1 year ago)
- Last Synced: 2025-03-13T11:34:33.338Z (over 1 year ago)
- Language: Dart
- Size: 98.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Localazy SDK
[](https://pub.dev/packages/localazy_sdk)
This package provides [Over-the-Air translation updates](#over-the-air-translation-updates) from the Localazy platform on top of the Intl package.
## Platform Support
| Android | iOS | Web | MacOS | Linux | Windows |
| :-----: | :-: | :-: | :---: | :---: | :-----: |
| ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
## Over-the-Air translation updates
Update translations for your Flutter applications over the air. [Learn more](https://localazy.com/tags/ota)
Works with projects that use Flutter Intl IDE plugin / `intl_utils`.
### Setup for Flutter Intl
1\. Update `pubspec.yaml` file
dependencies:
...
localazy_sdk: ^1.0.0
2\. Trigger localization files generation by Flutter Intl IDE plugin or by [intl_utils](https://pub.dev/packages/intl_utils) library
3\. Initialize Localazy SDK
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:localazy_sdk/localazy_sdk.dart';
import 'generated/l10n.dart';
void main() {
Localazy.init(
'cdn id',
fileName: 'intl.arb',
cacheFolder: path.join((await getTemporaryDirectory()).path, 'translations'),
);
Localazy.setAppVersion('1.0.0');
runApp(
LocalazyApp(
router: router,
),
);
}
class LocalazyApp extends StatelessWidget {
final GoRouter router;
const LocalazyApp({
required this.router,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routerConfig: router,
title: Env.appName,
theme: appTheme(),
debugShowCheckedModeBanner: false,
builder: (context, child) {
return LocalazyBuilder(
defaultLocale: Locale(Intl.getCurrentLocale()),
supportedLocales: S.delegate.supportedLocales,
builder: (context) => child ?? const SizedBox.shrink(),
);
},
localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
);
}
}