From 201fb5e2b6f340360fa4a81a83b1e315e687dd79 Mon Sep 17 00:00:00 2001 From: Stefanie Grewenig Date: Sat, 12 Jan 2019 15:44:02 +0100 Subject: [PATCH 1/5] move hard coded headers and explainers from bleeding into cycle day i18n - issue: 127 - by: sg --- components/cycle-day/symptoms/bleeding.js | 18 +++++++++--------- i18n/en/cycle-day.js | 13 ++++++++++++- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/components/cycle-day/symptoms/bleeding.js b/components/cycle-day/symptoms/bleeding.js index a17046b..3f7df98 100644 --- a/components/cycle-day/symptoms/bleeding.js +++ b/components/cycle-day/symptoms/bleeding.js @@ -6,7 +6,7 @@ import { } from 'react-native' import styles from '../../../styles' import { saveSymptom } from '../../../db' -import { bleeding as labels } from '../../../i18n/en/cycle-day' +import { bleeding } from '../../../i18n/en/cycle-day' import ActionButtonFooter from './action-button-footer' import SelectTabGroup from '../select-tab-group' import SymptomSection from './symptom-section' @@ -25,17 +25,17 @@ export default class Bleeding extends Component { render() { const bleedingRadioProps = [ - { label: labels[0], value: 0 }, - { label: labels[1], value: 1 }, - { label: labels[2], value: 2 }, - { label: labels[3], value: 3 }, + { label: bleeding.labels[0], value: 0 }, + { label: bleeding.labels[1], value: 1 }, + { label: bleeding.labels[2], value: 2 }, + { label: bleeding.labels[3], value: 3 }, ] return ( Date: Sat, 12 Jan 2019 15:54:03 +0100 Subject: [PATCH 2/5] move hard coded headers from sex into cycle day and shared labels i18n - issue: 127 - by: sg --- components/cycle-day/symptoms/sex.js | 7 ++++--- i18n/en/cycle-day.js | 2 ++ i18n/en/labels.js | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/cycle-day/symptoms/sex.js b/components/cycle-day/symptoms/sex.js index 6844985..df5d36f 100644 --- a/components/cycle-day/symptoms/sex.js +++ b/components/cycle-day/symptoms/sex.js @@ -7,6 +7,7 @@ import { import styles from '../../../styles' import { saveSymptom } from '../../../db' import { sex as sexLabels, contraceptives as cLabels } from '../../../i18n/en/cycle-day' +import { shared } from '../../../i18n/en/labels' import ActionButtonFooter from './action-button-footer' import SelectBoxGroup from '../select-box-group' import SymptomSection from './symptom-section' @@ -38,7 +39,7 @@ export default class Sex extends Component { { this.setState({ note: val }) diff --git a/i18n/en/cycle-day.js b/i18n/en/cycle-day.js index 2ad53ab..d946000 100644 --- a/i18n/en/cycle-day.js +++ b/i18n/en/cycle-day.js @@ -50,6 +50,7 @@ export const sex = { solo: 'Solo', partner: 'Partner', }, + header: "Activity", explainer: 'Were you sexually active today?', } @@ -65,6 +66,7 @@ export const contraceptives = { none: 'None', other: 'Other', }, + header: "Contraceptives", explainer: 'Did you use contraceptives?' } diff --git a/i18n/en/labels.js b/i18n/en/labels.js index c4b952a..208c75a 100644 --- a/i18n/en/labels.js +++ b/i18n/en/labels.js @@ -16,7 +16,8 @@ export const shared = { cycleDayWithLinebreak: 'Cycle\nday', loading: 'Loading ...', more: 'more', - less: 'less' + less: 'less', + enter: 'Enter' } export const headerTitles = { From 6d88f2bbc0ccdd2be8b10bac9c1cf831a150922f Mon Sep 17 00:00:00 2001 From: Stefanie Grewenig Date: Sat, 12 Jan 2019 15:59:16 +0100 Subject: [PATCH 3/5] use enter from i18n instead of hard-coded string - issue: 127 - by: sg --- components/cycle-day/symptoms/note.js | 3 ++- components/cycle-day/symptoms/pain.js | 3 ++- components/cycle-day/symptoms/temperature.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/cycle-day/symptoms/note.js b/components/cycle-day/symptoms/note.js index d43843d..155a573 100644 --- a/components/cycle-day/symptoms/note.js +++ b/components/cycle-day/symptoms/note.js @@ -10,6 +10,7 @@ import { saveSymptom } from '../../../db' import ActionButtonFooter from './action-button-footer' import SymptomSection from './symptom-section' import { noteExplainer } from '../../../i18n/en/cycle-day' +import { shared } from '../../../i18n/en/labels' export default class Note extends Component { constructor(props) { @@ -33,7 +34,7 @@ export default class Note extends Component { { this.setState({ currentValue: val }) }} diff --git a/components/cycle-day/symptoms/pain.js b/components/cycle-day/symptoms/pain.js index 1a25394..744cefd 100644 --- a/components/cycle-day/symptoms/pain.js +++ b/components/cycle-day/symptoms/pain.js @@ -6,6 +6,7 @@ import { } from 'react-native' import { saveSymptom } from '../../../db' import { pain as labels } from '../../../i18n/en/cycle-day' +import { shared } from '../../../i18n/en/labels' import ActionButtonFooter from './action-button-footer' import SelectBoxGroup from '../select-box-group' import SymptomSection from './symptom-section' @@ -49,7 +50,7 @@ export default class Pain extends Component { { this.setState({note: val}) diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index 32aeb0f..a38e51a 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -142,7 +142,7 @@ export default class Temp extends Component { { this.setState({ note: val }) From a951ffe9590f492e3775704c04d21a2becb18404 Mon Sep 17 00:00:00 2001 From: Stefanie Grewenig Date: Sat, 12 Jan 2019 16:25:40 +0100 Subject: [PATCH 4/5] move hard coded headers and explainers from temperature to i18n labels - issue: 127 - by: sg --- components/cycle-day/symptoms/temperature.js | 10 +++++----- i18n/en/cycle-day.js | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index a38e51a..170df7d 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -101,7 +101,7 @@ export default class Temp extends Component { @@ -112,7 +112,7 @@ export default class Temp extends Component { /> Date: Sat, 12 Jan 2019 16:29:31 +0100 Subject: [PATCH 5/5] postfix all i18n imports with 'labels' - issue: 127 - by: sg --- components/cycle-day/symptoms/note.js | 4 ++-- components/cycle-day/symptoms/pain.js | 4 ++-- components/cycle-day/symptoms/sex.js | 12 ++++++------ components/cycle-day/symptoms/temperature.js | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/components/cycle-day/symptoms/note.js b/components/cycle-day/symptoms/note.js index 155a573..491061b 100644 --- a/components/cycle-day/symptoms/note.js +++ b/components/cycle-day/symptoms/note.js @@ -10,7 +10,7 @@ import { saveSymptom } from '../../../db' import ActionButtonFooter from './action-button-footer' import SymptomSection from './symptom-section' import { noteExplainer } from '../../../i18n/en/cycle-day' -import { shared } from '../../../i18n/en/labels' +import { shared as sharedLabels } from '../../../i18n/en/labels' export default class Note extends Component { constructor(props) { @@ -34,7 +34,7 @@ export default class Note extends Component { { this.setState({ currentValue: val }) }} diff --git a/components/cycle-day/symptoms/pain.js b/components/cycle-day/symptoms/pain.js index 744cefd..7a2d9e3 100644 --- a/components/cycle-day/symptoms/pain.js +++ b/components/cycle-day/symptoms/pain.js @@ -6,7 +6,7 @@ import { } from 'react-native' import { saveSymptom } from '../../../db' import { pain as labels } from '../../../i18n/en/cycle-day' -import { shared } from '../../../i18n/en/labels' +import { shared as sharedLabels } from '../../../i18n/en/labels' import ActionButtonFooter from './action-button-footer' import SelectBoxGroup from '../select-box-group' import SymptomSection from './symptom-section' @@ -50,7 +50,7 @@ export default class Pain extends Component { { this.setState({note: val}) diff --git a/components/cycle-day/symptoms/sex.js b/components/cycle-day/symptoms/sex.js index df5d36f..0e5649b 100644 --- a/components/cycle-day/symptoms/sex.js +++ b/components/cycle-day/symptoms/sex.js @@ -6,8 +6,8 @@ import { } from 'react-native' import styles from '../../../styles' import { saveSymptom } from '../../../db' -import { sex as sexLabels, contraceptives as cLabels } from '../../../i18n/en/cycle-day' -import { shared } from '../../../i18n/en/labels' +import { sex as sexLabels, contraceptives as contraceptivesLabels } from '../../../i18n/en/cycle-day' +import { shared as sharedLabels } from '../../../i18n/en/labels' import ActionButtonFooter from './action-button-footer' import SelectBoxGroup from '../select-box-group' import SymptomSection from './symptom-section' @@ -49,11 +49,11 @@ export default class Sex extends Component { /> @@ -63,7 +63,7 @@ export default class Sex extends Component { { this.setState({ note: val }) diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index 170df7d..ae4634c 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -15,7 +15,7 @@ import styles from '../../../styles' import { LocalTime, ChronoUnit } from 'js-joda' import { temperature as labels } from '../../../i18n/en/cycle-day' import { scaleObservable } from '../../../local-storage' -import { shared } from '../../../i18n/en/labels' +import { shared as sharedLabels } from '../../../i18n/en/labels' import ActionButtonFooter from './action-button-footer' import config from '../../../config' import SymptomSection from './symptom-section' @@ -81,11 +81,11 @@ export default class Temp extends Component { if (warningMsg) { Alert.alert( - shared.warning, + sharedLabels.warning, warningMsg, [ - { text: shared.cancel }, - { text: shared.save, onPress: this.saveTemperature} + { text: sharedLabels.cancel }, + { text: sharedLabels.save, onPress: this.saveTemperature} ] ) } else { @@ -142,7 +142,7 @@ export default class Temp extends Component { { this.setState({ note: val })