flutter_app/README.md

63 lines
2.0 KiB
Markdown
Raw Normal View History

2021-02-25 23:33:15 +00:00
# flwtch
A Flutter based Cwtch UI
## Getting Started
2021-02-25 23:33:15 +00:00
click the play button in android studio
2021-04-01 20:41:46 +00:00
### Linux
- libCwtch-go: required to be on the link path (linux/cwtch.destktop demonstrates with `env LD_LIBRARY_PATH=./lib/` on the front of the comman)
- fetch-libcwtch-go.sh will fetch a prebuilt version
- or compile from source from libcwtch-go with `make linux`
2021-04-01 20:41:46 +00:00
- `tor` should be in the PATH
### Windows
- run `fetch-libcwtch-go.ps1` to get `libCwtch.dll` which is required to run
- run `fetch-tor-win.ps1` to fetch Tor for windows
#### Issues
- Flutter engine has a [known bug](https://github.com/flutter/flutter/issues/75675) around the Right Shift key being sticky. We have implemented the mostly work around, but until it is fixed, right shift occasionally acts permenent. If this happens, just tap left shift and it will reset
2021-04-01 20:41:46 +00:00
2021-02-25 23:33:15 +00:00
## l10n
2021-02-25 23:33:15 +00:00
### Adding a new string
2021-02-25 23:33:15 +00:00
Strings are managed directly from our Lokalise(url?) project.
Keys should be valid Dart variable names in lowerCamelCase.
After adding a new key and providing/obtaining translations for it, follow the next step to update your local copy.
### Updating translations
Only Open Privacy staff members can update translations automatically:
```
flutter pub run flutter_lokalise download -v --api-token "<X>" --project-id "<Y>"
```
This will download a bundle of translations from Lokalise and convert it to resource files in `lib/l10n/intl_*.arb`.
The next time Flwtch is built, Flutter will notice the changes and update `app_localizations.dart` accordingly (thanks to `generate:true` in `pubspec.yaml`).
### Using a string
Any widget underneath the main MaterialApp should be able to:
```
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
```
and then use:
```
2021-05-25 00:16:57 +00:00
Text(AppLocalizations.of(context)!.stringIdentifer),
2021-02-25 23:33:15 +00:00
```
### Configuration
API tokens are only available to Open Privacy staff at this time, who will perform the translation updates for you as part of merging your PRs.
2021-04-01 20:41:46 +00:00
With `generate: true` in `pubspec.yaml`, the Flutter build process checks `l10n.yaml` for input/output filenames.