Skip to content

Commit

Permalink
Merge pull request #104 from blockbasti/main
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
blockbasti authored Jan 25, 2022
2 parents 2d2bcf4 + f326718 commit df9645a
Show file tree
Hide file tree
Showing 19 changed files with 323 additions and 95 deletions.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: blockbasti
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
12 changes: 8 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,24 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '14.x'
java-version: "14.x"
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
channel: "stable"
- uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: flutter-install-cache

- name: Setup Flutter
run: |
flutter config --no-analytics
flutter pub get
sh ./scripts/generate_code.sh
- name: Build APKs
run: flutter build apk --build-number $(printf '%(%Y%m%d)T\n' -1) --debug

- name: Upload build artifacts
uses: actions/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/X8X8827HU)


<!-- PROJECT LOGO -->
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.5.31'
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionSha256Sum=c9490e938b221daf0094982288e4038deed954a3f12fb54cbf270ddf4e37d879
3 changes: 3 additions & 0 deletions lib/l10n/intl_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"tts": "Text-zu-Sprache (TTS)",
"ttsLang": "TTS Sprache",
"ttsLangDesc": "Wähle eine Sprache aus\n(nur bei aktiviertem TTS)",
"ttsVoice": "TTS Stimme (experimentell)",
"ttsVoiceDesc": "Wähle eine Stimme für TTS",
"voice": "Stimme",
"useSound": "Töne nutzen",
"useSoundDesc": "Übungsbeginn und -ende mit einfachen Tönen ankündigen",
"useTTS": "Text-zu-Sprache nutzen",
Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
"tts": "Text-to-Speech (TTS)",
"ttsLang": "TTS Language",
"ttsLangDesc": "Select a language\n(only when TTS is enabled)",
"ttsVoice": "TTS Voice (experimental)",
"ttsVoiceDesc": "Select a voice for TTS",
"voice": "Voice",
"useSound": "Use sound effects",
"useSoundDesc": "Use simple sounds to indicate starts and endings of exercises",
"useTTS": "Use Text-to-Speech",
Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/intl_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"tts": "Synthèse vocale (TTS)",
"ttsLang": "Langue du TTS",
"ttsLangDesc": "Choisir une langue\n(quand TTS est activé seulement)",
"ttsVoice": "Voix du TTS (expérimental)",
"ttsVoiceDesc": "Sélectionnez une voix pour TTS",
"voice": "Voix",
"useSound": "Utiliser les sons",
"useSoundDesc": "Utiliser des sons simples pour indiquer le début et la fin des exercices",
"useTTS": "Utiliser la synthèse vocale",
Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/intl_it.arb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"tts": "Sintesi vocale (TTS)",
"ttsLang": "Lingua TTS",
"ttsLangDesc": "Scegli una lingua\n(Solo se TTS è attivo)",
"ttsVoice": "TTS Voce (sperimentale)",
"ttsVoiceDesc": "Selezionare una voce per TTS",
"voice": "Voce",
"useSound": "Segnale sonoro",
"useSoundDesc": "Un segnale sonoro indicherà l'inizio e la fine degli esercizi",
"useTTS": "Usa la sintesi vocale Text-To-Speech (TTS)",
Expand Down
3 changes: 3 additions & 0 deletions lib/l10n/intl_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"tts": "Text-to-Speech (TTS)",
"ttsLang": "TTS Язык",
"ttsLangDesc": "Выберите язык\n(только когда TTS включен)",
"ttsVoice": "TTS голос (экспериментальный)",
"ttsVoiceDesc": "Выберите голос для TTS",
"voice": "голос",
"useSound": "Использовать звуковые эффекты",
"useSoundDesc": "Использовать простые звуки, чтобы анонсировать начало и конец упражнения.",
"useTTS": "Использовать Text-to-Speech",
Expand Down
85 changes: 85 additions & 0 deletions lib/l10n/intl_tr.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"@@locale": "tr",
"addExercise": "Egzersiz ekle",
"addRest": "Dinlenme ekle",
"addSet": "Set ekle",
"addWorkout": "Program ekle",
"announceUpcomingExercise": "Sıradaki egzersizi bildir",
"AnnounceUpcomingExerciseDesc": "TTS etkin olduğunda, sıradaki egzersizi bildir",
"backup": "Yedekleme",
"cancel": "İptal",
"countRepetitions": "{count} tekrar",
"currentSet": "Şu anki set",
"delete": "Sil",
"deleteConfirmation": "\"{title}\" programını silmek ister misiniz?",
"deleteExercise": "Egzersizi sil",
"deleteSet": "Seti sil",
"deleteWorkout": "Programı sil",
"duplicate": "Çoğalt",
"durationLeft": "Kalan süre: {timeLeft}-{timeTotal}",
"durationWithTime": "Süre: {formattedTime}",
"editWorkout": "Programı düzenle",
"enterWorkoutName": "Lütfen program için bir isim giriniz!",
"exercise": "Egzersiz",
"exerciseOf": "Egzersiz {total}-{currentIndex}",
"exitCheck": "Çıkmak istediğinizden emin misiniz?",
"export": "Bütün programları dışarı aktar",
"firstExercise": "İlk: {name}",
"general": "Genel",
"halfwayDone": "Yarısı bitti",
"import": "Bir yedeği içe aktar",
"importedCount": "{count} program içe aktarıldı",
"keepScreenAwake": "Ekranı açık tut",
"language": "Dil",
"licenses": "Lisanslar",
"moveExerciseDown": "Egzersizi aşağı taşı",
"moveExerciseUp": "Egzersizi yukarı taşı",
"moveSetDown": "Seti aşağı taşı",
"moveSetUp": "Seti yukarı taşı",
"name": "İsim",
"nextExercise": "Sırada: {name}",
"nextSet": "Sıradaki set",
"no": "Hayır",
"noSound": "Ses efekti yok",
"noSoundDesc": "Bütün ses çıkışlarını sessize al",
"ossLicenses": "Açık Kaynak Lisansları",
"overwriteExistingWorkout": "Var olan programın üzerine yazılsın mı?",
"playTickEverySecond": "Her saniye tik sesi oynat",
"repetitions": "Tekrar:",
"repOf": "Tekrar {currentIndex}-{total}",
"reportIssuesOrRequestAFeature": "Sorun bildir ya da bir özellik iste",
"rest": "Dinlenme",
"saved": "Kaydedildi",
"saveWorkout": "Programı kaydet",
"setIndex": "Set {number}",
"setOf": "Set {currentIndex}-{total}",
"settingHalfway": "Programın yarısında ses çal ya da bildirim yap",
"settings": "Ayarlar",
"soundOutput": "Ses çıkışı",
"startWorkout": "Programı başlat",
"title": "Just Another Workout Timer",
"tts": "Metinden konuşmaya (TTS)",
"ttsLang": "TTS Dili",
"ttsLangDesc": "Bir dil seç\n(yalnızca TTS etkin olduğunda)",
"ttsVoice": "TTS Ses (deneysel)",
"ttsVoiceDesc": "TTS için bir ses seçin",
"voice": "Ses",
"useSound": "Ses efektleri kullan",
"useSoundDesc": "Egzersizlerin başlangıcını ve bitişini bildirmek için basit sesler kullan",
"useTTS": "Metinden-konuşmaya kullan",
"useTTSDesc": "Şu anki ve sıradaki egzersizi bildir",
"viewLicense": "Lisansı göster",
"viewOnGithub": "GitHub'da göster",
"viewOSSLicenses": "Açık kaynak lisanslarını göster",
"workoutComplete": "Program tamamlandı",
"workouts": "Programlar",
"yes": "Evet",
"yesExit": "Evet, çık",
"expanded_setlist": "Genişletilmiş set listesi",
"expanded_setlist_info": "Her zaman setin tamamını göster",
"seconds": "Saniyeler",
"theme": "Tema",
"theme_dark": "Koyu",
"theme_light": "Açık",
"theme_system": "Sistem"
}
26 changes: 26 additions & 0 deletions lib/languages.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'dart:core';

class AppLanguage {
String displayName;
String localeCode;
String languageCode;

AppLanguage(this.displayName, this.localeCode, this.languageCode);
}

class Languages {
static final List<AppLanguage> languages = [
AppLanguage("English", "en", "en-US"),
AppLanguage("Deutsch", "de", "de-DE"),
AppLanguage("Français", "fr", "fr-FR"),
AppLanguage("Italiano", "it", "it-IT"),
AppLanguage("Русский", "ru", "ru-RU"),
AppLanguage("Türkçe", "tr", "tr-TR")
];

static List<String> get languageCodes =>
languages.map((lang) => lang.languageCode).toList();

static AppLanguage fromLocaleCode(String localeCode) => languages
.firstWhere((lang) => lang.localeCode == localeCode, orElse: null);
}
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ class JAWTApp extends StatelessWidget {
}

for (var locale in locales!) {
if (supportedLocales.contains(locale)) {
if (supportedLocales
.any((element) => element.languageCode == locale.languageCode)) {
PrefService.of(context).set('lang', locale.languageCode);
return locale;
}
Expand Down
1 change: 0 additions & 1 deletion lib/number_stepper.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:flutter/services.dart';

import 'generated/l10n.dart';
Expand Down
52 changes: 27 additions & 25 deletions lib/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_phoenix/flutter_phoenix.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:just_another_workout_timer/languages.dart';
import 'package:pref/pref.dart';
import 'package:prefs/prefs.dart';
import 'package:url_launcher/url_launcher.dart';

import 'generated/l10n.dart';
Expand Down Expand Up @@ -43,19 +45,15 @@ class _SettingsPageState extends State<SettingsPage> {
),
PrefDropdown(
title: Text(S.of(context).language),
items: [
DropdownMenuItem(
child: Text('English'),
value: 'en',
),
DropdownMenuItem(child: Text('Deutsch'), value: 'de'),
DropdownMenuItem(child: Text('Italiano'), value: 'it'),
DropdownMenuItem(child: Text('Français'), value: 'fr'),
DropdownMenuItem(child: Text('Русский'), value: 'ru'),
],
items: Languages.languages
.map((lang) => DropdownMenuItem(
child: Text(lang.displayName), value: lang.localeCode))
.toList(),
onChange: (String value) {
var lang = Languages.fromLocaleCode(value);
setState(() {
S.load(Locale(value));
S.load(Locale(lang.localeCode));
TTSHelper.setLanguage(lang.languageCode);
});
},
pref: 'lang',
Expand Down Expand Up @@ -141,22 +139,26 @@ class _SettingsPageState extends State<SettingsPage> {
Text(S.of(context).tts, style: TextStyle(color: Colors.blue)),
),
PrefDropdown(
title: Text(S.of(context).ttsLang),
pref: 'tts_lang',
subtitle: Text(S.of(context).ttsLangDesc),
items: [
DropdownMenuItem(
child: Text('English'),
value: 'en-US',
),
DropdownMenuItem(child: Text('Deutsch'), value: 'de-DE'),
DropdownMenuItem(child: Text('Italiano'), value: 'it-IT'),
DropdownMenuItem(child: Text('Français'), value: 'fr-FR'),
DropdownMenuItem(child: Text('Русский'), value: 'ru-RU'),
],
title: Text(S.of(context).ttsVoice),
pref: 'tts_voice',
subtitle: Text(S.of(context).ttsVoiceDesc),
items: TTSHelper.voices
.where((voice) =>
voice.locale == Prefs.getString('tts_lang', 'en-US'))
.toList()
.asMap()
.entries
.map((voice) => DropdownMenuItem(
child: Text(
'${S.of(context).voice} ${voice.key + 1} (${voice.value.name})'),
value: voice.value.name))
.toList(),
disabled: !TTSHelper.available,
onChange: (String value) {
TTSHelper.flutterTts.setLanguage(value);
TTSHelper.flutterTts.setVoice({
"name": value,
"locale": Prefs.getString('tts_lang', 'en-US')
});
},
),
PrefSwitch(
Expand Down
Loading

0 comments on commit df9645a

Please sign in to comment.