Some cleanup

This commit is contained in:
Martin Bauer 2021-07-28 16:00:34 +02:00
parent 472c1246a7
commit b0c90543ab
8 changed files with 19 additions and 14 deletions

3
.gitignore vendored
View File

@ -9,4 +9,5 @@ npm-debug.*
*.orig.* *.orig.*
web-build/ web-build/
web-report/ web-report/
/dist /dist
/venv

5
App.js
View File

@ -38,11 +38,10 @@ i18n.translations = {
en: en, en: en,
de: de, 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. 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 = { const persistConfig = {
key: 'root', key: 'root',
storage: AsyncStorage, storage: AsyncStorage,

View File

@ -4,7 +4,12 @@
npm -g install turtle-cli --legacy-peer-deps 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 # Needs jdk 8
apt install openjdk-8-jdk-headless apt install openjdk-8-jdk-headless
export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin/:$PATH export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin/:$PATH
turtle setup:android turtle build:android --type apk --public-url https://swimtracker.bauer.tech/app-update/android-index.json -o app.apk

View File

@ -5,7 +5,7 @@ export default {
advancedMode: "Mehr Einstellungen", advancedMode: "Mehr Einstellungen",
settings: "Einstellungen", settings: "Einstellungen",
help: "Hilfe", help: "Hilfe",
mainMenu_lastSessions: "Letzte Sessions", lastSessions: "Letzte Sessions",
mainMenu_social: "Freunde", mainMenu_social: "Freunde",
mainMenu_swimNow: "Jetzt schwimmen", mainMenu_swimNow: "Jetzt schwimmen",
} }

View File

@ -5,7 +5,7 @@ export default {
advancedMode: "Advanced Mode", advancedMode: "Advanced Mode",
help: "Need help?", help: "Need help?",
settings: "Settings", settings: "Settings",
mainMenu_lastSessions: "Last Sessions", lastSessions: "Last Sessions",
mainMenu_social: "Social", mainMenu_social: "Social",
mainMenu_swimNow: "Start training now" mainMenu_swimNow: "Swim now"
} }

View File

@ -24,17 +24,15 @@ export const stopSession = () => ({
}); });
const INITIAL_SETTINGS = { const INITIAL_SETTINGS = {
theme: "hot",
username: "", username: "",
//swimTrackerHost: "192.168.178.107", // am pool swimTrackerHost: "swimtracker",
swimTrackerHost: "192.168.42.1", // testgeraet
analysis: { analysis: {
peaksPerLap: 30, peaksPerLap: 30,
windowSizeInSecs: 5, windowSizeInSecs: 5,
numMeasurementsPerSec: 10, numMeasurementsPerSec: 10,
kgFactor: 1.0 / 701.0, kgFactor: 1.0 / (701.0 * 2.4),
peakDetector: 'SIMPLE', // either 'SIMPLE' or 'ZSCORE' peakDetector: 'SIMPLE', // either 'SIMPLE' or 'ZSCORE'
peakDetectorSimpleThreshold: 2000, peakDetectorSimpleThreshold: 2000,

View File

@ -20,6 +20,8 @@ import DataAnalysis from '../data_processing/DataAnalysis';
import * as msgpack from 'msgpack-lite'; import * as msgpack from 'msgpack-lite';
import { timeSince } from '../utility/TimeUtils'; import { timeSince } from '../utility/TimeUtils';
import XMLParser from 'react-xml-parser'; import XMLParser from 'react-xml-parser';
import i18n from 'i18n-js';
function SessionCard(props) { function SessionCard(props) {
return ( return (
@ -251,7 +253,7 @@ class LastSessionsView extends React.Component {
<StatusBar barStyle="light-content" backgroundColor="rgba(0,0,0,0.4)" translucent={true} /> <StatusBar barStyle="light-content" backgroundColor="rgba(0,0,0,0.4)" translucent={true} />
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<ImageHeader <ImageHeader
text="LETZTE SESSIONS" text={ i18n.t('lastSessions').toUpperCase() }
navigation={this.props.navigation} navigation={this.props.navigation}
image={require("../assets/swimmer.jpg")} image={require("../assets/swimmer.jpg")}
/> />

View File

@ -69,7 +69,7 @@ function ButtonGrid(props) {
activeOpacity={0.6} activeOpacity={0.6}
> >
<MaterialCommIcon name="swim" style={buttonGridStyles.icon}></MaterialCommIcon> <MaterialCommIcon name="swim" style={buttonGridStyles.icon}></MaterialCommIcon>
<Text style={buttonGridStyles.buttonText}>{ i18n.t('mainMenu_lastSessions').toUpperCase().split(" ").join("\n") }</Text> <Text style={buttonGridStyles.buttonText}>{ i18n.t('lastSessions').toUpperCase().split(" ").join("\n") }</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={buttonGridStyles.columnContainer}> <View style={buttonGridStyles.columnContainer}>