Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ android {
applicationId 'com.builderpro.opennotes'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 9
versionName "1.2"
versionCode 10
versionName "1.3"

buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
}
Expand Down
6 changes: 3 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"expo": {
"name": "OpenNotes",
"slug": "open-notes",
"version": "1.2",
"version": "1.3",
"scheme": "opennotes",
"orientation": "default",
"icon": "./assets/icon.png",
Expand All @@ -16,7 +16,7 @@
"ios": {
"bundleIdentifier": "com.builderpro.opennotes",
"icon": "./assets/icon.png",
"buildNumber": "9",
"buildNumber": "10",
"supportsTablet": true,
"usesIcloudStorage": true,
"entitlements": {
Expand Down Expand Up @@ -65,7 +65,7 @@
},
"android": {
"package": "com.builderpro.opennotes",
"versionCode": 9,
"versionCode": 10,
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#F7F7F4"
Expand Down
48 changes: 24 additions & 24 deletions app/note/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import { exportNotebookAsPdf } from '../../src/services/exportService';
import { recordSuccessfulNoteSave } from '../../src/services/lifecycleService';
import { textBoxId, insertedElementId } from '../../src/utils/id';
import { spacing } from '../../src/theme/spacing';
import { t } from '../../src/i18n';
import { typography } from '../../src/theme/typography';
import type { NoteMetadata } from '../../src/types/note';
import type { ToolDescriptor } from '../../src/utils/toolPalette';
Expand Down Expand Up @@ -335,12 +336,12 @@ export default function NoteScreen() {

const startBlankAfterLoadFailure = useCallback(() => {
Alert.alert(
'Start with a blank note?',
'The existing contents of this note could not be read. Starting blank will replace them the next time the note saves.',
t.editor.startBlankTitle,
t.editor.startBlankBody,
[
{ text: 'Cancel', style: 'cancel' },
{ text: t.common.cancel, style: 'cancel' },
{
text: 'Start blank',
text: t.editor.startBlankConfirm,
style: 'destructive',
onPress: () => {
setBodyLoadFailed(false);
Expand Down Expand Up @@ -715,13 +716,13 @@ export default function NoteScreen() {
});
if (!result.ok) {
Alert.alert(
'Export failed',
result.error ?? 'Could not generate a PDF. Please try again.',
t.editor.exportFailedTitle,
result.error ?? t.editor.exportFailedBody,
);
}
} catch (error) {
if (__DEV__) console.warn('[NoteScreen] export failed', error);
Alert.alert('Export failed', 'Could not generate a PDF. Please try again.');
Alert.alert(t.editor.exportFailedTitle, t.editor.exportFailedBody);
} finally {
if (isMountedRef.current) setIsExporting(false);
}
Expand Down Expand Up @@ -757,17 +758,17 @@ export default function NoteScreen() {
return;
}
Alert.alert(
"Couldn't save your note",
'Your latest changes could not be written to storage. Leaving now will discard them.',
t.editor.saveFailedTitle,
t.editor.saveFailedBody,
[
{ text: 'Try again', onPress: () => void attempt() },
{ text: t.editor.tryAgain, onPress: () => void attempt() },
{
text: 'Leave anyway',
text: t.editor.leaveAnyway,
style: 'destructive',
onPress: () => navigateHome(),
},
{
text: 'Stay',
text: t.editor.stay,
style: 'cancel',
onPress: () => {
exitRef.current = 'editing';
Expand Down Expand Up @@ -829,7 +830,7 @@ export default function NoteScreen() {
]}
>
<Text style={[typography.title, { color: theme.colors.text, textAlign: 'center' }]}>
Couldn't open this note
{t.editor.couldNotOpenTitle}
</Text>
<Text
style={[
Expand All @@ -842,26 +843,25 @@ export default function NoteScreen() {
},
]}
>
The note's contents could not be read from storage. Nothing has been
changed; your data is still on this device.
{t.editor.couldNotOpenBody}
</Text>
<Pressable
onPress={retryLoad}
style={[styles.errorButton, { backgroundColor: theme.colors.accent }]}
>
<Text style={[typography.headline, styles.errorButtonLabel]}>Try again</Text>
<Text style={[typography.headline, styles.errorButtonLabel]}>{t.editor.tryAgain}</Text>
</Pressable>
<Pressable
onPress={() => void handleBack()}
style={[styles.errorButton, { backgroundColor: theme.colors.surfaceMuted }]}
>
<Text style={[typography.headline, { color: theme.colors.text }]}>
Back to library
{t.editor.backToLibrary}
</Text>
</Pressable>
<Pressable onPress={startBlankAfterLoadFailure} style={styles.errorTextButton}>
<Text style={[typography.subhead, { color: theme.colors.destructive }]}>
Start with a blank note
{t.editor.startBlankLink}
</Text>
</Pressable>
</View>
Expand All @@ -881,7 +881,7 @@ export default function NoteScreen() {
return (
<View style={[styles.flex, { backgroundColor: theme.colors.background }]}>
<EditorHeader
title={metadata?.title ?? 'Untitled'}
title={metadata?.title ?? t.common.untitled}
status={autosaveStatus}
currentPage={currentPageIndex}
pageCount={Math.max(1, enginePages.length)}
Expand Down Expand Up @@ -983,16 +983,16 @@ export default function NoteScreen() {

<ItemActionsMenu
visible={action?.kind === 'insertImage'}
title="Insert image"
title={t.editor.insertImageTitle}
actions={[
{
key: 'library',
label: 'Choose from Photos',
label: t.editor.chooseFromPhotos,
onPress: () => void handleInsertFromLibrary(),
},
{
key: 'camera',
label: 'Take Photo',
label: t.editor.takePhoto,
onPress: () => void handleInsertFromCamera(),
},
]}
Expand All @@ -1004,9 +1004,9 @@ export default function NoteScreen() {

<RenameDialog
visible={action?.kind === 'rename'}
title="Rename note"
title={t.library.renameNoteTitle}
initialValue={metadata?.title ?? ''}
placeholder="Note title"
placeholder={t.library.noteTitlePlaceholder}
onCancel={() => setAction(null)}
onConfirm={(value) => void handleRename(value)}
/>
Expand Down
8 changes: 4 additions & 4 deletions ios/OpenNotes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@
CODE_SIGN_ENTITLEMENTS = OpenNotes/OpenNotes.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = U2CPXQV7AJ;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -377,7 +377,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2;
MARKETING_VERSION = 1.3;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -403,15 +403,15 @@
CODE_SIGN_ENTITLEMENTS = OpenNotes/OpenNotes.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 9;
CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = U2CPXQV7AJ;
INFOPLIST_FILE = OpenNotes/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2;
MARKETING_VERSION = 1.3;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
4 changes: 2 additions & 2 deletions ios/OpenNotes/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.2</string>
<string>1.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -54,7 +54,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>9</string>
<string>10</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSMinimumSystemVersion</key>
Expand Down
7 changes: 4 additions & 3 deletions src/components/editor/BackgroundSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { Sheet } from '../ui/Sheet';
import { useTheme } from '../../hooks/useTheme';
import { radius, spacing } from '../../theme/spacing';
import { typography } from '../../theme/typography';
import { BACKGROUND_LABELS, BACKGROUND_TYPES } from '../../types/note';
import { BACKGROUND_TYPES } from '../../types/note';
import type { BackgroundType } from '../../types/note';
import { t } from '../../i18n';

export interface BackgroundSheetProps {
visible: boolean;
Expand Down Expand Up @@ -34,7 +35,7 @@ export function BackgroundSheet({
return (
<Sheet visible={visible} onClose={onClose}>
<Text style={[typography.title, { color: theme.colors.text, marginBottom: spacing.md }]}>
Background
{t.editor.backgroundTitle}
</Text>
<View style={styles.grid}>
{BACKGROUND_TYPES.map((type) => {
Expand Down Expand Up @@ -70,7 +71,7 @@ export function BackgroundSheet({
},
]}
>
{BACKGROUND_LABELS[type]}
{t.library.backgrounds[type]}
</Text>
</Pressable>
);
Expand Down
19 changes: 10 additions & 9 deletions src/components/editor/EditorHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useTheme } from '../../hooks/useTheme';
import { spacing } from '../../theme/spacing';
import { typography } from '../../theme/typography';
import type { AutosaveStatus } from '../../hooks/useAutosave';
import { t } from '../../i18n';

export const EDITOR_HEADER_BAR_HEIGHT = 48;

Expand Down Expand Up @@ -54,7 +55,7 @@ export function EditorHeader({
style={({ pressed }) => [styles.sideButton, pressed && { opacity: 0.5 }]}
>
<Ionicons name="chevron-back" size={26} color={theme.colors.accent} />
<Text style={[typography.body, { color: theme.colors.accent }]}>Library</Text>
<Text style={[typography.body, { color: theme.colors.accent }]}>{t.library.backLabel}</Text>
</Pressable>

<Pressable
Expand All @@ -75,14 +76,14 @@ export function EditorHeader({
]}
numberOfLines={1}
>
Page {currentPage + 1} of {pageCount} · {statusLabel(status)}
{t.editor.pageStatus(currentPage + 1, pageCount, statusLabel(status))}
</Text>
</Pressable>

<View style={styles.rightActions}>
<Pressable
accessibilityRole="button"
accessibilityLabel="Pages"
accessibilityLabel={t.editor.pagesA11y}
onPress={onTogglePageSidebar}
disabled={pageCount < 2}
hitSlop={10}
Expand All @@ -98,7 +99,7 @@ export function EditorHeader({

<Pressable
accessibilityRole="button"
accessibilityLabel="Export"
accessibilityLabel={t.editor.exportA11y}
onPress={onExport}
disabled={isExporting}
hitSlop={10}
Expand All @@ -122,15 +123,15 @@ export function EditorHeader({
function statusLabel(status: AutosaveStatus): string {
switch (status) {
case 'idle':
return 'ready';
return t.editor.statusReady;
case 'pending':
return 'unsaved changes';
return t.editor.statusPending;
case 'saving':
return 'saving…';
return t.editor.statusSaving;
case 'saved':
return 'saved';
return t.editor.statusSaved;
case 'error':
return 'save failed';
return t.editor.statusError;
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/components/editor/FloatingToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { useTheme } from '../../hooks/useTheme';
import { radius, spacing } from '../../theme/spacing';
import { TOOL_DESCRIPTORS } from '../../utils/toolPalette';
import type { SupportedTool, ToolDescriptor } from '../../utils/toolPalette';
import { t } from '../../i18n';

const TOOLBAR_PAD = 6;
const EDGE_MARGIN = 12;
Expand Down Expand Up @@ -520,22 +521,22 @@ export function FloatingToolbar({
active={fingerDrawingEnabled}
compact={isCompactHorizontal}
accessibilityLabel={
fingerDrawingEnabled ? 'Disable finger drawing' : 'Enable finger drawing'
fingerDrawingEnabled ? t.editor.disableFingerDrawing : t.editor.enableFingerDrawing
}
onPress={onToggleFingerDrawing}
theme={theme}
/>
<SmallIconButton
iconName="arrow-undo-outline"
compact={isCompactHorizontal}
accessibilityLabel="Undo"
accessibilityLabel={t.editor.undo}
onPress={onUndo}
theme={theme}
/>
<SmallIconButton
iconName="arrow-redo-outline"
compact={isCompactHorizontal}
accessibilityLabel="Redo"
accessibilityLabel={t.editor.redo}
onPress={onRedo}
theme={theme}
/>
Expand Down
Loading
Loading