From 9120b1b62455bb353e12ec646140f14099ef8e92 Mon Sep 17 00:00:00 2001 From: Luigi Henrick Feitoza Silva Date: Tue, 3 Oct 2023 22:28:58 +0000 Subject: [PATCH 01/20] Translated using Weblate (Portuguese (Brazil)) Currently translated at 12.5% (29 of 232 strings) Translation: wger Workout Manager/Mobile App Translate-URL: https://hosted.weblate.org/projects/wger/mobile/pt_BR/ --- lib/l10n/app_pt_BR.arb | 56 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/lib/l10n/app_pt_BR.arb b/lib/l10n/app_pt_BR.arb index 986dfb29c..cbe927e96 100644 --- a/lib/l10n/app_pt_BR.arb +++ b/lib/l10n/app_pt_BR.arb @@ -40,5 +40,59 @@ "register": "Inscrever-se", "@register": { "description": "Text for registration button" - } + }, + "useDefaultServer": "Usar servidor padrão", + "@useDefaultServer": { + "description": "Toggle button allowing users to switch between the default and a custom wger server" + }, + "reset": "Redefinir", + "@reset": { + "description": "Button text allowing the user to reset the entered values to the default" + }, + "password": "Senha", + "@password": {}, + "invalidUsername": "Por favor insira um nome de usuário válido", + "@invalidUsername": { + "description": "Error message when the user enters an invalid username" + }, + "passwordTooShort": "A senha é muito curta", + "@passwordTooShort": { + "description": "Error message when the user a password that is too short" + }, + "email": "Endereço de email", + "@email": {}, + "username": "Usuário", + "@username": {}, + "customServerHint": "Digite o endereço do seu próprio servidor, caso contrário o padrão será usado", + "@customServerHint": { + "description": "Hint text for the form where the users can enter their own wger instance" + }, + "useCustomServer": "Usar servidor customizado", + "@useCustomServer": { + "description": "Toggle button allowing users to switch between the default and a custom wger server" + }, + "registerInstead": "Não tem uma conta? Registrar agora", + "@registerInstead": {}, + "usernameValidChars": "Um usuário deve apenas conter letras, digitos e os caracteres @, +, ., -, ou _", + "@usernameValidChars": { + "description": "Error message when the user tries to register a username with forbidden characters" + }, + "invalidUrl": "Por favor, digite uma URL válida", + "@invalidUrl": { + "description": "Error message when the user enters an invalid URL, e.g. in the login form" + }, + "customServerUrl": "URL da instância wger", + "@customServerUrl": { + "description": "Label in the form where the users can enter their own wger instance" + }, + "passwordsDontMatch": "As senhas não coincidem", + "@passwordsDontMatch": { + "description": "Error message when the user enters two different passwords during registration" + }, + "invalidEmail": "Por favor insira um endereço de e-mail válido", + "@invalidEmail": { + "description": "Error message when the user enters an invalid email" + }, + "confirmPassword": "Confirme sua senha", + "@confirmPassword": {} } From 6f6c41f17103445111c7dd2f468b3a5d9d405cf7 Mon Sep 17 00:00:00 2001 From: Antonis-geo Date: Tue, 3 Oct 2023 11:54:11 +0000 Subject: [PATCH 02/20] Translated using Weblate (Greek) Currently translated at 20.6% (48 of 232 strings) Translation: wger Workout Manager/Mobile App Translate-URL: https://hosted.weblate.org/projects/wger/mobile/el/ --- lib/l10n/app_el.arb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/l10n/app_el.arb b/lib/l10n/app_el.arb index 539e93bf2..afbf83238 100644 --- a/lib/l10n/app_el.arb +++ b/lib/l10n/app_el.arb @@ -136,5 +136,23 @@ "description": "Error message when the user enters an invalid email" }, "confirmPassword": "Επιβεβαίωση κωδικού πρόσβασης", - "@confirmPassword": {} + "@confirmPassword": {}, + "images": "Εικόνες", + "@images": {}, + "save": "Αποθήκευση", + "@save": {}, + "description": "Περιγραφή", + "@description": {}, + "name": "Όνομα", + "@name": { + "description": "Name for a workout or nutritional plan" + }, + "translation": "Μετάφραση", + "@translation": {}, + "language": "Γλώσσα", + "@language": {}, + "category": "Κατηγορία", + "@category": { + "description": "Category for an exercise, ingredient, etc." + } } From 0bf324f1884197db1ef26a422f7c45eb5d00a2c3 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sun, 15 Oct 2023 11:53:11 +0200 Subject: [PATCH 03/20] Mention the test server for easier onboarding --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dc5e37fb7..0e22ef2db 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,13 @@ height="80">](https://f-droid.org/packages/de.wger.flutter/) Install the [wger server](https://github.com/wger-project/wger), the easiest way is to start the development docker-compose: -Alternatively, you can use one of our test servers, just ask us for access. +Alternatively, you can use the test server (the db is reset every day): + +* URL: `https://wger-master.rge.uber.space` +* username: `user` +* password: `flutteruser` +* API key: `31e2ea0322c07b9df583a9b6d1e794f7139e78d4` + ### 2 From 73a311fad83ebb0d81bdc1c492ef97ae0d671da2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 01:10:48 +0000 Subject: [PATCH 04/20] Bump package_info_plus from 4.1.0 to 4.2.0 Bumps [package_info_plus](https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/fluttercommunity/plus_plugins/releases) - [Commits](https://github.com/fluttercommunity/plus_plugins/commits/package_info_plus-v4.2.0/packages/package_info_plus) --- updated-dependencies: - dependency-name: package_info_plus dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 2d3813d7f..5549c10ab 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -880,10 +880,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a" + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.2.0" package_info_plus_platform_interface: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a10bb92c6..328e285b7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,7 +46,7 @@ dependencies: intl: ^0.17.0 json_annotation: ^4.8.1 version: ^3.0.2 - package_info_plus: ^4.1.0 + package_info_plus: ^4.2.0 provider: ^6.0.5 rive: ^0.11.4 shared_preferences: ^2.2.1 From 15fce78867c572ff7592047d1cd41fbb5e96220f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 01:11:08 +0000 Subject: [PATCH 05/20] Bump shared_preferences from 2.2.1 to 2.2.2 Bumps [shared_preferences](https://github.com/flutter/packages/tree/main/packages/shared_preferences) from 2.2.1 to 2.2.2. - [Release notes](https://github.com/flutter/packages/releases) - [Commits](https://github.com/flutter/packages/commits/shared_preferences-v2.2.2/packages/shared_preferences) --- updated-dependencies: - dependency-name: shared_preferences dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 2d3813d7f..5b9a991ed 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1064,10 +1064,10 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: b7f41bad7e521d205998772545de63ff4e6c97714775902c199353f8bf1511ac + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" shared_preferences_android: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index a10bb92c6..210cf69c4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,7 +49,7 @@ dependencies: package_info_plus: ^4.1.0 provider: ^6.0.5 rive: ^0.11.4 - shared_preferences: ^2.2.1 + shared_preferences: ^2.2.2 table_calendar: ^3.0.8 url_launcher: ^6.1.11 flutter_barcode_scanner: ^2.0.0 From 80c8e67cc5e6b1d24fcf909936132dd435104698 Mon Sep 17 00:00:00 2001 From: Milo Ivir Date: Tue, 17 Oct 2023 21:51:18 +0000 Subject: [PATCH 06/20] Translated using Weblate (Croatian) Currently translated at 100.0% (232 of 232 strings) Translation: wger Workout Manager/Mobile App Translate-URL: https://hosted.weblate.org/projects/wger/mobile/hr/ --- lib/l10n/app_hr.arb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/l10n/app_hr.arb b/lib/l10n/app_hr.arb index 98cda53b7..29975a6ed 100644 --- a/lib/l10n/app_hr.arb +++ b/lib/l10n/app_hr.arb @@ -91,7 +91,7 @@ "@exercise": { "description": "An exercise for a workout" }, - "logHelpEntriesUnits": "Imaj na umu da su ovdje ucrtani samo unosi s jedinicom težine (kg ili lb) i ponavljanjima, druge kombinacije kao što su vrijeme ili do neuspjeha se ovdje zanemaruju.", + "logHelpEntriesUnits": "Napomena: prikazuju se samo unosi s jedinicom težine (kg ili lb) i ponavljanja, druge kombinacije kao što su vrijeme ili do neuspjeha se ovdje zanemaruju.", "@logHelpEntriesUnits": {}, "description": "Opis", "@description": {}, From fba46b96558b7dba3b7c8ef099842326f5e95cfd Mon Sep 17 00:00:00 2001 From: Milo Ivir Date: Wed, 18 Oct 2023 11:46:55 +0000 Subject: [PATCH 07/20] Translated using Weblate (Croatian) Currently translated at 100.0% (4 of 4 strings) Translation: wger Workout Manager/Play Store Translate-URL: https://hosted.weblate.org/projects/wger/play-store/hr/ --- fastlane/metadata/android/hr/full_description.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/metadata/android/hr/full_description.txt b/fastlane/metadata/android/hr/full_description.txt index 2fe31212a..e6b7b8e45 100644 --- a/fastlane/metadata/android/hr/full_description.txt +++ b/fastlane/metadata/android/hr/full_description.txt @@ -1,4 +1,4 @@ -Od ljubitelja fitnessa za ljubitelja fitnessa – organiziraj svoje zdravlje s WGER, tvojim upravljaöem treninga! +Od ljubitelja fitnessa za ljubitelje fitnessa – organiziraj svoje zdravlje s WGER, tvojim upravljačem treninga! Već si pronašao/la omiljeni program za fitness i voliš stvarati vlastite sportske rutine? Bez obzira na vrstu sportske zvijeri – svi imamo nešto zajedničko: Volimo pratiti naše zdravstvene podatke <3 @@ -22,7 +22,7 @@ Tvoj napredak: Nikada ne gubi iz vida svoje ciljeve. Prati svoju težinu i vodi statistiku. Tvoji podaci: -wger je tvoj personalizirani dnevnik fitnessa – ali ti posjeduješ svoje podatke. Koristi REST API za pristup i obavi s njim nevjerojatnih stvari. +wger je tvoj personalizirani dnevnik fitnessa – ali ti posjeduješ svoje podatke. Koristi REST API za pristup i obavi s njim nevjerojatne stvari. Napomena: Ovaj besplatni program ne temelji se na dodatnim sredstvima i ne tražimo da doniraš novac. Više od toga, ovo je projekt zajednice koji stalno raste. Stoga budi spreman/na za nove funkcije u bilo kojem trenutku! From 3a4848fdf0df3a78ccb03d516bdd39395faaf39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Ant=C3=B4nio=20Rodrigues=20Cardoso?= Date: Tue, 17 Oct 2023 16:54:07 +0000 Subject: [PATCH 08/20] Translated using Weblate (Portuguese (Brazil)) Currently translated at 62.9% (146 of 232 strings) Translation: wger Workout Manager/Mobile App Translate-URL: https://hosted.weblate.org/projects/wger/mobile/pt_BR/ --- lib/l10n/app_pt_BR.arb | 390 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 389 insertions(+), 1 deletion(-) diff --git a/lib/l10n/app_pt_BR.arb b/lib/l10n/app_pt_BR.arb index cbe927e96..838b0fd13 100644 --- a/lib/l10n/app_pt_BR.arb +++ b/lib/l10n/app_pt_BR.arb @@ -94,5 +94,393 @@ "description": "Error message when the user enters an invalid email" }, "confirmPassword": "Confirme sua senha", - "@confirmPassword": {} + "@confirmPassword": {}, + "comment": "Comente", + "@comment": { + "description": "Comment, additional information" + }, + "logIngredient": "Salvar no diário nutricional", + "@logIngredient": {}, + "equipment": "Equipamento", + "@equipment": { + "description": "Equipment needed to perform an exercise" + }, + "saturatedFat": "Gordura saturada", + "@saturatedFat": {}, + "mealLogged": "Refeição registrada no diário", + "@mealLogged": {}, + "images": "Imagens", + "@images": {}, + "close": "Fechar", + "@close": { + "description": "Translation for close" + }, + "successfullyDeleted": "Excluído", + "@successfullyDeleted": { + "description": "Message when an item was successfully deleted" + }, + "save": "Salvar", + "@save": {}, + "goToToday": "Vá para hoje", + "@goToToday": { + "description": "Label on button to jump back to 'today' in the calendar widget" + }, + "enterRepetitionsOrWeight": "Por favor preencha as repetições ou o peso para pelo menos uma das séries", + "@enterRepetitionsOrWeight": { + "description": "Error message when the user hasn't filled in the forms for exercise sets" + }, + "set": "Definir", + "@set": { + "description": "A set in a workout plan" + }, + "noMeasurementEntries": "Você não tem entradas de medição", + "@noMeasurementEntries": {}, + "newSet": "Novo conjunto", + "@newSet": { + "description": "Header when adding a new set to a workout day" + }, + "impression": "Impressão", + "@impression": { + "description": "General impression (e.g. for a workout session) such as good, bad, etc." + }, + "plateCalculator": "Pratos", + "@plateCalculator": { + "description": "Label used for the plate calculator in the gym mode" + }, + "newNutritionalPlan": "Novo plano nutricional", + "@newNutritionalPlan": {}, + "setNr": "Definir {nr}", + "@setNr": { + "description": "Header in form indicating the number of the current set. Can also be translated as something like 'Set Nr. xy'.", + "type": "text", + "placeholders": { + "nr": {} + } + }, + "fat": "Gordura", + "@fat": {}, + "timeStartAhead": "O horário de início não pode ser anterior ao horário de término", + "@timeStartAhead": {}, + "carbohydrates": "Carboidratos", + "@carbohydrates": {}, + "noWorkoutPlans": "Você não tem planos de treino", + "@noWorkoutPlans": { + "description": "Message shown when the user has no workout plans" + }, + "aboutTranslationTitle": "Tradução", + "@aboutTranslationTitle": { + "description": "Title for translation section in the about dialog" + }, + "muscles": "Músculos", + "@muscles": { + "description": "(main) muscles trained by an exercise" + }, + "total": "Total", + "@total": { + "description": "Label used for total sums of e.g. calories or similar" + }, + "dayDescriptionHelp": "Uma descrição do que é feito neste dia (por exemplo, 'dia de puxar') ou quais partes do corpo são treinadas (por exemplo, 'peito e ombros')", + "@dayDescriptionHelp": {}, + "gymMode": "Modo Gym", + "@gymMode": { + "description": "Label when starting the gym mode" + }, + "logged": "Desconectar", + "@logged": { + "description": "Header for the column of 'logged' nutritional values, i.e. what was eaten" + }, + "amount": "Quantia", + "@amount": { + "description": "The amount (e.g. in grams) of an ingredient in a meal" + }, + "loginInstead": "Já tem uma conta ? Entre", + "@loginInstead": {}, + "pause": "Pausar", + "@pause": { + "description": "Noun, not an imperative! Label used for the pause when using the gym mode" + }, + "success": "Sucesso", + "@success": { + "description": "Message when an action completed successfully, usually used as a heading" + }, + "repetitionUnit": "Unidade de repetição", + "@repetitionUnit": {}, + "weightUnit": "Unidade de peso", + "@weightUnit": {}, + "searchIngredient": "Pesquisar Ingrediente", + "@searchIngredient": { + "description": "Label on ingredient search form" + }, + "aboutBugsText": "Entre em contato se algo não se comportou conforme o esperado ou se houver algum recurso que você acha que está faltando.", + "@aboutBugsText": { + "description": "Text for bugs section in the about dialog" + }, + "anErrorOccurred": "Ocorreu um erro!", + "@anErrorOccurred": {}, + "aboutContactUsTitle": "Diga oi!", + "@aboutContactUsTitle": { + "description": "Title for contact us section in the about dialog" + }, + "enterValue": "por favor insira um valor", + "@enterValue": { + "description": "Error message when the user hasn't entered a value on a required field" + }, + "logMeal": "Registrar esta refeição", + "@logMeal": {}, + "newEntry": "Nova entrada", + "@newEntry": { + "description": "Title when adding a new entry such as a weight or log entry" + }, + "addSet": "Adicionar set", + "@addSet": { + "description": "Label for the button that adds a set (to a workout day)" + }, + "newWorkout": "Novo plano de treino", + "@newWorkout": { + "description": "Header when adding a new workout" + }, + "energyShort": "E", + "@energyShort": { + "description": "The first letter or short name of the word 'Energy', used in overviews" + }, + "name": "Nome", + "@name": { + "description": "Name for a workout or nutritional plan" + }, + "percentEnergy": "Porcentagem de energia", + "@percentEnergy": {}, + "searchNamesInEnglish": "Pesquise também por nomes em inglês", + "@searchNamesInEnglish": {}, + "exercise": "Exercício", + "@exercise": { + "description": "An exercise for a workout" + }, + "addIngredient": "Adicionar ingrediente", + "@addIngredient": {}, + "fatShort": "G", + "@fatShort": { + "description": "The first letter or short name of the word 'Fat', used in overviews" + }, + "start": "Começar", + "@start": { + "description": "Label on button to start the gym mode (i.e., an imperative)" + }, + "jumpTo": "Pule para", + "@jumpTo": { + "description": "Imperative. Label used in popup allowing the user to jump to a specific exercise while in the gym mode" + }, + "difference": "Diferença", + "@difference": {}, + "fibres": "Fibra", + "@fibres": {}, + "aboutDescription": "Obrigado por usar o Wger! Wger é um projeto colaborativo de código aberto, feito por entusiastas do fitness de todo o mundo.", + "@aboutDescription": { + "description": "Text in the about dialog" + }, + "timeStart": "Hora de início", + "@timeStart": { + "description": "The starting time of a workout" + }, + "searchExercise": "Exercício de pesquisa para adicionar", + "@searchExercise": { + "description": "Label on set form. Selected exercises are added to the set" + }, + "moreMeasurementEntries": "Adicionar nova medição", + "@moreMeasurementEntries": { + "description": "Message shown when the user wants to add new measurement" + }, + "loadingText": "Carregando...", + "@loadingText": { + "description": "Text to show when entries are being loaded in the background: Loading..." + }, + "selectExercises": "Se quiser fazer um superset você pode procurar vários exercícios, eles estarão agrupados", + "@selectExercises": {}, + "nutritionalDiary": "Diário nutricional", + "@nutritionalDiary": {}, + "protein": "Proteína", + "@protein": {}, + "labelWorkoutPlans": "Planos de treino", + "@labelWorkoutPlans": { + "description": "Title for screen workout plans" + }, + "proteinShort": "P", + "@proteinShort": { + "description": "The first letter or short name of the word 'Protein', used in overviews" + }, + "noWeightEntries": "Você não tem entradas de peso", + "@noWeightEntries": { + "description": "Message shown when the user has no logged weight entries" + }, + "noNutritionalPlans": "Você não tem planos nutricionais", + "@noNutritionalPlans": { + "description": "Message shown when the user has no nutritional plans" + }, + "goToDetailPage": "Ir para a página de detalhes", + "@goToDetailPage": {}, + "labelWorkoutLogs": "Registros de treinos", + "@labelWorkoutLogs": { + "description": "(Workout) logs" + }, + "aboutTranslationText": "Este aplicativo está traduzido no weblate. Se você também quiser ajudar, clique no link e comece a traduzir", + "@aboutTranslationText": { + "description": "Text for translation section in the about dialog" + }, + "ingredient": "Ingrediente", + "@ingredient": {}, + "measurementCategoriesHelpText": "Categoria de medição, como 'bíceps' ou 'gordura corporal'", + "@measurementCategoriesHelpText": {}, + "rirNotUsed": "RiR não usado", + "@rirNotUsed": { + "description": "Label used in RiR slider when the RiR value is not used/saved for the current setting or log" + }, + "todaysWorkout": "Seu treino hoje", + "@todaysWorkout": {}, + "aboutSourceText": "Obtenha o código fonte deste aplicativo e seu servidor no github", + "@aboutSourceText": { + "description": "Text for source code section in the about dialog" + }, + "kJ": "kJ", + "@kJ": { + "description": "Energy in a meal in kilo joules, kJ" + }, + "sodium": "Sódio", + "@sodium": {}, + "translation": "Tradução", + "@translation": {}, + "successfullySaved": "Salvo", + "@successfullySaved": { + "description": "Message when an item was successfully saved" + }, + "exerciseList": "Lista de exercícios", + "@exerciseList": {}, + "energy": "Energia", + "@energy": { + "description": "Energy in a meal, ingredient etc. e.g. in kJ" + }, + "newDay": "Novo dia", + "@newDay": {}, + "toggleDetails": "Alterar detalhes", + "@toggleDetails": { + "description": "Switch to toggle detail / overview" + }, + "musclesSecondary": "Músculos secundários", + "@musclesSecondary": { + "description": "secondary muscles trained by an exercise" + }, + "aboutContactUsText": "Se você quiser bater um papo conosco, entre no servidor Discord e entre em contato", + "@aboutContactUsText": { + "description": "Text for contact us section in the about dialog" + }, + "labelDashboard": "Painel", + "@labelDashboard": { + "description": "Title for screen dashboard" + }, + "timeEnd": "Fim do tempo", + "@timeEnd": { + "description": "The end time of a workout" + }, + "planned": "Planejado", + "@planned": { + "description": "Header for the column of 'planned' nutritional values, i.e. what should be eaten" + }, + "logHelpEntries": "Se em um mesmo dia houver mais de uma inscrição com o mesmo número de repetições, mas pesos diferentes, apenas a inscrição com maior peso será mostrada no diagrama.", + "@logHelpEntries": {}, + "exerciseName": "Nome do exercício", + "@exerciseName": { + "description": "Label for the name of a workout exercise" + }, + "labelBottomNavNutrition": "Nutrição", + "@labelBottomNavNutrition": { + "description": "Label used in bottom navigation, use a short word" + }, + "language": "Linguagem", + "@language": {}, + "nutritionalPlans": "Planos nutricionais", + "@nutritionalPlans": {}, + "kcal": "kcal", + "@kcal": { + "description": "Energy in a meal in kilocalories, kcal" + }, + "g": "g", + "@g": { + "description": "Abbreviation for gram" + }, + "addMeal": "Adicionar refeição", + "@addMeal": {}, + "sameRepetitions": "Se você fizer as mesmas repetições e peso para todas as séries, poderá preencher apenas uma linha. Por exemplo, para 4 séries basta inserir 10 para as repetições, isso automaticamente se torna \"4 x 10\".", + "@sameRepetitions": {}, + "measurementEntriesHelpText": "A unidade usada para medir a categoria, como 'cm' ou '%'", + "@measurementEntriesHelpText": {}, + "supersetWith": "superset com", + "@supersetWith": { + "description": "Text used between exercise cards when adding a new set. Translate as something like 'in a superset with'" + }, + "sugars": "Açúcar", + "@sugars": {}, + "aboutBugsTitle": "Tem um problema ou ideia?", + "@aboutBugsTitle": { + "description": "Title for bugs section in the about dialog" + }, + "carbohydratesShort": "C", + "@carbohydratesShort": { + "description": "The first letter or short name of the word 'Carbohydrates', used in overviews" + }, + "measurements": "Medidas", + "@measurements": { + "description": "Categories for the measurements such as biceps size, body fat, etc." + }, + "macronutrients": "Macronutrientes", + "@macronutrients": {}, + "plateCalculatorNotDivisible": "Não é possível atingir o peso com os pratos disponíveis", + "@plateCalculatorNotDivisible": { + "description": "Error message when the current weight is not reachable with plates (e.g. 33.1 kg)" + }, + "confirmDelete": "Tem certeza de que deseja excluir '{toDelete}'?", + "@confirmDelete": { + "description": "Confirmation text before the user deletes an object", + "type": "text", + "placeholders": { + "toDelete": {} + } + }, + "gPerBodyKg": "g por kg corporal", + "@gPerBodyKg": { + "description": "Label used for total sums of e.g. calories or similar in grams per Kg of body weight" + }, + "weekAverage": "Média de 7 dias", + "@weekAverage": { + "description": "Header for the column of '7 day average' nutritional values, i.e. what was logged last week" + }, + "labelWorkoutPlan": "Plano de treino", + "@labelWorkoutPlan": { + "description": "Title for screen workout plan" + }, + "category": "Categoria", + "@category": { + "description": "Category for an exercise, ingredient, etc." + }, + "exercises": "Exercícios", + "@exercises": { + "description": "Multiple exercises for a workout" + }, + "time": "Tempo", + "@time": { + "description": "The time of a meal or workout" + }, + "calendar": "Calendário", + "@calendar": {}, + "verify": "Verificar", + "@verify": {}, + "workoutSession": "Sessão de treino", + "@workoutSession": { + "description": "A (logged) workout session" + }, + "logHelpEntriesUnits": "Observe que apenas as entradas com uma unidade de peso (kg ou lb) e repetições são registradas; outras combinações, como tempo ou até a falha, são ignoradas aqui.", + "@logHelpEntriesUnits": {}, + "aboutSourceTitle": "Código fonte", + "@aboutSourceTitle": { + "description": "Title for source code section in the about dialog" + }, + "measurement": "Medição", + "@measurement": {} } From e75aff668e922d79cce1ee5dacb2d0e801387d8a Mon Sep 17 00:00:00 2001 From: Abhishek Saini <78199221+Abhisheksainii@users.noreply.github.com> Date: Sat, 21 Oct 2023 00:05:17 +0530 Subject: [PATCH 09/20] Update pull_request_template.md Changes proposed : 1. Updated structure of the file. 2. Added more clear requirements such as changes proposed and checklist --- .github/pull_request_template.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 28eea257a..f2b73a966 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,15 +1,27 @@ -# Proposed Changes +## Description (Proposed Changes) +(Please try to mention in bullet points.) -- - - -Related Issues (if applicable) +## Link to the issue : -- +(Add link of the issue you have proposed changes to) + +- Link : + +## Tests + +I added the following tests (mention the file name as well): + +- No Test(s) added. + +## Checklist -## Please check that the PR fulfills these requirements +Please check that the PR fulfills all requirements listed below by checking the relevant checkboxes (`[x]`). This will ensure a smooth and quick review process. - [ ] Set a 100 character limit in your editor/IDE to avoid white space diffs in the PR - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Added yourself to AUTHORS.md +- [x] I updated/added relevant documentation (doc comments with `///`). +- [ ] Added relevant reviewers. From 47501504046c82c1a5c31feb8214040a3e695be3 Mon Sep 17 00:00:00 2001 From: Abhishek Saini <78199221+Abhisheksainii@users.noreply.github.com> Date: Sat, 21 Oct 2023 00:13:33 +0530 Subject: [PATCH 10/20] Update AUTHORS.md Added myself to the developers --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 4c2d018fc..cbcbda3e7 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -22,6 +22,7 @@ - Miroslav Mazel - - artchiee - - Tejas Bir Singh - +- Abhishek Saini - ## Translators From 4f05597688cf2a71be0bc93bcb9c3320ae0f975d Mon Sep 17 00:00:00 2001 From: m4skedbyte Date: Fri, 20 Oct 2023 11:12:29 +0000 Subject: [PATCH 11/20] Translated using Weblate (German) Currently translated at 97.4% (226 of 232 strings) Translation: wger Workout Manager/Mobile App Translate-URL: https://hosted.weblate.org/projects/wger/mobile/de/ --- lib/l10n/app_de.arb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index 43b35d5be..6dc0eb90c 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -730,5 +730,23 @@ "swiss_ball": "Gymnastikball", "@swiss_ball": {}, "none__bodyweight_exercise_": "keine (Körpergewichtsübung)", - "@none__bodyweight_exercise_": {} + "@none__bodyweight_exercise_": {}, + "body_weight": "Körpergewicht", + "@body_weight": { + "description": "Generated entry for translation for server strings" + }, + "kg": "kg", + "@kg": { + "description": "Generated entry for translation for server strings" + }, + "kilometers_per_hour": "Kilometer pro Stunde", + "@kilometers_per_hour": { + "description": "Generated entry for translation for server strings" + }, + "miles_per_hour": "Meilen pro Stunde", + "@miles_per_hour": { + "description": "Generated entry for translation for server strings" + }, + "verify": "Verifizieren", + "@verify": {} } From e47ee4e3abfdb18a99e83d16b411c0e18780f355 Mon Sep 17 00:00:00 2001 From: Abhishek Saini <78199221+Abhisheksainii@users.noreply.github.com> Date: Sat, 21 Oct 2023 23:07:26 +0530 Subject: [PATCH 12/20] Update pull_request_template.md Changes : 1. Tests message updated 2. Improved bullet points structure in checklist --- .github/pull_request_template.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f2b73a966..4cf8375ad 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -12,9 +12,7 @@ ## Tests -I added the following tests (mention the file name as well): - -- No Test(s) added. +Please make sure to add tests when implementing new features. ## Checklist @@ -23,5 +21,5 @@ Please check that the PR fulfills all requirements listed below by checking the - [ ] Set a 100 character limit in your editor/IDE to avoid white space diffs in the PR - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Added yourself to AUTHORS.md -- [x] I updated/added relevant documentation (doc comments with `///`). +- [ ] Updated/added relevant documentation (doc comments with `///`). - [ ] Added relevant reviewers. From 3b44d296927ff63abbeea42a4c0a0660a85f21d5 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sat, 21 Oct 2023 13:45:35 +0200 Subject: [PATCH 13/20] Remove debug code --- lib/providers/workout_plans.dart | 1 - macos/Flutter/GeneratedPluginRegistrant.swift | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/providers/workout_plans.dart b/lib/providers/workout_plans.dart index 47dcea351..664468850 100644 --- a/lib/providers/workout_plans.dart +++ b/lib/providers/workout_plans.dart @@ -349,7 +349,6 @@ class WorkoutPlansProvider with ChangeNotifier { 'weightUnit': _weightUnits.map((e) => e.toJson()).toList(), }; prefs.setString('workoutUnits', json.encode(exerciseData)); - log(json.encode(exerciseData)); notifyListeners(); } diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index fa46ecee3..3de627737 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -13,7 +13,7 @@ import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) - FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) + FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) From 4761c6c1429eae5610dfa7a6955993cc55b4e2d1 Mon Sep 17 00:00:00 2001 From: Milo Ivir Date: Sun, 22 Oct 2023 21:03:32 +0000 Subject: [PATCH 14/20] Translated using Weblate (Croatian) Currently translated at 100.0% (4 of 4 strings) Translation: wger Workout Manager/Play Store Translate-URL: https://hosted.weblate.org/projects/wger/play-store/hr/ --- fastlane/metadata/android/hr/full_description.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/metadata/android/hr/full_description.txt b/fastlane/metadata/android/hr/full_description.txt index e6b7b8e45..72d819ac6 100644 --- a/fastlane/metadata/android/hr/full_description.txt +++ b/fastlane/metadata/android/hr/full_description.txt @@ -8,9 +8,9 @@ Razvili smo 100 % besplatan program za digitalno praćenje zdravlja i fitnessa, wger je projekt otvorenog koda za: * Tvoje tijelo -* Tvoje treninge +* Tvoji treninzi * Tvoj napredak -* Tvoje podatke +* Tvoji podaci Tvoje tijelo: Nema potrebe za guglanjem sastojaka omiljenih poslastica – odaberi dnevne obroke od više od 78.000 proizvoda i pogledaj nutritivne vrijednosti. Dodaj obroke u plan prehrane i čuvaj pregled svoje prehrane u kalendaru. From 511cde166924556eae158492df1b3d792b279b2a Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sun, 5 Nov 2023 11:07:35 +0100 Subject: [PATCH 15/20] Remove fl_chart_line.dart, not used --- lib/widgets/core/fl_chart_line.dart | 390 ---------------------------- 1 file changed, 390 deletions(-) delete mode 100644 lib/widgets/core/fl_chart_line.dart diff --git a/lib/widgets/core/fl_chart_line.dart b/lib/widgets/core/fl_chart_line.dart deleted file mode 100644 index 1eb4b007b..000000000 --- a/lib/widgets/core/fl_chart_line.dart +++ /dev/null @@ -1,390 +0,0 @@ -// Fl line chart [SAmple 2 ] for testing -// // #TODO : I may move this content to the core widget file -// - -//import 'package:fl_chart_app/presentation/resources/app_resources.dart'; -import 'dart:math'; - -import 'package:fl_chart/fl_chart.dart'; -import 'package:flutter/material.dart'; -import 'package:wger/helpers/consts.dart'; -import 'package:wger/models/measurements/measurement_entry.dart'; -import 'package:wger/widgets/core/charts.dart'; -//import 'package:intl/intl.dart'; -//import 'package:wger/widgets/core/charts.dart'; - -import 'package:wger/helpers/consts.dart'; - -import 'package:intl/intl.dart'; - -class MeasurementChartEntryflchat { - num value; // this needs to - DateTime date; - - MeasurementChartEntryflchat(this.value, this.date); -} - -class LineChartSample2 extends StatefulWidget { - //#TODO : Substitute below entries to the old entries for data return comapraison !! - final List allentries; - final String unit; - - // entries recieved from original measurement entry (old) - //final List _entries; - - const LineChartSample2(this.allentries, {this.unit = 'kg'}); - - //const LineChartSample2({super.key}); - - @override - State createState() => _LineChartSample2State(); -} - -class AppColors { - static const Color primary = contentColorCyan; - static const Color menuBackground = Color(0xFF090912); - static const Color itemsBackground = Color(0xFF1B2339); - static const Color pageBackground = Color(0xFF282E45); - static const Color mainTextColor1 = Colors.white; - static const Color mainTextColor2 = Colors.white70; - static const Color mainTextColor3 = Colors.white38; - static const Color mainGridLineColor = Colors.white10; - static const Color borderColor = Colors.white54; - static const Color gridLinesColor = Color(0x11FFFFFF); - - static const Color contentColorBlack = Colors.black; - static const Color contentColorWhite = Colors.white; - static const Color contentColorBlue = Color(0xFF2196F3); - static const Color contentColorYellow = Color(0xFFFFC300); - static const Color contentColorOrange = Color(0xFFFF683B); - static const Color contentColorGreen = Color(0xFF3BFF49); - static const Color contentColorPurple = Color(0xFF6E1BFF); - static const Color contentColorPink = Color(0xFFFF3AF2); - static const Color contentColorRed = Color(0xFFE80054); - static const Color contentColorCyan = Color(0xFF50E4FF); -} - -class _LineChartSample2State extends State { - List gradientColors = [ - AppColors.contentColorCyan, - AppColors.contentColorBlue, - ]; - - bool showAvg = false; - - @override - Widget build(BuildContext context) { - return Stack( - children: [ - AspectRatio( - aspectRatio: 1.70, - child: Padding( - padding: const EdgeInsets.only( - right: 18, - left: 12, - top: 24, - bottom: 12, - ), - child: LineChart( - showAvg ? avgData() : mainData(), - ), - ), - ), - SizedBox( - width: 60, - height: 34, - child: TextButton( - onPressed: () { - setState(() { - showAvg = !showAvg; - }); - }, - child: Text( - 'avg', - style: TextStyle( - fontSize: 12, - color: showAvg ? Colors.white.withOpacity(0.5) : Colors.white, - ), - ), - ), - ), - ], - ); - } - - // #TODO : Automatic dates on (x axis) - - SideTitles _bottomTitles() { - return SideTitles( - showTitles: true, - interval: 1, - getTitlesWidget: (value, meta) { - // // #TODO : format dates same as old chart - final getdates = - value.toInt() < widget.allentries.length ? widget.allentries[value.toInt()].date : ""; - - // final datesToStr = getdates.toString(); - - // final tempDate = DateTime.parse(getdates.toString()); - // //debugPrint(('tempDates \n' ) + tempDate.toString() ); - - // final finaldates = DateFormat('MM-dd').format(tempDate); - // debugPrint(('FinaleDates \n') + finaldates); - //final datestoformat = DateFormatLists.format(tempDate); - - // // # used built in above fun to return date format as (yyyy-mm-dd) - // debugPrint(datestoformat); - - // #BUG : if dates are formated -- the chart causes error (invalid dates format) - return SideTitleWidget(axisSide: meta.axisSide, child: Text(getdates.toString())); - }, - ); - } - - // Widget bottomTitleWidgets(double value, TitleMeta meta) { - // const style = TextStyle( - // fontWeight: FontWeight.bold, - // fontSize: 16, - // ); - - // List datesgeneric = [ - // 'Sun', - // 'Feb', - // 'Oct', - // 'Nov', - // ]; - - // //MeasurementChartEntry entry ; - // // Widget text; - // // switch (value.toInt()) { - // // case 2: - // // text = const Text('MAR', style: style); - // // break; - // // case 5: - // // text = const Text('JUN', style: style); - // // break; - // // case 8: - // // text = const Text('SEP', style: style); - // // break; - // // default: - // // text = const Text('', style: style); - // // break; - // // } - - // return SideTitleWidget( - // axisSide: meta.axisSide, - // child:Text('$datesgeneric'), - // ); - // } - - - // #TODO : needs to be changed (values for (y) axis) - Widget leftTitleWidgets(double value, TitleMeta meta) { - const style = TextStyle( - fontWeight: FontWeight.bold, - fontSize: 15, - ); - - String text; - switch (value.toInt()) { - case 1: - text = '10K'; - break; - case 3: - text = '30k'; - break; - case 5: - text = '50k'; - break; - default: - return Container(); - } - - return Text(text, style: style, textAlign: TextAlign.left); - } - - LineChartData mainData() { - return LineChartData( - gridData: FlGridData( - show: true, - drawVerticalLine: true, - horizontalInterval: 1, - verticalInterval: 1, - getDrawingHorizontalLine: (value) { - return FlLine( - color: AppColors.mainGridLineColor, - strokeWidth: 1, - ); - }, - getDrawingVerticalLine: (value) { - return FlLine( - color: AppColors.mainGridLineColor, - strokeWidth: 1, - ); - }, - ), - titlesData: FlTitlesData( - show: true, - rightTitles: AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - topTitles: AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - bottomTitles: AxisTitles( - sideTitles: _bottomTitles(), - ), - - // #FIXME : Custom bottom titles for dates entry - // bottomTitles: AxisTitles( - // sideTitles: SideTitles( - // showTitles: true, - // reservedSize: 30, - // interval: 1, - // getTitlesWidget: bottomTitleWidgets, - // ), - // ), - leftTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - interval: 1, - getTitlesWidget: leftTitleWidgets, - reservedSize: 42, - ), - ), - ), - borderData: FlBorderData( - show: true, - border: Border.all(color: const Color(0xff37434d)), - ), - minX: 0, - maxX: 11, - minY: 0, - maxY: 6, - lineBarsData: [ - LineChartBarData( - // spots: const [ - // FlSpot(0, 3), - // FlSpot(2.6, 2), - // FlSpot(4.9, 5), - // FlSpot(6.8, 3.1), - // FlSpot(8, 4), - // FlSpot(9.5, 3), - // FlSpot(11, 4), - // ], - isCurved: true, - gradient: LinearGradient( - colors: gradientColors, - ), - barWidth: 5, - isStrokeCapRound: true, - dotData: FlDotData( - show: false, - ), - belowBarData: BarAreaData( - show: true, - gradient: LinearGradient( - colors: gradientColors.map((color) => color.withOpacity(0.3)).toList(), - ), - ), - ), - ], - ); - } - - LineChartData avgData() { - return LineChartData( - lineTouchData: LineTouchData(enabled: false), - gridData: FlGridData( - show: true, - drawHorizontalLine: true, - verticalInterval: 1, - horizontalInterval: 1, - getDrawingVerticalLine: (value) { - return FlLine( - color: Color(0xff37434d), - strokeWidth: 1, - ); - }, - getDrawingHorizontalLine: (value) { - return FlLine( - color: Color(0xff37434d), - strokeWidth: 1, - ); - }, - ), - titlesData: FlTitlesData( - show: true, - bottomTitles: AxisTitles( - sideTitles: _bottomTitles(), - // sideTitles: SideTitles( - // showTitles: true, - // reservedSize: 30, - // getTitlesWidget: _, - // interval: 1, - // ), - ), - leftTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: leftTitleWidgets, - reservedSize: 42, - interval: 1, - ), - ), - topTitles: AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - rightTitles: AxisTitles( - sideTitles: SideTitles(showTitles: false), - ), - ), - borderData: FlBorderData( - show: true, - border: Border.all(color: const Color(0xff37434d)), - ), - minX: 0, - maxX: 11, - minY: 0, - maxY: 6, - lineBarsData: [ - LineChartBarData( - // spots: const [ - // FlSpot(0, 3.44), - // FlSpot(2.6, 3.44), - // FlSpot(4.9, 3.44), - // FlSpot(6.8, 3.44), - // FlSpot(8, 3.44), - // FlSpot(9.5, 3.44), - // FlSpot(11, 3.44), - // ], - isCurved: true, - gradient: LinearGradient( - colors: [ - ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!, - ColorTween(begin: gradientColors[0], end: gradientColors[1]).lerp(0.2)!, - ], - ), - barWidth: 5, - isStrokeCapRound: true, - dotData: FlDotData( - show: false, - ), - belowBarData: BarAreaData( - show: true, - gradient: LinearGradient( - colors: [ - ColorTween(begin: gradientColors[0], end: gradientColors[1]) - .lerp(0.2)! - .withOpacity(0.1), - ColorTween(begin: gradientColors[0], end: gradientColors[1]) - .lerp(0.2)! - .withOpacity(0.1), - ], - ), - ), - ), - ], - ); - } -} From 005f4d3db71ab264438a8cfaadf1e63e8087c206 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sun, 5 Nov 2023 11:56:38 +0100 Subject: [PATCH 16/20] Better intervals While this still doesn't look as nice and centered as I would like to, it is at least an improvement --- lib/helpers/charts.dart | 4 ++++ lib/widgets/core/charts.dart | 14 +++++++++----- lib/widgets/workouts/charts.dart | 19 +++++++++++-------- lib/widgets/workouts/log.dart | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 lib/helpers/charts.dart diff --git a/lib/helpers/charts.dart b/lib/helpers/charts.dart new file mode 100644 index 000000000..522d059dc --- /dev/null +++ b/lib/helpers/charts.dart @@ -0,0 +1,4 @@ +double chartGetInterval(DateTime first, DateTime last, {divider: 3}) { + final dayDiff = last.difference(first); + return dayDiff.inMilliseconds.toDouble() / 3; +} diff --git a/lib/widgets/core/charts.dart b/lib/widgets/core/charts.dart index 4fd223ae2..0b62ed2d5 100644 --- a/lib/widgets/core/charts.dart +++ b/lib/widgets/core/charts.dart @@ -19,6 +19,7 @@ import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import 'package:wger/helpers/charts.dart'; import 'package:wger/theme/theme.dart'; class MeasurementChartWidgetFl extends StatefulWidget { @@ -32,8 +33,6 @@ class MeasurementChartWidgetFl extends StatefulWidget { } class _MeasurementChartWidgetFlState extends State { - final interval = 15 * Duration.millisecondsPerDay / 1000 / 60; - @override Widget build(BuildContext context) { return AspectRatio( @@ -84,12 +83,17 @@ class _MeasurementChartWidgetFlState extends State { sideTitles: SideTitles( showTitles: true, getTitlesWidget: (value, meta) { - final DateTime date = DateTime.fromMillisecondsSinceEpoch(value.toInt() * 1000 * 60); + // Don't show the first and last entries, otherwise they'll overlap with the + // calculated interval + if (value == meta.min || value == meta.max) { + return const Text(''); + } + final DateTime date = DateTime.fromMillisecondsSinceEpoch(value.toInt()); return Text( DateFormat.yMd(Localizations.localeOf(context).languageCode).format(date), ); }, - interval: interval, + interval: chartGetInterval(widget._entries.last.date, widget._entries.first.date), ), ), leftTitles: AxisTitles( @@ -112,7 +116,7 @@ class _MeasurementChartWidgetFlState extends State { LineChartBarData( spots: [ ...widget._entries - .map((e) => FlSpot(e.date.millisecondsSinceEpoch / 1000 / 60, e.value.toDouble())) + .map((e) => FlSpot(e.date.millisecondsSinceEpoch.toDouble(), e.value.toDouble())) ], isCurved: false, color: wgerSecondaryColor, diff --git a/lib/widgets/workouts/charts.dart b/lib/widgets/workouts/charts.dart index b7a3f7ec3..082830470 100644 --- a/lib/widgets/workouts/charts.dart +++ b/lib/widgets/workouts/charts.dart @@ -20,6 +20,7 @@ import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:intl/intl.dart'; +import 'package:wger/helpers/charts.dart'; import 'package:wger/helpers/colors.dart'; /// Sample time series data type. @@ -47,8 +48,6 @@ class _LogChartWidgetFlState extends State { aspectRatio: 1.70, child: Padding( padding: const EdgeInsets.only( - right: 18, - left: 12, top: 24, bottom: 12, ), @@ -60,11 +59,6 @@ class _LogChartWidgetFlState extends State { } LineChartData mainData() { - final dayDiff = DateTime.parse(widget._data['logs'].keys.last) - .difference(DateTime.parse(widget._data['logs'].keys.first)); - - final interval = dayDiff.inDays * 1.3 * Duration.millisecondsPerDay; - return LineChartData( gridData: FlGridData( show: true, @@ -96,12 +90,21 @@ class _LogChartWidgetFlState extends State { sideTitles: SideTitles( showTitles: true, getTitlesWidget: (value, meta) { + // Don't show the first and last entries, otherwise they'll overlap with the + // calculated interval + if (value == meta.min || value == meta.max) { + return const Text(''); + } + final DateTime date = DateTime.fromMillisecondsSinceEpoch(value.toInt()); return Text( DateFormat.yMd(Localizations.localeOf(context).languageCode).format(date), ); }, - interval: interval, + interval: chartGetInterval( + DateTime.parse(widget._data['logs'].keys.first), + DateTime.parse(widget._data['logs'].keys.last), + ), ), ), leftTitles: AxisTitles( diff --git a/lib/widgets/workouts/log.dart b/lib/widgets/workouts/log.dart index e58d0d732..2ed27940e 100644 --- a/lib/widgets/workouts/log.dart +++ b/lib/widgets/workouts/log.dart @@ -44,7 +44,7 @@ class ExerciseLogChart extends StatelessWidget { return FutureBuilder( future: getChartEntries(context), builder: (context, AsyncSnapshot> snapshot) => SizedBox( - height: 150, + height: 190, child: snapshot.connectionState == ConnectionState.waiting ? const Center(child: CircularProgressIndicator()) : LogChartWidgetFl(snapshot.data!, _currentDate), From 67f727867c81497ccc172057ead2780b45e7784e Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sun, 5 Nov 2023 14:52:35 +0100 Subject: [PATCH 17/20] Some improvements to interval handling --- lib/helpers/charts.dart | 5 +++-- lib/widgets/core/charts.dart | 4 +++- test/measurements/measurement_entries_screen_test.dart | 10 +++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/helpers/charts.dart b/lib/helpers/charts.dart index 522d059dc..64a0b6e84 100644 --- a/lib/helpers/charts.dart +++ b/lib/helpers/charts.dart @@ -1,4 +1,5 @@ -double chartGetInterval(DateTime first, DateTime last, {divider: 3}) { +double chartGetInterval(DateTime first, DateTime last, {divider = 3}) { final dayDiff = last.difference(first); - return dayDiff.inMilliseconds.toDouble() / 3; + + return dayDiff.inMilliseconds == 0 ? 1000 : dayDiff.inMilliseconds.abs() / divider; } diff --git a/lib/widgets/core/charts.dart b/lib/widgets/core/charts.dart index 0b62ed2d5..1a33cf98f 100644 --- a/lib/widgets/core/charts.dart +++ b/lib/widgets/core/charts.dart @@ -93,7 +93,9 @@ class _MeasurementChartWidgetFlState extends State { DateFormat.yMd(Localizations.localeOf(context).languageCode).format(date), ); }, - interval: chartGetInterval(widget._entries.last.date, widget._entries.first.date), + interval: widget._entries.isNotEmpty + ? chartGetInterval(widget._entries.last.date, widget._entries.first.date) + : 1000, ), ), leftTitles: AxisTitles( diff --git a/test/measurements/measurement_entries_screen_test.dart b/test/measurements/measurement_entries_screen_test.dart index 6182ab373..321a94bf7 100644 --- a/test/measurements/measurement_entries_screen_test.dart +++ b/test/measurements/measurement_entries_screen_test.dart @@ -73,8 +73,8 @@ void main() { expect(find.text('body fat'), findsOneWidget); // Entries - expect(find.text('10.2 %'), findsOneWidget); - expect(find.text('18.1 %'), findsOneWidget); + expect(find.text('10.2 %'), findsNWidgets(2)); + expect(find.text('18.1 %'), findsNWidgets(2)); }); testWidgets('Tests the localization of dates - EN', (WidgetTester tester) async { @@ -83,8 +83,8 @@ void main() { await tester.pumpAndSettle(); // From the entries list and from the chart - expect(find.text('8/1/2021'), findsNWidgets(3)); - expect(find.text('8/10/2021'), findsNWidgets(2)); + expect(find.text('8/1/2021'), findsNWidgets(2)); + expect(find.text('8/10/2021'), findsOneWidget); }); testWidgets('Tests the localization of dates - DE', (WidgetTester tester) async { @@ -92,7 +92,7 @@ void main() { await tester.tap(find.byType(TextButton)); await tester.pumpAndSettle(); - expect(find.text('1.8.2021'), findsOneWidget); + expect(find.text('1.8.2021'), findsNWidgets(2)); expect(find.text('10.8.2021'), findsOneWidget); }); } From 6a9ebadb73afac708107fd6f750915eee730bf18 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sun, 5 Nov 2023 15:12:32 +0100 Subject: [PATCH 18/20] Correctly set the colors for the training logs --- lib/widgets/workouts/charts.dart | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/widgets/workouts/charts.dart b/lib/widgets/workouts/charts.dart index 082830470..621f0fb6d 100644 --- a/lib/widgets/workouts/charts.dart +++ b/lib/widgets/workouts/charts.dart @@ -59,12 +59,12 @@ class _LogChartWidgetFlState extends State { } LineChartData mainData() { + final colors = generateChartColors(widget._data['chart_data'].length).iterator; + return LineChartData( gridData: FlGridData( show: true, drawVerticalLine: true, - //horizontalInterval: 1, - //verticalInterval: interval, getDrawingHorizontalLine: (value) { return FlLine( color: Colors.grey, @@ -124,15 +124,18 @@ class _LogChartWidgetFlState extends State { lineBarsData: [ ...widget._data['chart_data'].map( (e) { + colors.moveNext(); return LineChartBarData( spots: [ - ...e.map((entry) => FlSpot( - DateTime.parse(entry['date']).millisecondsSinceEpoch.toDouble(), - double.parse(entry['weight']), - )) + ...e.map( + (entry) => FlSpot( + DateTime.parse(entry['date']).millisecondsSinceEpoch.toDouble(), + double.parse(entry['weight']), + ), + ) ], isCurved: false, - color: getRandomColor(widget._data['chart_data'].length, e.first['reps']), + color: colors.current, barWidth: 2, isStrokeCapRound: true, dotData: FlDotData( From 2ff02c0935a257e3a0b87efd72ef8ce3574867aa Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sun, 5 Nov 2023 15:14:19 +0100 Subject: [PATCH 19/20] Fix test --- test/weight/weight_screen_test.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/weight/weight_screen_test.dart b/test/weight/weight_screen_test.dart index c95c1c049..96b52f87e 100644 --- a/test/weight/weight_screen_test.dart +++ b/test/weight/weight_screen_test.dart @@ -84,8 +84,8 @@ void main() { await tester.pumpWidget(createWeightScreen()); // One in the entries list, one in the chart - expect(find.text('1/1/2021'), findsNWidgets(2)); - expect(find.text('1/10/2021'), findsNWidgets(2)); + expect(find.text('1/1/2021'), findsOneWidget); + expect(find.text('1/10/2021'), findsOneWidget); }); testWidgets('Tests the localization of dates - DE', (WidgetTester tester) async { From 4fcccf2f61afa862c832a3b71788ed7393a374ac Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sun, 5 Nov 2023 15:20:01 +0100 Subject: [PATCH 20/20] Change tester to findsWidgets For some reason this tests behaves differently on github actions vs locally --- test/measurements/measurement_entries_screen_test.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/measurements/measurement_entries_screen_test.dart b/test/measurements/measurement_entries_screen_test.dart index 321a94bf7..20b9b5dcd 100644 --- a/test/measurements/measurement_entries_screen_test.dart +++ b/test/measurements/measurement_entries_screen_test.dart @@ -83,8 +83,8 @@ void main() { await tester.pumpAndSettle(); // From the entries list and from the chart - expect(find.text('8/1/2021'), findsNWidgets(2)); - expect(find.text('8/10/2021'), findsOneWidget); + expect(find.text('8/1/2021'), findsWidgets); + expect(find.text('8/10/2021'), findsWidgets); }); testWidgets('Tests the localization of dates - DE', (WidgetTester tester) async { @@ -92,7 +92,7 @@ void main() { await tester.tap(find.byType(TextButton)); await tester.pumpAndSettle(); - expect(find.text('1.8.2021'), findsNWidgets(2)); - expect(find.text('10.8.2021'), findsOneWidget); + expect(find.text('1.8.2021'), findsWidgets); + expect(find.text('10.8.2021'), findsWidgets); }); }