From b0c90543ab6e89b6cdeee51bb9a2a6a34c765831 Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Wed, 28 Jul 2021 16:00:34 +0200 Subject: [PATCH] Some cleanup --- .gitignore | 3 ++- App.js | 5 ++--- howto_local_android_build.txt | 7 ++++++- locales/de/translations.js | 2 +- locales/en/translations.js | 4 ++-- state/Reducer.js | 6 ++---- views/LastSessionsView.js | 4 +++- views/MainMenuView.js | 2 +- 8 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index abd02bb..a295efc 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ npm-debug.* *.orig.* web-build/ web-report/ -/dist \ No newline at end of file +/dist +/venv \ No newline at end of file diff --git a/App.js b/App.js index 27c5b6d..5649da5 100644 --- a/App.js +++ b/App.js @@ -38,11 +38,10 @@ i18n.translations = { en: en, de: de, }; -i18n.locale = "de-DE"; //Localization.locale; // Set the locale once at the beginning of your app. +i18n.locale = Localization.locale; // Set the locale once at the beginning of your app. +//i18n.locale = "en-US"; i18n.fallbacks = true; // When a value is missing from a language it'll fallback to another language with the key present. -console.log("locale", i18n.locale); - const persistConfig = { key: 'root', storage: AsyncStorage, diff --git a/howto_local_android_build.txt b/howto_local_android_build.txt index 645bfbb..710196c 100644 --- a/howto_local_android_build.txt +++ b/howto_local_android_build.txt @@ -4,7 +4,12 @@ npm -g install turtle-cli --legacy-peer-deps +# local hosting +expo export --public-url https://swimtracker.bauer.tech/app-update +scp -r dist/* root@server:"/volumes/swimtracker/app-update/" + + # Needs jdk 8 apt install openjdk-8-jdk-headless export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin/:$PATH -turtle setup:android \ No newline at end of file +turtle build:android --type apk --public-url https://swimtracker.bauer.tech/app-update/android-index.json -o app.apk diff --git a/locales/de/translations.js b/locales/de/translations.js index 9eaedcf..5029f4d 100644 --- a/locales/de/translations.js +++ b/locales/de/translations.js @@ -5,7 +5,7 @@ export default { advancedMode: "Mehr Einstellungen", settings: "Einstellungen", help: "Hilfe", - mainMenu_lastSessions: "Letzte Sessions", + lastSessions: "Letzte Sessions", mainMenu_social: "Freunde", mainMenu_swimNow: "Jetzt schwimmen", } diff --git a/locales/en/translations.js b/locales/en/translations.js index e3ddb75..2f2391f 100644 --- a/locales/en/translations.js +++ b/locales/en/translations.js @@ -5,7 +5,7 @@ export default { advancedMode: "Advanced Mode", help: "Need help?", settings: "Settings", - mainMenu_lastSessions: "Last Sessions", + lastSessions: "Last Sessions", mainMenu_social: "Social", - mainMenu_swimNow: "Start training now" + mainMenu_swimNow: "Swim now" } \ No newline at end of file diff --git a/state/Reducer.js b/state/Reducer.js index c4cdc56..63535b1 100644 --- a/state/Reducer.js +++ b/state/Reducer.js @@ -24,17 +24,15 @@ export const stopSession = () => ({ }); const INITIAL_SETTINGS = { - theme: "hot", username: "", - //swimTrackerHost: "192.168.178.107", // am pool - swimTrackerHost: "192.168.42.1", // testgeraet + swimTrackerHost: "swimtracker", analysis: { peaksPerLap: 30, windowSizeInSecs: 5, numMeasurementsPerSec: 10, - kgFactor: 1.0 / 701.0, + kgFactor: 1.0 / (701.0 * 2.4), peakDetector: 'SIMPLE', // either 'SIMPLE' or 'ZSCORE' peakDetectorSimpleThreshold: 2000, diff --git a/views/LastSessionsView.js b/views/LastSessionsView.js index e17a88f..f8378ae 100644 --- a/views/LastSessionsView.js +++ b/views/LastSessionsView.js @@ -20,6 +20,8 @@ import DataAnalysis from '../data_processing/DataAnalysis'; import * as msgpack from 'msgpack-lite'; import { timeSince } from '../utility/TimeUtils'; import XMLParser from 'react-xml-parser'; +import i18n from 'i18n-js'; + function SessionCard(props) { return ( @@ -251,7 +253,7 @@ class LastSessionsView extends React.Component { diff --git a/views/MainMenuView.js b/views/MainMenuView.js index 64901cb..d0a445c 100644 --- a/views/MainMenuView.js +++ b/views/MainMenuView.js @@ -69,7 +69,7 @@ function ButtonGrid(props) { activeOpacity={0.6} > - { i18n.t('mainMenu_lastSessions').toUpperCase().split(" ").join("\n") } + { i18n.t('lastSessions').toUpperCase().split(" ").join("\n") }