Skip to content

Commit

Permalink
update file read and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed May 30, 2024
1 parent 204c81b commit 9b1c8fe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,20 @@ A Webhook to notify Weblate that code was pushed to this repo.
A SSH key is installed in my account which allows weblate to push translation changes to the repo.
### Updating EN Localizations
To update EN localization strings, the file [intn_defs.dart](lib/Frontend/intn_defs.dart) needs to be updated.
```dart
String message() => Intl.message('Displayed Message', name: 'message', desc: 'A description of the string and where it is used');
```
The `Displayed Message` is the string that appears in the UI.
The `name` is the variable name. This must match the variable name used such as `message()` but without the `()`.
The `desc` is a description of the string for use by translators.
When [intn_defs.dart](lib/Frontend/intn_defs.dart) is updated, the job [localization_strings_update.yml](.github/workflows/localization_strings_update.yml) updates the generated localization file [messages_en.arb](lib/l10n/messages_en.arb) which makes the strings available to [Weblate](https://weblate.codel1417.xyz/projects/tail_app/tail_app/).
### Developer Mode Features
- Gear console
Expand Down
9 changes: 3 additions & 6 deletions lib/Frontend/pages/custom_audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class _CustomAudioState extends ConsumerState<CustomAudio> {
floatingActionButton: FloatingActionButton.extended(
onPressed: () async {
_audioLogger.info("Opening file dialog");
FilePickerResult? result = await FilePicker.platform.pickFiles(
type: FileType.audio,
);
FilePickerResult? result = await FilePicker.platform.pickFiles(type: FileType.audio, withReadStream: true);
if (result != null) {
_audioLogger.info("Selected file");
PlatformFile file = result.files.first;
Expand All @@ -43,9 +41,8 @@ class _CustomAudioState extends ConsumerState<CustomAudio> {
await audioDir.create();
File storedAudioFilePath = File("${audioDir.path}/${file.name}");
_audioLogger.info("File path ${storedAudioFilePath.path}");
File selectedFile = File(file.path!);
_audioLogger.info("Selected file Path ${selectedFile.path}");
Stream<List<int>> openRead = selectedFile.openRead();
_audioLogger.info("Selected file Path ${file.path}");
Stream<List<int>> openRead = file.readStream!;
IOSink ioSinkWrite = storedAudioFilePath.openWrite();
await ioSinkWrite.addStream(openRead);
ioSinkWrite.close();
Expand Down

0 comments on commit 9b1c8fe

Please sign in to comment.