diff --git a/components/app.js b/components/app.js index 5f7c766..028578e 100644 --- a/components/app.js +++ b/components/app.js @@ -9,7 +9,7 @@ import symptomViews from './cycle-day/symptoms' import Chart from './chart/chart' import Settings from './settings' import Stats from './stats' -import {headerTitles, menuTitles} from './labels' +import {headerTitles, menuTitles} from '../copy/en/labels' import setupNotifications from '../lib/notifications' // design wants everyhting lowercased, but we don't diff --git a/components/chart/chart.js b/components/chart/chart.js index c0cd73d..a94e474 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -11,7 +11,7 @@ import styles from './styles' import { scaleObservable } from '../../local-storage' import config from '../../config' import AppText from '../app-text' -import { shared as labels } from '../labels' +import { shared as labels } from '../../copy/en/labels' import DripIcon from '../../assets/drip-icons' import CycleDayIcon from '../../assets/home-circle' import nothingChanged from '../../db/db-unchanged' diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index 49613b6..7430041 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 '../../../copy/en/cycle-day' import { scaleObservable } from '../../../local-storage' -import { shared } from '../../labels' +import { shared } from '../../../copy/en/labels' import ActionButtonFooter from './action-button-footer' import config from '../../../config' import SymptomSection from './symptom-section' diff --git a/components/home.js b/components/home.js index 9553ba8..db7d93b 100644 --- a/components/home.js +++ b/components/home.js @@ -4,7 +4,7 @@ import { LocalDate, ChronoUnit } from 'js-joda' import Icon from 'react-native-vector-icons/Entypo' import { Surface } from 'react-native/Libraries/ART/ReactNativeART' import { secondaryColor, cycleDayColor, periodColor } from '../styles' -import { home as labels, bleedingPrediction as predictLabels, shared } from './labels' +import { home as labels, bleedingPrediction as predictLabels, shared } from '../copy/en/labels' import CycleDayIcon from '../assets/home-circle' import Drop from '../assets/home-drop' import cycleModule from '../lib/cycle' diff --git a/components/password-prompt.js b/components/password-prompt.js index dec0b68..1606fb0 100644 --- a/components/password-prompt.js +++ b/components/password-prompt.js @@ -4,7 +4,7 @@ import nodejs from 'nodejs-mobile-react-native' import { saveEncryptionFlag } from '../local-storage' import AppText from './app-text' import styles from '../styles' -import { passwordPrompt as labels, shared } from './labels' +import { passwordPrompt as labels, shared } from '../copy/en/labels' import { requestHash, deleteDbAndOpenNew, openDb } from '../db' export default class PasswordPrompt extends Component { diff --git a/components/settings/alert-error.js b/components/settings/alert-error.js index ae37540..fe38876 100644 --- a/components/settings/alert-error.js +++ b/components/settings/alert-error.js @@ -1,5 +1,5 @@ import { Alert } from 'react-native' -import { shared as sharedLabels } from '../labels' +import { shared as sharedLabels } from '../../copy/en/labels' export default function alertError(msg) { Alert.alert(sharedLabels.errorTitle, msg) diff --git a/components/settings/export-dialog.js b/components/settings/export-dialog.js index 4e3c21f..dc23aad 100644 --- a/components/settings/export-dialog.js +++ b/components/settings/export-dialog.js @@ -1,7 +1,7 @@ import Share from 'react-native-share' import getDataAsCsvDataUri from '../../lib/import-export/export-to-csv' import alertError from './alert-error' -import { settings as labels } from '../labels' +import { settings as labels } from '../../copy/en/labels' export default async function openShareDialogAndExport() { let data diff --git a/components/settings/import-dialog.js b/components/settings/import-dialog.js index a076717..c48bd89 100644 --- a/components/settings/import-dialog.js +++ b/components/settings/import-dialog.js @@ -2,7 +2,7 @@ import { Alert } from 'react-native' import { DocumentPicker, DocumentPickerUtil } from 'react-native-document-picker' import rnfs from 'react-native-fs' import importCsv from '../../lib/import-export/import-from-csv' -import { settings as labels, shared as sharedLabels } from '../labels' +import { settings as labels, shared as sharedLabels } from '../../copy/en/labels' import alertError from './alert-error' export default function openImportDialogAndImport() { diff --git a/components/settings/index.js b/components/settings/index.js index fd432f8..11568dc 100644 --- a/components/settings/index.js +++ b/components/settings/index.js @@ -5,7 +5,7 @@ import { ScrollView, } from 'react-native' import styles from '../../styles/index' -import { settings as labels } from '../labels' +import { settings as labels } from '../../copy/en/labels' import AppText from '../app-text' import TempReminderPicker from './temp-reminder-picker' import PeriodReminderPicker from './period-reminder' diff --git a/components/settings/password/check-current-password.js b/components/settings/password/check-current-password.js index 7d60308..d4050e7 100644 --- a/components/settings/password/check-current-password.js +++ b/components/settings/password/check-current-password.js @@ -1,6 +1,6 @@ import { Alert } from 'react-native' import { openDb } from '../../../db' -import { shared } from '../../labels' +import { shared } from '../../../copy/en/labels' export default async function checkPassword({hash, onCancel, onTryAgain }) { const connected = await openDb(hash) diff --git a/components/settings/password/create.js b/components/settings/password/create.js index 7e04294..5f0fef5 100644 --- a/components/settings/password/create.js +++ b/components/settings/password/create.js @@ -6,7 +6,7 @@ import { import nodejs from 'nodejs-mobile-react-native' import AppText from '../../app-text' import styles from '../../../styles' -import { settings as labels } from '../../labels' +import { settings as labels } from '../../../copy/en/settings' import { requestHash, changeEncryptionAndRestartApp } from '../../../db' import PasswordField from './password-field' import showBackUpReminder from './show-backup-reminder' diff --git a/components/settings/password/delete.js b/components/settings/password/delete.js index 74fcd6b..73b4e77 100644 --- a/components/settings/password/delete.js +++ b/components/settings/password/delete.js @@ -6,7 +6,7 @@ import { import nodejs from 'nodejs-mobile-react-native' import AppText from '../../app-text' import styles from '../../../styles' -import { settings as labels } from '../../labels' +import { settings as labels } from '../../../copy/en/settings' import { requestHash, changeEncryptionAndRestartApp } from '../../../db' import PasswordField from './password-field' import showBackUpReminder from './show-backup-reminder' diff --git a/components/settings/password/index.js b/components/settings/password/index.js index 7a11744..7f22215 100644 --- a/components/settings/password/index.js +++ b/components/settings/password/index.js @@ -8,7 +8,7 @@ import { hasEncryptionObservable } from '../../../local-storage' import styles from '../../../styles/index' -import { settings as labels } from '../../labels' +import { settings as labels } from '../../../copy/en/labels' export default class PasswordSetting extends Component { constructor(props) { diff --git a/components/settings/password/show-backup-reminder.js b/components/settings/password/show-backup-reminder.js index 11a7d83..bf5bbcf 100644 --- a/components/settings/password/show-backup-reminder.js +++ b/components/settings/password/show-backup-reminder.js @@ -1,5 +1,5 @@ import { Alert } from 'react-native' -import { settings as labels, shared } from '../../labels' +import { settings as labels, shared } from '../../../copy/en/labels' export default function showBackUpReminder(okHandler, isDelete) { let title, message diff --git a/components/settings/password/update.js b/components/settings/password/update.js index 2681d2e..88b9a9c 100644 --- a/components/settings/password/update.js +++ b/components/settings/password/update.js @@ -6,7 +6,7 @@ import { import nodejs from 'nodejs-mobile-react-native' import AppText from '../../app-text' import styles from '../../../styles' -import { settings as labels, shared } from '../../labels' +import { settings as labels, shared } from '../../../copy/en/labels' import { requestHash, changeEncryptionAndRestartApp } from '../../../db' import PasswordField from './password-field' import showBackUpReminder from './show-backup-reminder' diff --git a/components/settings/period-reminder.js b/components/settings/period-reminder.js index 3624e2f..f8e1759 100644 --- a/components/settings/period-reminder.js +++ b/components/settings/period-reminder.js @@ -9,7 +9,7 @@ import { savePeriodReminder } from '../../local-storage' import styles from '../../styles/index' -import { settings as labels } from '../labels' +import { settings as labels } from '../../copy/en/labels' export default class PeriodReminderPicker extends Component { constructor(props) { diff --git a/components/settings/temp-reminder-picker.js b/components/settings/temp-reminder-picker.js index b3a2a4e..7ae6cc3 100644 --- a/components/settings/temp-reminder-picker.js +++ b/components/settings/temp-reminder-picker.js @@ -11,7 +11,7 @@ import { saveTempReminder } from '../../local-storage' import styles from '../../styles/index' -import { settings as labels } from '../labels' +import { settings as labels } from '../../copy/en/labels' import padWithZeros from '../helpers/pad-time-with-zeros' export default class TempReminderPicker extends Component { diff --git a/components/settings/temp-slider.js b/components/settings/temp-slider.js index 1bd0976..2d26c15 100644 --- a/components/settings/temp-slider.js +++ b/components/settings/temp-slider.js @@ -7,7 +7,7 @@ import { saveTempScale, } from '../../local-storage' import { secondaryColor } from '../../styles/index' -import { settings as labels } from '../labels' +import { settings as labels } from '../../copy/en/labels' import config from '../../config' import alertError from './alert-error' diff --git a/components/stats.js b/components/stats.js index a888de4..38268c7 100644 --- a/components/stats.js +++ b/components/stats.js @@ -7,7 +7,7 @@ import { import styles from '../styles/index' import cycleModule from '../lib/cycle' import {getCycleLengthStats as getCycleInfo} from '../lib/cycle-length' -import {stats as labels} from './labels' +import {stats as labels} from '../copy/en/labels' import AppText from './app-text' import { getCycleStartsSortedByDate } from '../db' diff --git a/components/labels.js b/copy/en/labels.js similarity index 58% rename from components/labels.js rename to copy/en/labels.js index 6a9709c..059e2c0 100644 --- a/components/labels.js +++ b/copy/en/labels.js @@ -16,70 +16,6 @@ export const shared = { less: 'less' } -export const settings = { - export: { - errors: { - noData: 'There is no data to export', - couldNotConvert: 'Could not convert data to CSV', - problemSharing: 'There was a problem sharing the data export file' - }, - title: 'My Drip data export', - subject: 'My Drip data export', - button: 'Export data', - segmentExplainer: 'Export data in CSV format for backup or so you can use it elsewhere' - }, - import: { - button: 'Import data', - title: 'Keep existing data?', - message: `There are two options for the import: -1. Keep existing cycle days and replace only the ones in the import file. -2. Delete all existing cycle days and import cycle days from file.`, - replaceOption: 'Import and replace', - deleteOption: 'Import and delete existing', - errors: { - couldNotOpenFile: 'Could not open file', - postFix: 'No data was imported or changed' - }, - success: { - message: 'Data successfully imported' - }, - segmentExplainer: 'Import data in CSV format' - }, - tempScale: { - segmentTitle: 'Temperature scale', - segmentExplainer: 'Change the minimum and maximum value for the temperature chart', - min: 'Min', - max: 'Max', - loadError: 'Could not load saved temperature scale settings', - saveError: 'Could not save temperature scale settings' - }, - tempReminder: { - title: 'Temperature reminder', - noTimeSet: 'Set a time for a daily reminder to take your temperature', - timeSet: time => `Daily reminder set for ${time}`, - notification: 'Record your morning temperature' - }, - periodReminder: { - title: 'Next period reminder', - reminderText: 'Get a notification 3 days before your next period is likely to start.', - notification: daysToEndOfPrediction => `Your next period is likely to start in 3 to ${daysToEndOfPrediction} days.` - }, - passwordSettings: { - title: 'App password', - explainerDisabled: "Encrypt the app's database with a password. You need to enter the password every time the app is started.", - explainerEnabled: "Password protection and database encryption is currently enabled", - setPassword: 'Set password', - changePassword: 'Change password', - deletePassword: 'Delete password', - enterCurrent: "Please enter your current password", - enterNew: "Please enter a new password", - backupReminderTitle: 'Read this before making changes to your password', - backupReminder: 'Just to be safe, please backup your data using the export function before making changes to your password.\n\nLonger passwords are better! Consider using a passphrase.\n\nPlease also make sure you do not lose your password. There is no way to recover your data if you do.\n\nMaking any changes to your password setting will keep your data as it was before and restart the app.', - deleteBackupReminderTitle: 'Read this before deleting your password', - deleteBackupReminder: 'Deleting your password means your data will no longer be encrypted.\n\nJust to be safe, please backup your data using the export function before deleting your password.\n\nMaking any changes to your password setting will keep your data as it was before and restart the app.', - } -} - export const headerTitles = { Home: 'Home', Calendar: 'Calendar', diff --git a/copy/en/settings.js b/copy/en/settings.js new file mode 100644 index 0000000..e985f7d --- /dev/null +++ b/copy/en/settings.js @@ -0,0 +1,63 @@ +export const settings = { + export: { + errors: { + noData: 'There is no data to export', + couldNotConvert: 'Could not convert data to CSV', + problemSharing: 'There was a problem sharing the data export file' + }, + title: 'My Drip data export', + subject: 'My Drip data export', + button: 'Export data', + segmentExplainer: 'Export data in CSV format for backup or so you can use it elsewhere' + }, + import: { + button: 'Import data', + title: 'Keep existing data?', + message: `There are two options for the import: +1. Keep existing cycle days and replace only the ones in the import file. +2. Delete all existing cycle days and import cycle days from file.`, + replaceOption: 'Import and replace', + deleteOption: 'Import and delete existing', + errors: { + couldNotOpenFile: 'Could not open file', + postFix: 'No data was imported or changed' + }, + success: { + message: 'Data successfully imported' + }, + segmentExplainer: 'Import data in CSV format' + }, + tempScale: { + segmentTitle: 'Temperature scale', + segmentExplainer: 'Change the minimum and maximum value for the temperature chart', + min: 'Min', + max: 'Max', + loadError: 'Could not load saved temperature scale settings', + saveError: 'Could not save temperature scale settings' + }, + tempReminder: { + title: 'Temperature reminder', + noTimeSet: 'Set a time for a daily reminder to take your temperature', + timeSet: time => `Daily reminder set for ${time}`, + notification: 'Record your morning temperature' + }, + periodReminder: { + title: 'Next period reminder', + reminderText: 'Get a notification 3 days before your next period is likely to start.', + notification: daysToEndOfPrediction => `Your next period is likely to start in 3 to ${daysToEndOfPrediction} days.` + }, + passwordSettings: { + title: 'App password', + explainerDisabled: "Encrypt the app's database with a password. You need to enter the password every time the app is started.", + explainerEnabled: "Password protection and database encryption is currently enabled", + setPassword: 'Set password', + changePassword: 'Change password', + deletePassword: 'Delete password', + enterCurrent: "Please enter your current password", + enterNew: "Please enter a new password", + backupReminderTitle: 'Read this before making changes to your password', + backupReminder: 'Just to be safe, please backup your data using the export function before making changes to your password.\n\nLonger passwords are better! Consider using a passphrase.\n\nPlease also make sure you do not lose your password. There is no way to recover your data if you do.\n\nMaking any changes to your password setting will keep your data as it was before and restart the app.', + deleteBackupReminderTitle: 'Read this before deleting your password', + deleteBackupReminder: 'Deleting your password means your data will no longer be encrypted.\n\nJust to be safe, please backup your data using the export function before deleting your password.\n\nMaking any changes to your password setting will keep your data as it was before and restart the app.', + } +} \ No newline at end of file diff --git a/lib/notifications.js b/lib/notifications.js index 6382481..1915c45 100644 --- a/lib/notifications.js +++ b/lib/notifications.js @@ -2,7 +2,7 @@ import {tempReminderObservable, periodReminderObservable} from '../local-storage import Notification from 'react-native-push-notification' import { LocalDate } from 'js-joda' import Moment from 'moment' -import { settings as labels } from '../components/labels' +import { settings as labels } from '../copy/en/labels' import { getBleedingDaysSortedByDate } from '../db' import cycleModule from './cycle' import nothingChanged from '../db/db-unchanged' diff --git a/lib/sympto-adapter.js b/lib/sympto-adapter.js index a6d0d7e..44b09cb 100644 --- a/lib/sympto-adapter.js +++ b/lib/sympto-adapter.js @@ -1,6 +1,6 @@ import getFertilityStatus from './sympto' import cycleModule from './cycle' -import { fertilityStatus } from '../components/labels' +import { fertilityStatus } from '../copy/en/labels' export function getFertilityStatusForDay(dateString) { const status = getCycleStatusForDay(dateString)