Skip to content

Send files directly between devices over the internet - no cloud storage, no size limits.

Add shared i18n infrastructure with 12 locales (#20)

Acentristf9a5c48382fa
diff --git a/.prettierignore b/.prettierignore
index 039b15d..a92bca3 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -17,6 +17,7 @@ apps/mobile/.expo
# Generated from tokens.json by scripts/generate-tokens.mjs
packages/components/src/theme/tokens.raw.ts
packages/components/src/theme/tokens.css.ts
+packages/components/src/theme/tokens.css.native.ts
packages/components/src/theme/themes/dark.ts
packages/components/src/theme/themes/dark.css.ts
packages/components/src/theme/themes/light.ts
diff --git a/README.md b/README.md
index 62363ad..0d22c91 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,7 @@
- [Run](#run)
- [Build](#build)
- [Project structure](#project-structure)
+ - [Internationalization](#internationalization)
- [Tech stack](#tech-stack)
- [Crash reporting](#crash-reporting)
- [Contributing](#contributing)
@@ -136,12 +137,18 @@ packages/
core/ P2P protocol — Hyperswarm, Hyperdrive, RPC
domain/ State management — Zustand store, business logic
components/ Cross-platform UI — React Strict DOM + Tailwind
+ locales/ Shared locale metadata, i18next setup, and catalogs
docs/
architecture.md Full system overview
+ i18n.md Translation workflow and locale coverage
```
See [docs/architecture.md](docs/architecture.md) for data flow and inter-process boundaries.
+### Internationalization
+
+Desktop and mobile share locale resolution, metadata, and translation catalogs through `@altersend/locales`. Multi-language UI is currently release-gated by `isMultiLangEnabled = false`, which hides language pickers and keeps the active app locale at `en-US` until the feature is ready to ship. See [docs/i18n.md](docs/i18n.md) for the translation workflow.
+
### Tech stack
[Electron](https://electronjs.org) · [React Native](https://reactnative.dev) · [Expo](https://expo.dev) · [Bare](https://bare.pears.com) · [Hyperswarm](https://github.com/holepunchto/hyperswarm) · [Hyperdrive](https://github.com/holepunchto/hyperdrive) · [React Strict DOM](https://github.com/facebook/react-strict-dom) · [Tailwind](https://tailwindcss.com) · [Zustand](https://github.com/pmndrs/zustand)
diff --git a/apps/desktop/build/locales/de.lproj/InfoPlist.strings b/apps/desktop/build/locales/de.lproj/InfoPlist.strings
new file mode 100644
index 0000000..5f1b312
--- /dev/null
+++ b/apps/desktop/build/locales/de.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend verwendet Ihre Kamera, um QR-Verbindungscodes zu scannen.";
diff --git a/apps/desktop/build/locales/en.lproj/InfoPlist.strings b/apps/desktop/build/locales/en.lproj/InfoPlist.strings
new file mode 100644
index 0000000..cbc8fe2
--- /dev/null
+++ b/apps/desktop/build/locales/en.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend uses your camera to scan connection QR codes.";
diff --git a/apps/desktop/build/locales/en_GB.lproj/InfoPlist.strings b/apps/desktop/build/locales/en_GB.lproj/InfoPlist.strings
new file mode 100644
index 0000000..cbc8fe2
--- /dev/null
+++ b/apps/desktop/build/locales/en_GB.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend uses your camera to scan connection QR codes.";
diff --git a/apps/desktop/build/locales/es-419.lproj/InfoPlist.strings b/apps/desktop/build/locales/es-419.lproj/InfoPlist.strings
new file mode 100644
index 0000000..3e473eb
--- /dev/null
+++ b/apps/desktop/build/locales/es-419.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend usa tu cámara para escanear códigos de conexión QR.";
diff --git a/apps/desktop/build/locales/es.lproj/InfoPlist.strings b/apps/desktop/build/locales/es.lproj/InfoPlist.strings
new file mode 100644
index 0000000..3e473eb
--- /dev/null
+++ b/apps/desktop/build/locales/es.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend usa tu cámara para escanear códigos de conexión QR.";
diff --git a/apps/desktop/build/locales/fr.lproj/InfoPlist.strings b/apps/desktop/build/locales/fr.lproj/InfoPlist.strings
new file mode 100644
index 0000000..cd04228
--- /dev/null
+++ b/apps/desktop/build/locales/fr.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend utilise votre caméra pour scanner les codes de connexion QR.";
diff --git a/apps/desktop/build/locales/it.lproj/InfoPlist.strings b/apps/desktop/build/locales/it.lproj/InfoPlist.strings
new file mode 100644
index 0000000..0e27803
--- /dev/null
+++ b/apps/desktop/build/locales/it.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend utilizza la fotocamera per scansionare i codici di connessione QR.";
diff --git a/apps/desktop/build/locales/ja.lproj/InfoPlist.strings b/apps/desktop/build/locales/ja.lproj/InfoPlist.strings
new file mode 100644
index 0000000..2bb5fe7
--- /dev/null
+++ b/apps/desktop/build/locales/ja.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend は接続QRコードをスキャンするためにカメラを使用します。";
diff --git a/apps/desktop/build/locales/ko.lproj/InfoPlist.strings b/apps/desktop/build/locales/ko.lproj/InfoPlist.strings
new file mode 100644
index 0000000..f5618a0
--- /dev/null
+++ b/apps/desktop/build/locales/ko.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend가 카메라를 사용하여 연결 QR 코드를 스캔합니다.";
diff --git a/apps/desktop/build/locales/pt-BR.lproj/InfoPlist.strings b/apps/desktop/build/locales/pt-BR.lproj/InfoPlist.strings
new file mode 100644
index 0000000..fdb368a
--- /dev/null
+++ b/apps/desktop/build/locales/pt-BR.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "O AlterSend usa sua câmera para escanear códigos QR de conexão.";
diff --git a/apps/desktop/build/locales/zh-Hans.lproj/InfoPlist.strings b/apps/desktop/build/locales/zh-Hans.lproj/InfoPlist.strings
new file mode 100644
index 0000000..d0d0a22
--- /dev/null
+++ b/apps/desktop/build/locales/zh-Hans.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend 使用相机扫描连接 QR 码。";
diff --git a/apps/desktop/build/locales/zh-Hant.lproj/InfoPlist.strings b/apps/desktop/build/locales/zh-Hant.lproj/InfoPlist.strings
new file mode 100644
index 0000000..4848835
--- /dev/null
+++ b/apps/desktop/build/locales/zh-Hant.lproj/InfoPlist.strings
@@ -0,0 +1,2 @@
+"CFBundleDisplayName" = "AlterSend";
+"NSCameraUsageDescription" = "AlterSend 使用相機掃描連線 QR 碼。";
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index 26baad9..7a22a75 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -10,7 +10,7 @@
"main": "dist/electron/main.js",
"private": true,
"scripts": {
- "build": "node scripts/gen-sentry-dsn.cjs && tsc -p src/tsconfig.electron.json && cp src/electron/preload.cjs dist/electron/ && vite build",
+ "build": "node scripts/gen-sentry-dsn.cjs && tsc -p src/tsconfig.electron.json && node scripts/copy-preload.cjs && vite build",
"build:electron": "node scripts/gen-sentry-dsn.cjs && tsc -p src/tsconfig.electron.json",
"build:renderer": "vite build",
"typecheck": "tsc --noEmit -p src/tsconfig.electron.json && tsc --noEmit -p tsconfig.json",
diff --git a/apps/desktop/postcss.config.mjs b/apps/desktop/postcss.config.mjs
index 3408dab..76a8338 100644
--- a/apps/desktop/postcss.config.mjs
+++ b/apps/desktop/postcss.config.mjs
@@ -5,6 +5,7 @@ export default {
'src/renderer/**/*.{js,jsx,mjs,ts,tsx}',
'../../packages/components/src/**/*.{js,jsx,mjs,ts,tsx}',
],
+ exclude: ['../../packages/components/src/**/*.native.{js,jsx,mjs,ts,tsx}'],
babelConfig: (await import('./babel.config.cjs')).default,
useLayers: true,
},
diff --git a/apps/desktop/scripts/afterPack.cjs b/apps/desktop/scripts/afterPack.cjs
index 5ef4517..c3053e2 100644
--- a/apps/desktop/scripts/afterPack.cjs
+++ b/apps/desktop/scripts/afterPack.cjs
@@ -18,6 +18,7 @@
const fs = require('fs')
const fsp = require('fs/promises')
const path = require('path')
+const releaseConfig = require('../../../packages/locales/src/release.json')
const ARCH_NAMES = {
0: 'ia32',
@@ -28,6 +29,7 @@ const ARCH_NAMES = {
}
exports.default = async function afterPack(context) {
+ await copyMacLocalizations(context)
await prunePrebuilds(context)
if (context.electronPlatformName === 'linux') {
@@ -35,6 +37,33 @@ exports.default = async function afterPack(context) {
}
}
+async function copyMacLocalizations(context) {
+ if (context.electronPlatformName !== 'darwin' && context.electronPlatformName !== 'mas') return
+
+ const sourceDir = path.join(__dirname, '..', 'build', 'locales')
+ if (!fs.existsSync(sourceDir)) return
+
+ const appName = context.packager.appInfo.productFilename
+ const resourcesDir = path.join(context.appOutDir, `${appName}.app`, 'Contents', 'Resources')
+ const entries = await safeReadDir(sourceDir)
+
+ const localeEntries = releaseConfig.isMultiLangEnabled
+ ? entries
+ : entries.filter((entry) => entry.name === 'en.lproj')
+
+ for (const entry of localeEntries) {
+ if (!entry.isDirectory() || !entry.name.endsWith('.lproj')) continue
+ const targetDir = path.join(resourcesDir, entry.name)
+ await fsp.mkdir(targetDir, { recursive: true })
+ await fsp.copyFile(
+ path.join(sourceDir, entry.name, 'InfoPlist.strings'),
+ path.join(targetDir, 'InfoPlist.strings')
+ )
+ }
+
+ console.log(`afterPack: copied ${localeEntries.length} macOS localization dir(s)`)
+}
+
async function prunePrebuilds(context) {
const { appOutDir, electronPlatformName, arch, packager } = context
const archName = ARCH_NAMES[arch] ?? String(arch)
diff --git a/apps/desktop/scripts/copy-preload.cjs b/apps/desktop/scripts/copy-preload.cjs
new file mode 100644
index 0000000..1e1bc92
--- /dev/null
+++ b/apps/desktop/scripts/copy-preload.cjs
@@ -0,0 +1,10 @@
+#!/usr/bin/env node
+const { copyFileSync, mkdirSync } = require('fs')
+const path = require('path')
+
+const appRoot = path.join(__dirname, '..')
+const source = path.join(appRoot, 'src', 'electron', 'preload.cjs')
+const targetDir = path.join(appRoot, 'dist', 'electron')
+
+mkdirSync(targetDir, { recursive: true })
+copyFileSync(source, path.join(targetDir, 'preload.cjs'))
diff --git a/apps/desktop/src/renderer/components/QRCode.tsx b/apps/desktop/src/renderer/components/QRCode.tsx
index d4d25c0..0a3002e 100644
--- a/apps/desktop/src/renderer/components/QRCode.tsx
+++ b/apps/desktop/src/renderer/components/QRCode.tsx
@@ -5,9 +5,11 @@ import { useTheme } from '@altersend/components'
interface QRCodeProps {
value: string
size?: number
+ loadingLabel: string
+ imageLabel: string
}
-export function QRCode({ value, size = 220 }: QRCodeProps) {
+export function QRCode({ value, loadingLabel, imageLabel, size = 220 }: QRCodeProps) {
const [svg, setSvg] = useState<string | null>(null)
const { theme } = useTheme()
const dark = theme.colors.colorBackground
@@ -53,14 +55,14 @@ export function QRCode({ value, size = 220 }: QRCodeProps) {
className='flex items-center justify-center rounded-lg bg-background-subtle text-[12px] text-text-muted'
style={{ width: size, height: size }}
>
- Generating…
+ {loadingLabel}
</div>
)
}
return (
<div
- aria-label='QR code for connection key'
+ aria-label={imageLabel}
className='rounded-lg p-3'
dangerouslySetInnerHTML={{ __html: svg }}
role='img'
diff --git a/apps/desktop/src/renderer/components/QRModal.tsx b/apps/desktop/src/renderer/components/QRModal.tsx
index 64f7a80..592bfda 100644
--- a/apps/desktop/src/renderer/components/QRModal.tsx
+++ b/apps/desktop/src/renderer/components/QRModal.tsx
@@ -1,6 +1,7 @@
import { useEffect } from 'react'
import { buildJoinUrl } from '@altersend/domain'
import { CloseIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import { QRCode } from './QRCode'
interface QRModalProps {
@@ -10,6 +11,7 @@ interface QRModalProps {
}
export function QRModal({ topic, open, onClose }: QRModalProps) {
+ const { t } = useTranslation(['send', 'common'])
useEffect(() => {
if (!open) return
const onKey = (event: KeyboardEvent) => {
@@ -42,14 +44,14 @@ export function QRModal({ topic, open, onClose }: QRModalProps) {
<div className='relative flex items-start justify-center px-10 pb-1 pt-5'>
<div className='text-center'>
<span className='block text-[17px] font-semibold text-text-primary'>
- Scan to connect
+ {t('send:connection.scanToConnect')}
</span>
<p className='m-0 mt-1 text-[12px] leading-relaxed text-text-muted'>
- Open AlterSend on another device and scan this code
+ {t('send:connection.qrModalDescription')}
</p>
</div>
<button
- aria-label='Close'
+ aria-label={t('common:actions.close')}
className='absolute right-4 top-4 inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border-none bg-transparent p-0 text-text-muted transition-colors hover:bg-surface-secondary hover:text-text-primary'
onClick={onClose}
style={{ appearance: 'none' }}
@@ -61,7 +63,12 @@ export function QRModal({ topic, open, onClose }: QRModalProps) {
<div className='flex justify-center px-6 pb-6 pt-4'>
<div className='overflow-hidden rounded-[12px]'>
- <QRCode size={240} value={buildJoinUrl(topic)} />
+ <QRCode
+ imageLabel={t('send:connection.qrCodeLabel')}
+ loadingLabel={t('send:connection.generating')}
+ size={240}
+ value={buildJoinUrl(topic)}
+ />
</div>
</div>
</div>
diff --git a/apps/desktop/src/renderer/components/Select.tsx b/apps/desktop/src/renderer/components/Select.tsx
index 9e32570..a304369 100644
--- a/apps/desktop/src/renderer/components/Select.tsx
+++ b/apps/desktop/src/renderer/components/Select.tsx
@@ -1,9 +1,12 @@
+import { useEffect, useId, useRef, useState, type KeyboardEvent } from 'react'
+import { flushSync } from 'react-dom'
import { ChevronDownIcon } from '@altersend/components/icons'
-
-interface SelectOption {
- value: string
- label: string
-}
+import {
+ chooseSelectOption,
+ getInitialHighlightedIndex,
+ getNextSelectKeyboardState,
+ type SelectOption
+} from './selectBehavior'
interface SelectProps {
value: string
@@ -14,10 +17,6 @@ interface SelectProps {
className?: string
}
-/**
- * Styled dropdown shared across the desktop renderer (camera picker, language
- * picker, …). Wraps a native `<select>` with a chevron affordance.
- */
export function Select({
value,
onChange,
@@ -26,24 +25,133 @@ export function Select({
className,
'aria-label': ariaLabel
}: SelectProps) {
+ const generatedId = useId()
+ const triggerId = id ?? generatedId
+ const listboxId = `${triggerId}-listbox`
+ const rootRef = useRef<HTMLDivElement>(null)
+ const [open, setOpen] = useState(false)
+ const selectedIndex = options.findIndex((option) => option.value === value)
+ const selectedOption = selectedIndex >= 0 ? options[selectedIndex] : null
+ const [highlightedIndex, setHighlightedIndex] = useState(selectedIndex >= 0 ? selectedIndex : 0)
+
+ useEffect(() => {
+ if (!open) {
+ setHighlightedIndex(getInitialHighlightedIndex(selectedIndex, options.length))
+ return
+ }
+
+ const handlePointerDown = (event: PointerEvent) => {
+ if (!rootRef.current?.contains(event.target as Node)) setOpen(false)
+ }
+
+ document.addEventListener('pointerdown', handlePointerDown, true)
+ return () => document.removeEventListener('pointerdown', handlePointerDown, true)
+ }, [open, options.length, selectedIndex])
+
+ const openListbox = (nextIndex = selectedIndex >= 0 ? selectedIndex : 0) => {
+ setHighlightedIndex(getInitialHighlightedIndex(nextIndex, options.length))
+ setOpen(true)
+ }
+
+ const chooseOption = (option: SelectOption) => {
+ chooseSelectOption({
+ option,
+ currentValue: value,
+ close: () => flushSync(() => setOpen(false)),
+ onChange
+ })
+ }
+
+ const handleTriggerKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {
+ const next = getNextSelectKeyboardState({
+ key: event.key,
+ open,
+ selectedIndex,
+ highlightedIndex,
+ optionCount: options.length
+ })
+
+ if (next.preventDefault) event.preventDefault()
+
+ switch (next.action) {
+ case 'open':
+ openListbox(next.highlightedIndex)
+ break
+ case 'close':
+ setOpen(false)
+ break
+ case 'highlight':
+ setHighlightedIndex(next.highlightedIndex)
+ break
+ case 'choose': {
+ const highlightedOption = options[next.highlightedIndex]
+ if (highlightedOption) chooseOption(highlightedOption)
+ break
+ }
+ case 'none':
+ break
+ }
+ }
+
return (
- <div className={`relative${className ? ` ${className}` : ''}`}>
- <select
- id={id}
+ <div ref={rootRef} className={`relative${className ? ` ${className}` : ''}`}>
+ <button
+ id={triggerId}
+ type='button'
aria-label={ariaLabel}
- className='w-full cursor-pointer appearance-none rounded-[10px] border border-border-primary bg-background-subtle py-3 pl-4 pr-10 text-[13px] text-text-primary transition-colors hover:border-border-strong focus:border-border-strong focus:outline-none'
- value={value}
- onChange={(e) => onChange(e.currentTarget.value)}
+ aria-haspopup='listbox'
+ aria-expanded={open}
+ aria-controls={open ? listboxId : undefined}
+ className='flex w-full cursor-pointer appearance-none items-center justify-between gap-3 rounded-[10px] border border-border-primary bg-background-subtle py-3 pl-4 pr-3 text-left text-[13px] text-text-primary transition-colors hover:border-border-strong focus:border-border-strong focus:outline-none'
+ onClick={() => {
+ if (open) setOpen(false)
+ else openListbox()
+ }}
+ onKeyDown={handleTriggerKeyDown}
>
- {options.map((option) => (
- <option key={option.value} value={option.value}>
- {option.label}
- </option>
- ))}
- </select>
- <span className='pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-text-muted'>
- <ChevronDownIcon size={16} />
- </span>
+ <span
+ className='min-w-0 flex-1 truncate'
+ style={selectedOption?.fontFamily ? { fontFamily: selectedOption.fontFamily } : undefined}
+ >
+ {selectedOption?.label ?? options[0]?.label}
+ </span>
+ <span className='shrink-0 text-text-muted'>
+ <ChevronDownIcon size={16} />
+ </span>
+ </button>
+
+ {open ? (
+ <div
+ id={listboxId}
+ role='listbox'
+ aria-label={ariaLabel}
+ className='absolute left-0 right-0 top-[calc(100%+6px)] z-50 max-h-[220px] overflow-y-auto rounded-[10px] border border-border-primary bg-surface-primary p-1 shadow-xl'
+ >
+ {options.map((option, index) => {
+ const selected = option.value === value
+ const highlighted = index === highlightedIndex
+
+ return (
+ <button
+ key={option.value}
+ type='button'
+ role='option'
+ aria-selected={selected}
+ className={`flex w-full appearance-none items-center rounded-[8px] border-0 bg-transparent px-3 py-2 text-left text-[13px] transition-colors ${
+ selected || highlighted
+ ? 'bg-surface-secondary text-text-primary'
+ : 'text-text-secondary hover:bg-surface-secondary hover:text-text-primary'
+ }`}
+ style={option.fontFamily ? { fontFamily: option.fontFamily } : undefined}
+ onMouseEnter={() => setHighlightedIndex(index)}
+ onClick={() => chooseOption(option)}
+ >
+ <span className='min-w-0 flex-1 truncate'>{option.label}</span>
+ </button>
+ )
+ })}
+ </div>
+ ) : null}
</div>
)
}
diff --git a/apps/desktop/src/renderer/components/UpdateBanner.tsx b/apps/desktop/src/renderer/components/UpdateBanner.tsx
index b5a12cb..61ed6fe 100644
--- a/apps/desktop/src/renderer/components/UpdateBanner.tsx
+++ b/apps/desktop/src/renderer/components/UpdateBanner.tsx
@@ -1,8 +1,10 @@
import { ArrowUp, X } from 'lucide-react'
import { useState } from 'react'
+import { useTranslation } from '@altersend/locales'
import { bridgeApi } from '../api/bridgeApi'
export function UpdateBanner({ ready }: { ready: boolean }) {
+ const { t } = useTranslation(['common'])
const [dismissed, setDismissed] = useState(false)
const [restartFailed, setRestartFailed] = useState(false)
@@ -25,17 +27,17 @@ export function UpdateBanner({ ready }: { ready: boolean }) {
<ArrowUp size={12} className='text-info' aria-hidden />
</div>
<span className='flex-1 text-[13px] font-semibold text-text-primary'>
- {restartFailed ? 'Restart failed — please quit and reopen' : 'Update ready'}
+ {restartFailed ? t('common:update.restartFailed') : t('common:update.ready')}
</span>
<div className='flex items-center gap-2'>
<button
onClick={() => void restart()}
className='appearance-none border-0 bg-transparent p-0 text-[13px] font-semibold text-info cursor-pointer'
>
- Restart
+ {t('common:update.restart')}
</button>
<button
- aria-label='Dismiss'
+ aria-label={t('common:actions.dismiss')}
onClick={() => setDismissed(true)}
className='flex appearance-none border-0 bg-transparent p-0 cursor-pointer text-text-secondary'
>
diff --git a/apps/desktop/src/renderer/components/selectBehavior.ts b/apps/desktop/src/renderer/components/selectBehavior.ts
new file mode 100644
index 0000000..75204b5
--- /dev/null
+++ b/apps/desktop/src/renderer/components/selectBehavior.ts
@@ -0,0 +1,92 @@
+export interface SelectOption {
+ value: string
+ label: string
+ fontFamily?: string
+}
+
+interface ChooseSelectOptionOptions {
+ option: SelectOption
+ currentValue: string
+ close: () => void
+ onChange: (value: string) => void
+}
+
+export type SelectKeyboardAction =
+ | { action: 'none'; preventDefault?: false }
+ | { action: 'open'; highlightedIndex: number; preventDefault: true }
+ | { action: 'close'; preventDefault: true }
+ | { action: 'close'; preventDefault?: false }
+ | { action: 'choose'; highlightedIndex: number; preventDefault: true }
+ | { action: 'highlight'; highlightedIndex: number; preventDefault: true }
+
+interface SelectKeyboardStateInput {
+ key: string
+ open: boolean
+ selectedIndex: number
+ highlightedIndex: number
+ optionCount: number
+}
+
+function clampIndex(index: number, optionCount: number): number {
+ return Math.max(0, Math.min(optionCount - 1, index))
+}
+
+export function getInitialHighlightedIndex(selectedIndex: number, optionCount: number): number {
+ return optionCount > 0 ? clampIndex(selectedIndex >= 0 ? selectedIndex : 0, optionCount) : 0
+}
+
+export function chooseSelectOption({
+ option,
+ currentValue,
+ close,
+ onChange
+}: ChooseSelectOptionOptions): void {
+ close()
+ if (option.value !== currentValue) onChange(option.value)
+}
+
+export function getNextSelectKeyboardState({
+ key,
+ open,
+ selectedIndex,
+ highlightedIndex,
+ optionCount
+}: SelectKeyboardStateInput): SelectKeyboardAction {
+ if (optionCount === 0) return { action: 'none' }
+
+ const initialIndex = getInitialHighlightedIndex(selectedIndex, optionCount)
+
+ switch (key) {
+ case 'ArrowDown':
+ return open
+ ? {
+ action: 'highlight',
+ highlightedIndex: clampIndex(highlightedIndex + 1, optionCount),
+ preventDefault: true
+ }
+ : { action: 'open', highlightedIndex: initialIndex, preventDefault: true }
+ case 'ArrowUp':
+ return open
+ ? {
+ action: 'highlight',
+ highlightedIndex: clampIndex(highlightedIndex - 1, optionCount),
+ preventDefault: true
+ }
+ : { action: 'open', highlightedIndex: initialIndex, preventDefault: true }
+ case 'Home':
+ return { action: 'open', highlightedIndex: 0, preventDefault: true }
+ case 'End':
+ return { action: 'open', highlightedIndex: optionCount - 1, preventDefault: true }
+ case 'Enter':
+ case ' ':
+ return open
+ ? { action: 'choose', highlightedIndex, preventDefault: true }
+ : { action: 'open', highlightedIndex: initialIndex, preventDefault: true }
+ case 'Escape':
+ return open ? { action: 'close', preventDefault: true } : { action: 'none' }
+ case 'Tab':
+ return { action: 'close' }
+ default:
+ return { action: 'none' }
+ }
+}
diff --git a/apps/desktop/src/renderer/fonts.css b/apps/desktop/src/renderer/fonts.css
new file mode 100644
index 0000000..5e43d09
--- /dev/null
+++ b/apps/desktop/src/renderer/fonts.css
@@ -0,0 +1,63 @@
+@font-face {
+ font-family: 'AlterSend Sans JP';
+ src: url('../../../../assets/fonts/NotoSans-JP-Regular.ttf') format('truetype');
+ font-style: normal;
+ font-weight: 100 500;
+ font-display: swap;
+}
+
+@font-face {
+ font-family: 'AlterSend Sans JP';
+ src: url('../../../../assets/fonts/NotoSans-JP-Bold.ttf') format('truetype');
+ font-style: normal;
+ font-weight: 600 900;
+ font-display: swap;
+}
+
+@font-face {
+ font-family: 'AlterSend Sans KR';
+ src: url('../../../../assets/fonts/NotoSans-KR-Regular.ttf') format('truetype');
+ font-style: normal;
+ font-weight: 100 500;
+ font-display: swap;
+}
+
+@font-face {
+ font-family: 'AlterSend Sans KR';
+ src: url('../../../../assets/fonts/NotoSans-KR-Bold.ttf') format('truetype');
+ font-style: normal;
+ font-weight: 600 900;
+ font-display: swap;
+}
+
+@font-face {
+ font-family: 'AlterSend Sans SC';
+ src: url('../../../../assets/fonts/NotoSans-SC-Regular.ttf') format('truetype');
+ font-style: normal;
+ font-weight: 100 500;
+ font-display: swap;
+}
+
+@font-face {
+ font-family: 'AlterSend Sans SC';
+ src: url('../../../../assets/fonts/NotoSans-SC-Bold.ttf') format('truetype');
+ font-style: normal;
+ font-weight: 600 900;
+ font-display: swap;
+}
+
+@font-face {
+ font-family: 'AlterSend Sans TC';
+ src: url('../../../../assets/fonts/NotoSans-TC-Regular.ttf') format('truetype');
+ font-style: normal;
+ font-weight: 100 500;
+ font-display: swap;
+}
+
+@font-face {
+ font-family: 'AlterSend Sans TC';
+ src: url('../../../../assets/fonts/NotoSans-TC-Bold.ttf') format('truetype');
+ font-style: normal;
+ font-weight: 600 900;
+ font-display: swap;
+}
diff --git a/apps/desktop/src/renderer/index.css b/apps/desktop/src/renderer/index.css
index 6b98e91..e23b838 100644
--- a/apps/desktop/src/renderer/index.css
+++ b/apps/desktop/src/renderer/index.css
@@ -88,6 +88,13 @@
text-rendering: optimizeLegibility;
}
+ button,
+ input,
+ select,
+ textarea {
+ font: inherit;
+ }
+
::selection {
background: color-mix(in oklab, var(--as-color-accent) 20%, transparent);
}
diff --git a/apps/desktop/src/renderer/lifecycle/localePreferenceStorage.ts b/apps/desktop/src/renderer/lifecycle/localePreferenceStorage.ts
new file mode 100644
index 0000000..472895e
--- /dev/null
+++ b/apps/desktop/src/renderer/lifecycle/localePreferenceStorage.ts
@@ -0,0 +1,21 @@
+import {
+ SYSTEM_LOCALE_PREFERENCE,
+ normalizeLocalePreference,
+ type LocalePreference
+} from '@altersend/locales'
+
+const KEY = 'altersend.locale.preference'
+
+export function getSavedLocalePreference(): LocalePreference {
+ try {
+ return normalizeLocalePreference(window.localStorage.getItem(KEY))
+ } catch {
+ return SYSTEM_LOCALE_PREFERENCE
+ }
+}
+
+export function setSavedLocalePreference(preference: LocalePreference): void {
+ try {
+ window.localStorage.setItem(KEY, preference)
+ } catch {}
+}
diff --git a/apps/desktop/src/renderer/lifecycle/localeStorage.ts b/apps/desktop/src/renderer/lifecycle/localeStorage.ts
deleted file mode 100644
index ce9437c..0000000
--- a/apps/desktop/src/renderer/lifecycle/localeStorage.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import type { LocalePreference } from '@altersend/locales'
-
-const KEY = 'altersend.locale'
-
-export function getSavedLocale(): LocalePreference | null {
- try {
- return window.localStorage.getItem(KEY) as LocalePreference | null
- } catch {
- return null
- }
-}
-
-export function setSavedLocale(locale: LocalePreference): void {
- try {
- window.localStorage.setItem(KEY, locale)
- } catch {}
-}
diff --git a/apps/desktop/src/renderer/lifecycle/systemLocale.ts b/apps/desktop/src/renderer/lifecycle/systemLocale.ts
new file mode 100644
index 0000000..a200c13
--- /dev/null
+++ b/apps/desktop/src/renderer/lifecycle/systemLocale.ts
@@ -0,0 +1,8 @@
+import { DEFAULT_LOCALE } from '@altersend/locales'
+
+export function getDesktopSystemLocales(): string[] {
+ if (typeof navigator === 'undefined') return [DEFAULT_LOCALE]
+ const languages = navigator.languages?.filter(Boolean)
+ if (languages && languages.length > 0) return [...languages]
+ return navigator.language ? [navigator.language] : [DEFAULT_LOCALE]
+}
diff --git a/apps/desktop/src/renderer/main.tsx b/apps/desktop/src/renderer/main.tsx
index 40e3d55..ceb726b 100644
--- a/apps/desktop/src/renderer/main.tsx
+++ b/apps/desktop/src/renderer/main.tsx
@@ -1,21 +1,63 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import { CrashScreen, ErrorBoundary, ThemeProvider, ThemeType } from '@altersend/components'
+import {
+ getLocaleFontFamily,
+ initI18n,
+ isSupportedLocaleCode,
+ resolveActiveLocalePreference,
+ useTranslation
+} from '@altersend/locales'
import {
bindTransferApi,
startBackgroundReconnectEffect,
startPeerWatchdog
} from '@altersend/domain'
-import { changeLocale, getInitialLocale } from '@altersend/locales'
import App from './App.js'
import { bridgeApi, hasBridge } from './api/bridgeApi'
import { startDeepLinkHandler } from './lifecycle/deepLinkHandler'
import { initSentry, captureException } from './sentry'
import { isCrashReportingEnabled } from './lifecycle/crashReportingStorage'
-import { getSavedLocale } from './lifecycle/localeStorage'
+import { getSavedLocalePreference } from './lifecycle/localePreferenceStorage'
+import { getDesktopSystemLocales } from './lifecycle/systemLocale'
import './strict.css'
+import './fonts.css'
import './index.css'
+function DesktopCrashScreen({ error }: { error: Error }) {
+ const { t } = useTranslation(['errors'])
+
+ return (
+ <CrashScreen
+ error={error}
+ onRestart={() => bridgeApi.appRestart?.()}
+ title={t('errors:crash.title')}
+ description={t('errors:crash.desktopDescription')}
+ restartLabel={t('errors:crash.restartAlterSend')}
+ />
+ )
+}
+
+function DesktopRoot() {
+ const { i18n } = useTranslation()
+ const language = i18n.resolvedLanguage ?? i18n.language
+ const locale = isSupportedLocaleCode(language) ? language : 'en-US'
+ const fontFamily = getLocaleFontFamily(locale)
+
+ return (
+ <ThemeProvider theme={ThemeType.Dark} fontFamily={fontFamily}>
+ <ErrorBoundary
+ fallback={(error) => {
+ captureException(error)
+ return <DesktopCrashScreen error={error} />
+ }}
+ >
+ <App />
+ </ErrorBoundary>
+ </ThemeProvider>
+ )
+}
+
initSentry()
void bridgeApi.setSentryEnabled(isCrashReportingEnabled())
@@ -29,32 +71,18 @@ if (hasBridge()) {
}
async function bootstrap() {
- const savedLocale = getSavedLocale() || 'system'
try {
- await changeLocale(getInitialLocale(savedLocale))
- } catch (err) {
- console.warn('Failed to bootstrap locale', err)
+ await initI18n(
+ resolveActiveLocalePreference(getSavedLocalePreference(), getDesktopSystemLocales())
+ )
+ } catch (error) {
+ captureException(error)
+ console.warn('Failed to bootstrap locale', error)
}
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
- <ThemeProvider theme={ThemeType.Dark}>
- <ErrorBoundary
- fallback={(error) => {
- captureException(error)
- return (
- <CrashScreen
- error={error}
- onRestart={() => bridgeApi.appRestart?.()}
- description='AlterSend hit an unexpected error and needs to restart. The transfer worker may be in an inconsistent state, so a restart is the safest option.'
- restartLabel='Restart AlterSend'
- />
- )
- }}
- >
- <App />
- </ErrorBoundary>
- </ThemeProvider>
+ <DesktopRoot />
</React.StrictMode>
)
}
diff --git a/apps/desktop/src/renderer/pages/BridgeUnavailablePage/index.tsx b/apps/desktop/src/renderer/pages/BridgeUnavailablePage/index.tsx
index e15a011..45afafc 100644
--- a/apps/desktop/src/renderer/pages/BridgeUnavailablePage/index.tsx
+++ b/apps/desktop/src/renderer/pages/BridgeUnavailablePage/index.tsx
@@ -1,6 +1,9 @@
+import { useTranslation } from '@altersend/locales'
import logo from '../../../../../../assets/logo.png'
export default function BridgeUnavailablePage() {
+ const { t } = useTranslation(['errors', 'common'])
+
return (
<main className='flex h-screen w-full flex-col bg-background text-text-primary'>
<div className='h-8 w-full shrink-0' style={{ WebkitAppRegion: 'drag' }} />
@@ -8,9 +11,9 @@ export default function BridgeUnavailablePage() {
<section className='flex min-h-0 flex-1 flex-col px-6 pb-6 pt-2 max-[640px]:px-4'>
<div className='mx-auto flex h-full w-full max-w-[920px] flex-1 flex-col justify-center'>
<div className='rounded-[10px] border border-border-primary bg-surface-primary px-4 py-4'>
- <h1 className='m-0 text-[14px] font-medium'>Bridge error</h1>
+ <h1 className='m-0 text-[14px] font-medium'>{t('errors:bridgeUnavailable.title')}</h1>
<p className='mt-1 text-[13px] leading-5 text-text-secondary'>
- Could not find the Electron bridge.
+ {t('errors:bridgeUnavailable.description')}
</p>
</div>
</div>
@@ -18,7 +21,7 @@ export default function BridgeUnavailablePage() {
<div
role='status'
- aria-label='Status bar'
+ aria-label={t('common:labels.statusBar')}
className='shrink-0 border-t border-border-primary bg-background-subtle'
>
<div className='mx-auto flex h-8 w-full select-none items-center justify-between gap-3 px-3 text-[11px] text-text-muted'>
@@ -32,9 +35,9 @@ export default function BridgeUnavailablePage() {
</div>
<div className='flex min-w-0 items-center justify-center gap-2 text-text-secondary'>
<div className='h-1.5 w-1.5 shrink-0 rounded-full bg-danger' />
- <span className='truncate'>Bridge unavailable</span>
+ <span className='truncate'>{t('errors:bridgeUnavailable.status')}</span>
</div>
- <span className='shrink-0'>Desktop</span>
+ <span className='shrink-0'>{t('common:labels.desktop')}</span>
</div>
</div>
</main>
diff --git a/apps/desktop/src/renderer/pages/LoadingPage/index.tsx b/apps/desktop/src/renderer/pages/LoadingPage/index.tsx
index 3e2c5bd..1edf7c3 100644
--- a/apps/desktop/src/renderer/pages/LoadingPage/index.tsx
+++ b/apps/desktop/src/renderer/pages/LoadingPage/index.tsx
@@ -1,3 +1,4 @@
+import { useTranslation } from '@altersend/locales'
import logo from '../../../../../../assets/logo.png'
import loadingSvg from '../../../../../../assets/loading.svg'
@@ -6,7 +7,9 @@ interface LoadingPageProps {
}
export default function LoadingPage({ progress = 0 }: LoadingPageProps) {
+ const { t } = useTranslation(['common'])
const clamped = Math.max(0, Math.min(100, progress))
+ const taglineLines = t('common:app.loadingTagline').split('\n')
return (
<main className='flex h-screen w-full flex-col overflow-hidden bg-background text-text-primary'>
@@ -24,12 +27,15 @@ export default function LoadingPage({ progress = 0 }: LoadingPageProps) {
<div className='flex min-h-0 flex-1 flex-col items-center justify-center px-8 py-6'>
<img src={loadingSvg} alt='' className='block h-auto max-h-[200px] max-w-[280px] w-auto' />
<h1 className='mb-0 mt-9 max-w-[460px] text-center text-[30px] font-bold leading-[1.1] tracking-[-0.03em] text-text-primary'>
- Welcome to AlterSend
+ {t('common:app.welcome')}
</h1>
<p className='mt-3 max-w-[420px] text-center text-[13px] leading-[1.6] text-text-secondary'>
- Files travel directly between your devices.
- <br />
- No servers, no copies, no middlemen.
+ {taglineLines.map((line, index) => (
+ <span key={`${index}-${line}`}>
+ {line}
+ {index < taglineLines.length - 1 ? <br /> : null}
+ </span>
+ ))}
</p>
</div>
diff --git a/apps/desktop/src/renderer/pages/OnboardingPage/index.tsx b/apps/desktop/src/renderer/pages/OnboardingPage/index.tsx
index f1bab7a..5eb7079 100644
--- a/apps/desktop/src/renderer/pages/OnboardingPage/index.tsx
+++ b/apps/desktop/src/renderer/pages/OnboardingPage/index.tsx
@@ -2,6 +2,7 @@ import { useState } from 'react'
import { Button, PaginationDots } from '@altersend/components'
import { onboardingSlides, type OnboardingSlide, type OnboardingSlideKind } from '@altersend/domain'
import { ExternalLink } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import logo from '../../../../../../assets/logo.png'
import pairingSvg from '../../../../../../assets/onboarding.svg'
import keepOpenSvg from '../../../../../../assets/laptop.svg'
@@ -13,14 +14,27 @@ const ILLUSTRATIONS: Record<OnboardingSlideKind, string> = {
privacy: encryptedSvg
}
+function getSlideKey(kind: OnboardingSlideKind) {
+ switch (kind) {
+ case 'pairing':
+ return 'direct'
+ case 'keep-open':
+ return 'keepOpen'
+ case 'privacy':
+ return 'encrypted'
+ }
+}
+
interface OnboardingPageProps {
onFinish: () => void
}
export default function OnboardingPage({ onFinish }: OnboardingPageProps) {
+ const { t } = useTranslation(['onboarding', 'common'])
const [index, setIndex] = useState(0)
const slide = onboardingSlides[index]
const isLast = index === onboardingSlides.length - 1
+ const slideKey = getSlideKey(slide.kind)
const next = () => {
if (isLast) {
@@ -43,7 +57,7 @@ export default function OnboardingPage({ onFinish }: OnboardingPageProps) {
</div>
<div className={isLast ? 'pointer-events-none invisible' : ''}>
<Button onClick={onFinish} size='sm' variant='ghost'>
- Skip
+ {t('common:actions.skip')}
</Button>
</div>
</div>
@@ -52,16 +66,18 @@ export default function OnboardingPage({ onFinish }: OnboardingPageProps) {
<SlideHero slide={slide} />
<h1 className='mb-0 mt-9 max-w-[460px] text-center text-[30px] font-bold leading-[1.1] tracking-[-0.03em] text-text-primary'>
- {slide.title}
+ {t(`onboarding:slides.${slideKey}.title`)}
</h1>
<p className='mt-3 max-w-[420px] text-center text-[13px] leading-[1.6] text-text-secondary'>
- {slide.subtitle}
+ {t(`onboarding:slides.${slideKey}.description`)}
</p>
{slide.link ? (
<div className='absolute bottom-4'>
- <ExternalLink href={slide.link.url}>{slide.link.label}</ExternalLink>
+ <ExternalLink href={slide.link.url}>
+ {t('onboarding:slides.encrypted.link')}
+ </ExternalLink>
</div>
) : null}
</div>
@@ -70,7 +86,7 @@ export default function OnboardingPage({ onFinish }: OnboardingPageProps) {
<PaginationDots count={onboardingSlides.length} activeIndex={index} />
<Button onClick={next} size='sm' variant='primary'>
- {isLast ? 'Get started' : 'Continue'}
+ {isLast ? t('common:actions.getStarted') : t('common:actions.continue')}
</Button>
</div>
</main>
diff --git a/apps/desktop/src/renderer/pages/ReceivePage/ReceiveCompleteView.tsx b/apps/desktop/src/renderer/pages/ReceivePage/ReceiveCompleteView.tsx
index 88f5d87..5ec39cc 100644
--- a/apps/desktop/src/renderer/pages/ReceivePage/ReceiveCompleteView.tsx
+++ b/apps/desktop/src/renderer/pages/ReceivePage/ReceiveCompleteView.tsx
@@ -1,6 +1,7 @@
import { useEffect } from 'react'
import { Button, SendFileListRow } from '@altersend/components'
import { CheckIcon, FolderIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import {
clearSession,
formatFileSize,
@@ -18,6 +19,7 @@ function openFileWithLogging(filePath: string): void {
}
export function ReceiveCompleteView() {
+ const { t } = useTranslation(['receive', 'common'])
const incomingFileOffers = useTransferStore((s) => s.incomingFileOffers)
const downloadStates = useTransferStore((s) => s.receiveDownloadStates)
@@ -35,9 +37,11 @@ export function ReceiveCompleteView() {
const displayDir = saveDir ? shortenHomePath(saveDir) : null
const successSubtitle = [
- `${fileCount} ${fileCount === 1 ? 'file' : 'files'}`,
+ t('common:files.count', { count: fileCount }),
formatFileSize(totalBytes),
- displayDir ? `saved to ${displayDir}` : 'saved'
+ displayDir
+ ? t('receive:summary.savedToLocation', { location: displayDir })
+ : t('receive:summary.saved')
].join(' · ')
return (
@@ -48,7 +52,9 @@ export function ReceiveCompleteView() {
<CheckIcon size={16} />
</div>
<div>
- <p className='m-0 text-[14px] font-bold text-success'>Files received</p>
+ <p className='m-0 text-[14px] font-bold text-success'>
+ {t('receive:page.completed.title', { count: fileCount })}
+ </p>
<p className='m-0 mt-0.5 text-[12px] leading-5 text-text-secondary'>
{successSubtitle}
</p>
@@ -61,16 +67,18 @@ export function ReceiveCompleteView() {
size='sm'
variant='secondary'
>
- Show in Finder
+ {t('receive:actions.showInFinder')}
</Button>
) : null}
</div>
<div className='flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px] border border-border-primary bg-surface-primary'>
<div className='flex shrink-0 items-center justify-between border-b border-border-primary pl-[14px] pr-3 py-3'>
- <p className='m-0 text-[14px] font-semibold text-text-primary'>Received files</p>
+ <p className='m-0 text-[14px] font-semibold text-text-primary'>
+ {t('receive:panel.receivedFiles')}
+ </p>
<p className='m-0 text-[13px] text-text-muted'>
- {fileCount} {fileCount === 1 ? 'file' : 'files'}
+ {t('common:files.count', { count: fileCount })}
</p>
</div>
@@ -95,7 +103,7 @@ export function ReceiveCompleteView() {
size='sm'
variant='secondary'
>
- Open
+ {t('receive:actions.open')}
</Button>
) : undefined
}
@@ -106,7 +114,7 @@ export function ReceiveCompleteView() {
<div className='flex shrink-0 items-center justify-end gap-2.5 border-t border-border-primary px-6 py-4'>
<Button onClick={clearSession} size='sm' variant='primary'>
- Done
+ {t('common:actions.done')}
</Button>
</div>
</div>
diff --git a/apps/desktop/src/renderer/pages/ReceivePage/ReceiveConnectedView.tsx b/apps/desktop/src/renderer/pages/ReceivePage/ReceiveConnectedView.tsx
index 6b76165..c5b53f7 100644
--- a/apps/desktop/src/renderer/pages/ReceivePage/ReceiveConnectedView.tsx
+++ b/apps/desktop/src/renderer/pages/ReceivePage/ReceiveConnectedView.tsx
@@ -1,6 +1,7 @@
import { useMemo } from 'react'
import { Button, SendFileListRow } from '@altersend/components'
import { DownloadIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import { bridgeApi } from '../../api/bridgeApi'
import {
clearSession,
@@ -13,7 +14,23 @@ import {
useTransferStore
} from '@altersend/domain'
+type DownloadRow = ReturnType<typeof getDownloadRowDisplay>
+
+function getDownloadStatusLabel(t: ReturnType<typeof useTranslation>['t'], row: DownloadRow) {
+ switch (row.status.kind) {
+ case 'saved':
+ return t('receive:status.saved')
+ case 'failed':
+ return t('errors:transfer.downloadFailed')
+ case 'progress':
+ return t('receive:status.percent', { percent: row.percent })
+ case 'ready':
+ return t('receive:status.ready')
+ }
+}
+
export function ReceiveConnectedView() {
+ const { t } = useTranslation(['receive', 'common', 'errors'])
const incomingFileOffers = useTransferStore((s) => s.incomingFileOffers)
const downloadStates = useTransferStore((s) => s.receiveDownloadStates)
const peerCount = useTransferStore((s) => s.peerCount)
@@ -68,7 +85,7 @@ export function ReceiveConnectedView() {
name={file.name}
size={file.size}
description={row.description}
- status={row.status}
+ status={{ label: getDownloadStatusLabel(t, row), tone: row.status.tone }}
progressPercent={row.progressPercent}
/>
)
@@ -79,7 +96,7 @@ export function ReceiveConnectedView() {
<div className='mt-4 flex shrink-0 items-center justify-end gap-4'>
<div className='flex shrink-0 items-center gap-2'>
<Button onClick={clearSession} size='sm' variant='secondary'>
- End session
+ {t('common:actions.endSession')}
</Button>
{peerCount > 0 && hasIncomingFiles && !allCompleted ? (
<Button
@@ -89,7 +106,9 @@ export function ReceiveConnectedView() {
size='sm'
variant='primary'
>
- {isDownloading ? `Downloading ${totals.percent}%` : 'Download all'}
+ {isDownloading
+ ? t('receive:actions.downloadingPercent', { percent: totals.percent })
+ : t('receive:actions.downloadAll')}
</Button>
) : null}
</div>
diff --git a/apps/desktop/src/renderer/pages/ReceivePage/ReceiveDisconnectedView.tsx b/apps/desktop/src/renderer/pages/ReceivePage/ReceiveDisconnectedView.tsx
index c13b268..deb1b3e 100644
--- a/apps/desktop/src/renderer/pages/ReceivePage/ReceiveDisconnectedView.tsx
+++ b/apps/desktop/src/renderer/pages/ReceivePage/ReceiveDisconnectedView.tsx
@@ -1,9 +1,11 @@
import { Button, SendFileListRow } from '@altersend/components'
import { CloseIcon } from '@altersend/components/icons'
import { clearSession, formatFileSize, getOfferKey, useTransferStore } from '@altersend/domain'
+import { useTranslation } from '@altersend/locales'
import { TransferActionGroup } from '../../components/TransferPrimitives'
export function ReceiveDisconnectedView() {
+ const { t } = useTranslation(['receive', 'common'])
const incomingFileOffers = useTransferStore((s) => s.incomingFileOffers)
const downloadStates = useTransferStore((s) => s.receiveDownloadStates)
const completedCount = incomingFileOffers.filter(
@@ -20,11 +22,11 @@ export function ReceiveDisconnectedView() {
<div>
<p className='m-0 text-[14px] font-bold text-warning'>
{total > 0
- ? `Received ${completedCount} of ${total} ${total === 1 ? 'file' : 'files'}`
- : 'Transfer incomplete'}
+ ? t('receive:summary.receivedCount', { completed: completedCount, count: total })
+ : t('receive:page.interrupted.title')}
</p>
<p className='m-0 mt-0.5 text-[12px] leading-5 text-text-secondary'>
- The sender left before finishing.
+ {t('receive:summary.senderLeftBeforeFinishing')}
</p>
</div>
</div>
@@ -32,9 +34,11 @@ export function ReceiveDisconnectedView() {
{total > 0 ? (
<div className='flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px] border border-border-primary bg-surface-primary'>
<div className='flex shrink-0 items-center justify-between border-b border-border-primary pl-[14px] pr-3 py-3'>
- <p className='m-0 text-[14px] font-semibold text-text-primary'>Files</p>
+ <p className='m-0 text-[14px] font-semibold text-text-primary'>
+ {t('common:files.files')}
+ </p>
<p className='m-0 text-[13px] text-text-muted'>
- {completedCount} of {total} received
+ {t('receive:summary.receivedProgress', { completed: completedCount, count: total })}
</p>
</div>
@@ -47,7 +51,9 @@ export function ReceiveDisconnectedView() {
key={getOfferKey(file)}
bare
name={file.name}
- description={isComplete ? formatFileSize(file.size) : "Didn't arrive"}
+ description={
+ isComplete ? formatFileSize(file.size) : t('receive:errors.didntArrive')
+ }
disabled={!isComplete}
/>
)
@@ -56,14 +62,14 @@ export function ReceiveDisconnectedView() {
<div className='flex shrink-0 items-center justify-end gap-2.5 border-t border-border-primary px-6 py-4'>
<Button onClick={clearSession} size='sm' variant='primary'>
- Done
+ {t('common:actions.done')}
</Button>
</div>
</div>
) : (
<TransferActionGroup>
<Button onClick={clearSession} size='sm' variant='primary'>
- Done
+ {t('common:actions.done')}
</Button>
</TransferActionGroup>
)}
diff --git a/apps/desktop/src/renderer/pages/ReceivePage/ReceiveJoinView.tsx b/apps/desktop/src/renderer/pages/ReceivePage/ReceiveJoinView.tsx
index d733644..580364a 100644
--- a/apps/desktop/src/renderer/pages/ReceivePage/ReceiveJoinView.tsx
+++ b/apps/desktop/src/renderer/pages/ReceivePage/ReceiveJoinView.tsx
@@ -1,16 +1,29 @@
import { useState, type ChangeEvent } from 'react'
import { Button, Input } from '@altersend/components'
import { ChevronRightIcon, QrCodeIcon } from '@altersend/components/icons'
-import { isValidJoinCode, joinSession, useTransferStore } from '@altersend/domain'
+import {
+ getDisplayError,
+ getTransferErrorCode,
+ isValidJoinCode,
+ joinSession,
+ TRANSFER_ERROR_CODES,
+ type TransferErrorCode,
+ useTransferStore
+} from '@altersend/domain'
+import { useTranslation } from '@altersend/locales'
import { WebcamScanView } from './WebcamScanView'
export function ReceiveJoinView() {
+ const { t } = useTranslation(['receive', 'common', 'errors'])
const [joinKey, setJoinKey] = useState('')
const [showValidation, setShowValidation] = useState(false)
const [isJoining, setIsJoining] = useState(false)
- const [localError, setLocalError] = useState<string | null>(null)
+ const [localErrorCode, setLocalErrorCode] = useState<TransferErrorCode | null>(null)
const [mode, setMode] = useState<'paste' | 'scan'>('paste')
- const storeError = useTransferStore((s) => s.errorMessage)
+ const storeErrorCode = useTransferStore((s) => s.errorCode)
+ const displayStoreError = getDisplayError(t, storeErrorCode, {
+ invalidTopicKey: 'receive:errors.invalidKey'
+ })
if (mode === 'scan') {
return <WebcamScanView onCancel={() => setMode('paste')} />
@@ -20,19 +33,21 @@ export function ReceiveJoinView() {
const isValidJoinKey = isValidJoinCode(trimmedJoinKey)
const joinKeyError =
showValidation && trimmedJoinKey.length > 0 && !isValidJoinKey
- ? 'Enter a valid 64-character hex key.'
- : (localError ?? storeError ?? undefined)
+ ? t('receive:errors.invalidKey')
+ : (getDisplayError(t, localErrorCode, { invalidTopicKey: 'receive:errors.invalidKey' }) ??
+ displayStoreError ??
+ undefined)
const join = async () => {
setShowValidation(true)
if (!isValidJoinKey) return
try {
setIsJoining(true)
- setLocalError(null)
+ setLocalErrorCode(null)
await joinSession(trimmedJoinKey)
} catch (error) {
setIsJoining(false)
- setLocalError(error instanceof Error ? error.message : 'Could not join the session.')
+ setLocalErrorCode(getTransferErrorCode(error, TRANSFER_ERROR_CODES.joinFailed))
}
}
@@ -49,10 +64,10 @@ export function ReceiveJoinView() {
</span>
<span className='min-w-0 flex-1'>
<span className='block text-[13.5px] font-semibold text-text-primary'>
- Scan or import QR
+ {t('receive:actions.scanOrImportQr')}
</span>
<span className='block text-[12px] leading-snug text-text-muted'>
- Use the webcam, or import a saved QR image
+ {t('receive:actions.scanOrImportQrHintDesktop')}
</span>
</span>
<span className='shrink-0 text-text-muted transition-transform group-hover:translate-x-0.5'>
@@ -60,7 +75,9 @@ export function ReceiveJoinView() {
</span>
</button>
- <div className='py-0.5 text-center text-[12px] text-text-muted'>or paste code</div>
+ <div className='py-0.5 text-center text-[12px] text-text-muted'>
+ {t('receive:form.orPasteCode')}
+ </div>
<div className='flex flex-col gap-3.5'>
<Input
@@ -69,14 +86,14 @@ export function ReceiveJoinView() {
disabled={isJoining}
error={joinKeyError}
secure
- label='Connection code'
+ label={t('receive:form.codeLabel')}
mono
onChange={(e: ChangeEvent<HTMLInputElement>) => {
setJoinKey(e.currentTarget.value)
if (showValidation) setShowValidation(false)
- if (localError) setLocalError(null)
+ if (localErrorCode) setLocalErrorCode(null)
}}
- placeholder='Paste 64-char code…'
+ placeholder={t('receive:form.codePlaceholder')}
spellCheck={false}
type='text'
value={joinKey}
@@ -84,7 +101,7 @@ export function ReceiveJoinView() {
<div>
<Button disabled={isJoining} onClick={() => void join()} size='sm' variant='primary'>
- {isJoining ? 'Connecting…' : 'Connect'}
+ {isJoining ? t('common:actions.connecting') : t('common:actions.connect')}
</Button>
</div>
</div>
diff --git a/apps/desktop/src/renderer/pages/ReceivePage/WebcamScanView.tsx b/apps/desktop/src/renderer/pages/ReceivePage/WebcamScanView.tsx
index 9c780ab..a41d207 100644
--- a/apps/desktop/src/renderer/pages/ReceivePage/WebcamScanView.tsx
+++ b/apps/desktop/src/renderer/pages/ReceivePage/WebcamScanView.tsx
@@ -1,7 +1,14 @@
import { useEffect, useRef, useState } from 'react'
import QrScanner from 'qr-scanner'
import { Button } from '@altersend/components'
-import { extractJoinCode, joinSession } from '@altersend/domain'
+import {
+ extractJoinCode,
+ getDisplayError,
+ getTransferErrorCode,
+ joinSession,
+ TRANSFER_ERROR_CODES
+} from '@altersend/domain'
+import { useTranslation } from '@altersend/locales'
import { bridgeApi } from '../../api/bridgeApi'
import { Select } from '../../components/Select'
@@ -19,6 +26,7 @@ const CAMERA_ERROR_STATES: Record<string, ScanState> = {
}
export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
+ const { t } = useTranslation(['receive', 'common', 'errors'])
const videoRef = useRef<HTMLVideoElement>(null)
const scannerRef = useRef<QrScanner | null>(null)
const fileInputRef = useRef<HTMLInputElement>(null)
@@ -50,7 +58,11 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
} catch (error) {
if (signal.aborted) return
handledRef.current = false
- setErrorMessage(error instanceof Error ? error.message : 'Could not join the session.')
+ setErrorMessage(
+ getDisplayError(t, getTransferErrorCode(error, TRANSFER_ERROR_CODES.joinFailed), {
+ invalidTopicKey: 'receive:errors.invalidKey'
+ })
+ )
setState('scanning')
void scannerRef.current?.start()
}
@@ -99,7 +111,7 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
if (mapped) {
setState(mapped)
} else {
- setErrorMessage(error instanceof Error ? error.message : 'Camera unavailable.')
+ setErrorMessage(t('receive:errors.cameraCouldNotStart'))
setState('failed')
}
}
@@ -112,7 +124,7 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
scanner.destroy()
scannerRef.current = null
}
- }, [retryNonce])
+ }, [retryNonce, t])
const retry = () => {
setErrorMessage(null)
@@ -139,13 +151,13 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
const result = await QrScanner.scanImage(file, { returnDetailedScanResult: true })
data = result.data
} catch {
- setErrorMessage('No QR code found in that image.')
+ setErrorMessage(t('receive:errors.imageNoQrHint'))
return
}
const joinCode = extractJoinCode(data)
if (!joinCode) {
- setErrorMessage('That image isn’t an AlterSend connection code.')
+ setErrorMessage(t('receive:errors.imageUnsupportedQrHint'))
return
}
@@ -161,7 +173,11 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
await joinSession(joinCode)
} catch (error) {
handledRef.current = false
- setErrorMessage(error instanceof Error ? error.message : 'Could not join the session.')
+ setErrorMessage(
+ getDisplayError(t, getTransferErrorCode(error, TRANSFER_ERROR_CODES.joinFailed), {
+ invalidTopicKey: 'receive:errors.invalidKey'
+ })
+ )
setState(resumeState)
if (resumeState === 'scanning') void scannerRef.current?.start()
}
@@ -169,16 +185,16 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
const blockedMessages: Partial<Record<ScanState, { title: string; hint: string }>> = {
denied: {
- title: 'Camera access blocked',
- hint: 'Allow camera access for AlterSend in your system settings, then try again. You can also paste the code instead.'
+ title: t('receive:camera.blockedTitle'),
+ hint: t('receive:camera.blockedHint')
},
'no-camera': {
- title: 'No camera found',
- hint: 'Connect a webcam to scan, or paste the connection code instead.'
+ title: t('receive:camera.noneTitle'),
+ hint: t('receive:camera.noneHint')
},
failed: {
- title: 'Camera unavailable',
- hint: errorMessage ?? 'The camera could not be started. Paste the connection code instead.'
+ title: t('receive:camera.unavailableTitle'),
+ hint: errorMessage ?? t('receive:errors.cameraCouldNotStart')
}
}
const blocked = blockedMessages[state] ?? null
@@ -202,13 +218,13 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
<p className='m-0 mt-1.5 text-[13px] leading-relaxed text-text-muted'>{blocked.hint}</p>
<div className='mt-4 flex flex-wrap items-center gap-2.5'>
<Button onClick={retry} size='sm' variant='primary'>
- Try again
+ {t('common:actions.tryAgain')}
</Button>
<Button onClick={() => fileInputRef.current?.click()} size='sm' variant='secondary'>
- Import image
+ {t('receive:actions.importImage')}
</Button>
<Button onClick={onCancel} size='sm' variant='secondary'>
- Paste code instead
+ {t('receive:camera.usePastedCode')}
</Button>
</div>
</div>
@@ -237,11 +253,13 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
{state === 'starting' || state === 'connecting' ? (
<div className='absolute inset-0 flex flex-col items-center justify-center gap-2 bg-scrim/55 text-center'>
<span className='text-[14px] font-medium text-on-accent'>
- {state === 'connecting' ? 'Connecting…' : 'Starting camera…'}
+ {state === 'connecting'
+ ? t('common:actions.connecting')
+ : t('receive:camera.starting')}
</span>
{state === 'connecting' ? (
<span className='text-[12px] text-on-accent/75'>
- Joining the sender’s session.
+ {t('receive:camera.joiningDescription')}
</span>
) : null}
</div>
@@ -250,8 +268,7 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
<div className='flex min-w-0 flex-1 flex-col gap-4'>
<p className='m-0 text-[13px] leading-relaxed text-text-muted'>
- Center the sender’s QR in the frame, or import a saved image. AlterSend connects
- automatically.
+ {t('receive:camera.desktopImportHint')}
</p>
{errorMessage ? (
@@ -260,22 +277,27 @@ export function WebcamScanView({ onCancel }: WebcamScanViewProps) {
{cameras.length > 1 ? (
<div className='flex flex-col gap-1.5'>
- <span className='text-[12px] font-medium text-text-secondary'>Camera</span>
+ <span className='text-[12px] font-medium text-text-secondary'>
+ {t('common:labels.camera')}
+ </span>
<Select
- aria-label='Camera'
+ aria-label={t('common:labels.camera')}
value={activeCamera ?? ''}
onChange={(value) => void switchCamera(value)}
- options={cameras.map((cam) => ({ value: cam.id, label: cam.label || 'Camera' }))}
+ options={cameras.map((cam) => ({
+ value: cam.id,
+ label: cam.label || t('common:labels.camera')
+ }))}
/>
</div>
) : null}
<div className='flex flex-wrap gap-2.5'>
<Button onClick={() => fileInputRef.current?.click()} size='sm' variant='secondary'>
- Import image
+ {t('receive:actions.importImage')}
</Button>
<Button onClick={onCancel} size='sm' variant='secondary'>
- Paste code instead
+ {t('receive:camera.usePastedCode')}
</Button>
</div>
</div>
diff --git a/apps/desktop/src/renderer/pages/ReceivePage/index.tsx b/apps/desktop/src/renderer/pages/ReceivePage/index.tsx
index 74e59da..c4ecaec 100644
--- a/apps/desktop/src/renderer/pages/ReceivePage/index.tsx
+++ b/apps/desktop/src/renderer/pages/ReceivePage/index.tsx
@@ -1,5 +1,6 @@
import { useMemo } from 'react'
import { Button } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import { TransferStatusPanel, TransferCardFrame } from '../../components/TransferPrimitives'
import { ReceiveCompleteView } from './ReceiveCompleteView'
import { ReceiveConnectedView } from './ReceiveConnectedView'
@@ -16,6 +17,7 @@ import {
} from '@altersend/domain'
export default function ReceivePage() {
+ const { t } = useTranslation(['receive', 'common'])
const role = useTransferStore((s) => s.role)
const incomingFileOffers = useTransferStore((s) => s.incomingFileOffers)
const receiveDownloadStates = useTransferStore((s) => s.receiveDownloadStates)
@@ -37,13 +39,13 @@ export default function ReceivePage() {
})
const totalBytes = incomingFileOffers.reduce((sum, f) => sum + f.size, 0)
- const { title, description } = getReceivePageCopy(step, incomingFileOffers.length, totalBytes)
+ const { title, description } = getReceivePageCopy(t, step, incomingFileOffers.length, totalBytes)
const connectedBadge =
isConnectedStep(step) && step !== 'completed' && step !== 'interrupted' ? (
<div className='inline-flex items-center gap-2 rounded-full border border-success/22 bg-success/8 px-3 py-1.5 text-[12px] font-medium text-success'>
<span className='h-1.5 w-1.5 shrink-0 rounded-full bg-success' />
- Connected
+ {t('common:status.connected')}
</div>
) : undefined
@@ -55,8 +57,8 @@ export default function ReceivePage() {
if (step === 'connecting') {
return (
<TransferStatusPanel
- description='Completing the secure handshake with the sender.'
- title='Connection in progress'
+ description={t('receive:page.handshake.description')}
+ title={t('receive:page.handshake.title')}
/>
)
}
@@ -80,7 +82,7 @@ export default function ReceivePage() {
step === 'connecting' ? (
<div className='flex items-center justify-end gap-2.5'>
<Button onClick={clearSession} size='sm' variant='secondary'>
- End session
+ {t('common:actions.endSession')}
</Button>
</div>
) : undefined
diff --git a/apps/desktop/src/renderer/pages/SendPage/ConnectionCard.tsx b/apps/desktop/src/renderer/pages/SendPage/ConnectionCard.tsx
index cfda802..5082466 100644
--- a/apps/desktop/src/renderer/pages/SendPage/ConnectionCard.tsx
+++ b/apps/desktop/src/renderer/pages/SendPage/ConnectionCard.tsx
@@ -1,5 +1,6 @@
import { buildJoinUrl } from '@altersend/domain'
import { QrCodeIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import { QRCode } from '../../components/QRCode'
import { TopicCopyButton } from './TopicCopyButton'
@@ -36,30 +37,37 @@ interface WaitingForPeersProps {
}
function WaitingForPeers({ topic, isKeyCopied, onCopy }: WaitingForPeersProps) {
+ const { t } = useTranslation(['send'])
+
return (
<div className='flex flex-col gap-5 px-5 py-5'>
<TopicCopyButton
topic={topic}
copied={isKeyCopied}
onCopy={onCopy}
- placeholder='Generating secure key…'
+ placeholder={t('send:connection.placeholder')}
/>
<div className='flex items-center gap-3'>
<span className='h-px flex-1 bg-border-primary' />
- <span className='text-[11px] text-text-muted'>or scan</span>
+ <span className='text-[11px] text-text-muted'>{t('send:connection.orScan')}</span>
<span className='h-px flex-1 bg-border-primary' />
</div>
<div className='flex flex-col items-center gap-3'>
{topic ? (
- <QRCode size={180} value={buildJoinUrl(topic)} />
+ <QRCode
+ imageLabel={t('send:connection.qrCodeLabel')}
+ loadingLabel={t('send:connection.generating')}
+ size={180}
+ value={buildJoinUrl(topic)}
+ />
) : (
<div
className='flex items-center justify-center rounded-lg bg-surface-primary text-[12px] text-text-muted'
style={{ width: 180, height: 180 }}
>
- Generating…
+ {t('send:connection.generating')}
</div>
)}
<div className='flex items-center gap-2'>
@@ -70,7 +78,9 @@ function WaitingForPeers({ topic, isKeyCopied, onCopy }: WaitingForPeersProps) {
/>
<div className='relative h-1.5 w-1.5 rounded-full bg-text-muted' />
</div>
- <span className='text-[12px] text-text-muted'>Waiting for a connection…</span>
+ <span className='text-[12px] text-text-muted'>
+ {t('send:connection.waitingForConnection')}
+ </span>
</div>
</div>
</div>
@@ -85,17 +95,19 @@ interface ConnectedKeyProps {
}
function ConnectedKey({ topic, isKeyCopied, onCopy, onOpenQR }: ConnectedKeyProps) {
+ const { t } = useTranslation(['send'])
+
return (
<div className='flex items-center gap-2 px-5 py-5'>
<TopicCopyButton topic={topic} copied={isKeyCopied} onCopy={onCopy} placeholder='—' />
{topic ? (
<button
- aria-label='Show QR code'
+ aria-label={t('send:connection.showQrLabel')}
className='flex h-[38px] w-[38px] shrink-0 items-center justify-center rounded-[8px] border border-border-primary bg-surface-primary text-text-muted transition-colors hover:bg-surface-secondary hover:text-text-primary'
onClick={onOpenQR}
type='button'
>
- <QrCodeIcon size={14} label='Show QR code' />
+ <QrCodeIcon size={14} label={t('send:connection.showQrLabel')} />
</button>
) : null}
</div>
diff --git a/apps/desktop/src/renderer/pages/SendPage/PreparingView.tsx b/apps/desktop/src/renderer/pages/SendPage/PreparingView.tsx
index 59c7134..b47370f 100644
--- a/apps/desktop/src/renderer/pages/SendPage/PreparingView.tsx
+++ b/apps/desktop/src/renderer/pages/SendPage/PreparingView.tsx
@@ -1,4 +1,5 @@
import { SendFileListRow } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import {
getOverallProgress,
getProgressState,
@@ -8,6 +9,7 @@ import {
} from '@altersend/domain'
export function PreparingView() {
+ const { t } = useTranslation(['send'])
const uploadItems = useTransferStore((s) => s.uploadItems)
const { completed, total, percent } = getOverallProgress(uploadItems)
const allCompleted = completed === total && total > 0
@@ -17,7 +19,7 @@ export function PreparingView() {
<div className='rounded-[10px] border border-border-primary bg-background-subtle px-4 py-4'>
<div className='flex items-center justify-between gap-4'>
<p className='m-0 text-[14px] font-medium text-text-primary'>
- {allCompleted ? 'Upload complete' : 'Uploading files'}
+ {allCompleted ? t('send:status.uploadComplete') : t('send:status.uploadingFiles')}
</p>
<span className='tabular-nums text-[14px] font-semibold text-text-primary'>
{percent}%
@@ -30,7 +32,7 @@ export function PreparingView() {
/>
</div>
<p className='m-0 mt-2 text-[12px] text-text-secondary'>
- {completed} of {total} {total === 1 ? 'file' : 'files'} uploaded
+ {t('send:preparing.uploadedCount', { completed, count: total })}
</p>
</div>
@@ -43,7 +45,10 @@ export function PreparingView() {
compact
name={item.name}
size={item.size}
- status={{ label: getStatusLabel(item), tone: getStatusTone(item) }}
+ status={{
+ label: getStatusLabel(t, item),
+ tone: getStatusTone(item)
+ }}
progress={
progress === 'waiting' || progress === 'uploading' || progress === 'completed'
? progress
diff --git a/apps/desktop/src/renderer/pages/SendPage/SelectFilesView.tsx b/apps/desktop/src/renderer/pages/SendPage/SelectFilesView.tsx
index 9a29a99..637e307 100644
--- a/apps/desktop/src/renderer/pages/SendPage/SelectFilesView.tsx
+++ b/apps/desktop/src/renderer/pages/SendPage/SelectFilesView.tsx
@@ -1,5 +1,6 @@
import { useState } from 'react'
import { DropZoneLink, ErrorBanner, FileDropZone, SendFileListRow } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import {
addSelectedFiles,
normalizeSelectedFiles,
@@ -23,6 +24,7 @@ function getEntry(item: DataTransferItem) {
}
export function SelectFilesView() {
+ const { t } = useTranslation(['send'])
const selectedFiles = useTransferStore((s) => s.selectedFiles)
const [isDropZoneDragging, setIsDropZoneDragging] = useState(false)
const [selectionError, setSelectionError] = useState<string | null>(null)
@@ -60,9 +62,7 @@ export function SelectFilesView() {
})
: Array.from(event.dataTransfer.files ?? [])
- setSelectionError(
- hasFolderSelection ? "Folders aren't supported yet. Please select files only." : null
- )
+ setSelectionError(hasFolderSelection ? t('send:errors.folderUnsupported') : null)
const normalizedFiles = normalizeSelectedFiles(droppedFiles, bridgeApi.getPathForFile)
if (normalizedFiles.length > 0) {
@@ -77,11 +77,13 @@ export function SelectFilesView() {
description={
hasSelectedFiles ? (
<>
- or click to <DropZoneLink>add more</DropZoneLink>
+ {t('send:dropzone.orClickTo')}{' '}
+ <DropZoneLink>{t('send:dropzone.addMoreLink')}</DropZoneLink>
</>
) : (
<>
- or click to <DropZoneLink>browse</DropZoneLink>
+ {t('send:dropzone.orClickTo')}{' '}
+ <DropZoneLink>{t('send:dropzone.browseLink')}</DropZoneLink>
</>
)
}
@@ -97,7 +99,7 @@ export function SelectFilesView() {
setIsDropZoneDragging(true)
}}
onDrop={onDrop}
- title={hasSelectedFiles ? 'Add more files' : 'Drag and drop'}
+ title={hasSelectedFiles ? t('send:actions.addMoreFiles') : t('send:actions.dragAndDrop')}
/>
</div>
@@ -109,6 +111,7 @@ export function SelectFilesView() {
compact
name={file.name}
onRemove={() => removeSelectedFile(file.path)}
+ removeLabel={t('send:files.removeLabel', { name: file.name })}
size={file.size}
/>
))}
diff --git a/apps/desktop/src/renderer/pages/SendPage/ShareView.tsx b/apps/desktop/src/renderer/pages/SendPage/ShareView.tsx
index cc47349..86da5d7 100644
--- a/apps/desktop/src/renderer/pages/SendPage/ShareView.tsx
+++ b/apps/desktop/src/renderer/pages/SendPage/ShareView.tsx
@@ -1,16 +1,67 @@
import { useEffect, useMemo, useState } from 'react'
+import type { PeerListCardEntry } from '@altersend/components'
import {
formatFileSize,
getPeerListEntries,
- senderKeepOpenHint,
+ type PeerListEntry,
+ type PeerListEntryDetail,
useTransferStore
} from '@altersend/domain'
import { Disclosure, PeerListCard, SendFileListRow } from '@altersend/components'
import { AlertCircleIcon, FolderIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import { QRModal } from '../../components/QRModal'
import { ConnectionCard } from './ConnectionCard'
+function getPeerStatusLabel(t: ReturnType<typeof useTranslation>['t'], entry: PeerListEntry) {
+ switch (entry.status) {
+ case 'failed':
+ return t('send:status.failed')
+ case 'downloaded':
+ return t('send:status.downloaded')
+ case 'disconnected':
+ return t('send:status.disconnected')
+ case 'online':
+ return t('send:status.online')
+ case 'downloading':
+ return entry.progressPercent != null
+ ? t('send:status.downloadingPercent', { percent: entry.progressPercent })
+ : t('send:status.downloading')
+ }
+}
+
+function getPeerDetailLabel(
+ t: ReturnType<typeof useTranslation>['t'],
+ detail: PeerListEntryDetail | null
+) {
+ if (!detail) return null
+
+ switch (detail.type) {
+ case 'failed-file':
+ case 'in-flight-file':
+ return detail.fileName
+ case 'completed-files':
+ return t('common:files.count', { count: detail.count })
+ case 'completed-done':
+ return t('send:peer.completedDone', { count: detail.count })
+ case 'progress-bytes':
+ return `${formatFileSize(detail.transferredBytes)} / ${formatFileSize(detail.totalBytes)}`
+ }
+}
+
+function toPeerListCardEntry(
+ t: ReturnType<typeof useTranslation>['t'],
+ entry: PeerListEntry
+): PeerListCardEntry {
+ return {
+ ...entry,
+ statusLabel: getPeerStatusLabel(t, entry),
+ detail: getPeerDetailLabel(t, entry.detail)
+ }
+}
+
export function ShareView() {
+ const { t } = useTranslation(['send', 'common'])
const selectedFiles = useTransferStore((s) => s.selectedFiles)
const connectionState = useTransferStore((s) => s.connectionState)
const topic = useTransferStore((s) => s.topic)
@@ -26,6 +77,7 @@ export function ShareView() {
() => getPeerListEntries(connectedPeers, peerDownloads, selectedFiles),
[connectedPeers, peerDownloads, selectedFiles]
)
+ const peerCardEntries = peerEntries.map((entry) => toPeerListCardEntry(t, entry))
const hasActivity = isPeerConnected || peerEntries.length > 0
useEffect(() => {
@@ -44,7 +96,7 @@ export function ShareView() {
<div className='flex flex-col gap-3'>
<aside aria-live='polite' className='flex items-center gap-2 px-1 text-text-muted'>
<AlertCircleIcon size={12} />
- <span className='text-[11.5px] leading-[1.4]'>{senderKeepOpenHint}</span>
+ <span className='text-[11.5px] leading-[1.4]'>{t('send:hints.keepOpen')}</span>
</aside>
<ConnectionCard
@@ -55,7 +107,13 @@ export function ShareView() {
onOpenQR={() => setIsQRModalOpen(true)}
/>
- <PeerListCard entries={peerEntries} />
+ <PeerListCard
+ entries={peerCardEntries}
+ labels={{
+ title: t('send:peer.devices'),
+ connectedCount: (count) => t('send:peer.connectedCount', { count })
+ }}
+ />
<Disclosure
compact
@@ -63,7 +121,7 @@ export function ShareView() {
icon={<FolderIcon size={16} />}
onToggle={() => setIsFilesExpanded((v) => !v)}
subtitle={formatFileSize(totalSize)}
- title={selectedFiles.length === 1 ? '1 file' : `${selectedFiles.length} files`}
+ title={t('common:files.count', { count: selectedFiles.length })}
>
{selectedFiles.map((file) => (
<SendFileListRow key={file.path} bare compact name={file.name} size={file.size} />
diff --git a/apps/desktop/src/renderer/pages/SendPage/TopicCopyButton.tsx b/apps/desktop/src/renderer/pages/SendPage/TopicCopyButton.tsx
index 9b9872c..8a21490 100644
--- a/apps/desktop/src/renderer/pages/SendPage/TopicCopyButton.tsx
+++ b/apps/desktop/src/renderer/pages/SendPage/TopicCopyButton.tsx
@@ -1,3 +1,4 @@
+import { useTranslation } from '@altersend/locales'
import { LockIcon } from '@altersend/components/icons'
interface TopicCopyButtonProps {
@@ -8,9 +9,11 @@ interface TopicCopyButtonProps {
}
export function TopicCopyButton({ topic, copied, onCopy, placeholder }: TopicCopyButtonProps) {
+ const { t } = useTranslation(['send', 'common'])
+
return (
<button
- aria-label='Copy connection code'
+ aria-label={t('send:connection.copyLabel')}
className='flex min-w-0 flex-1 items-center gap-3 rounded-[8px] border border-border-primary bg-surface-primary px-3.5 py-2.5 text-left transition-colors hover:bg-surface-secondary disabled:cursor-not-allowed disabled:opacity-60'
disabled={!topic}
onClick={onCopy}
@@ -25,7 +28,7 @@ export function TopicCopyButton({ topic, copied, onCopy, placeholder }: TopicCop
<span
className={`shrink-0 text-[12px] font-medium ${copied ? 'text-success' : 'text-text-muted'}`}
>
- {copied ? 'Copied' : 'Copy'}
+ {copied ? t('common:actions.copied') : t('common:actions.copy')}
</span>
</button>
)
diff --git a/apps/desktop/src/renderer/pages/SendPage/index.tsx b/apps/desktop/src/renderer/pages/SendPage/index.tsx
index c2b0771..b2c316a 100644
--- a/apps/desktop/src/renderer/pages/SendPage/index.tsx
+++ b/apps/desktop/src/renderer/pages/SendPage/index.tsx
@@ -1,4 +1,5 @@
import { Button } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import {
clearSenderFlow,
continueShare,
@@ -7,20 +8,19 @@ import {
isShareStep,
useTransferStore
} from '@altersend/domain'
-import { useTranslation } from '@altersend/locales'
import { TransferActionGroup, TransferCardFrame } from '../../components/TransferPrimitives'
import { PreparingView } from './PreparingView'
import { SelectFilesView } from './SelectFilesView'
import { ShareView } from './ShareView'
export default function SendPage() {
- const { t } = useTranslation('send')
+ const { t } = useTranslation(['send', 'common'])
const selectedFiles = useTransferStore((s) => s.selectedFiles)
const draftPhase = useTransferStore((s) => s.draftPhase)
const connectionState = useTransferStore((s) => s.connectionState)
const step = getSendStep({ draftPhase, isPeerConnected: connectionState === 'peer-connected' })
- const copy = getSendPageCopy(step, t)
+ const copy = getSendPageCopy(t, step)
const hasSelectedFiles = selectedFiles.length > 0
function renderView() {
@@ -44,7 +44,7 @@ export default function SendPage() {
return (
<TransferActionGroup>
<Button onClick={clearSenderFlow} size='sm' variant='secondary'>
- End session
+ {t('common:actions.endSession')}
</Button>
</TransferActionGroup>
)
@@ -57,10 +57,10 @@ export default function SendPage() {
return (
<TransferActionGroup>
<Button onClick={clearSenderFlow} size='sm' variant='ghost'>
- Clear
+ {t('common:actions.clear')}
</Button>
<Button onClick={() => void continueShare(selectedFiles)} size='sm' variant='primary'>
- Send {selectedFiles.length} file{selectedFiles.length === 1 ? '' : 's'}
+ {t('send:actions.sendFiles', { count: selectedFiles.length })}
</Button>
</TransferActionGroup>
)
diff --git a/apps/desktop/src/renderer/pages/TransferPage/FooterBar.tsx b/apps/desktop/src/renderer/pages/TransferPage/FooterBar.tsx
index 5495c7a..b440b32 100644
--- a/apps/desktop/src/renderer/pages/TransferPage/FooterBar.tsx
+++ b/apps/desktop/src/renderer/pages/TransferPage/FooterBar.tsx
@@ -1,6 +1,24 @@
import { useState } from 'react'
-import { Button, ExternalLink, FeedbackTypeSelector, ToggleSwitch } from '@altersend/components'
+import {
+ Button,
+ ExternalLink,
+ FeedbackTypeSelector,
+ ToggleSwitch,
+ getFontFamilyCssVariables
+} from '@altersend/components'
import type { FeedbackType } from '@altersend/components'
+import {
+ LOCALE_OPTIONS,
+ changeI18nLanguage,
+ getLocaleFontFamily,
+ isMultiLangEnabled,
+ normalizeLocalePreference,
+ resolveActiveLocalePreference,
+ Trans,
+ useTranslation,
+ type LocaleOption,
+ type LocalePreference
+} from '@altersend/locales'
import {
AlertCircleIcon,
ArrowLeftIcon,
@@ -17,13 +35,6 @@ import {
termsOfServiceUrl,
websiteUrl
} from '@altersend/domain'
-import {
- MULTI_LANG_ENABLED,
- PICKABLE_LANGUAGES,
- useTranslation,
- changeLocale,
- type LocalePreference
-} from '@altersend/locales'
import logo from '../../../../../../assets/logo.png'
import { bridgeApi } from '../../api/bridgeApi'
import { Select } from '../../components/Select'
@@ -32,30 +43,35 @@ import {
isCrashReportingEnabled,
setCrashReportingEnabled
} from '../../lifecycle/crashReportingStorage'
-import { setSavedLocale } from '../../lifecycle/localeStorage'
-
-const PLACEHOLDERS: Record<FeedbackType, string> = {
- 'Bug report': 'Describe what went wrong…',
- 'Feature request': 'What would you like to see?',
- General: 'Share your thoughts…'
-}
+import {
+ getSavedLocalePreference,
+ setSavedLocalePreference
+} from '../../lifecycle/localePreferenceStorage'
+import { getDesktopSystemLocales } from '../../lifecycle/systemLocale'
const MENU_ITEMS = [
- { icon: AlertCircleIcon, label: 'Feedback', key: 'feedback', chevron: true },
- { icon: DiscordIcon, label: 'Discord', key: 'discord' },
- { icon: GithubIcon, label: 'GitHub', key: 'github' },
- { icon: GlobeIcon, label: 'Website', key: 'website' }
+ { icon: AlertCircleIcon, key: 'feedback', chevron: true },
+ { icon: DiscordIcon, key: 'discord' },
+ { icon: GithubIcon, key: 'github' },
+ { icon: GlobeIcon, key: 'website' }
] as const
+const DISCORD_EMBED_COLOR = 0x5865f2
+
+function getLocaleOptionFontFamily(option: LocaleOption): string | undefined {
+ if (!option.resolvedCode) return undefined
+ return getFontFamilyCssVariables(getLocaleFontFamily(option.resolvedCode)).fontFamily
+}
export function FooterBar({ version }: { version: string }) {
+ const { t } = useTranslation(['settings', 'common', 'feedback'])
const [settingsOpen, setSettingsOpen] = useState(false)
const [panel, setPanel] = useState<'settings' | 'report'>('settings')
- const [reportType, setReportType] = useState<FeedbackType>('Bug report')
+ const [reportType, setReportType] = useState<FeedbackType>('bug')
const [reportMessage, setReportMessage] = useState('')
const [reportState, setReportState] = useState<'idle' | 'sending' | 'sent' | 'error'>('idle')
const [crashReporting, setCrashReporting] = useState(isCrashReportingEnabled)
- const { i18n } = useTranslation()
- const locale = i18n.language
+ const [localePreference, setLocalePreference] =
+ useState<LocalePreference>(getSavedLocalePreference)
const handleCrashReportingToggle = (next: boolean) => {
setCrashReporting(next)
@@ -65,10 +81,17 @@ export function FooterBar({ version }: { version: string }) {
void bridgeApi.setSentryEnabled(next)
}
+ const handleLocaleChange = (value: string) => {
+ const preference = normalizeLocalePreference(value)
+ setLocalePreference(preference)
+ setSavedLocalePreference(preference)
+ void changeI18nLanguage(resolveActiveLocalePreference(preference, getDesktopSystemLocales()))
+ }
+
const closePanel = () => {
setSettingsOpen(false)
setPanel('settings')
- setReportType('Bug report')
+ setReportType('bug')
setReportMessage('')
setReportState('idle')
}
@@ -94,12 +117,16 @@ export function FooterBar({ version }: { version: string }) {
body: JSON.stringify({
embeds: [
{
- title: reportType,
+ title: t(`feedback:types.${reportType}`),
description: reportMessage.trim(),
- color: 0x5865f2,
+ color: DISCORD_EMBED_COLOR,
fields: [
- { name: 'Version', value: `v${version}`, inline: true },
- { name: 'Platform', value: 'Desktop', inline: true }
+ { name: t('common:labels.version'), value: `v${version}`, inline: true },
+ {
+ name: t('common:labels.platform'),
+ value: t('common:labels.desktop'),
+ inline: true
+ }
],
timestamp: new Date().toISOString()
}
@@ -128,8 +155,8 @@ export function FooterBar({ version }: { version: string }) {
<div className='relative'>
<button
- aria-label='Settings'
- title='Settings'
+ aria-label={t('common:labels.settings')}
+ title={t('common:labels.settings')}
type='button'
className='flex p-1.5 appearance-none items-center justify-center rounded-full border border-border-strong bg-surface-primary text-text-muted transition-colors hover:border-text-muted hover:text-text-primary'
onClick={() => setSettingsOpen((v) => !v)}
@@ -145,40 +172,36 @@ export function FooterBar({ version }: { version: string }) {
<>
<div className='px-5 pb-4 pt-5'>
<p className='mb-4 mt-0 text-[11px] font-semibold uppercase tracking-widest text-text-muted'>
- Settings
+ {t('settings:title')}
</p>
<ToggleSwitch
checked={crashReporting}
onChange={handleCrashReportingToggle}
- label='Crash reports'
- description='Share anonymous crash data to help improve AlterSend'
+ label={t('settings:crashReports.label')}
+ description={t('settings:crashReports.description')}
/>
- {MULTI_LANG_ENABLED && (
+ {isMultiLangEnabled && (
<div className='mt-3'>
<label className='mb-2 block text-[13px] font-medium text-text-secondary'>
- Language
+ {t('common:labels.language')}
</label>
<Select
- aria-label='Language'
- value={locale}
- onChange={async (value) => {
- try {
- await changeLocale(value as LocalePreference)
- setSavedLocale(value as LocalePreference)
- } catch (err) {
- console.warn('Failed to change language', err)
- }
- }}
- options={PICKABLE_LANGUAGES.map((l) => ({
- value: l.code,
- label: l.label
+ aria-label={t('common:labels.language')}
+ value={localePreference}
+ onChange={handleLocaleChange}
+ options={LOCALE_OPTIONS.map((option) => ({
+ value: option.preference,
+ label: option.nativeName
+ ? `${option.nativeName} · ${option.label}`
+ : t('common:labels.systemDefault'),
+ fontFamily: getLocaleOptionFontFamily(option)
}))}
/>
</div>
)}
</div>
<div className='border-t border-border-primary py-1'>
- {MENU_ITEMS.map(({ icon: Icon, label, key, ...rest }) => (
+ {MENU_ITEMS.map(({ icon: Icon, key, ...rest }) => (
<button
key={key}
type='button'
@@ -186,25 +209,41 @@ export function FooterBar({ version }: { version: string }) {
className='flex w-full appearance-none items-center gap-3 border-0 bg-transparent px-5 py-2.5 text-[14px] text-text-secondary transition-colors hover:bg-surface-secondary hover:text-text-primary'
>
<Icon size={15} />
- <span className='flex-1 text-left'>{label}</span>
+ <span className='flex-1 text-left'>
+ {key === 'feedback'
+ ? t('settings:rows.feedback')
+ : key === 'discord'
+ ? t('settings:rows.discord')
+ : key === 'github'
+ ? 'GitHub'
+ : t('settings:rows.website')}
+ </span>
{'chevron' in rest && rest.chevron && <ChevronRightIcon size={13} />}
</button>
))}
</div>
<div className='border-t border-border-primary px-5 py-4'>
<p className='m-0 font-medium text-[12px] text-text-muted'>
- <ExternalLink
- onPress={() => void bridgeApi.openExternalUrl(termsOfServiceUrl)}
- >
- Terms of Use
- </ExternalLink>
- {' and '}
- <ExternalLink
- onPress={() => void bridgeApi.openExternalUrl(privacyPolicyUrl)}
- >
- Privacy Statement
- </ExternalLink>
- {'.'}
+ <Trans
+ ns='settings'
+ i18nKey='legal.sentence'
+ components={{
+ terms: (
+ <ExternalLink
+ onPress={() => void bridgeApi.openExternalUrl(termsOfServiceUrl)}
+ >
+ {null}
+ </ExternalLink>
+ ),
+ privacy: (
+ <ExternalLink
+ onPress={() => void bridgeApi.openExternalUrl(privacyPolicyUrl)}
+ >
+ {null}
+ </ExternalLink>
+ )
+ }}
+ />
</p>
</div>
</>
@@ -219,16 +258,16 @@ export function FooterBar({ version }: { version: string }) {
setPanel('settings')
setReportState('idle')
setReportMessage('')
- setReportType('Bug report')
+ setReportType('bug')
}}
>
- Feedback
+ {t('feedback:title')}
</Button>
</div>
{reportState === 'sent' ? (
<p className='py-8 text-center text-[14px] text-text-secondary'>
- Thanks for your feedback!
+ {t('feedback:states.sent')}
</p>
) : (
<>
@@ -236,13 +275,24 @@ export function FooterBar({ version }: { version: string }) {
<FeedbackTypeSelector
value={reportType}
onChange={setReportType}
+ labels={{
+ bug: t('feedback:types.bug'),
+ feature: t('feedback:types.feature'),
+ general: t('feedback:types.general')
+ }}
disabled={reportState === 'sending'}
/>
</div>
<textarea
className='w-full resize-none rounded-lg border border-border-primary bg-surface-secondary px-3 py-3 font-sans text-[13px] text-text-primary placeholder:text-text-muted focus:border-border-strong focus:outline-none disabled:opacity-50'
rows={4}
- placeholder={PLACEHOLDERS[reportType]}
+ placeholder={
+ reportType === 'bug'
+ ? t('feedback:placeholders.desktopBug')
+ : reportType === 'feature'
+ ? t('feedback:placeholders.desktopFeature')
+ : t('feedback:placeholders.general')
+ }
value={reportMessage}
disabled={reportState === 'sending'}
onChange={(e) => {
@@ -252,7 +302,7 @@ export function FooterBar({ version }: { version: string }) {
/>
{reportState === 'error' && (
<p className='mt-1.5 text-[11px] text-danger'>
- Failed to send. Check your connection.
+ {t('feedback:states.failed')}
</p>
)}
<div className='mt-3'>
@@ -263,7 +313,9 @@ export function FooterBar({ version }: { version: string }) {
disabled={!reportMessage.trim() || reportState === 'sending'}
onClick={() => void sendReport()}
>
- {reportState === 'sending' ? 'Sending…' : 'Send feedback'}
+ {reportState === 'sending'
+ ? t('feedback:actions.sending')
+ : t('feedback:actions.send')}
</Button>
</div>
</>
diff --git a/apps/desktop/src/renderer/pages/TransferPage/index.tsx b/apps/desktop/src/renderer/pages/TransferPage/index.tsx
index 84d1cb9..b6ff7c5 100644
--- a/apps/desktop/src/renderer/pages/TransferPage/index.tsx
+++ b/apps/desktop/src/renderer/pages/TransferPage/index.tsx
@@ -1,12 +1,14 @@
import { useState } from 'react'
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@altersend/components'
import { clearSession, useTransferStore } from '@altersend/domain'
+import { useTranslation } from '@altersend/locales'
import { FooterBar } from './FooterBar'
import { ReceivePage, SendPage } from '..'
type TransferTab = 'send' | 'receive'
export default function TransferPage({ version }: { version: string }) {
+ const { t } = useTranslation(['common'])
const role = useTransferStore((s) => s.role)
const [userTab, setUserTab] = useState<TransferTab>('send')
@@ -16,8 +18,8 @@ export default function TransferPage({ version }: { version: string }) {
if (role !== null) {
const message =
role === 'sender'
- ? 'Leaving will end your active share session. Continue?'
- : 'Leaving will end your active receive session. Continue?'
+ ? t('common:confirm.leaveShareSession')
+ : t('common:confirm.leaveReceiveSession')
if (!window.confirm(message)) return
void clearSession()
}
@@ -32,9 +34,9 @@ export default function TransferPage({ version }: { version: string }) {
<Tabs onValueChange={handleTabChange} value={userTab}>
<div className='mx-auto flex h-full w-full max-w-[860px] flex-1 flex-col'>
<div className='flex items-center gap-4'>
- <TabsList aria-label='Transfer mode'>
- <TabsTrigger value='send'>Send</TabsTrigger>
- <TabsTrigger value='receive'>Receive</TabsTrigger>
+ <TabsList aria-label={t('common:labels.transferMode')}>
+ <TabsTrigger value='send'>{t('common:labels.send')}</TabsTrigger>
+ <TabsTrigger value='receive'>{t('common:labels.receive')}</TabsTrigger>
</TabsList>
</div>
diff --git a/apps/mobile/app.config.cjs b/apps/mobile/app.config.cjs
new file mode 100644
index 0000000..aa763c5
--- /dev/null
+++ b/apps/mobile/app.config.cjs
@@ -0,0 +1,43 @@
+const appJson = require('./app.json')
+const releaseConfig = require('../../packages/locales/src/release.json')
+
+const DEFAULT_LOCALE = 'en-US'
+
+function clone(value) {
+ return JSON.parse(JSON.stringify(value))
+}
+
+function getEnabledLocaleCodes(locales) {
+ return releaseConfig.isMultiLangEnabled ? Object.keys(locales) : [DEFAULT_LOCALE]
+}
+
+function filterLocales(locales, enabledCodes) {
+ return Object.fromEntries(enabledCodes.map((code) => [code, locales[code]]).filter(([, path]) => path))
+}
+
+function gateLocalizationPlugin(plugin, enabledCodes) {
+ if (!Array.isArray(plugin) || plugin[0] !== 'expo-localization') return plugin
+
+ const options = clone(plugin[1] ?? {})
+ options.supportedLocales = {
+ ios: enabledCodes,
+ android: enabledCodes
+ }
+
+ return [plugin[0], options]
+}
+
+module.exports = ({ config }) => {
+ const expo = clone(appJson.expo)
+ const enabledLocaleCodes = getEnabledLocaleCodes(expo.locales ?? {})
+
+ expo.locales = filterLocales(expo.locales ?? {}, enabledLocaleCodes)
+ expo.plugins = (expo.plugins ?? []).map((plugin) =>
+ gateLocalizationPlugin(plugin, enabledLocaleCodes)
+ )
+
+ return {
+ ...config,
+ ...expo
+ }
+}
diff --git a/apps/mobile/app.json b/apps/mobile/app.json
index 3b00c06..5dcdf7b 100644
--- a/apps/mobile/app.json
+++ b/apps/mobile/app.json
@@ -21,7 +21,8 @@
"NSBonjourServices": ["_altersend._udp", "_altersend._tcp"],
"UIFileSharingEnabled": true,
"LSSupportsOpeningDocumentsInPlace": true,
- "ITSAppUsesNonExemptEncryption": false
+ "ITSAppUsesNonExemptEncryption": false,
+ "CFBundleAllowMixedLocalizations": true
},
"privacyManifests": {
"NSPrivacyTracking": false,
@@ -120,12 +121,133 @@
"androidIntentFilters": ["*/*"]
}
],
- "expo-localization"
+ [
+ "expo-localization",
+ {
+ "supportedLocales": {
+ "ios": [
+ "en-US",
+ "en-GB",
+ "ja-JP",
+ "ko-KR",
+ "zh-CN",
+ "zh-TW",
+ "fr-FR",
+ "de-DE",
+ "it-IT",
+ "pt-BR",
+ "es-419",
+ "es-ES"
+ ],
+ "android": [
+ "en-US",
+ "en-GB",
+ "ja-JP",
+ "ko-KR",
+ "zh-CN",
+ "zh-TW",
+ "fr-FR",
+ "de-DE",
+ "it-IT",
+ "pt-BR",
+ "es-419",
+ "es-ES"
+ ]
+ }
+ }
+ ],
+ [
+ "expo-font",
+ {
+ "ios": {
+ "fonts": [
+ "../../assets/fonts/NotoSans-JP-Regular.ttf",
+ "../../assets/fonts/NotoSans-JP-Bold.ttf",
+ "../../assets/fonts/NotoSans-KR-Regular.ttf",
+ "../../assets/fonts/NotoSans-KR-Bold.ttf",
+ "../../assets/fonts/NotoSans-SC-Regular.ttf",
+ "../../assets/fonts/NotoSans-SC-Bold.ttf",
+ "../../assets/fonts/NotoSans-TC-Regular.ttf",
+ "../../assets/fonts/NotoSans-TC-Bold.ttf"
+ ]
+ },
+ "android": {
+ "fonts": [
+ {
+ "fontFamily": "AlterSend Sans JP",
+ "fontDefinitions": [
+ {
+ "path": "../../assets/fonts/NotoSans-JP-Regular.ttf",
+ "weight": 400
+ },
+ {
+ "path": "../../assets/fonts/NotoSans-JP-Bold.ttf",
+ "weight": 700
+ }
+ ]
+ },
+ {
+ "fontFamily": "AlterSend Sans KR",
+ "fontDefinitions": [
+ {
+ "path": "../../assets/fonts/NotoSans-KR-Regular.ttf",
+ "weight": 400
+ },
+ {
+ "path": "../../assets/fonts/NotoSans-KR-Bold.ttf",
+ "weight": 700
+ }
+ ]
+ },
+ {
+ "fontFamily": "AlterSend Sans SC",
+ "fontDefinitions": [
+ {
+ "path": "../../assets/fonts/NotoSans-SC-Regular.ttf",
+ "weight": 400
+ },
+ {
+ "path": "../../assets/fonts/NotoSans-SC-Bold.ttf",
+ "weight": 700
+ }
+ ]
+ },
+ {
+ "fontFamily": "AlterSend Sans TC",
+ "fontDefinitions": [
+ {
+ "path": "../../assets/fonts/NotoSans-TC-Regular.ttf",
+ "weight": 400
+ },
+ {
+ "path": "../../assets/fonts/NotoSans-TC-Bold.ttf",
+ "weight": 700
+ }
+ ]
+ }
+ ]
+ }
+ }
+ ]
],
"extra": {
"eas": {
"projectId": "3727baf7-0b5c-4e81-97bd-28296124d0c0"
}
+ },
+ "locales": {
+ "en-US": "./locales/en-US.json",
+ "en-GB": "./locales/en-GB.json",
+ "ja-JP": "./locales/ja-JP.json",
+ "ko-KR": "./locales/ko-KR.json",
+ "zh-CN": "./locales/zh-CN.json",
+ "zh-TW": "./locales/zh-TW.json",
+ "fr-FR": "./locales/fr-FR.json",
+ "de-DE": "./locales/de-DE.json",
+ "it-IT": "./locales/it-IT.json",
+ "pt-BR": "./locales/pt-BR.json",
+ "es-419": "./locales/es-419.json",
+ "es-ES": "./locales/es-ES.json"
}
}
}
diff --git a/apps/mobile/app/(tabs)/_layout.tsx b/apps/mobile/app/(tabs)/_layout.tsx
index a509b03..438c24b 100644
--- a/apps/mobile/app/(tabs)/_layout.tsx
+++ b/apps/mobile/app/(tabs)/_layout.tsx
@@ -1,8 +1,10 @@
import { NativeTabs } from 'expo-router/unstable-native-tabs'
import { Ionicons } from '@expo/vector-icons'
import { useTheme } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
export default function TabLayout() {
+ const { t } = useTranslation(['common'])
const { theme } = useTheme()
const c = theme.colors
return (
@@ -24,7 +26,7 @@ export default function TabLayout() {
sf='paperplane.fill'
src={<NativeTabs.Trigger.VectorIcon family={Ionicons} name='paper-plane' />}
/>
- <NativeTabs.Trigger.Label>Send</NativeTabs.Trigger.Label>
+ <NativeTabs.Trigger.Label>{t('common:labels.send')}</NativeTabs.Trigger.Label>
</NativeTabs.Trigger>
<NativeTabs.Trigger name='receive/index'>
@@ -32,7 +34,7 @@ export default function TabLayout() {
sf='square.and.arrow.down'
src={<NativeTabs.Trigger.VectorIcon family={Ionicons} name='download' />}
/>
- <NativeTabs.Trigger.Label>Receive</NativeTabs.Trigger.Label>
+ <NativeTabs.Trigger.Label>{t('common:labels.receive')}</NativeTabs.Trigger.Label>
</NativeTabs.Trigger>
</NativeTabs>
)
diff --git a/apps/mobile/app/(tabs)/receive/index.tsx b/apps/mobile/app/(tabs)/receive/index.tsx
index f934706..5af1f8d 100644
--- a/apps/mobile/app/(tabs)/receive/index.tsx
+++ b/apps/mobile/app/(tabs)/receive/index.tsx
@@ -1,8 +1,10 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { Button } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import { useFocusEffect, useRouter } from 'expo-router'
import {
JOIN_CODE_PATTERN,
+ getDisplayError,
getDownloadTotals,
getReceivePageCopy,
getReceiveStep,
@@ -19,8 +21,9 @@ import {
import { Layout } from '@/src/components'
export default function ReceiveScreen() {
+ const { t } = useTranslation(['receive', 'common', 'errors'])
const router = useRouter()
- const errorMessage = useTransferStore((s) => s.errorMessage)
+ const errorCode = useTransferStore((s) => s.errorCode)
const role = useTransferStore((s) => s.role)
const isReconnecting = useTransferStore((s) => s.isReconnecting)
const incomingFileOffers = useTransferStore((s) => s.incomingFileOffers)
@@ -38,8 +41,8 @@ export default function ReceiveScreen() {
if (!showValidation || isValidJoinCode || trimmedJoinCode.length === 0) {
return undefined
}
- return 'Enter a valid 64-character hex code.'
- }, [isValidJoinCode, showValidation, trimmedJoinCode.length])
+ return t('receive:errors.invalidCode')
+ }, [isValidJoinCode, showValidation, t, trimmedJoinCode.length])
const handleJoinCodeChange = (value: string) => {
setJoinCode(value)
@@ -91,12 +94,10 @@ export default function ReceiveScreen() {
}
}, [step])
- const copy = getReceivePageCopy(step, incomingFileOffers.length)
- const title = step === 'join' ? 'Receive' : copy.title
- const description =
- step === 'join'
- ? "Scan or import a sender's QR, or paste their 64-character code to start streaming."
- : copy.description
+ const totalBytes = incomingFileOffers.reduce((sum, file) => sum + file.size, 0)
+ const copy = getReceivePageCopy(t, step, incomingFileOffers.length, totalBytes)
+ const title = step === 'join' ? t('receive:page.tabTitle') : copy.title
+ const description = step === 'join' ? t('receive:page.join.mobileDescription') : copy.description
const footer =
step === 'join' ? undefined : (
@@ -106,12 +107,15 @@ export default function ReceiveScreen() {
variant={step === 'interrupted' ? 'primary' : 'secondary'}
width='full'
>
- {step === 'interrupted' ? 'Done' : 'End session'}
+ {step === 'interrupted' ? t('common:actions.done') : t('common:actions.endSession')}
</Button>
)
+ const displayError = getDisplayError(t, errorCode)
const errorPanel =
- errorMessage && step !== 'interrupted' ? <ErrorPanel message={errorMessage} /> : null
+ displayError && step !== 'interrupted' ? (
+ <ErrorPanel title={t('receive:errors.transferIssue')} message={displayError} />
+ ) : null
if (step === 'join') {
return (
diff --git a/apps/mobile/app/(tabs)/send/index.tsx b/apps/mobile/app/(tabs)/send/index.tsx
index c0357f7..0807fcc 100644
--- a/apps/mobile/app/(tabs)/send/index.tsx
+++ b/apps/mobile/app/(tabs)/send/index.tsx
@@ -1,12 +1,12 @@
import { useCallback, useEffect } from 'react'
import { View } from 'react-native'
import { Button } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import { Layout } from '@/src/components'
import { SelectFilesView } from '@/src/transfer/send'
import { usePathname, useRouter } from 'expo-router'
import { getSendPageCopy, getSendStep, isShareStep, useTransferStore } from '@altersend/domain'
import { continueShare } from '@altersend/domain'
-import { useTranslation } from '@altersend/locales'
function NavigationController() {
const router = useRouter()
@@ -39,14 +39,14 @@ function NavigationController() {
}
export default function SendSelectScreen() {
- const { t } = useTranslation('send')
+ const { t } = useTranslation(['send'])
const selectedFiles = useTransferStore((s) => s.selectedFiles)
const draftPhase = useTransferStore((s) => s.draftPhase)
const connectionState = useTransferStore((s) => s.connectionState)
const router = useRouter()
const step = getSendStep({ draftPhase, isPeerConnected: connectionState === 'peer-connected' })
- const copy = getSendPageCopy(step, t)
+ const copy = getSendPageCopy(t, step)
const hasSelectedFiles = selectedFiles.length > 0
const openMenu = useCallback(() => router.push('/settings'), [router])
@@ -66,7 +66,7 @@ export default function SendSelectScreen() {
variant='primary'
width='full'
>
- {`Send ${selectedFiles.length} file${selectedFiles.length === 1 ? '' : 's'}`}
+ {t('send:actions.sendFiles', { count: selectedFiles.length })}
</Button>
) : undefined
}
diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx
index 77061d8..b94b5f0 100644
--- a/apps/mobile/app/_layout.tsx
+++ b/apps/mobile/app/_layout.tsx
@@ -12,25 +12,33 @@ import {
startPeerWatchdog,
useSimulatedLoading
} from '@altersend/domain'
-import { changeLocale, getInitialLocale } from '@altersend/locales'
+import {
+ getLocaleFontFamily,
+ initI18n,
+ isSupportedLocaleCode,
+ resolveActiveLocalePreference,
+ useTranslation
+} from '@altersend/locales'
import { Stack } from 'expo-router'
-import { StyleSheet, View } from 'react-native'
+import { Platform, StyleSheet, View } from 'react-native'
import { useEffect, useState } from 'react'
import * as SplashScreen from 'expo-splash-screen'
-
-SplashScreen.preventAutoHideAsync().catch(() => {})
import { LoadingScreen } from '../src/loading'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { mobileApi } from '../src/api/mobileApi'
import { ToastProvider } from '../src/components/Toast'
import { UpdateBanner } from '../src/components/UpdateBanner'
+import { useAlterSendFonts } from '../src/theme/useAlterSendFonts'
import { startAppStateBridge } from '../src/lifecycle/appStateBridge'
import { startDeepLinkHandler } from '../src/lifecycle/deepLinkHandler'
-import { getSavedLocale } from '../src/lifecycle/localeStorage'
+import { getSavedLocalePreference } from '../src/lifecycle/localePreferenceStorage'
+import { getMobileSystemLocales } from '../src/lifecycle/systemLocale'
import { ShareIntentHandler } from '../src/lifecycle/ShareIntentHandler'
import { startPhotosCopyEffect } from '../src/transfer/receive'
import { initSentry, captureException } from '../src/sentry'
+SplashScreen.preventAutoHideAsync().catch(() => {})
+
initSentry()
bindTransferApi(mobileApi, {
onError: (context, error) => captureException(error, context)
@@ -41,20 +49,35 @@ startBackgroundReconnectEffect()
startPhotosCopyEffect()
startDeepLinkHandler()
-function getFlowScreenOptions(theme: Theme) {
+function MobileCrashScreen({ error, onRestart }: { error: Error; onRestart: () => void }) {
+ const { t } = useTranslation(['errors'])
+
+ return (
+ <CrashScreen
+ error={error}
+ onRestart={onRestart}
+ title={t('errors:crash.title')}
+ description={t('errors:crash.mobileDescription')}
+ restartLabel={t('errors:crash.tryAgain')}
+ />
+ )
+}
+
+function getFlowScreenOptions(theme: Theme, backTitle: string) {
return {
headerShown: true,
headerStyle: { backgroundColor: theme.colors.colorBackground },
headerTintColor: theme.colors.colorTextPrimary,
headerShadowVisible: false,
headerTitle: '',
- headerBackTitle: 'Back'
+ ...(Platform.OS === 'ios' ? { headerBackTitle: backTitle } : {})
} as const
}
function ThemedStack() {
+ const { t } = useTranslation(['common'])
const { theme } = useTheme()
- const flowScreenOptions = getFlowScreenOptions(theme)
+ const flowScreenOptions = getFlowScreenOptions(theme, t('common:actions.back'))
const progress = useSimulatedLoading()
if (progress < 100) {
@@ -89,49 +112,20 @@ function ThemedStack() {
)
}
-export default function RootLayout() {
- const [isReady, setIsReady] = useState(false)
-
- useEffect(() => {
- let isMounted = true
- async function initLocale() {
- try {
- const savedLocale = await getSavedLocale()
- if (!isMounted) return
- const preference = savedLocale || 'system'
- await changeLocale(getInitialLocale(preference))
- } catch (err) {
- console.warn(err)
- } finally {
- if (isMounted) {
- setIsReady(true)
- SplashScreen.hideAsync().catch(console.warn)
- }
- }
- }
- void initLocale()
- return () => {
- isMounted = false
- }
- }, [])
-
- if (!isReady) return null
+function AppShell() {
+ const { i18n } = useTranslation()
+ const language = i18n.resolvedLanguage ?? i18n.language
+ const locale = isSupportedLocaleCode(language) ? language : 'en-US'
+ const fontFamily = getLocaleFontFamily(locale)
return (
<SafeAreaProvider>
<View style={styles.root}>
- <ThemeProvider theme={ThemeType.Dark}>
+ <ThemeProvider theme={ThemeType.Dark} fontFamily={fontFamily}>
<ErrorBoundary
fallback={(error, reset) => {
captureException(error)
- return (
- <CrashScreen
- error={error}
- onRestart={reset}
- description='AlterSend hit an unexpected error. Try again, or close and reopen the app if the problem persists.'
- restartLabel='Try again'
- />
- )
+ return <MobileCrashScreen error={error} onRestart={reset} />
}}
>
<ToastProvider>
@@ -146,6 +140,42 @@ export default function RootLayout() {
)
}
+export default function RootLayout() {
+ const [i18nReady, setI18nReady] = useState(false)
+ const [fontsLoaded, fontError] = useAlterSendFonts()
+
+ useEffect(() => {
+ let mounted = true
+ async function initializeLocale() {
+ try {
+ const preference = await getSavedLocalePreference()
+ await initI18n(resolveActiveLocalePreference(preference, getMobileSystemLocales()))
+ } catch (error) {
+ captureException(error)
+ console.warn('Failed to initialize locale:', error)
+ } finally {
+ if (mounted) setI18nReady(true)
+ }
+ }
+
+ void initializeLocale()
+ return () => {
+ mounted = false
+ }
+ }, [])
+
+ useEffect(() => {
+ if (i18nReady && fontsLoaded) {
+ SplashScreen.hideAsync().catch(console.warn)
+ }
+ }, [fontsLoaded, i18nReady])
+
+ if (fontError) throw fontError
+ if (!i18nReady || !fontsLoaded) return null
+
+ return <AppShell />
+}
+
const styles = StyleSheet.create({
root: {
flex: 1
diff --git a/apps/mobile/app/language.tsx b/apps/mobile/app/language.tsx
index c10bb14..b62ecb1 100644
--- a/apps/mobile/app/language.tsx
+++ b/apps/mobile/app/language.tsx
@@ -1,30 +1,59 @@
-import { Pressable, StyleSheet, Text, View } from 'react-native'
-import { useRouter } from 'expo-router'
import {
- PICKABLE_LANGUAGES,
- changeLocale,
+ LOCALE_OPTIONS,
+ changeI18nLanguage,
+ getLocaleFontFamily,
+ isMultiLangEnabled,
+ normalizeLocalePreference,
+ resolveActiveLocalePreference,
useTranslation,
- type LocalePreference
+ type LocaleOption,
+ type LocalePreference,
+ type SupportedLocaleCode
} from '@altersend/locales'
-import { useTheme } from '@altersend/components'
+import { getNativeFontFamilyName, useTheme } from '@altersend/components'
import { CheckIcon } from '@altersend/components/icons'
import { Layout } from '@/src/components'
-import { setSavedLocale } from '@/src/lifecycle/localeStorage'
+import {
+ getLocalePreferenceSnapshot,
+ getSavedLocalePreference,
+ setSavedLocalePreference
+} from '@/src/lifecycle/localePreferenceStorage'
+import { getMobileSystemLocales } from '@/src/lifecycle/systemLocale'
+import { useRouter } from 'expo-router'
+import { useEffect, useState } from 'react'
+import { Pressable, StyleSheet, View } from 'react-native'
+import { Text } from '@/src/components/ThemedText'
export default function LanguageScreen() {
+ const { t } = useTranslation(['settings', 'common'])
const { theme } = useTheme()
const router = useRouter()
- const { i18n } = useTranslation()
- const locale = i18n.language
+ const [preference, setPreference] = useState<LocalePreference>(getLocalePreferenceSnapshot)
- const handleSelect = async (code: string) => {
- try {
- await changeLocale(code as LocalePreference)
- void setSavedLocale(code as LocalePreference)
+ useEffect(() => {
+ if (!isMultiLangEnabled) {
router.back()
- } catch (err) {
- console.warn('Failed to change language', err)
+ return
+ }
+
+ let mounted = true
+ void getSavedLocalePreference().then((saved) => {
+ if (mounted) setPreference(saved)
+ })
+ return () => {
+ mounted = false
}
+ }, [router])
+
+ if (!isMultiLangEnabled) return null
+
+ const handleSelect = async (value: string) => {
+ const next = normalizeLocalePreference(value)
+ const resolvedLocale = resolveActiveLocalePreference(next, getMobileSystemLocales())
+ setPreference(next)
+ await setSavedLocalePreference(next)
+ router.back()
+ scheduleLanguageChange(resolvedLocale)
}
const cardStyle = {
@@ -33,27 +62,53 @@ export default function LanguageScreen() {
}
return (
- <Layout title='Language' description='' hasNativeHeader>
+ <Layout
+ title={t('settings:languageTitle')}
+ description={t('settings:languageHint')}
+ hasNativeHeader
+ >
<View style={[styles.card, cardStyle]}>
- {PICKABLE_LANGUAGES.map((language, index) => {
- const selected = language.code === locale
+ {LOCALE_OPTIONS.map((option, index) => {
+ const selected = option.preference === preference
return (
- <View key={language.code}>
+ <View key={option.preference}>
<Pressable
accessibilityRole='button'
accessibilityState={{ selected }}
- onPress={() => handleSelect(language.code)}
+ onPress={() => void handleSelect(option.preference)}
style={({ pressed }) => [
styles.row,
pressed && { backgroundColor: theme.colors.colorSurfacePrimary }
]}
>
- <Text style={[styles.label, { color: theme.colors.colorTextPrimary }]}>
- {language.label}
- </Text>
+ <View style={styles.rowText}>
+ <Text
+ style={[
+ styles.label,
+ {
+ color: theme.colors.colorTextPrimary,
+ fontFamily: getOptionNativeNameFontFamily(option)
+ }
+ ]}
+ >
+ {option.nativeName ?? t('common:labels.systemDefault')}
+ </Text>
+ {option.nativeName ? (
+ <Text
+ style={[
+ styles.hint,
+ {
+ color: theme.colors.colorTextMuted
+ }
+ ]}
+ >
+ {option.label}
+ </Text>
+ ) : null}
+ </View>
{selected && <CheckIcon size={18} color={theme.colors.colorTextPrimary} />}
</Pressable>
- {index < PICKABLE_LANGUAGES.length - 1 && (
+ {index < LOCALE_OPTIONS.length - 1 && (
<View
style={[styles.divider, { backgroundColor: theme.colors.colorBorderPrimary }]}
/>
@@ -66,6 +121,24 @@ export default function LanguageScreen() {
)
}
+function scheduleLanguageChange(resolvedLocale: SupportedLocaleCode) {
+ const changeLanguage = () => {
+ void changeI18nLanguage(resolvedLocale)
+ }
+
+ if (typeof requestIdleCallback === 'function') {
+ requestIdleCallback(changeLanguage)
+ return
+ }
+
+ requestAnimationFrame(changeLanguage)
+}
+
+function getOptionNativeNameFontFamily(option: LocaleOption) {
+ if (!option.resolvedCode) return undefined
+ return getNativeFontFamilyName(getLocaleFontFamily(option.resolvedCode))
+}
+
const styles = StyleSheet.create({
card: {
borderRadius: 16,
@@ -76,12 +149,23 @@ const styles = StyleSheet.create({
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
+ gap: 12,
paddingHorizontal: 16,
- paddingVertical: 15
+ paddingVertical: 13
+ },
+ rowText: {
+ flex: 1,
+ gap: 2
},
label: {
fontSize: 15,
- fontWeight: '500'
+ includeFontPadding: false,
+ lineHeight: 20
+ },
+ hint: {
+ fontSize: 12,
+ includeFontPadding: false,
+ lineHeight: 16
},
divider: {
height: StyleSheet.hairlineWidth,
diff --git a/apps/mobile/app/onboarding.tsx b/apps/mobile/app/onboarding.tsx
index adc97a9..c9ce726 100644
--- a/apps/mobile/app/onboarding.tsx
+++ b/apps/mobile/app/onboarding.tsx
@@ -1,6 +1,7 @@
import { useRef, useState } from 'react'
import { Button, ExternalLink, PaginationDots, useTheme } from '@altersend/components'
-import { onboardingSlides, type OnboardingSlide } from '@altersend/domain'
+import { onboardingSlides, type OnboardingSlide, type OnboardingSlideKind } from '@altersend/domain'
+import { useTranslation } from '@altersend/locales'
import { useRouter } from 'expo-router'
import {
FlatList,
@@ -9,7 +10,6 @@ import {
type NativeScrollEvent,
type NativeSyntheticEvent,
StyleSheet,
- Text,
View,
useWindowDimensions
} from 'react-native'
@@ -17,8 +17,21 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { OnboardingIllustration } from '@/src/onboarding/OnboardingIllustration'
import { markOnboardingCompleted } from '@/src/onboarding/onboardingStorage'
import brandLogo from '@/assets/images/brand-logo.png'
+import { Text } from '@/src/components/ThemedText'
+
+function getSlideKey(kind: OnboardingSlideKind) {
+ switch (kind) {
+ case 'pairing':
+ return 'direct'
+ case 'keep-open':
+ return 'keepOpen'
+ case 'privacy':
+ return 'encrypted'
+ }
+}
export default function OnboardingScreen() {
+ const { t } = useTranslation(['onboarding', 'common'])
const { theme } = useTheme()
const router = useRouter()
const insets = useSafeAreaInsets()
@@ -66,7 +79,7 @@ export default function OnboardingScreen() {
</View>
<View pointerEvents={isLast ? 'none' : 'auto'} style={{ opacity: isLast ? 0 : 1 }}>
<Button onClick={finish} size='sm' variant='ghost'>
- Skip
+ {t('common:actions.skip')}
</Button>
</View>
</View>
@@ -87,7 +100,7 @@ export default function OnboardingScreen() {
<View style={styles.footer}>
<PaginationDots count={onboardingSlides.length} activeIndex={index} />
<Button onClick={next} size='lg' variant='light' width='full'>
- {isLast ? 'Get started' : 'Continue'}
+ {isLast ? t('common:actions.getStarted') : t('common:actions.continue')}
</Button>
</View>
</View>
@@ -95,7 +108,9 @@ export default function OnboardingScreen() {
}
function Slide({ slide, width }: { slide: OnboardingSlide; width: number }) {
+ const { t } = useTranslation(['onboarding'])
const { theme } = useTheme()
+ const slideKey = getSlideKey(slide.kind)
return (
<View style={[styles.slide, { width }]}>
@@ -103,15 +118,17 @@ function Slide({ slide, width }: { slide: OnboardingSlide; width: number }) {
<SlideHero slide={slide} />
</View>
- <Text style={[styles.title, { color: theme.colors.colorTextPrimary }]}>{slide.title}</Text>
+ <Text style={[styles.title, { color: theme.colors.colorTextPrimary }]}>
+ {t(`onboarding:slides.${slideKey}.title`)}
+ </Text>
<Text style={[styles.subtitle, { color: theme.colors.colorTextSecondary }]}>
- {slide.subtitle}
+ {t(`onboarding:slides.${slideKey}.description`)}
</Text>
{slide.link ? (
<View style={styles.linkButton}>
<ExternalLink href={slide.link.url} onPress={() => void Linking.openURL(slide.link!.url)}>
- {slide.link.label}
+ {t('onboarding:slides.encrypted.link')}
</ExternalLink>
</View>
) : null}
diff --git a/apps/mobile/app/receive/complete.tsx b/apps/mobile/app/receive/complete.tsx
index fee2268..855a7ff 100644
--- a/apps/mobile/app/receive/complete.tsx
+++ b/apps/mobile/app/receive/complete.tsx
@@ -1,11 +1,13 @@
import { useEffect } from 'react'
import { Button } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import { useRouter } from 'expo-router'
import { clearSession } from '@altersend/domain'
import { mobileApi } from '@/src/api/mobileApi'
import { Layout } from '@/src/components'
import { ReceiveCompleteView } from '@/src/transfer/receive'
export default function ReceiveCompleteScreen() {
+ const { t } = useTranslation(['receive', 'common'])
const router = useRouter()
useEffect(() => {
@@ -21,11 +23,11 @@ export default function ReceiveCompleteScreen() {
return (
<Layout
- title='Downloads complete'
+ title={t('receive:page.completed.downloadsComplete')}
description=''
footer={
<Button onClick={handleDone} size='lg' variant='primary' width='full'>
- Done
+ {t('common:actions.done')}
</Button>
}
>
diff --git a/apps/mobile/app/receive/incoming.tsx b/apps/mobile/app/receive/incoming.tsx
index 48fcdb4..d8a895f 100644
--- a/apps/mobile/app/receive/incoming.tsx
+++ b/apps/mobile/app/receive/incoming.tsx
@@ -1,8 +1,9 @@
import { useCallback, useEffect, useMemo } from 'react'
-import { View, Text, StyleSheet, Pressable } from 'react-native'
+import { View, StyleSheet, Pressable } from 'react-native'
import { Paths } from 'expo-file-system'
import { Button, useTheme, withAlpha } from '@altersend/components'
import { ArrowLeftIcon, DownloadIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import { useNavigation, useRouter } from 'expo-router'
import { uriToPath } from '@/src/api/mobileApi'
import { Layout, IllustrationLayout } from '@/src/components'
@@ -11,14 +12,17 @@ import ConnectionLostSvg from '../../../../assets/connection-lost.svg'
import {
createDirectoryDownloadRequests,
formatFileSize,
+ getDisplayError,
getDownloadTotals,
getReceivePageCopy,
getReceiveStep,
useTransferStore
} from '@altersend/domain'
import { clearSession, downloadFiles } from '@altersend/domain'
+import { Text } from '@/src/components/ThemedText'
export default function ReceiveIncomingScreen() {
+ const { t } = useTranslation(['receive', 'common', 'errors'])
const { theme } = useTheme()
const navigation = useNavigation()
const router = useRouter()
@@ -27,7 +31,8 @@ export default function ReceiveIncomingScreen() {
const role = useTransferStore((s) => s.role)
const peerCount = useTransferStore((s) => s.peerCount)
const isReconnecting = useTransferStore((s) => s.isReconnecting)
- const errorMessage = useTransferStore((s) => s.errorMessage)
+ const errorCode = useTransferStore((s) => s.errorCode)
+ const displayError = getDisplayError(t, errorCode)
const totals = useMemo(
() => getDownloadTotals(incomingFileOffers, receiveDownloadStates),
@@ -63,7 +68,7 @@ export default function ReceiveIncomingScreen() {
headerLeft: () => (
<Pressable
accessibilityRole='button'
- accessibilityLabel='Back'
+ accessibilityLabel={t('common:actions.back')}
onPress={handleEndSession}
hitSlop={12}
style={({ pressed }) => ({
@@ -76,10 +81,10 @@ export default function ReceiveIncomingScreen() {
</Pressable>
)
})
- }, [navigation, handleEndSession, theme.colors.colorTextPrimary])
+ }, [navigation, handleEndSession, t, theme.colors.colorTextPrimary])
const totalBytes = incomingFileOffers.reduce((sum, f) => sum + f.size, 0)
- const { title, description } = getReceivePageCopy(step, incomingFileOffers.length, totalBytes)
+ const { title, description } = getReceivePageCopy(t, step, incomingFileOffers.length, totalBytes)
const handleDownloadAll = async () => {
if (incomingFileOffers.length === 0 || isDownloading) return
@@ -96,7 +101,7 @@ export default function ReceiveIncomingScreen() {
const endSessionButton = (
<Button onClick={handleEndSession} size='lg' variant='secondary' width='full'>
- End session
+ {t('common:actions.endSession')}
</Button>
)
@@ -118,14 +123,14 @@ export default function ReceiveIncomingScreen() {
if (step !== 'incoming_transfer') {
return (
<IllustrationLayout
- title='Session ended'
- description='Return to start a new transfer.'
+ title={t('receive:page.sessionEnded.title')}
+ description={t('receive:page.sessionEnded.description')}
hasNativeHeader
illustration={<ConnectionLostSvg width='100%' height='100%' />}
aspectRatio={800 / 430}
footer={
<Button onClick={handleEndSession} size='lg' variant='primary' width='full'>
- Back to home
+ {t('receive:actions.backToHome')}
</Button>
}
/>
@@ -143,7 +148,9 @@ export default function ReceiveIncomingScreen() {
]}
>
<View style={[styles.badgeDot, { backgroundColor: theme.colors.colorSuccess }]} />
- <Text style={[styles.badgeText, { color: theme.colors.colorSuccess }]}>Connected</Text>
+ <Text style={[styles.badgeText, { color: theme.colors.colorSuccess }]}>
+ {t('common:status.connected')}
+ </Text>
</View>
)
@@ -163,13 +170,19 @@ export default function ReceiveIncomingScreen() {
variant='light'
width='full'
>
- {isDownloading ? `Downloading ${totals.percent}%` : `Download all${sizeLabel}`}
+ {isDownloading
+ ? t('receive:actions.downloadingPercent', { percent: totals.percent })
+ : sizeLabel
+ ? t('receive:actions.downloadAllWithSize', { size: formatFileSize(totalBytes) })
+ : t('receive:actions.downloadAll')}
</Button>
{endSessionButton}
</View>
}
>
- {errorMessage ? <ErrorPanel message={errorMessage} /> : null}
+ {displayError ? (
+ <ErrorPanel title={t('receive:errors.transferIssue')} message={displayError} />
+ ) : null}
<ReceiveIncomingView />
</Layout>
)
diff --git a/apps/mobile/app/receive/scan.tsx b/apps/mobile/app/receive/scan.tsx
index b66581b..f3c30e4 100644
--- a/apps/mobile/app/receive/scan.tsx
+++ b/apps/mobile/app/receive/scan.tsx
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
-import { ActivityIndicator, Linking, Pressable, StyleSheet, Text, View } from 'react-native'
+import { ActivityIndicator, Linking, Pressable, StyleSheet, View } from 'react-native'
import {
CameraView,
scanFromURLAsync,
@@ -9,13 +9,16 @@ import {
import * as ImagePicker from 'expo-image-picker'
import { Button, useTheme, withAlpha } from '@altersend/components'
import { ArrowLeftIcon, QrCodeIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import { useNavigation, useRouter } from 'expo-router'
import { extractJoinCode, useTransferStore } from '@altersend/domain'
import { joinSession } from '@altersend/domain'
import { Layout } from '@/src/components'
import { useToast } from '@/src/components/Toast'
+import { Text } from '@/src/components/ThemedText'
export default function ReceiveScanScreen() {
+ const { t } = useTranslation(['receive', 'common'])
const { theme } = useTheme()
const navigation = useNavigation()
const router = useRouter()
@@ -45,7 +48,7 @@ export default function ReceiveScanScreen() {
headerBackVisible: false,
headerLeft: () => (
<Pressable
- accessibilityLabel='Back'
+ accessibilityLabel={t('common:actions.back')}
accessibilityRole='button'
hitSlop={12}
onPress={goBack}
@@ -59,7 +62,7 @@ export default function ReceiveScanScreen() {
</Pressable>
)
})
- }, [goBack, navigation, theme.colors.colorTextPrimary])
+ }, [goBack, navigation, t, theme.colors.colorTextPrimary])
useEffect(() => {
if (!permission) {
@@ -84,7 +87,7 @@ export default function ReceiveScanScreen() {
if (now - invalidScanAtRef.current > 1500) {
invalidScanAtRef.current = now
toast.show({
- title: 'Unsupported QR code',
+ title: t('receive:errors.unsupportedQrTitle'),
hint: invalidHint,
durationMs: 2500
})
@@ -102,21 +105,21 @@ export default function ReceiveScanScreen() {
scanLockRef.current = false
setIsResolving(false)
toast.show({
- title: 'Couldn’t join session',
- hint: 'Try again or paste the code manually.',
+ title: t('receive:errors.mobileJoinFailedTitle'),
+ hint: t('receive:errors.mobileJoinFailedHint'),
durationMs: 3500
})
}
},
- [goBack, role, toast]
+ [goBack, role, t, toast]
)
const handleBarcodeScanned = useCallback(
({ data }: BarcodeScanningResult) => {
if (!canScan) return
- void resolveCode(data, 'Scan an AlterSend connection code.')
+ void resolveCode(data, t('receive:errors.unsupportedQrHint'))
},
- [canScan, resolveCode]
+ [canScan, resolveCode, t]
)
const importFromImage = useCallback(async () => {
@@ -135,40 +138,39 @@ export default function ReceiveScanScreen() {
const [scan] = await scanFromURLAsync(asset.uri, ['qr'])
if (!scan) {
toast.show({
- title: 'No QR code found',
- hint: 'Pick an image that shows an AlterSend QR code.',
+ title: t('receive:errors.imageNoQrTitle'),
+ hint: t('receive:errors.imageNoQrHint'),
durationMs: 2500
})
return
}
- await resolveCode(scan.data, 'That image isn’t an AlterSend connection code.')
+ await resolveCode(scan.data, t('receive:errors.imageUnsupportedQrHint'))
} catch (error) {
console.warn('ReceiveScanScreen: importFromImage failed', error)
- toast.show({ title: 'Couldn’t read that image', durationMs: 2500 })
+ toast.show({ title: t('receive:errors.imageReadFailedTitle'), durationMs: 2500 })
}
- }, [resolveCode, role, toast])
+ }, [resolveCode, role, t, toast])
const permissionCopy = useMemo(() => {
if (!permission) {
return {
- title: 'Preparing camera',
- description: 'Checking camera access so you can scan the sender’s QR code.'
+ title: t('receive:camera.preparingTitle'),
+ description: t('receive:camera.preparingDescription')
}
}
if (!cameraGranted) {
return {
- title: 'Camera access needed',
- description: 'Allow camera access to scan a sender’s connection QR code.'
+ title: t('receive:camera.accessNeededTitle'),
+ description: t('receive:camera.accessNeededDescription')
}
}
return {
- title: 'Scan or import QR',
- description:
- 'Center the sender’s QR in the frame, or import a saved image. AlterSend connects automatically.'
+ title: t('receive:camera.scanImportTitle'),
+ description: t('receive:camera.scanImportDescription')
}
- }, [cameraGranted, permission])
+ }, [cameraGranted, permission, t])
const handlePermissionAction = useCallback(async () => {
if (canAskAgain) {
@@ -179,7 +181,9 @@ export default function ReceiveScanScreen() {
await Linking.openSettings()
}, [canAskAgain, requestPermission])
- const permissionButtonLabel = canAskAgain ? 'Allow camera' : 'Open settings'
+ const permissionButtonLabel = canAskAgain
+ ? t('receive:actions.allowCamera')
+ : t('common:actions.openSettings')
return (
<Layout title={permissionCopy.title} description={permissionCopy.description} hasNativeHeader>
@@ -199,11 +203,10 @@ export default function ReceiveScanScreen() {
<QrCodeIcon size={24} color={theme.colors.colorInfo} />
</View>
<Text style={[styles.noticeTitle, { color: theme.colors.colorTextPrimary }]}>
- Enable camera access
+ {t('receive:camera.enableTitle')}
</Text>
<Text style={[styles.noticeText, { color: theme.colors.colorTextSecondary }]}>
- The camera is only needed to scan a QR. You can also import a saved image or paste the
- code manually.
+ {t('receive:camera.enableImportDescription')}
</Text>
<Button
onClick={() => void handlePermissionAction()}
@@ -214,10 +217,10 @@ export default function ReceiveScanScreen() {
{permissionButtonLabel}
</Button>
<Button onClick={() => void importFromImage()} size='lg' variant='secondary' width='full'>
- Import from image
+ {t('receive:actions.importFromImage')}
</Button>
<Button onClick={goBack} size='lg' variant='secondary' width='full'>
- Use pasted code instead
+ {t('receive:camera.usePastedCode')}
</Button>
</View>
) : (
@@ -312,7 +315,7 @@ export default function ReceiveScanScreen() {
>
<ActivityIndicator color={theme.colors.colorTextPrimary} />
<Text style={[styles.statusTitle, { color: theme.colors.colorTextPrimary }]}>
- Connecting…
+ {t('common:actions.connecting')}
</Text>
<Text
style={[
@@ -320,7 +323,7 @@ export default function ReceiveScanScreen() {
{ color: withAlpha(theme.colors.colorTextPrimary, 0.82) }
]}
>
- Joining the sender’s session.
+ {t('receive:camera.joiningDescription')}
</Text>
</View>
</View>
@@ -334,7 +337,7 @@ export default function ReceiveScanScreen() {
variant='secondary'
width='full'
>
- Import from image
+ {t('receive:actions.importFromImage')}
</Button>
</View>
)}
diff --git a/apps/mobile/app/report.tsx b/apps/mobile/app/report.tsx
index c130262..ba81b0c 100644
--- a/apps/mobile/app/report.tsx
+++ b/apps/mobile/app/report.tsx
@@ -1,20 +1,22 @@
-import { StyleSheet, Text, TextInput, View } from 'react-native'
+import { StyleSheet, View } from 'react-native'
import Constants from 'expo-constants'
import { useState } from 'react'
import { Button, FeedbackTypeSelector, useTheme } from '@altersend/components'
import { SendIcon } from '@altersend/components/icons'
import type { FeedbackType } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import { Layout } from '@/src/components'
+import { Text, TextInput } from '@/src/components/ThemedText'
type State = 'idle' | 'sending' | 'sent' | 'error'
+const DISCORD_EMBED_COLOR = 0x5865f2
-const PLACEHOLDERS: Record<FeedbackType, string> = {
- 'Bug report': 'Describe what happened and how to reproduce it…',
- 'Feature request': 'What would you like to see in AlterSend?',
- General: 'Share your thoughts…'
-}
-
-async function postToDiscord(type: FeedbackType, message: string, version: string): Promise<void> {
+async function postToDiscord(
+ title: string,
+ message: string,
+ version: string,
+ labels: { version: string; platform: string; mobile: string }
+): Promise<void> {
const url = process.env.EXPO_PUBLIC_DISCORD_WEBHOOK_URL
if (!url || url.includes('PLACEHOLDER')) throw new Error('Webhook not configured')
await fetch(url, {
@@ -23,12 +25,12 @@ async function postToDiscord(type: FeedbackType, message: string, version: strin
body: JSON.stringify({
embeds: [
{
- title: type,
+ title,
description: message,
- color: 0x5865f2,
+ color: DISCORD_EMBED_COLOR,
fields: [
- { name: 'Version', value: `v${version}`, inline: true },
- { name: 'Platform', value: 'Mobile', inline: true }
+ { name: labels.version, value: `v${version}`, inline: true },
+ { name: labels.platform, value: labels.mobile, inline: true }
],
timestamp: new Date().toISOString()
}
@@ -38,8 +40,9 @@ async function postToDiscord(type: FeedbackType, message: string, version: strin
}
export default function ReportScreen() {
+ const { t } = useTranslation(['feedback', 'common'])
const { theme } = useTheme()
- const [type, setType] = useState<FeedbackType>('Bug report')
+ const [type, setType] = useState<FeedbackType>('bug')
const [message, setMessage] = useState('')
const [state, setState] = useState<State>('idle')
const version = Constants.expoConfig?.version ?? '0.0.0'
@@ -47,7 +50,11 @@ export default function ReportScreen() {
const send = async () => {
setState('sending')
try {
- await postToDiscord(type, message.trim(), version)
+ await postToDiscord(t(`feedback:types.${type}`), message.trim(), version, {
+ version: t('common:labels.version'),
+ platform: t('common:labels.platform'),
+ mobile: t('common:labels.mobile')
+ })
setState('sent')
} catch {
setState('error')
@@ -58,11 +65,13 @@ export default function ReportScreen() {
if (state === 'sent') {
return (
- <Layout title='Feedback' description='' hasNativeHeader>
+ <Layout title={t('feedback:title')} description='' hasNativeHeader>
<View style={styles.centred}>
- <Text style={[styles.sentTitle, { color: theme.colors.colorTextPrimary }]}>Thanks!</Text>
+ <Text style={[styles.sentTitle, { color: theme.colors.colorTextPrimary }]}>
+ {t('feedback:states.sent')}
+ </Text>
<Text style={[styles.sentHint, { color: theme.colors.colorTextMuted }]}>
- Your feedback has been received.
+ {t('feedback:states.received')}
</Text>
</View>
</Layout>
@@ -70,9 +79,18 @@ export default function ReportScreen() {
}
return (
- <Layout title='Feedback' description='' hasNativeHeader>
+ <Layout title={t('feedback:title')} description='' hasNativeHeader>
<View style={styles.content}>
- <FeedbackTypeSelector value={type} onChange={setType} disabled={state === 'sending'} />
+ <FeedbackTypeSelector
+ value={type}
+ onChange={setType}
+ labels={{
+ bug: t('feedback:types.bug'),
+ feature: t('feedback:types.feature'),
+ general: t('feedback:types.general')
+ }}
+ disabled={state === 'sending'}
+ />
<TextInput
style={[
@@ -84,7 +102,13 @@ export default function ReportScreen() {
state === 'error' ? theme.colors.colorDanger : theme.colors.colorBorderPrimary
}
]}
- placeholder={PLACEHOLDERS[type]}
+ placeholder={
+ type === 'bug'
+ ? t('feedback:placeholders.bug')
+ : type === 'feature'
+ ? t('feedback:placeholders.feature')
+ : t('feedback:placeholders.general')
+ }
placeholderTextColor={theme.colors.colorTextMuted}
multiline
textAlignVertical='top'
@@ -98,7 +122,7 @@ export default function ReportScreen() {
{state === 'error' && (
<Text style={[styles.error, { color: theme.colors.colorDanger }]}>
- Failed to send. Check your connection and try again.
+ {t('feedback:states.failed')}
</Text>
)}
@@ -115,7 +139,7 @@ export default function ReportScreen() {
/>
}
>
- {state === 'sending' ? 'Sending…' : 'Send feedback'}
+ {state === 'sending' ? t('feedback:actions.sending') : t('feedback:actions.send')}
</Button>
</View>
</Layout>
diff --git a/apps/mobile/app/send/preparing.tsx b/apps/mobile/app/send/preparing.tsx
index bbfbcf4..fa19dab 100644
--- a/apps/mobile/app/send/preparing.tsx
+++ b/apps/mobile/app/send/preparing.tsx
@@ -10,12 +10,12 @@ import { PreparingView } from '@/src/transfer/send'
import { useNavigation, useRouter } from 'expo-router'
export default function SendPreparingScreen() {
- const { t } = useTranslation('send')
+ const { t } = useTranslation(['send', 'common'])
const { theme } = useTheme()
const draftPhase = useTransferStore((s) => s.draftPhase)
const connectionState = useTransferStore((s) => s.connectionState)
const step = getSendStep({ draftPhase, isPeerConnected: connectionState === 'peer-connected' })
- const copy = getSendPageCopy(step, t)
+ const copy = getSendPageCopy(t, step)
const navigation = useNavigation()
const router = useRouter()
@@ -33,7 +33,7 @@ export default function SendPreparingScreen() {
headerLeft: () => (
<Pressable
accessibilityRole='button'
- accessibilityLabel='Back'
+ accessibilityLabel={t('common:actions.back')}
onPress={handleBack}
hitSlop={12}
style={({ pressed }) => ({
@@ -46,7 +46,7 @@ export default function SendPreparingScreen() {
</Pressable>
)
})
- }, [navigation, handleBack, theme.colors.colorTextPrimary])
+ }, [navigation, handleBack, t, theme.colors.colorTextPrimary])
return (
<Layout title={copy.title} description={copy.description} hasNativeHeader>
diff --git a/apps/mobile/app/send/share.tsx b/apps/mobile/app/send/share.tsx
index e9f9840..cfa3b29 100644
--- a/apps/mobile/app/send/share.tsx
+++ b/apps/mobile/app/send/share.tsx
@@ -10,12 +10,12 @@ import { ShareView } from '@/src/transfer/send'
import { useNavigation } from 'expo-router'
export default function SendShareScreen() {
- const { t } = useTranslation('send')
+ const { t } = useTranslation(['send', 'common'])
const { theme } = useTheme()
const draftPhase = useTransferStore((s) => s.draftPhase)
const connectionState = useTransferStore((s) => s.connectionState)
const step = getSendStep({ draftPhase, isPeerConnected: connectionState === 'peer-connected' })
- const copy = getSendPageCopy(step, t)
+ const copy = getSendPageCopy(t, step)
const navigation = useNavigation()
const handleBack = useCallback(() => {
@@ -28,7 +28,7 @@ export default function SendShareScreen() {
headerLeft: () => (
<Pressable
accessibilityRole='button'
- accessibilityLabel='Back'
+ accessibilityLabel={t('common:actions.back')}
onPress={handleBack}
hitSlop={12}
style={({ pressed }) => ({
@@ -41,7 +41,7 @@ export default function SendShareScreen() {
</Pressable>
)
})
- }, [navigation, handleBack, theme.colors.colorTextPrimary])
+ }, [navigation, handleBack, t, theme.colors.colorTextPrimary])
return (
<Layout
@@ -51,7 +51,7 @@ export default function SendShareScreen() {
footer={
<View style={{ marginBottom: Platform.OS === 'android' ? 20 : 0 }}>
<Button onClick={clearSenderFlow} size='lg' variant='secondary' width='full'>
- End session
+ {t('common:actions.endSession')}
</Button>
</View>
}
diff --git a/apps/mobile/app/settings.tsx b/apps/mobile/app/settings.tsx
index d4311fa..49a19ff 100644
--- a/apps/mobile/app/settings.tsx
+++ b/apps/mobile/app/settings.tsx
@@ -1,7 +1,13 @@
-import { Image, Linking, Pressable, StyleSheet, Text, View } from 'react-native'
+import { Image, Linking, Pressable, StyleSheet, View } from 'react-native'
import Constants from 'expo-constants'
-import { useState } from 'react'
-import { useRouter } from 'expo-router'
+import { useCallback, useEffect, useState } from 'react'
+import { useFocusEffect, useRouter } from 'expo-router'
+import {
+ LOCALE_OPTIONS,
+ isMultiLangEnabled,
+ useTranslation,
+ type LocalePreference
+} from '@altersend/locales'
import {
discordUrl,
privacyPolicyUrl,
@@ -9,7 +15,6 @@ import {
termsOfServiceUrl,
websiteUrl
} from '@altersend/domain'
-import { MULTI_LANG_ENABLED, getLanguage, useTranslation } from '@altersend/locales'
import { ToggleSwitch, useTheme } from '@altersend/components'
import {
AlertCircleIcon,
@@ -22,11 +27,17 @@ import {
} from '@altersend/components/icons'
import { Layout } from '@/src/components'
import brandLogo from '@/assets/images/brand-logo.png'
+import {
+ getLocalePreferenceSnapshot,
+ getSavedLocalePreference,
+ subscribeLocalePreference
+} from '@/src/lifecycle/localePreferenceStorage'
import {
isCrashReportingEnabled,
setCrashReportingEnabled
} from '@/src/lifecycle/crashReportingStorage'
import { closeSentry, initSentry } from '@/src/sentry'
+import { Text } from '@/src/components/ThemedText'
interface LinkRowProps {
label: string
@@ -68,12 +79,34 @@ function LinkRow({ label, hint, icon, onPress, isLast }: LinkRowProps) {
}
export default function SettingsScreen() {
+ const { t } = useTranslation(['settings', 'common'])
const { theme } = useTheme()
const router = useRouter()
const version = Constants.expoConfig?.version ?? '0.0.0'
const [crashReporting, setCrashReporting] = useState(isCrashReportingEnabled)
- const { i18n } = useTranslation()
- const locale = i18n.language
+ const [localePreference, setLocalePreference] = useState<LocalePreference>(
+ getLocalePreferenceSnapshot
+ )
+
+ useEffect(() => subscribeLocalePreference(setLocalePreference), [])
+
+ useFocusEffect(
+ useCallback(() => {
+ let active = true
+
+ void getSavedLocalePreference()
+ .then((preference) => {
+ if (active) setLocalePreference(preference)
+ })
+ .catch((error) => {
+ console.warn('Failed to load locale preference:', error)
+ })
+
+ return () => {
+ active = false
+ }
+ }, [])
+ )
const handleCrashReportingToggle = (value: boolean) => {
setCrashReporting(value)
@@ -92,14 +125,17 @@ export default function SettingsScreen() {
}
return (
- <Layout title='Settings' description='' hasNativeHeader>
+ <Layout title={t('settings:title')} description='' hasNativeHeader>
<View style={styles.content}>
- {MULTI_LANG_ENABLED && (
+ {isMultiLangEnabled && (
<View style={styles.section}>
<View style={[styles.card, cardStyle]}>
<LinkRow
- label='Language'
- hint={getLanguage(locale)?.label ?? locale}
+ label={t('common:labels.language')}
+ hint={
+ LOCALE_OPTIONS.find((option) => option.preference === localePreference)
+ ?.nativeName ?? t('common:labels.systemDefault')
+ }
icon={<GlobeIcon size={16} color={theme.colors.colorTextSecondary} />}
onPress={() => router.push('/language')}
isLast
@@ -109,34 +145,38 @@ export default function SettingsScreen() {
)}
<View style={styles.section}>
- <Text style={[styles.sectionTitle, { color: theme.colors.colorTextMuted }]}>Privacy</Text>
+ <Text style={[styles.sectionTitle, { color: theme.colors.colorTextMuted }]}>
+ {t('settings:sections.privacy')}
+ </Text>
<View style={[styles.card, styles.toggleCardPad, cardStyle]}>
<ToggleSwitch
checked={crashReporting}
onChange={handleCrashReportingToggle}
- label='Crash reports'
- description='Share anonymous crash data to help improve AlterSend'
+ label={t('settings:crashReports.label')}
+ description={t('settings:crashReports.description')}
/>
</View>
</View>
<View style={styles.section}>
- <Text style={[styles.sectionTitle, { color: theme.colors.colorTextMuted }]}>Support</Text>
+ <Text style={[styles.sectionTitle, { color: theme.colors.colorTextMuted }]}>
+ {t('settings:sections.support')}
+ </Text>
<View style={[styles.card, cardStyle]}>
<LinkRow
- label='Feedback'
- hint='Report a problem or suggest a feature'
+ label={t('settings:rows.feedback')}
+ hint={t('settings:rows.feedbackHint')}
icon={<AlertCircleIcon size={16} color={theme.colors.colorTextSecondary} />}
onPress={() => router.push('/report')}
/>
<LinkRow
- label='Discord'
- hint='Join the community'
+ label={t('settings:rows.discord')}
+ hint={t('settings:rows.discordHint')}
icon={<DiscordIcon size={16} color={theme.colors.colorTextSecondary} />}
onPress={() => openUrl(discordUrl)}
/>
<LinkRow
- label='Contact us'
+ label={t('settings:rows.contact')}
hint={supportEmail}
icon={<MailIcon size={16} color={theme.colors.colorTextSecondary} />}
onPress={() => openUrl(`mailto:${supportEmail}`)}
@@ -146,22 +186,24 @@ export default function SettingsScreen() {
</View>
<View style={styles.section}>
- <Text style={[styles.sectionTitle, { color: theme.colors.colorTextMuted }]}>About</Text>
+ <Text style={[styles.sectionTitle, { color: theme.colors.colorTextMuted }]}>
+ {t('settings:sections.about')}
+ </Text>
<View style={[styles.card, cardStyle]}>
<LinkRow
- label='Privacy policy'
- hint='How AlterSend handles your data'
+ label={t('settings:rows.privacyPolicy')}
+ hint={t('settings:rows.privacyPolicyHint')}
icon={<LockIcon size={16} color={theme.colors.colorTextSecondary} />}
onPress={() => openUrl(privacyPolicyUrl)}
/>
<LinkRow
- label='Terms of service'
- hint='Rules for using AlterSend'
+ label={t('settings:rows.terms')}
+ hint={t('settings:rows.termsHint')}
icon={<FileTextIcon size={16} color={theme.colors.colorTextSecondary} />}
onPress={() => openUrl(termsOfServiceUrl)}
/>
<LinkRow
- label='Website'
+ label={t('settings:rows.website')}
hint={websiteUrl.replace(/^https?:\/\//, '')}
icon={<GlobeIcon size={16} color={theme.colors.colorTextSecondary} />}
onPress={() => openUrl(websiteUrl)}
@@ -177,7 +219,7 @@ export default function SettingsScreen() {
AlterSend
</Text>
<Text style={[styles.brandTagline, { color: theme.colors.colorTextMuted }]}>
- Peer-to-peer file transfer
+ {t('common:app.tagline')}
</Text>
</View>
<View style={[styles.versionChip, { backgroundColor: theme.colors.colorSurfacePrimary }]}>
@@ -230,14 +272,16 @@ const styles = StyleSheet.create({
},
rowText: {
flex: 1,
- gap: 2
+ gap: 0
},
rowLabel: {
fontSize: 14,
- fontWeight: '500'
+ fontWeight: '500',
+ lineHeight: 18
},
rowHint: {
- fontSize: 12
+ fontSize: 12,
+ lineHeight: 16
},
divider: {
height: StyleSheet.hairlineWidth,
@@ -262,10 +306,12 @@ const styles = StyleSheet.create({
},
brandName: {
fontSize: 13,
- fontWeight: '600'
+ fontWeight: '600',
+ lineHeight: 18
},
brandTagline: {
- fontSize: 12
+ fontSize: 12,
+ lineHeight: 16
},
versionChip: {
paddingHorizontal: 8,
diff --git a/apps/mobile/locales/de-DE.json b/apps/mobile/locales/de-DE.json
new file mode 100644
index 0000000..9088ca0
--- /dev/null
+++ b/apps/mobile/locales/de-DE.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend verwendet Ihre Kamera, um QR-Verbindungscodes zu scannen.",
+ "NSLocalNetworkUsageDescription": "AlterSend nutzt Ihr lokales Netzwerk, um Geräte in der Nähe zu finden und Dateien direkt zu übertragen.",
+ "NSPhotoLibraryUsageDescription": "AlterSend liest Ihre Fotobibliothek, sodass Sie Fotos und Videos auswählen und an ein anderes Gerät senden können.",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend speichert empfangene Bilder und Videos in Ihrer Fotobibliothek."
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/en-GB.json b/apps/mobile/locales/en-GB.json
new file mode 100644
index 0000000..0682c26
--- /dev/null
+++ b/apps/mobile/locales/en-GB.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend uses your camera to scan connection QR codes.",
+ "NSLocalNetworkUsageDescription": "AlterSend uses your local network to discover nearby devices for peer-to-peer file transfer.",
+ "NSPhotoLibraryUsageDescription": "AlterSend reads your photo library so you can pick photos and videos to send to another device.",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend saves received images and videos to your photo library."
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/en-US.json b/apps/mobile/locales/en-US.json
new file mode 100644
index 0000000..0682c26
--- /dev/null
+++ b/apps/mobile/locales/en-US.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend uses your camera to scan connection QR codes.",
+ "NSLocalNetworkUsageDescription": "AlterSend uses your local network to discover nearby devices for peer-to-peer file transfer.",
+ "NSPhotoLibraryUsageDescription": "AlterSend reads your photo library so you can pick photos and videos to send to another device.",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend saves received images and videos to your photo library."
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/es-419.json b/apps/mobile/locales/es-419.json
new file mode 100644
index 0000000..581107a
--- /dev/null
+++ b/apps/mobile/locales/es-419.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend usa tu cámara para escanear códigos de conexión QR.",
+ "NSLocalNetworkUsageDescription": "AlterSend usa la red local para encontrar dispositivos cercanos y transferir archivos directamente.",
+ "NSPhotoLibraryUsageDescription": "AlterSend lee tu biblioteca de fotos para que puedas elegir fotos y videos para enviarlos a otro dispositivo.",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend guarda las imágenes y los videos recibidos en su biblioteca de fotos."
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/es-ES.json b/apps/mobile/locales/es-ES.json
new file mode 100644
index 0000000..581107a
--- /dev/null
+++ b/apps/mobile/locales/es-ES.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend usa tu cámara para escanear códigos de conexión QR.",
+ "NSLocalNetworkUsageDescription": "AlterSend usa la red local para encontrar dispositivos cercanos y transferir archivos directamente.",
+ "NSPhotoLibraryUsageDescription": "AlterSend lee tu biblioteca de fotos para que puedas elegir fotos y videos para enviarlos a otro dispositivo.",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend guarda las imágenes y los videos recibidos en su biblioteca de fotos."
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/fr-FR.json b/apps/mobile/locales/fr-FR.json
new file mode 100644
index 0000000..c23609f
--- /dev/null
+++ b/apps/mobile/locales/fr-FR.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend utilise votre caméra pour scanner les codes de connexion QR.",
+ "NSLocalNetworkUsageDescription": "AlterSend utilise votre réseau local pour trouver les appareils à proximité et transférer des fichiers directement.",
+ "NSPhotoLibraryUsageDescription": "AlterSend lit votre photothèque afin que vous puissiez sélectionner des photos et des vidéos à envoyer vers un autre appareil.",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend enregistre les images et vidéos reçues dans votre photothèque."
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/it-IT.json b/apps/mobile/locales/it-IT.json
new file mode 100644
index 0000000..131d8c3
--- /dev/null
+++ b/apps/mobile/locales/it-IT.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend utilizza la fotocamera per scansionare i codici di connessione QR.",
+ "NSLocalNetworkUsageDescription": "AlterSend utilizza la tua rete locale per trovare dispositivi nelle vicinanze e trasferire file direttamente.",
+ "NSPhotoLibraryUsageDescription": "AlterSend legge la tua libreria fotografica così puoi scegliere foto e video da inviare a un altro dispositivo.",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend salva le immagini e i video ricevuti nella tua libreria di foto."
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/ja-JP.json b/apps/mobile/locales/ja-JP.json
new file mode 100644
index 0000000..36a2487
--- /dev/null
+++ b/apps/mobile/locales/ja-JP.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend は接続QRコードをスキャンするためにカメラを使用します。",
+ "NSLocalNetworkUsageDescription": "AlterSend は近くの端末を検出し、ファイルを直接転送するためにローカルネットワークを使用します。",
+ "NSPhotoLibraryUsageDescription": "AlterSend は別の端末へ送信する写真や動画を選ぶためフォトライブラリを読み取ります。",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend は受信した画像や動画をフォトライブラリに保存します。"
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/ko-KR.json b/apps/mobile/locales/ko-KR.json
new file mode 100644
index 0000000..e5f0548
--- /dev/null
+++ b/apps/mobile/locales/ko-KR.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend가 카메라를 사용하여 연결 QR 코드를 스캔합니다.",
+ "NSLocalNetworkUsageDescription": "AlterSend가 로컬 네트워크를 사용하여 주변 기기를 찾고 파일을 직접 전송합니다.",
+ "NSPhotoLibraryUsageDescription": "AlterSend가 사진 보관함에 접근하여 다른 기기로 보낼 사진과 동영상을 선택할 수 있습니다.",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend가 받은 이미지와 동영상을 사진 보관함에 저장합니다."
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/pt-BR.json b/apps/mobile/locales/pt-BR.json
new file mode 100644
index 0000000..f581384
--- /dev/null
+++ b/apps/mobile/locales/pt-BR.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "O AlterSend usa sua câmera para escanear códigos QR de conexão.",
+ "NSLocalNetworkUsageDescription": "O AlterSend usa a rede local para encontrar dispositivos próximos e transferir arquivos diretamente.",
+ "NSPhotoLibraryUsageDescription": "O AlterSend acessa sua biblioteca de fotos para que você possa escolher fotos e vídeos para enviar para outro dispositivo.",
+ "NSPhotoLibraryAddUsageDescription": "O AlterSend salva as imagens e vídeos recebidos na sua biblioteca de fotos."
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/zh-CN.json b/apps/mobile/locales/zh-CN.json
new file mode 100644
index 0000000..b565726
--- /dev/null
+++ b/apps/mobile/locales/zh-CN.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend 使用相机扫描连接 QR 码。",
+ "NSLocalNetworkUsageDescription": "AlterSend 使用本地网络寻找附近设备并直接传输文件。",
+ "NSPhotoLibraryUsageDescription": "AlterSend 会读取您的照片库,以便您可以选择照片和视频发送到其他设备。",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend 将收到的图片和视频保存到您的照片库。"
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/locales/zh-TW.json b/apps/mobile/locales/zh-TW.json
new file mode 100644
index 0000000..9d9cab4
--- /dev/null
+++ b/apps/mobile/locales/zh-TW.json
@@ -0,0 +1,12 @@
+{
+ "ios": {
+ "CFBundleDisplayName": "AlterSend",
+ "NSCameraUsageDescription": "AlterSend 使用相機掃描連線 QR 碼。",
+ "NSLocalNetworkUsageDescription": "AlterSend 使用本機網路尋找附近裝置並直接傳輸檔案。",
+ "NSPhotoLibraryUsageDescription": "AlterSend 會讀取您的照片圖庫,以便您選擇要傳送到其他裝置的照片和影片。",
+ "NSPhotoLibraryAddUsageDescription": "AlterSend 將收到的圖片和影片儲存到您的照片圖庫。"
+ },
+ "android": {
+ "app_name": "AlterSend"
+ }
+}
diff --git a/apps/mobile/metro.config.js b/apps/mobile/metro.config.js
index 119adf4..4802b5a 100644
--- a/apps/mobile/metro.config.js
+++ b/apps/mobile/metro.config.js
@@ -5,6 +5,24 @@ const projectRoot = __dirname
const monorepoRoot = path.resolve(projectRoot, '../..')
const config = getDefaultConfig(projectRoot)
+const workspaceSourceAliases = new Map([
+ ['@altersend/core', path.resolve(monorepoRoot, 'packages/core/src/index.ts')],
+ ['@altersend/domain', path.resolve(monorepoRoot, 'packages/domain/src/index.ts')],
+ ['@altersend/components', path.resolve(monorepoRoot, 'packages/components/src/index.ts')],
+ [
+ '@altersend/components/icons',
+ path.resolve(monorepoRoot, 'packages/components/src/icons/index.ts')
+ ],
+ [
+ '@altersend/components/theme',
+ path.resolve(monorepoRoot, 'packages/components/src/theme/index.ts')
+ ],
+ [
+ '@altersend/components/theme/raw',
+ path.resolve(monorepoRoot, 'packages/components/src/theme/tokens.raw.ts')
+ ],
+ ['@altersend/locales', path.resolve(monorepoRoot, 'packages/locales/src/index.ts')]
+])
config.watchFolders = [monorepoRoot]
config.resolver.nodeModulesPaths = [
@@ -20,7 +38,14 @@ config.transformer = {
config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter((ext) => ext !== 'svg'),
- sourceExts: [...resolver.sourceExts, 'svg']
+ sourceExts: [...resolver.sourceExts, 'svg'],
+ resolveRequest(context, moduleName, platform) {
+ return context.resolveRequest(
+ context,
+ workspaceSourceAliases.get(moduleName) ?? moduleName,
+ platform
+ )
+ }
}
module.exports = config
diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index c7824f2..e699075 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -5,16 +5,17 @@
"description": "AlterSend mobile app (React Native / Expo)",
"main": "expo-router/entry",
"scripts": {
- "prestart": "npm run bundle-bare",
+ "build:packages": "cd ../.. && npm run build -w packages/core && npm run build -w packages/locales && npm run build -w packages/domain && npm run build -w packages/components",
+ "prestart": "npm run build:packages && npm run bundle-bare",
"start": "expo start --dev-client",
"postinstall": "npm run barekit:link-ios-addons && npm run barekit:link-android-addons",
"eas-build-post-install": "cd ../.. && npm run build -w packages/core && npm run build -w packages/locales && npm run build -w packages/domain && npm run build -w packages/components && npm run bundle-bare -w apps/mobile",
"barekit:link-ios-addons": "node ./scripts/link-ios-addons.cjs",
"barekit:link-android-addons": "node ./scripts/link-android-addons.cjs",
"pods:install": "cd ios && LANG=en_US.UTF-8 pod install",
- "preandroid": "npm run bundle:android",
+ "preandroid": "npm run build:packages && npm run bundle:android",
"android": "expo run:android",
- "preios": "npm run bundle:ios",
+ "preios": "npm run build:packages && npm run bundle:ios",
"ios": "expo run:ios",
"bundle:android": "bare-pack --host android-arm64 --host android-arm --host android-ia32 --host android-x64 --linked --out bundles/app-android.bundle.js ../../packages/core/dist/worklet/index.js",
"bundle:ios": "bare-pack --host ios-arm64 --host ios-arm64-simulator --host ios-x64-simulator --linked --out bundles/app-ios.bundle.js ../../packages/core/dist/worklet/index.js",
@@ -49,6 +50,7 @@
"expo-constants": "~55.0.7",
"expo-document-picker": "~55.0.13",
"expo-file-system": "~55.0.16",
+ "expo-font": "~55.0.7",
"expo-haptics": "~15.0.7",
"expo-image-picker": "~55.0.18",
"expo-linking": "~55.0.13",
diff --git a/apps/mobile/src/components/IllustrationLayout/IllustrationLayout.tsx b/apps/mobile/src/components/IllustrationLayout/IllustrationLayout.tsx
index 7ed4d57..4a2f3b8 100644
--- a/apps/mobile/src/components/IllustrationLayout/IllustrationLayout.tsx
+++ b/apps/mobile/src/components/IllustrationLayout/IllustrationLayout.tsx
@@ -1,7 +1,6 @@
import React, { PropsWithChildren } from 'react'
import {
View,
- Text,
ScrollView,
StyleSheet,
Pressable,
@@ -10,7 +9,9 @@ import {
} from 'react-native'
import { useTheme } from '@altersend/components'
import { SettingsIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
+import { Text } from '@/src/components/ThemedText'
interface IllustrationLayoutProps {
title: string
@@ -34,6 +35,7 @@ export function IllustrationLayout({
onMenuPress,
children
}: PropsWithChildren<IllustrationLayoutProps>) {
+ const { t } = useTranslation(['common'])
const { theme } = useTheme()
const insets = useSafeAreaInsets()
@@ -54,7 +56,7 @@ export function IllustrationLayout({
{onMenuPress ? (
<Pressable
accessibilityRole='button'
- accessibilityLabel='Settings'
+ accessibilityLabel={t('common:labels.settings')}
onPress={onMenuPress}
hitSlop={12}
style={({ pressed }) => ({ opacity: pressed ? 0.5 : 1 })}
diff --git a/apps/mobile/src/components/Layout/Layout.tsx b/apps/mobile/src/components/Layout/Layout.tsx
index bd2fff9..b4745e9 100644
--- a/apps/mobile/src/components/Layout/Layout.tsx
+++ b/apps/mobile/src/components/Layout/Layout.tsx
@@ -1,9 +1,11 @@
import { useTheme } from '@altersend/components'
import { SettingsIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import { BlurView } from 'expo-blur'
import { PropsWithChildren } from 'react'
-import { View, Text, StyleSheet, ScrollView, Pressable, Platform } from 'react-native'
+import { View, StyleSheet, ScrollView, Pressable, Platform } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
+import { Text } from '@/src/components/ThemedText'
interface LayoutProps {
title: string
@@ -25,6 +27,7 @@ export const Layout = ({
compactHeader,
onMenuPress
}: PropsWithChildren<LayoutProps>) => {
+ const { t } = useTranslation(['common'])
const { theme } = useTheme()
const insets = useSafeAreaInsets()
@@ -49,7 +52,7 @@ export const Layout = ({
{onMenuPress ? (
<Pressable
accessibilityRole='button'
- accessibilityLabel='Settings'
+ accessibilityLabel={t('common:labels.settings')}
onPress={onMenuPress}
hitSlop={12}
style={({ pressed }) => [styles.menuButton, { opacity: pressed ? 0.6 : 1 }]}
diff --git a/apps/mobile/src/components/ThemedText.tsx b/apps/mobile/src/components/ThemedText.tsx
new file mode 100644
index 0000000..3db6a7e
--- /dev/null
+++ b/apps/mobile/src/components/ThemedText.tsx
@@ -0,0 +1,27 @@
+import {
+ Text as NativeText,
+ TextInput as NativeTextInput,
+ type TextInputProps,
+ type TextProps
+} from 'react-native'
+import { useTheme } from '@altersend/components'
+
+export function Text({ style, ...props }: TextProps) {
+ const { fontFamilyName } = useTheme()
+ return (
+ <NativeText
+ {...props}
+ style={[fontFamilyName ? { fontFamily: fontFamilyName } : null, style]}
+ />
+ )
+}
+
+export function TextInput({ style, ...props }: TextInputProps) {
+ const { fontFamilyName } = useTheme()
+ return (
+ <NativeTextInput
+ {...props}
+ style={[fontFamilyName ? { fontFamily: fontFamilyName } : null, style]}
+ />
+ )
+}
diff --git a/apps/mobile/src/components/Toast/ToastAndroid.tsx b/apps/mobile/src/components/Toast/ToastAndroid.tsx
index 95640c4..0366444 100644
--- a/apps/mobile/src/components/Toast/ToastAndroid.tsx
+++ b/apps/mobile/src/components/Toast/ToastAndroid.tsx
@@ -1,7 +1,8 @@
import React from 'react'
-import { Animated, Pressable, StyleSheet, Text, View } from 'react-native'
+import { Animated, Pressable, StyleSheet, View } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { useTheme } from '@altersend/components'
+import { Text } from '@/src/components/ThemedText'
interface ToastAndroidProps {
title: string
diff --git a/apps/mobile/src/components/Toast/ToastIos.tsx b/apps/mobile/src/components/Toast/ToastIos.tsx
index 8a5f700..252a939 100644
--- a/apps/mobile/src/components/Toast/ToastIos.tsx
+++ b/apps/mobile/src/components/Toast/ToastIos.tsx
@@ -1,8 +1,9 @@
import React from 'react'
-import { Animated, Pressable, StyleSheet, Text, View } from 'react-native'
+import { Animated, Pressable, StyleSheet, View } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { useTheme } from '@altersend/components'
import { CheckIcon } from '@altersend/components/icons'
+import { Text } from '@/src/components/ThemedText'
interface ToastIosProps {
title: string
diff --git a/apps/mobile/src/components/UpdateBanner/index.tsx b/apps/mobile/src/components/UpdateBanner/index.tsx
index 92823ca..47ba015 100644
--- a/apps/mobile/src/components/UpdateBanner/index.tsx
+++ b/apps/mobile/src/components/UpdateBanner/index.tsx
@@ -1,8 +1,10 @@
import { useTheme } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import { ArrowUp, X } from 'lucide-react-native'
-import { Linking, Platform, Pressable, StyleSheet, Text, View } from 'react-native'
+import { Linking, Platform, Pressable, StyleSheet, View } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { useUpdateCheck } from '../../hooks/useUpdateCheck'
+import { Text } from '@/src/components/ThemedText'
const STORE_URL =
Platform.OS === 'ios'
@@ -10,6 +12,7 @@ const STORE_URL =
: 'https://play.google.com/store/apps/details?id=com.altersend.mobile'
export function UpdateBanner() {
+ const { t } = useTranslation(['common'])
const { theme } = useTheme()
const insets = useSafeAreaInsets()
const { needsUpdate, dismiss } = useUpdateCheck()
@@ -33,7 +36,7 @@ export function UpdateBanner() {
</View>
<Text style={[styles.label, { color: theme.colors.colorTextPrimary }]} numberOfLines={1}>
- Update available
+ {t('common:update.available')}
</Text>
<Pressable
@@ -43,10 +46,17 @@ export function UpdateBanner() {
}}
hitSlop={8}
>
- <Text style={[styles.updateBtn, { color: theme.colors.colorInfo }]}>Update</Text>
+ <Text style={[styles.updateBtn, { color: theme.colors.colorInfo }]}>
+ {t('common:update.update')}
+ </Text>
</Pressable>
- <Pressable onPress={dismiss} hitSlop={8}>
+ <Pressable
+ accessibilityRole='button'
+ accessibilityLabel={t('common:actions.dismiss')}
+ onPress={dismiss}
+ hitSlop={8}
+ >
<X size={16} color={theme.colors.colorTextSecondary} />
</Pressable>
</View>
diff --git a/apps/mobile/src/lifecycle/localePreferenceStorage.ts b/apps/mobile/src/lifecycle/localePreferenceStorage.ts
new file mode 100644
index 0000000..a3e1825
--- /dev/null
+++ b/apps/mobile/src/lifecycle/localePreferenceStorage.ts
@@ -0,0 +1,64 @@
+import {
+ SYSTEM_LOCALE_PREFERENCE,
+ normalizeLocalePreference,
+ type LocalePreference
+} from '@altersend/locales'
+import { Directory, File, Paths } from 'expo-file-system'
+
+const DIRNAME = 'altersend'
+const FILENAME = 'locale.preference'
+const listeners = new Set<(preference: LocalePreference) => void>()
+let localePreferenceSnapshot: LocalePreference = SYSTEM_LOCALE_PREFERENCE
+
+function setLocalePreferenceSnapshot(preference: LocalePreference) {
+ localePreferenceSnapshot = preference
+ listeners.forEach((listener) => listener(preference))
+}
+
+export function getLocalePreferenceSnapshot(): LocalePreference {
+ return localePreferenceSnapshot
+}
+
+export function subscribeLocalePreference(
+ listener: (preference: LocalePreference) => void
+): () => void {
+ listeners.add(listener)
+ return () => {
+ listeners.delete(listener)
+ }
+}
+
+function getPreferenceFile(): File | null {
+ const documentDirectory = Paths.document
+ if (!documentDirectory?.uri) return null
+ return new File(new Directory(documentDirectory, DIRNAME), FILENAME)
+}
+
+export async function getSavedLocalePreference(): Promise<LocalePreference> {
+ try {
+ const file = getPreferenceFile()
+ const preference = file?.exists
+ ? normalizeLocalePreference(await file.text())
+ : SYSTEM_LOCALE_PREFERENCE
+ setLocalePreferenceSnapshot(preference)
+ return preference
+ } catch {
+ setLocalePreferenceSnapshot(SYSTEM_LOCALE_PREFERENCE)
+ return SYSTEM_LOCALE_PREFERENCE
+ }
+}
+
+export async function setSavedLocalePreference(preference: LocalePreference): Promise<void> {
+ const normalizedPreference = normalizeLocalePreference(preference)
+ setLocalePreferenceSnapshot(normalizedPreference)
+
+ try {
+ const documentDirectory = Paths.document
+ if (!documentDirectory?.uri) return
+ const dir = new Directory(documentDirectory, DIRNAME)
+ if (!dir.exists) dir.create({ idempotent: true, intermediates: true })
+ new File(dir, FILENAME).write(normalizedPreference)
+ } catch (err) {
+ console.warn('localePreferenceStorage: setSavedLocalePreference failed', err)
+ }
+}
diff --git a/apps/mobile/src/lifecycle/localeStorage.ts b/apps/mobile/src/lifecycle/localeStorage.ts
deleted file mode 100644
index 43b18f4..0000000
--- a/apps/mobile/src/lifecycle/localeStorage.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { Directory, File, Paths } from 'expo-file-system'
-import type { LocalePreference } from '@altersend/locales'
-
-const DIRNAME = 'altersend'
-const FILENAME = 'locale.txt'
-
-function getLocaleFile(): File | null {
- const documentDirectory = Paths.document
- if (!documentDirectory?.uri) return null
- return new File(new Directory(documentDirectory, DIRNAME), FILENAME)
-}
-
-export async function getSavedLocale(): Promise<LocalePreference | null> {
- try {
- const file = getLocaleFile()
- if (!file?.exists) return null
- const content = await file.text()
- return (content.trim() || null) as LocalePreference | null
- } catch {
- return null
- }
-}
-
-export async function setSavedLocale(locale: LocalePreference): Promise<void> {
- try {
- const documentDirectory = Paths.document
- if (!documentDirectory?.uri) return
- const dir = new Directory(documentDirectory, DIRNAME)
- if (!dir.exists) dir.create({ idempotent: true, intermediates: true })
- const file = new File(dir, FILENAME)
- file.write(locale)
- } catch (err) {
- console.warn('localeStorage: setSavedLocale failed', err)
- }
-}
diff --git a/apps/mobile/src/lifecycle/systemLocale.ts b/apps/mobile/src/lifecycle/systemLocale.ts
new file mode 100644
index 0000000..b0ca5cc
--- /dev/null
+++ b/apps/mobile/src/lifecycle/systemLocale.ts
@@ -0,0 +1,8 @@
+import { DEFAULT_LOCALE } from '@altersend/locales'
+import { getLocales } from 'expo-localization'
+
+export function getMobileSystemLocales(): string[] {
+ const locales = getLocales()
+ const tags = locales.map((locale) => locale.languageTag).filter(Boolean)
+ return tags.length > 0 ? tags : [DEFAULT_LOCALE]
+}
diff --git a/apps/mobile/src/loading/LoadingScreen.tsx b/apps/mobile/src/loading/LoadingScreen.tsx
index 434f5bf..620555b 100644
--- a/apps/mobile/src/loading/LoadingScreen.tsx
+++ b/apps/mobile/src/loading/LoadingScreen.tsx
@@ -1,14 +1,17 @@
import { useTheme } from '@altersend/components'
-import { Image, StyleSheet, Text, View } from 'react-native'
+import { useTranslation } from '@altersend/locales'
+import { Image, StyleSheet, View } from 'react-native'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import LoadingSvg from '../../../../assets/loading.svg'
import brandLogo from '@/assets/images/brand-logo.png'
+import { Text } from '@/src/components/ThemedText'
interface LoadingScreenProps {
progress?: number
}
export function LoadingScreen({ progress = 0 }: LoadingScreenProps) {
+ const { t } = useTranslation(['common'])
const { theme } = useTheme()
const insets = useSafeAreaInsets()
const clamped = Math.max(0, Math.min(100, progress))
@@ -34,10 +37,10 @@ export function LoadingScreen({ progress = 0 }: LoadingScreenProps) {
<View style={styles.content}>
<LoadingSvg height={160} width={237} />
<Text style={[styles.title, { color: theme.colors.colorTextPrimary }]}>
- Welcome to AlterSend
+ {t('common:app.welcome')}
</Text>
<Text style={[styles.subtitle, { color: theme.colors.colorTextSecondary }]}>
- {'Files travel directly between your devices.\nNo servers, no copies, no middlemen.'}
+ {t('common:app.loadingTagline')}
</Text>
</View>
diff --git a/apps/mobile/src/theme/useAlterSendFonts.ts b/apps/mobile/src/theme/useAlterSendFonts.ts
new file mode 100644
index 0000000..04b6807
--- /dev/null
+++ b/apps/mobile/src/theme/useAlterSendFonts.ts
@@ -0,0 +1,24 @@
+import { useFonts } from 'expo-font'
+
+import { BUNDLED_FONT_FAMILIES } from '@altersend/components'
+import japaneseRegularFont from '../../../../assets/fonts/NotoSans-JP-Regular.ttf'
+import japaneseBoldFont from '../../../../assets/fonts/NotoSans-JP-Bold.ttf'
+import koreanRegularFont from '../../../../assets/fonts/NotoSans-KR-Regular.ttf'
+import koreanBoldFont from '../../../../assets/fonts/NotoSans-KR-Bold.ttf'
+import simplifiedChineseRegularFont from '../../../../assets/fonts/NotoSans-SC-Regular.ttf'
+import simplifiedChineseBoldFont from '../../../../assets/fonts/NotoSans-SC-Bold.ttf'
+import traditionalChineseRegularFont from '../../../../assets/fonts/NotoSans-TC-Regular.ttf'
+import traditionalChineseBoldFont from '../../../../assets/fonts/NotoSans-TC-Bold.ttf'
+
+export function useAlterSendFonts() {
+ return useFonts({
+ [BUNDLED_FONT_FAMILIES.japanese.cssFamily]: japaneseRegularFont,
+ [`${BUNDLED_FONT_FAMILIES.japanese.cssFamily} Bold`]: japaneseBoldFont,
+ [BUNDLED_FONT_FAMILIES.korean.cssFamily]: koreanRegularFont,
+ [`${BUNDLED_FONT_FAMILIES.korean.cssFamily} Bold`]: koreanBoldFont,
+ [BUNDLED_FONT_FAMILIES.simplifiedChinese.cssFamily]: simplifiedChineseRegularFont,
+ [`${BUNDLED_FONT_FAMILIES.simplifiedChinese.cssFamily} Bold`]: simplifiedChineseBoldFont,
+ [BUNDLED_FONT_FAMILIES.traditionalChinese.cssFamily]: traditionalChineseRegularFont,
+ [`${BUNDLED_FONT_FAMILIES.traditionalChinese.cssFamily} Bold`]: traditionalChineseBoldFont
+ })
+}
diff --git a/apps/mobile/src/transfer/receive/utils/completionToast.ts b/apps/mobile/src/transfer/receive/utils/completionToast.ts
index 7a07454..8efa619 100644
--- a/apps/mobile/src/transfer/receive/utils/completionToast.ts
+++ b/apps/mobile/src/transfer/receive/utils/completionToast.ts
@@ -1,5 +1,6 @@
import { Linking, Platform } from 'react-native'
import type { SaveDestination } from '@altersend/domain'
+import { i18nextInstance } from '@altersend/locales'
import type { ShowToastInput } from '@/src/components/Toast'
interface BuildCompletionToastInput {
@@ -30,9 +31,11 @@ export function buildCompletionToast({
if (photosCount > 0 && filesystemCount > 0) {
return {
- title: `${count} files saved`,
- hint: Platform.OS === 'ios' ? 'Photos + AlterSend folder' : undefined,
- actionLabel: Platform.OS === 'android' ? 'View Photos' : undefined,
+ title: i18nextInstance.t('receive:summary.filesSaved', { count }),
+ hint:
+ Platform.OS === 'ios' ? i18nextInstance.t('common:files.photosAndAlterSend') : undefined,
+ actionLabel:
+ Platform.OS === 'android' ? i18nextInstance.t('receive:actions.viewPhotos') : undefined,
onPress: openPhotos,
durationMs: LONG_DURATION_MS
}
@@ -40,18 +43,19 @@ export function buildCompletionToast({
if (photosCount > 0) {
return {
- title: count === 1 ? 'Saved to Photos' : `${count} saved to Photos`,
- hint: Platform.OS === 'ios' ? 'Tap to view' : undefined,
- actionLabel: Platform.OS === 'android' ? 'View' : undefined,
+ title: i18nextInstance.t('receive:summary.savedToPhotos', { count }),
+ hint: Platform.OS === 'ios' ? i18nextInstance.t('receive:summary.tapToView') : undefined,
+ actionLabel:
+ Platform.OS === 'android' ? i18nextInstance.t('receive:actions.view') : undefined,
onPress: openPhotos,
durationMs: LONG_DURATION_MS
}
}
return {
- title: count === 1 ? 'Saved in Files' : `${count} saved in Files`,
- hint: Platform.OS === 'ios' ? 'AlterSend folder' : undefined,
- actionLabel: Platform.OS === 'android' ? 'Open' : undefined,
+ title: i18nextInstance.t('receive:summary.savedInFiles', { count }),
+ hint: Platform.OS === 'ios' ? i18nextInstance.t('common:files.alterSendFolder') : undefined,
+ actionLabel: Platform.OS === 'android' ? i18nextInstance.t('receive:actions.open') : undefined,
onPress: Platform.OS === 'ios' ? openFiles : undefined,
durationMs: LONG_DURATION_MS
}
diff --git a/apps/mobile/src/transfer/receive/utils/fileRowUtils.tsx b/apps/mobile/src/transfer/receive/utils/fileRowUtils.tsx
index 5e8be32..6e7ae9f 100644
--- a/apps/mobile/src/transfer/receive/utils/fileRowUtils.tsx
+++ b/apps/mobile/src/transfer/receive/utils/fileRowUtils.tsx
@@ -1,28 +1,33 @@
import React from 'react'
-import { Pressable, StyleSheet, Text } from 'react-native'
+import { Pressable, StyleSheet } from 'react-native'
import { getFileKind, useTheme } from '@altersend/components'
import { formatFileSize, type DownloadItemState } from '@altersend/domain'
+import { useTranslation } from '@altersend/locales'
+import { Text } from '@/src/components/ThemedText'
-function getActionLabel(name: string): string {
+type Translate = ReturnType<typeof useTranslation>['t']
+
+function getActionLabel(name: string, t: Translate): string {
const kind = getFileKind(name)
- if (kind === 'image') return 'View'
- if (kind === 'video') return 'Play'
- return 'Open'
+ if (kind === 'image') return t('receive:actions.view')
+ if (kind === 'video') return t('receive:actions.play')
+ return t('receive:actions.open')
}
-function getDestinationLabel(state: DownloadItemState | undefined): string {
+function getDestinationLabel(state: DownloadItemState | undefined, t: Translate): string {
if (!state || state.destination === undefined) return ''
- if (state.destination === 'photos') return 'Photos'
- return 'Files › Downloads'
+ if (state.destination === 'photos') return t('common:files.photos')
+ return t('common:files.downloads')
}
export function getFileMeta(
size: number,
state: DownloadItemState | undefined,
+ t: Translate,
options?: { disabled?: boolean }
): string {
- if (options?.disabled) return "Didn't arrive"
- const destination = getDestinationLabel(state)
+ if (options?.disabled) return t('receive:errors.didntArrive')
+ const destination = getDestinationLabel(state, t)
return destination ? `${destination} · ${formatFileSize(size)}` : formatFileSize(size)
}
@@ -33,6 +38,7 @@ interface OpenActionProps {
}
export function OpenAction({ fileName, offerKey, onPress }: OpenActionProps) {
+ const { t } = useTranslation(['receive'])
const { theme } = useTheme()
return (
<Pressable
@@ -46,7 +52,7 @@ export function OpenAction({ fileName, offerKey, onPress }: OpenActionProps) {
]}
>
<Text style={[actionStyles.label, { color: theme.colors.colorTextSecondary }]}>
- {getActionLabel(fileName)}
+ {getActionLabel(fileName, t)}
</Text>
</Pressable>
)
diff --git a/apps/mobile/src/transfer/receive/views/ErrorPanel.tsx b/apps/mobile/src/transfer/receive/views/ErrorPanel.tsx
index 412adb8..a002a9e 100644
--- a/apps/mobile/src/transfer/receive/views/ErrorPanel.tsx
+++ b/apps/mobile/src/transfer/receive/views/ErrorPanel.tsx
@@ -1,11 +1,13 @@
-import { StyleSheet, Text, View } from 'react-native'
+import { StyleSheet, View } from 'react-native'
import { useTheme, withAlpha } from '@altersend/components'
+import { Text } from '@/src/components/ThemedText'
interface ErrorPanelProps {
+ title: string
message: string
}
-export function ErrorPanel({ message }: ErrorPanelProps) {
+export function ErrorPanel({ title, message }: ErrorPanelProps) {
const { theme } = useTheme()
return (
<View
@@ -17,7 +19,7 @@ export function ErrorPanel({ message }: ErrorPanelProps) {
}
]}
>
- <Text style={[styles.title, { color: theme.colors.colorDanger }]}>Transfer issue</Text>
+ <Text style={[styles.title, { color: theme.colors.colorDanger }]}>{title}</Text>
<Text style={[styles.text, { color: theme.colors.colorDanger }]}>{message}</Text>
</View>
)
diff --git a/apps/mobile/src/transfer/receive/views/ReceiveCompleteView.tsx b/apps/mobile/src/transfer/receive/views/ReceiveCompleteView.tsx
index 2f4a8fc..2aadd18 100644
--- a/apps/mobile/src/transfer/receive/views/ReceiveCompleteView.tsx
+++ b/apps/mobile/src/transfer/receive/views/ReceiveCompleteView.tsx
@@ -1,12 +1,15 @@
import React from 'react'
-import { StyleSheet, Text, View } from 'react-native'
+import { StyleSheet, View } from 'react-native'
import { SendFileListRow, useTheme, withAlpha } from '@altersend/components'
import { CheckIcon } from '@altersend/components/icons'
import { formatFileSize, getOfferKey, useTransferStore } from '@altersend/domain'
+import { useTranslation } from '@altersend/locales'
import { OpenAction, getFileMeta } from '../utils/fileRowUtils'
import { openCompletedFile } from '../utils/openCompletedFile'
+import { Text } from '@/src/components/ThemedText'
export function ReceiveCompleteView() {
+ const { t } = useTranslation(['receive', 'common'])
const incomingFileOffers = useTransferStore((s) => s.incomingFileOffers)
const downloadStates = useTransferStore((s) => s.receiveDownloadStates)
const onOpenFile = openCompletedFile
@@ -36,10 +39,10 @@ export function ReceiveCompleteView() {
</View>
<View style={styles.successText}>
<Text style={[styles.successTitle, { color: theme.colors.colorSuccess }]}>
- {fileCount} {fileCount === 1 ? 'file' : 'files'} received
+ {t('receive:page.completed.title', { count: fileCount })}
</Text>
<Text style={[styles.successSubtitle, { color: theme.colors.colorTextMuted }]}>
- {formatFileSize(totalBytes)} · saved
+ {formatFileSize(totalBytes)} · {t('receive:summary.saved')}
</Text>
</View>
</View>
@@ -63,7 +66,7 @@ export function ReceiveCompleteView() {
bare
isFirst={index === 0}
name={file.name}
- description={getFileMeta(file.size, state)}
+ description={getFileMeta(file.size, state, t)}
trailing={
isComplete ? (
<OpenAction fileName={file.name} offerKey={offerKey} onPress={onOpenFile} />
diff --git a/apps/mobile/src/transfer/receive/views/ReceiveConnectingView.tsx b/apps/mobile/src/transfer/receive/views/ReceiveConnectingView.tsx
index 7c8099e..3781615 100644
--- a/apps/mobile/src/transfer/receive/views/ReceiveConnectingView.tsx
+++ b/apps/mobile/src/transfer/receive/views/ReceiveConnectingView.tsx
@@ -1,8 +1,10 @@
import React, { PropsWithChildren } from 'react'
-import { View, ActivityIndicator, Text, StyleSheet } from 'react-native'
+import { View, ActivityIndicator, StyleSheet } from 'react-native'
import { useTheme } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import { IllustrationLayout } from '@/src/components'
import ConnectingSvg from '../../../../../../assets/connecting.svg'
+import { Text } from '@/src/components/ThemedText'
interface ReceiveConnectingViewProps {
title: string
@@ -18,6 +20,7 @@ export function ReceiveConnectingView({
onMenuPress,
children
}: PropsWithChildren<ReceiveConnectingViewProps>) {
+ const { t } = useTranslation(['receive'])
const { theme } = useTheme()
return (
@@ -42,10 +45,10 @@ export function ReceiveConnectingView({
<ActivityIndicator color={theme.colors.colorAccent} size='small' />
<View style={styles.textWrap}>
<Text style={[styles.title, { color: theme.colors.colorTextPrimary }]}>
- Connection in progress
+ {t('receive:page.handshake.title')}
</Text>
<Text style={[styles.description, { color: theme.colors.colorTextSecondary }]}>
- Completing the secure handshake with the sender.
+ {t('receive:page.handshake.description')}
</Text>
</View>
</View>
diff --git a/apps/mobile/src/transfer/receive/views/ReceiveIncomingView.tsx b/apps/mobile/src/transfer/receive/views/ReceiveIncomingView.tsx
index c3988ab..bbf83ed 100644
--- a/apps/mobile/src/transfer/receive/views/ReceiveIncomingView.tsx
+++ b/apps/mobile/src/transfer/receive/views/ReceiveIncomingView.tsx
@@ -1,9 +1,12 @@
import React from 'react'
-import { View, Text, StyleSheet } from 'react-native'
+import { View, StyleSheet } from 'react-native'
import { SendFileListRow, useTheme } from '@altersend/components'
import { getDownloadRowDisplay, getOfferKey, useTransferStore } from '@altersend/domain'
+import { useTranslation } from '@altersend/locales'
+import { Text } from '@/src/components/ThemedText'
export function ReceiveIncomingView() {
+ const { t } = useTranslation(['receive'])
const incomingFileOffers = useTransferStore((s) => s.incomingFileOffers)
const downloadStates = useTransferStore((s) => s.receiveDownloadStates)
const { theme } = useTheme()
@@ -37,7 +40,7 @@ export function ReceiveIncomingView() {
</View>
) : (
<Text style={[styles.waitingText, { color: theme.colors.colorTextMuted }]}>
- Waiting for files from sender…
+ {t('receive:status.waitingForFiles')}
</Text>
)}
</View>
diff --git a/apps/mobile/src/transfer/receive/views/ReceiveInterruptedView.tsx b/apps/mobile/src/transfer/receive/views/ReceiveInterruptedView.tsx
index c7cf42a..493b9ce 100644
--- a/apps/mobile/src/transfer/receive/views/ReceiveInterruptedView.tsx
+++ b/apps/mobile/src/transfer/receive/views/ReceiveInterruptedView.tsx
@@ -1,12 +1,14 @@
import React, { PropsWithChildren } from 'react'
-import { StyleSheet, Text, View } from 'react-native'
+import { StyleSheet, View } from 'react-native'
import type { IncomingFileOffer } from '@altersend/core'
import { SendFileListRow, useTheme, withAlpha } from '@altersend/components'
import { CloseIcon } from '@altersend/components/icons'
import { getOfferKey, type DownloadItemState } from '@altersend/domain'
+import { useTranslation } from '@altersend/locales'
import { IllustrationLayout } from '@/src/components'
import { OpenAction, getFileMeta } from '../utils/fileRowUtils'
import MissingFilesSvg from '../../../../../../assets/missing-files.svg'
+import { Text } from '@/src/components/ThemedText'
interface ReceiveInterruptedViewProps {
title: string
@@ -28,6 +30,7 @@ export function ReceiveInterruptedView({
onMenuPress,
children
}: PropsWithChildren<ReceiveInterruptedViewProps>) {
+ const { t } = useTranslation(['receive', 'common'])
const { theme } = useTheme()
const completedCount = incomingFileOffers.filter(
@@ -65,10 +68,10 @@ export function ReceiveInterruptedView({
</View>
<View style={styles.statusText}>
<Text style={[styles.statusTitle, { color: theme.colors.colorWarning }]}>
- {`Received ${completedCount} of ${total} ${total === 1 ? 'file' : 'files'}`}
+ {t('receive:summary.receivedCount', { completed: completedCount, count: total })}
</Text>
<Text style={[styles.statusSubtitle, { color: theme.colors.colorTextMuted }]}>
- The sender left before finishing.
+ {t('receive:summary.senderLeftBeforeFinishing')}
</Text>
</View>
</View>
@@ -93,7 +96,7 @@ export function ReceiveInterruptedView({
isFirst={index === 0}
disabled={!isComplete}
name={file.name}
- description={getFileMeta(file.size, state, { disabled: !isComplete })}
+ description={getFileMeta(file.size, state, t, { disabled: !isComplete })}
trailing={
isComplete ? (
<OpenAction fileName={file.name} offerKey={offerKey} onPress={onOpenFile} />
diff --git a/apps/mobile/src/transfer/receive/views/ReceiveJoinView.tsx b/apps/mobile/src/transfer/receive/views/ReceiveJoinView.tsx
index 834f860..2e4ceaf 100644
--- a/apps/mobile/src/transfer/receive/views/ReceiveJoinView.tsx
+++ b/apps/mobile/src/transfer/receive/views/ReceiveJoinView.tsx
@@ -1,7 +1,9 @@
import React from 'react'
-import { Pressable, StyleSheet, Text, View } from 'react-native'
+import { Pressable, StyleSheet, View } from 'react-native'
import { Button, Input, useTheme, withAlpha } from '@altersend/components'
import { ChevronRightIcon, QrCodeIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
+import { Text } from '@/src/components/ThemedText'
interface ReceiveJoinViewProps {
joinCode: string
@@ -20,6 +22,7 @@ export function ReceiveJoinView({
onConnect,
onScanQr
}: ReceiveJoinViewProps) {
+ const { t } = useTranslation(['receive', 'common'])
const { theme } = useTheme()
const trimmed = joinCode.trim()
const canConnect = trimmed.length > 0 && !isLoading
@@ -49,10 +52,10 @@ export function ReceiveJoinView({
</View>
<View style={styles.qrText}>
<Text style={[styles.qrTitle, { color: theme.colors.colorTextPrimary }]}>
- Scan or import QR
+ {t('receive:actions.scanOrImportQr')}
</Text>
<Text style={[styles.qrSubtitle, { color: theme.colors.colorTextSecondary }]}>
- Use the camera, or import a saved image
+ {t('receive:actions.scanOrImportQrHintMobile')}
</Text>
</View>
<ChevronRightIcon size={18} color={theme.colors.colorTextMuted} />
@@ -61,7 +64,7 @@ export function ReceiveJoinView({
<View style={styles.divider}>
<Text style={[styles.dividerText, { color: theme.colors.colorTextMuted }]}>
- or paste code
+ {t('receive:form.orPasteCode')}
</Text>
</View>
@@ -79,17 +82,17 @@ export function ReceiveJoinView({
<Input
disabled={isLoading}
error={joinCodeError}
- label='Connection code'
+ label={t('receive:form.codeLabel')}
mono
secure
onChange={(e: { target: { value: string } }) => onJoinCodeChange(e.target.value)}
- placeholder='Paste 64-char code…'
+ placeholder={t('receive:form.codePlaceholder')}
type='text'
value={joinCode}
/>
<Button disabled={!canConnect} onClick={onConnect} size='md' variant='primary' width='full'>
- {isLoading ? 'Connecting…' : 'Connect'}
+ {isLoading ? t('common:actions.connecting') : t('common:actions.connect')}
</Button>
</View>
</View>
diff --git a/apps/mobile/src/transfer/receive/views/ReceiveReconnectingView.tsx b/apps/mobile/src/transfer/receive/views/ReceiveReconnectingView.tsx
index b4883ec..eaaf3dd 100644
--- a/apps/mobile/src/transfer/receive/views/ReceiveReconnectingView.tsx
+++ b/apps/mobile/src/transfer/receive/views/ReceiveReconnectingView.tsx
@@ -1,8 +1,10 @@
import React, { PropsWithChildren } from 'react'
-import { View, ActivityIndicator, Text, StyleSheet } from 'react-native'
+import { View, ActivityIndicator, StyleSheet } from 'react-native'
import { useTheme } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
import { IllustrationLayout } from '@/src/components'
import ConnectionLostSvg from '../../../../../../assets/connection-lost.svg'
+import { Text } from '@/src/components/ThemedText'
interface ReceiveReconnectingViewProps {
title: string
@@ -18,6 +20,7 @@ export function ReceiveReconnectingView({
hasNativeHeader,
children
}: PropsWithChildren<ReceiveReconnectingViewProps>) {
+ const { t } = useTranslation(['receive'])
const { theme } = useTheme()
return (
@@ -42,10 +45,10 @@ export function ReceiveReconnectingView({
<ActivityIndicator color={theme.colors.colorAccent} size='small' />
<View style={styles.textWrap}>
<Text style={[styles.title, { color: theme.colors.colorTextPrimary }]}>
- Reconnecting
+ {t('receive:page.reconnecting.title')}
</Text>
<Text style={[styles.description, { color: theme.colors.colorTextSecondary }]}>
- Connection dropped. Rejoining the session…
+ {t('receive:page.reconnecting.panelDescription')}
</Text>
</View>
</View>
diff --git a/apps/mobile/src/transfer/send/views/PreparingView.tsx b/apps/mobile/src/transfer/send/views/PreparingView.tsx
index 8310943..a9157cd 100644
--- a/apps/mobile/src/transfer/send/views/PreparingView.tsx
+++ b/apps/mobile/src/transfer/send/views/PreparingView.tsx
@@ -1,14 +1,16 @@
-import { View, Text, StyleSheet } from 'react-native'
+import { View, StyleSheet } from 'react-native'
import {
getOverallProgress,
getProgressState,
- getStatusLabel,
getStatusTone,
useTransferStore
} from '@altersend/domain'
import { SendFileListRow, useTheme } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
+import { Text } from '@/src/components/ThemedText'
export function PreparingView() {
+ const { t } = useTranslation(['send'])
const uploadItems = useTransferStore((s) => s.uploadItems)
const { theme } = useTheme()
const { completed, total, percent } = getOverallProgress(uploadItems)
@@ -24,7 +26,7 @@ export function PreparingView() {
<View style={[styles.card, surfaceStyle]}>
<View style={styles.header}>
<Text style={[styles.title, { color: theme.colors.colorTextPrimary }]}>
- {allCompleted ? 'Upload complete' : 'Uploading files'}
+ {allCompleted ? t('send:status.uploadComplete') : t('send:status.uploadingFiles')}
</Text>
<Text style={[styles.percent, { color: theme.colors.colorTextPrimary }]}>{percent}%</Text>
</View>
@@ -42,7 +44,7 @@ export function PreparingView() {
</View>
<Text style={[styles.subtitle, { color: theme.colors.colorTextSecondary }]}>
- {completed} of {total} {total === 1 ? 'file' : 'files'} uploaded
+ {t('send:preparing.uploadedCount', { completed, count: total })}
</Text>
</View>
@@ -54,7 +56,15 @@ export function PreparingView() {
key={item.path}
name={item.name}
size={item.size}
- status={{ label: getStatusLabel(item), tone: getStatusTone(item) }}
+ status={{
+ label:
+ item.status === 'completed'
+ ? t('send:status.uploaded')
+ : item.status === 'uploading'
+ ? t('send:status.uploading')
+ : t('send:status.waiting'),
+ tone: getStatusTone(item)
+ }}
progress={
progress === 'waiting' || progress === 'uploading' || progress === 'completed'
? progress
diff --git a/apps/mobile/src/transfer/send/views/QRSection.tsx b/apps/mobile/src/transfer/send/views/QRSection.tsx
index e22f925..21e6de9 100644
--- a/apps/mobile/src/transfer/send/views/QRSection.tsx
+++ b/apps/mobile/src/transfer/send/views/QRSection.tsx
@@ -1,9 +1,11 @@
import { useEffect, useRef } from 'react'
-import { Animated, Pressable, StyleSheet, Text, View } from 'react-native'
+import { Animated, Pressable, StyleSheet, View } from 'react-native'
import QRCode from 'react-native-qrcode-svg'
import { buildJoinUrl } from '@altersend/domain'
import { Input, useTheme } from '@altersend/components'
import { CheckIcon, CopyIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
+import { Text } from '@/src/components/ThemedText'
interface QRSectionProps {
topic: string
@@ -13,6 +15,7 @@ interface QRSectionProps {
}
export function QRSection({ topic, isKeyCopied, onCopy, showWaitingState }: QRSectionProps) {
+ const { t } = useTranslation(['send'])
const { theme } = useTheme()
const pulseAnim = useRef(new Animated.Value(0.3)).current
@@ -51,7 +54,9 @@ export function QRSection({ topic, isKeyCopied, onCopy, showWaitingState }: QRSe
{ backgroundColor: theme.colors.colorTextPrimary }
]}
>
- <Text style={{ color: theme.colors.colorTextSecondary }}>Generating code...</Text>
+ <Text style={{ color: theme.colors.colorTextSecondary }}>
+ {t('send:connection.generating')}
+ </Text>
</View>
)}
@@ -60,13 +65,13 @@ export function QRSection({ topic, isKeyCopied, onCopy, showWaitingState }: QRSe
mono
readOnly
secure
- placeholder='Generating secure key...'
+ placeholder={t('send:connection.placeholder')}
value={topic}
trailing={
<Pressable
onPress={onCopy}
accessibilityRole='button'
- accessibilityLabel='Copy connection code'
+ accessibilityLabel={t('send:connection.copyLabel')}
style={({ pressed }) => [styles.copyButton, pressed && styles.copyButtonPressed]}
>
{isKeyCopied ? <CheckIcon size={16} /> : <CopyIcon size={16} />}
@@ -84,7 +89,7 @@ export function QRSection({ topic, isKeyCopied, onCopy, showWaitingState }: QRSe
]}
/>
<Text style={[styles.waitingText, { color: theme.colors.colorTextMuted }]}>
- Waiting for connection…
+ {t('send:connection.waitingForConnection')}
</Text>
</View>
)}
diff --git a/apps/mobile/src/transfer/send/views/SelectFilesView.tsx b/apps/mobile/src/transfer/send/views/SelectFilesView.tsx
index f4524ec..b8d9e95 100644
--- a/apps/mobile/src/transfer/send/views/SelectFilesView.tsx
+++ b/apps/mobile/src/transfer/send/views/SelectFilesView.tsx
@@ -9,6 +9,7 @@ import {
type SelectedFile
} from '@altersend/domain'
import { DropZoneLink, ErrorBanner, FileDropZone, SendFileListRow } from '@altersend/components'
+import { useTranslation } from '@altersend/locales'
function uriToFilePath(uri: string): string {
if (!uri.startsWith('file://')) return uri
@@ -21,6 +22,7 @@ function uriToFilePath(uri: string): string {
}
export function SelectFilesView() {
+ const { t } = useTranslation(['send', 'common'])
const selectedFiles = useTransferStore((s) => s.selectedFiles)
const [selectionError, setSelectionError] = useState<string | null>(null)
@@ -48,7 +50,7 @@ export function SelectFilesView() {
addSelectedFiles(normalizedFiles)
}
} catch (error) {
- setSelectionError('Failed to pick files')
+ setSelectionError(t('send:errors.failedPickFiles'))
console.error(error)
}
}
@@ -76,7 +78,7 @@ export function SelectFilesView() {
addSelectedFiles(normalizedFiles)
}
} catch (error) {
- setSelectionError('Failed to pick photos')
+ setSelectionError(t('send:errors.failedPickPhotos'))
console.error(error)
}
}
@@ -85,7 +87,7 @@ export function SelectFilesView() {
if (Platform.OS === 'ios') {
ActionSheetIOS.showActionSheetWithOptions(
{
- options: ['Cancel', 'Photos', 'Files'],
+ options: [t('common:actions.cancel'), t('common:files.photos'), t('common:files.files')],
cancelButtonIndex: 0
},
(index) => {
@@ -96,10 +98,10 @@ export function SelectFilesView() {
return
}
- Alert.alert('Add files', undefined, [
- { text: 'Photos', onPress: () => void pickFromPhotos() },
- { text: 'Files', onPress: () => void pickFromFiles() },
- { text: 'Cancel', style: 'cancel' }
+ Alert.alert(t('send:actions.pickFilesTitle'), undefined, [
+ { text: t('common:files.photos'), onPress: () => void pickFromPhotos() },
+ { text: t('common:files.files'), onPress: () => void pickFromFiles() },
+ { text: t('common:actions.cancel'), style: 'cancel' }
])
}
@@ -110,17 +112,19 @@ export function SelectFilesView() {
description={
hasSelectedFiles ? (
<>
- Tap to <DropZoneLink>add more</DropZoneLink>
+ {t('send:dropzone.tapTo')}{' '}
+ <DropZoneLink>{t('send:dropzone.addMoreLink')}</DropZoneLink>
</>
) : (
<>
- Tap to <DropZoneLink>browse</DropZoneLink>
+ {t('send:dropzone.tapTo')}{' '}
+ <DropZoneLink>{t('send:dropzone.browseLink')}</DropZoneLink>
</>
)
}
hasFiles={hasSelectedFiles}
onClick={() => void browse()}
- title={hasSelectedFiles ? 'Add more files' : 'Add files'}
+ title={hasSelectedFiles ? t('send:actions.addMoreFiles') : t('send:actions.addFiles')}
/>
</View>
@@ -131,6 +135,7 @@ export function SelectFilesView() {
key={file.path}
name={file.name}
onRemove={() => removeSelectedFile(file.path)}
+ removeLabel={t('send:files.removeLabel', { name: file.name })}
size={file.size}
/>
))}
diff --git a/apps/mobile/src/transfer/send/views/ShareView.tsx b/apps/mobile/src/transfer/send/views/ShareView.tsx
index ad56717..a8b752a 100644
--- a/apps/mobile/src/transfer/send/views/ShareView.tsx
+++ b/apps/mobile/src/transfer/send/views/ShareView.tsx
@@ -1,19 +1,71 @@
import { useEffect, useMemo, useState } from 'react'
-import { ScrollView, Share, StyleSheet, Text, View } from 'react-native'
+import { ScrollView, Share, StyleSheet, View } from 'react-native'
import * as Clipboard from 'expo-clipboard'
+import type { PeerListCardEntry } from '@altersend/components'
import {
buildInviteText,
formatFileSize,
getPeerListEntries,
- senderKeepOpenHint,
+ type PeerListEntry,
+ type PeerListEntryDetail,
useTransferStore
} from '@altersend/domain'
import { Disclosure, PeerListCard, SendFileListRow, useTheme } from '@altersend/components'
import { AlertCircleIcon, FolderIcon } from '@altersend/components/icons'
+import { useTranslation } from '@altersend/locales'
import { useToast } from '@/src/components/Toast'
import { QRSection } from './QRSection'
+import { Text } from '@/src/components/ThemedText'
+
+function getPeerStatusLabel(t: ReturnType<typeof useTranslation>['t'], entry: PeerListEntry) {
+ switch (entry.status) {
+ case 'failed':
+ return t('send:status.failed')
+ case 'downloaded':
+ return t('send:status.downloaded')
+ case 'disconnected':
+ return t('send:status.disconnected')
+ case 'online':
+ return t('send:status.online')
+ case 'downloading':
+ return entry.progressPercent != null
+ ? t('send:status.downloadingPercent', { percent: entry.progressPercent })
+ : t('send:status.downloading')
+ }
+}
+
+function getPeerDetailLabel(
+ t: ReturnType<typeof useTranslation>['t'],
+ detail: PeerListEntryDetail | null
+) {
+ if (!detail) return null
+
+ switch (detail.type) {
+ case 'failed-file':
+ case 'in-flight-file':
+ return detail.fileName
+ case 'completed-files':
+ return t('common:files.count', { count: detail.count })
+ case 'completed-done':
+ return t('send:peer.completedDone', { count: detail.count })
+ case 'progress-bytes':
+ return `${formatFileSize(detail.transferredBytes)} / ${formatFileSize(detail.totalBytes)}`
+ }
+}
+
+function toPeerListCardEntry(
+ t: ReturnType<typeof useTranslation>['t'],
+ entry: PeerListEntry
+): PeerListCardEntry {
+ return {
+ ...entry,
+ statusLabel: getPeerStatusLabel(t, entry),
+ detail: getPeerDetailLabel(t, entry.detail)
+ }
+}
export function ShareView() {
+ const { t } = useTranslation(['send', 'common'])
const { theme } = useTheme()
const selectedFiles = useTransferStore((s) => s.selectedFiles)
const topicRaw = useTransferStore((s) => s.topic)
@@ -31,6 +83,7 @@ export function ShareView() {
() => getPeerListEntries(connectedPeers, peerDownloads, selectedFiles),
[connectedPeers, peerDownloads, selectedFiles]
)
+ const peerCardEntries = peerEntries.map((entry) => toPeerListCardEntry(t, entry))
const hasActivity = isPeerConnected || peerEntries.length > 0
const showWaitingState = !hasActivity
@@ -39,7 +92,7 @@ export function ShareView() {
try {
await Clipboard.setStringAsync(topic)
setIsKeyCopied(true)
- toast.show({ title: 'Copied to clipboard' })
+ toast.show({ title: t('send:connection.copiedToast') })
await Share.share({ message: buildInviteText(topic) })
} catch (error) {
console.error(error)
@@ -57,7 +110,7 @@ export function ShareView() {
<View style={styles.hint}>
<AlertCircleIcon size={12} />
<Text style={[styles.hintText, { color: theme.colors.colorTextMuted }]}>
- {senderKeepOpenHint}
+ {t('send:hints.keepOpen')}
</Text>
</View>
@@ -70,7 +123,13 @@ export function ShareView() {
{peerEntries.length > 0 ? (
<View style={styles.peerListWrap}>
- <PeerListCard entries={peerEntries} />
+ <PeerListCard
+ entries={peerCardEntries}
+ labels={{
+ title: t('send:peer.devices'),
+ connectedCount: (count) => t('send:peer.connectedCount', { count })
+ }}
+ />
</View>
) : null}
@@ -79,7 +138,7 @@ export function ShareView() {
icon={<FolderIcon size={20} />}
onToggle={() => setIsFilesExpanded(!isFilesExpanded)}
subtitle={formatFileSize(totalSize)}
- title={selectedFiles.length === 1 ? '1 file' : `${selectedFiles.length} files`}
+ title={t('common:files.count', { count: selectedFiles.length })}
>
{selectedFiles.map((file) => (
<SendFileListRow key={file.path} bare name={file.name} size={file.size} />
diff --git a/apps/mobile/types/assets.d.ts b/apps/mobile/types/assets.d.ts
index b012f44..758eb6a 100644
--- a/apps/mobile/types/assets.d.ts
+++ b/apps/mobile/types/assets.d.ts
@@ -3,6 +3,11 @@ declare module '*.png' {
export default value
}
+declare module '*.ttf' {
+ const value: number
+ export default value
+}
+
declare module '*.svg' {
import React from 'react'
import { SvgProps } from 'react-native-svg'
diff --git a/assets/fonts/NotoSans-JP-Bold.ttf b/assets/fonts/NotoSans-JP-Bold.ttf
new file mode 100644
index 0000000..9e23bd7
Binary files /dev/null and b/assets/fonts/NotoSans-JP-Bold.ttf differ
diff --git a/assets/fonts/NotoSans-JP-Regular.ttf b/assets/fonts/NotoSans-JP-Regular.ttf
new file mode 100644
index 0000000..71ae9d4
Binary files /dev/null and b/assets/fonts/NotoSans-JP-Regular.ttf differ
diff --git a/assets/fonts/NotoSans-KR-Bold.ttf b/assets/fonts/NotoSans-KR-Bold.ttf
new file mode 100644
index 0000000..d52b825
Binary files /dev/null and b/assets/fonts/NotoSans-KR-Bold.ttf differ
diff --git a/assets/fonts/NotoSans-KR-Regular.ttf b/assets/fonts/NotoSans-KR-Regular.ttf
new file mode 100644
index 0000000..61d37a5
Binary files /dev/null and b/assets/fonts/NotoSans-KR-Regular.ttf differ
diff --git a/assets/fonts/NotoSans-SC-Bold.ttf b/assets/fonts/NotoSans-SC-Bold.ttf
new file mode 100644
index 0000000..d43bce7
Binary files /dev/null and b/assets/fonts/NotoSans-SC-Bold.ttf differ
diff --git a/assets/fonts/NotoSans-SC-Regular.ttf b/assets/fonts/NotoSans-SC-Regular.ttf
new file mode 100644
index 0000000..6ab4b5c
Binary files /dev/null and b/assets/fonts/NotoSans-SC-Regular.ttf differ
diff --git a/assets/fonts/NotoSans-TC-Bold.ttf b/assets/fonts/NotoSans-TC-Bold.ttf
new file mode 100644
index 0000000..0c7ddb7
Binary files /dev/null and b/assets/fonts/NotoSans-TC-Bold.ttf differ
diff --git a/assets/fonts/NotoSans-TC-Regular.ttf b/assets/fonts/NotoSans-TC-Regular.ttf
new file mode 100644
index 0000000..1c8c168
Binary files /dev/null and b/assets/fonts/NotoSans-TC-Regular.ttf differ
diff --git a/assets/fonts/OFL.txt b/assets/fonts/OFL.txt
new file mode 100644
index 0000000..7d7fbd8
--- /dev/null
+++ b/assets/fonts/OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/docs/architecture.md b/docs/architecture.md
index e9c0ed5..075ac76 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -1,6 +1,6 @@
# Architecture
-AlterSend is a monorepo with two apps (desktop, mobile) sharing three packages (core, domain, components). All P2P networking runs in a Bare worklet process, isolated from both the UI and the host runtime.
+AlterSend is a monorepo with two apps (desktop, mobile) sharing four packages (core, domain, components, i18n). All P2P networking runs in a Bare worklet process, isolated from both the UI and the host runtime.
## Repository layout
@@ -12,6 +12,7 @@ packages/
core/ P2P protocol — Hyperswarm, Hyperdrive, RPC, transfer orchestration
domain/ State management — Zustand store, reducers, business logic
components/ Shared UI — React Strict DOM components, Tailwind tokens
+ i18n/ Shared locale metadata, i18next setup, and catalogs
```
## Data flow
@@ -49,7 +50,6 @@ packages/
The protocol layer. Runs entirely inside a **Bare worklet** — a lightweight JS runtime (Bare) spawned by the host app. This isolates P2P networking from Electron / React Native.
Key modules:
-
- `worklet/index.ts` — entrypoint; wires Bare IPC → RPC server → orchestrator
- `worklet/transfer/orchestrator.ts` — top-level coordinator; owns session lifecycle + state and composes the three subsystems below
- `worklet/transfer/swarm.ts` — `TransferSwarm`: Hyperswarm peer connectivity, Corestore replication, and per-peer control channels
@@ -64,7 +64,6 @@ Key modules:
State and business logic, shared across desktop and mobile.
Key modules:
-
- `transfer/store.ts` — Zustand store
- `transfer/reducer.ts` — pure reducer (all state transitions)
- `transfer/binding.ts` — `bindTransferApi()` wires the store to the core worklet
@@ -76,7 +75,7 @@ Shared React components using **React Strict DOM** (works on both web and native
### `packages/locales`
-Shared multi-language (i18n) setup, consumed by both apps. Translations are JSON split by context (`common`, `send`, …) under `src/locales/<code>/`, with vanilla **i18next** initialized via **react-i18next** bindings; formatting leans on the platform `Intl` APIs. Each language declares a `productionReady` flag in its `meta.json`, and only ready languages are offered (`PICKABLE_LANGUAGES`); `resolveSupportedLocale()` normalizes any system/persisted BCP-47 tag down to a ready code. Locale preference lives in a small settings store in `packages/domain`; persistence is app-side (`localStorage` on desktop, a file on mobile). The picker UI is gated behind the `MULTI_LANG_ENABLED` release flag (currently `false`) so the app ships single-language until translations land. See `packages/locales/README.md` for the add-a-language guide.
+Shared internationalization package used by desktop and mobile. It owns supported locale metadata, locale preference resolution, i18next initialization, and bundled translation catalogs. The app-facing language UI is currently release-gated by `isMultiLangEnabled = false`; while disabled, desktop and mobile hide language pickers and force the active locale to `en-US`. See [i18n.md](i18n.md) for catalog structure and translation workflow.
## Transfer flow
diff --git a/docs/i18n.md b/docs/i18n.md
new file mode 100644
index 0000000..f11f114
--- /dev/null
+++ b/docs/i18n.md
@@ -0,0 +1,57 @@
+# Internationalization
+
+AlterSend uses `@altersend/locales` for shared locale metadata, locale resolution, i18next setup, and translation catalogs.
+
+The language UI is currently release-gated by `isMultiLangEnabled = false`. While the flag is disabled, apps keep initializing i18next but force the active locale to `en-US` and hide language selection UI. Flip the flag only when the translated release is ready for user-facing rollout.
+
+## Supported Locales
+
+The production locale set is:
+
+- `en-US`
+- `en-GB`
+- `ja-JP`
+- `ko-KR`
+- `zh-CN`
+- `zh-TW`
+- `fr-FR`
+- `de-DE`
+- `it-IT`
+- `pt-BR`
+- `es-419`
+- `es-ES`
+
+`system` is a preference, not a concrete locale. It is resolved with `resolveLocalePreference(preference, systemLocales)` and falls back to `en-US` when no supported match exists. App startup should use `resolveActiveLocalePreference(preference, systemLocales)` so the release gate is applied consistently.
+
+All currently published locales are LTR. Locale metadata has a `dir` field so RTL can be added later, but RTL is not part of this release surface.
+
+## Catalog Layout
+
+Catalogs live in `packages/locales/src/locales/<locale>/<namespace>.json`.
+
+Namespaces:
+
+- `common`
+- `send`
+- `receive`
+- `settings`
+- `onboarding`
+- `feedback`
+- `errors`
+- `native`
+
+Use stable, semantic keys grouped by screen or behavior. Prefer `send.status.uploaded` over keys that describe a visual location. Use i18next plural keys with `count`, `_one`, and `_other`.
+
+## Adding a Locale
+
+1. Add the locale to `SUPPORTED_LOCALES` in `packages/locales/src/locale.ts`.
+2. Add `packages/locales/src/locales/<locale>/` with every namespace file.
+3. Add the locale imports to `packages/locales/src/resources.ts`.
+4. Run `npm test -w packages/locales`.
+5. Run app typechecks and visually inspect long labels on desktop and mobile.
+
+## Review Workflow
+
+AI-generated translations are acceptable as a first draft, but they must keep every key present and non-empty. Before release, review visible flows in at least `de-DE`, `fr-FR`, `es-419`, `ja-JP`, and `zh-TW`, because those catch most length and script issues.
+
+Do not add `skip` or `todo` tests for missing translation work. Keep catalog parity tests passing instead.
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 2c44900..fe13cfc 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -96,6 +96,7 @@ export default tseslint.config(
files: [
'packages/components/src/theme/tokens.raw.ts',
'packages/components/src/theme/tokens.css.ts',
+ 'packages/components/src/theme/tokens.css.native.ts',
'packages/components/src/theme/withAlpha.ts',
'packages/components/src/theme/fileTypeColors.ts',
'packages/components/src/theme/themes/*.ts',
diff --git a/knip.json b/knip.json
index 9d53b9d..4335e2b 100644
--- a/knip.json
+++ b/knip.json
@@ -6,9 +6,7 @@
"project": ["scripts/**/*.{js,cjs,mjs}"],
"ignoreDependencies": [
"expo",
- "react",
- "react-dom",
- "react-native"
+ "react-dom"
]
},
"packages/core": {
@@ -18,14 +16,11 @@
"entry": ["src/**/*.test.ts"]
},
"packages/locales": {
- "entry": ["src/**/*.test.ts"]
+ "entry": ["src/**/*.test.ts"],
+ "project": ["src/**/*.{ts,tsx}"]
},
"packages/components": {
"entry": [
- "src/index.ts",
- "src/theme/index.ts",
- "src/theme/tokens.raw.ts",
- "src/icons/index.ts",
"scripts/*.mjs",
".storybook/{main,preview}.{ts,tsx}",
"src/**/*.stories.{ts,tsx}"
@@ -50,7 +45,6 @@
"src/**/*.{ts,tsx,cjs}",
"scripts/**/*.{js,cjs,mjs}"
],
- "ignoreUnresolved": ["^\\./sentry-dsn\\.gen\\.js$"],
"ignoreDependencies": [
"b4a",
"bare-rpc",
@@ -59,12 +53,14 @@
"hyperdrive",
"hyperswarm",
"pear-runtime-updater",
- "tailwindcss",
"@electron-forge/maker-dmg",
"@electron-forge/maker-msix",
"@electron-forge/maker-squirrel",
"app-builder-lib"
],
+ "ignoreUnresolved": [
+ "^\\./sentry-dsn\\.gen\\.js$"
+ ],
"ignoreBinaries": [
"electron-builder.mac.json",
"electron-builder.linux.json"
diff --git a/package-lock.json b/package-lock.json
index 6a766f3..072fdcd 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -122,6 +122,7 @@
"expo-constants": "~55.0.7",
"expo-document-picker": "~55.0.13",
"expo-file-system": "~55.0.16",
+ "expo-font": "~55.0.7",
"expo-haptics": "~15.0.7",
"expo-image-picker": "~55.0.18",
"expo-linking": "~55.0.13",
@@ -27092,7 +27093,8 @@
"react-dom": "^19.2.4",
"storybook": "^10.2.13",
"typescript": "^5.9.3",
- "vite": "^8.0.5"
+ "vite": "^8.0.5",
+ "vitest": "^4.1.8"
},
"peerDependencies": {
"lucide-react": "*",
@@ -27282,7 +27284,6 @@
},
"devDependencies": {
"@types/react": "^19.0.0",
- "i18next": "^26.2.0",
"react": "19.2.0",
"typescript": "^5.9.3",
"vitest": "^4.1.8",
diff --git a/package.json b/package.json
index b105118..794fdf5 100644
--- a/package.json
+++ b/package.json
@@ -17,6 +17,8 @@
"desktop:build": "npm run build -w packages/core && npm run build -w packages/locales && npm run build -w packages/domain && npm run build -w packages/components && npm run build -w apps/desktop",
"components:build": "npm run build -w packages/components",
"domain:build": "npm run build -w packages/domain",
+ "locales:build": "npm run build -w packages/locales",
+ "locales:typecheck": "npm run typecheck -w packages/locales",
"components:typecheck": "npm run typecheck -w packages/components",
"components:storybook": "npm run storybook -w packages/components",
"components:build-storybook": "npm run build-storybook -w packages/components",
diff --git a/packages/components/package.json b/packages/components/package.json
index d271314..ffd11a0 100644
--- a/packages/components/package.json
+++ b/packages/components/package.json
@@ -10,21 +10,25 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
+ "react-native": "./src/index.ts",
"import": "./dist/index.js",
"require": "./dist/index.js"
},
"./theme": {
"types": "./dist/theme/index.d.ts",
+ "react-native": "./src/theme/index.ts",
"import": "./dist/theme/index.js",
"require": "./dist/theme/index.js"
},
"./theme/raw": {
"types": "./dist/theme/tokens.raw.d.ts",
+ "react-native": "./src/theme/tokens.raw.ts",
"import": "./dist/theme/tokens.raw.js",
"require": "./dist/theme/tokens.raw.js"
},
"./icons": {
"types": "./dist/icons/index.d.ts",
+ "react-native": "./src/icons/index.ts",
"import": "./dist/icons/index.js",
"require": "./dist/icons/index.js"
},
@@ -42,6 +46,8 @@
"generate-tokens": "node scripts/generate-tokens.mjs",
"build": "npm run generate-tokens && tsc --project tsconfig.build.json && node scripts/fix-esm-imports.mjs",
"typecheck": "npm run generate-tokens && tsc --noEmit",
+ "test": "vitest run",
+ "test:watch": "vitest",
"storybook": "storybook dev -p 6100",
"build-storybook": "storybook build"
},
@@ -77,6 +83,7 @@
"react-dom": "^19.2.4",
"storybook": "^10.2.13",
"typescript": "^5.9.3",
- "vite": "^8.0.5"
+ "vite": "^8.0.5",
+ "vitest": "^4.1.8"
}
}
diff --git a/packages/components/scripts/generate-tokens.mjs b/packages/components/scripts/generate-tokens.mjs
index c950db2..fd4f0b9 100644
--- a/packages/components/scripts/generate-tokens.mjs
+++ b/packages/components/scripts/generate-tokens.mjs
@@ -7,7 +7,7 @@ const root = join(__dirname, '..');
const sourcePath = join(root, 'src', 'theme', 'tokens.json');
const tokens = JSON.parse(readFileSync(sourcePath, 'utf8'));
-const { colors, space, radius, fontSize, fontWeight, lineHeight, fontFamily } = tokens;
+const { colors, space, radius, fontSize, fontWeight, lineHeight, fontFamily, fontFamilyNative } = tokens;
function toCssValue(value) {
return typeof value === 'number' ? `${value}px` : value;
@@ -54,6 +54,37 @@ ${scaleEntriesAsString.map(([key, value]) => ` ${key}: ${JSON.stringify(value)}
export type Tokens = typeof tokens;
`;
+const tokensCssNativeTs = `${header}
+import { Platform } from 'react-native';
+import { css } from 'react-strict-dom';
+
+export interface NativeFontFamilyStack {
+ fontFamilySans: string;
+ fontFamilyDisplay: string;
+ fontFamilyMono: string;
+}
+
+export const nativeFontFamilies = ${JSON.stringify(fontFamilyNative, null, 2)} as Record<
+ 'ios' | 'android' | 'default',
+ NativeFontFamilyStack
+>;
+
+const nativeFontFamily =
+ Platform.select<NativeFontFamilyStack>(nativeFontFamilies) ?? nativeFontFamilies.default;
+
+export const tokens = css.defineVars({
+${darkColorEntries.map(([key, value]) => ` ${key}: '${toCssValue(value)}',`).join('\n')}
+${scaleEntriesAsCss.map(([key, value]) => ` ${key}: '${toCssValue(value)}',`).join('\n')}
+${fontWeightEntries.map(([key, value]) => ` ${key}: ${JSON.stringify(value)},`).join('\n')}
+${lineHeightEntries.map(([key, value]) => ` ${key}: ${JSON.stringify(value)},`).join('\n')}
+ fontFamilySans: nativeFontFamily.fontFamilySans,
+ fontFamilyDisplay: nativeFontFamily.fontFamilyDisplay,
+ fontFamilyMono: nativeFontFamily.fontFamilyMono,
+});
+
+export type Tokens = typeof tokens;
+`;
+
const tokensRawTs = `${header}
export const rawTokens = {
colors: {
@@ -147,6 +178,7 @@ ${lightColorEntries.map(([key, value]) => ` --as-${kebab(key)}: ${value};`).joi
const files = [
['src/theme/tokens.css.ts', tokensCssTs],
+ ['src/theme/tokens.css.native.ts', tokensCssNativeTs],
['src/theme/tokens.raw.ts', tokensRawTs],
['src/theme/themes/dark.ts', darkThemeTs],
['src/theme/themes/light.ts', lightThemeTs],
diff --git a/packages/components/src/components/CrashScreen/CrashScreen.tsx b/packages/components/src/components/CrashScreen/CrashScreen.tsx
index 346f745..4aa0ef5 100644
--- a/packages/components/src/components/CrashScreen/CrashScreen.tsx
+++ b/packages/components/src/components/CrashScreen/CrashScreen.tsx
@@ -5,17 +5,17 @@ import { styles } from './styles'
export interface CrashScreenProps {
error: Error
onRestart: () => void
- title?: string
+ title: string
description?: string
- restartLabel?: string
+ restartLabel: string
}
export function CrashScreen({
error,
onRestart,
- title = 'Something went wrong',
+ title,
description,
- restartLabel = 'Restart'
+ restartLabel
}: CrashScreenProps) {
return (
<html.div style={styles.root}>
diff --git a/packages/components/src/components/FeedbackTypeSelector/FeedbackTypeSelector.test.ts b/packages/components/src/components/FeedbackTypeSelector/FeedbackTypeSelector.test.ts
new file mode 100644
index 0000000..52cf7f8
--- /dev/null
+++ b/packages/components/src/components/FeedbackTypeSelector/FeedbackTypeSelector.test.ts
@@ -0,0 +1,27 @@
+import { readFileSync } from 'node:fs'
+import { describe, expect, it } from 'vitest'
+
+const source = readFileSync(new URL('./FeedbackTypeSelector.tsx', import.meta.url), 'utf8')
+
+function getStyleBlock(name: string, followingName: string): string {
+ const block = source.match(
+ new RegExp(`\\n ${name}: \\{([\\s\\S]*?)\\n \\},\\n ${followingName}`)
+ )?.[1]
+
+ expect(block).toBeDefined()
+ return block ?? ''
+}
+
+describe('FeedbackTypeSelector layout', () => {
+ it('keeps long translated labels inside fixed-height segments', () => {
+ const chipStyle = getStyleBlock('chip', 'chipDefault')
+ const labelStyle = getStyleBlock('label', 'labelDefault')
+
+ expect(chipStyle).toContain('minWidth: 0')
+ expect(chipStyle).toContain('minHeight:')
+ expect(labelStyle).toContain("overflow: 'hidden'")
+ expect(labelStyle).toContain("textOverflow: 'ellipsis'")
+ expect(labelStyle).toContain("whiteSpace: 'nowrap'")
+ expect(labelStyle).not.toContain('overflowWrap')
+ })
+})
diff --git a/packages/components/src/components/FeedbackTypeSelector/FeedbackTypeSelector.tsx b/packages/components/src/components/FeedbackTypeSelector/FeedbackTypeSelector.tsx
index e22aac0..c22769b 100644
--- a/packages/components/src/components/FeedbackTypeSelector/FeedbackTypeSelector.tsx
+++ b/packages/components/src/components/FeedbackTypeSelector/FeedbackTypeSelector.tsx
@@ -1,13 +1,14 @@
import { css, html } from 'react-strict-dom'
import { tokens } from '../../theme/tokens.css'
-const TYPES = ['Bug report', 'Feature request', 'General'] as const
+const TYPES = ['bug', 'feature', 'general'] as const
export type FeedbackType = (typeof TYPES)[number]
export { TYPES as FEEDBACK_TYPES }
interface FeedbackTypeSelectorProps {
value: FeedbackType
onChange: (type: FeedbackType) => void
+ labels: Record<FeedbackType, string>
disabled?: boolean
}
@@ -23,10 +24,12 @@ const styles = css.create({
chip: {
display: 'flex',
flex: 1,
+ minWidth: 0,
+ minHeight: 40,
borderRadius: tokens.radiusSm,
borderWidth: 0,
- paddingTop: 10,
- paddingBottom: 10,
+ paddingTop: 8,
+ paddingBottom: 8,
paddingLeft: 8,
paddingRight: 8,
alignItems: 'center',
@@ -34,8 +37,7 @@ const styles = css.create({
cursor: 'pointer',
transitionProperty: 'background-color',
transitionDuration: '150ms',
- transitionTimingFunction: 'ease',
- whiteSpace: 'nowrap'
+ transitionTimingFunction: 'ease'
},
chipDefault: {
backgroundColor: 'transparent'
@@ -52,8 +54,11 @@ const styles = css.create({
fontFamily: tokens.fontFamilySans,
fontSize: tokens.fontSizeMd,
fontWeight: tokens.fontWeightMedium,
+ overflow: 'hidden',
textAlign: 'center',
- whiteSpace: 'nowrap'
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+ width: '100%'
},
labelDefault: {
color: tokens.colorTextMuted
@@ -63,7 +68,12 @@ const styles = css.create({
}
})
-export function FeedbackTypeSelector({ value, onChange, disabled }: FeedbackTypeSelectorProps) {
+export function FeedbackTypeSelector({
+ value,
+ onChange,
+ labels,
+ disabled
+}: FeedbackTypeSelectorProps) {
return (
<html.div style={styles.track}>
{TYPES.map((t) => {
@@ -82,7 +92,7 @@ export function FeedbackTypeSelector({ value, onChange, disabled }: FeedbackType
<html.span
style={[styles.label, selected ? styles.labelSelected : styles.labelDefault]}
>
- {t}
+ {labels[t]}
</html.span>
</html.button>
)
diff --git a/packages/components/src/components/Input/Input.android.tsx b/packages/components/src/components/Input/Input.android.tsx
new file mode 100644
index 0000000..95cd4be
--- /dev/null
+++ b/packages/components/src/components/Input/Input.android.tsx
@@ -0,0 +1,215 @@
+import { useId, useState, type ReactNode } from 'react'
+import { StyleSheet, Text, TextInput, View, type TextInputProps } from 'react-native'
+import { LockIcon } from '../../icons'
+import { rawTokens, useTheme } from '../../theme'
+
+type InputChangeEvent = {
+ target: { value: string }
+ type: 'change'
+}
+
+export interface InputProps extends Omit<
+ TextInputProps,
+ 'editable' | 'onChange' | 'onChangeText' | 'secureTextEntry' | 'style'
+> {
+ description?: string
+ disabled?: boolean
+ error?: string
+ icon?: ReactNode
+ label?: string
+ mono?: boolean
+ onChange?: (event: InputChangeEvent) => void
+ onChangeText?: (text: string) => void
+ readOnly?: boolean
+ secure?: boolean
+ trailing?: ReactNode
+ type?: string
+}
+
+export function Input({
+ description,
+ disabled = false,
+ error,
+ icon,
+ id,
+ label,
+ mono = false,
+ onBlur,
+ onChange,
+ onChangeText,
+ onFocus,
+ readOnly = false,
+ secure = false,
+ trailing,
+ type,
+ ...props
+}: InputProps) {
+ const generatedId = useId()
+ const inputId = id ?? generatedId
+ const { fontFamilyName, theme } = useTheme()
+ const [isFocused, setIsFocused] = useState(false)
+ const hasError = Boolean(error)
+ const resolvedIcon = secure ? <LockIcon size={13} /> : icon
+ const useWrapper = Boolean(resolvedIcon || trailing)
+ const textColor = disabled ? theme.colors.colorTextMuted : theme.colors.colorTextPrimary
+ const borderColor = hasError
+ ? theme.colors.colorDanger
+ : isFocused
+ ? theme.colors.colorFocusRing
+ : theme.colors.colorBorderPrimary
+ const fontFamilyStyle = fontFamilyName ? { fontFamily: fontFamilyName } : null
+
+ const handleChangeText = (text: string) => {
+ onChangeText?.(text)
+ onChange?.({ target: { value: text }, type: 'change' })
+ }
+
+ const handleFocus: NonNullable<TextInputProps['onFocus']> = (event) => {
+ setIsFocused(true)
+ onFocus?.(event)
+ }
+
+ const handleBlur: NonNullable<TextInputProps['onBlur']> = (event) => {
+ setIsFocused(false)
+ onBlur?.(event)
+ }
+
+ const input = (
+ <TextInput
+ {...props}
+ accessibilityLabel={label}
+ accessibilityState={{ disabled }}
+ editable={!disabled && !readOnly}
+ id={inputId}
+ key={fontFamilyName ?? 'system'}
+ onBlur={handleBlur}
+ onChangeText={handleChangeText}
+ onFocus={handleFocus}
+ placeholderTextColor={theme.colors.colorTextMuted}
+ secureTextEntry={type === 'password'}
+ style={[
+ styles.input,
+ {
+ color: textColor
+ },
+ fontFamilyStyle,
+ mono && styles.inputMono,
+ !useWrapper && styles.fieldInput
+ ]}
+ underlineColorAndroid='transparent'
+ />
+ )
+
+ return (
+ <View style={styles.root}>
+ {label ? (
+ <Text style={[styles.label, { color: theme.colors.colorTextMuted }, fontFamilyStyle]}>
+ {label}
+ </Text>
+ ) : null}
+
+ {useWrapper ? (
+ <View
+ style={[
+ styles.iconWrapper,
+ {
+ backgroundColor: theme.colors.colorBackgroundSubtle,
+ borderColor
+ }
+ ]}
+ >
+ {resolvedIcon ? <View style={styles.iconSlot}>{resolvedIcon}</View> : null}
+ {input}
+ {trailing ? (
+ <View style={[styles.trailingSlot, { borderColor: theme.colors.colorBorderPrimary }]}>
+ {trailing}
+ </View>
+ ) : null}
+ </View>
+ ) : (
+ <View
+ style={[
+ styles.field,
+ {
+ backgroundColor: theme.colors.colorBackgroundSubtle,
+ borderColor
+ }
+ ]}
+ >
+ {input}
+ </View>
+ )}
+
+ {error || description ? (
+ <Text
+ style={[
+ styles.hint,
+ {
+ color: error ? theme.colors.colorDanger : theme.colors.colorTextMuted
+ },
+ fontFamilyStyle
+ ]}
+ >
+ {error ?? description}
+ </Text>
+ ) : null}
+ </View>
+ )
+}
+
+const styles = StyleSheet.create({
+ root: {
+ gap: rawTokens.space.space2,
+ width: '100%'
+ },
+ label: {
+ fontSize: rawTokens.fontSize.fontSizeXs,
+ fontWeight: '600',
+ letterSpacing: 1.3,
+ lineHeight: 16,
+ textTransform: 'uppercase'
+ },
+ field: {
+ borderRadius: rawTokens.radius.radiusSm,
+ borderWidth: 1,
+ minHeight: 48
+ },
+ fieldInput: {
+ paddingHorizontal: rawTokens.space.space4
+ },
+ iconWrapper: {
+ alignItems: 'center',
+ borderRadius: rawTokens.radius.radiusSm,
+ borderWidth: 1,
+ flexDirection: 'row',
+ gap: rawTokens.space.space25,
+ minHeight: 48,
+ paddingLeft: rawTokens.space.space35
+ },
+ iconSlot: {
+ alignItems: 'center',
+ justifyContent: 'center'
+ },
+ input: {
+ flex: 1,
+ fontSize: rawTokens.fontSize.fontSizeLg,
+ minWidth: 0,
+ paddingHorizontal: 0,
+ paddingVertical: 0,
+ textAlignVertical: 'center'
+ },
+ inputMono: {
+ fontSize: rawTokens.fontSize.fontSizeBase
+ },
+ trailingSlot: {
+ alignItems: 'center',
+ alignSelf: 'stretch',
+ borderLeftWidth: 1,
+ justifyContent: 'center',
+ width: 48
+ },
+ hint: {
+ fontSize: rawTokens.fontSize.fontSizeMd,
+ lineHeight: 18
+ }
+})
diff --git a/packages/components/src/components/Input/index.ts b/packages/components/src/components/Input/index.ts
index e7313ae..3d46975 100644
--- a/packages/components/src/components/Input/index.ts
+++ b/packages/components/src/components/Input/index.ts
@@ -1,2 +1,2 @@
-// Platform-specific export - Metro/Expo will automatically use Input.native.tsx on React Native
+// Platform-specific export - Metro/Expo will automatically use Input.android.tsx on Android.
export { Input, type InputProps } from './Input'
diff --git a/packages/components/src/components/PeerListCard/PeerListCard.tsx b/packages/components/src/components/PeerListCard/PeerListCard.tsx
index b4fdd0a..9933ee6 100644
--- a/packages/components/src/components/PeerListCard/PeerListCard.tsx
+++ b/packages/components/src/components/PeerListCard/PeerListCard.tsx
@@ -14,6 +14,10 @@ export interface PeerListCardEntry {
interface PeerListCardProps {
entries: PeerListCardEntry[]
+ labels: {
+ title: string
+ connectedCount: (count: number) => string
+ }
}
const DOT_TONE = {
@@ -32,16 +36,16 @@ const TEXT_TONE = {
disconnected: styles.textDisconnected
} as const
-export function PeerListCard({ entries }: PeerListCardProps) {
+export function PeerListCard({ entries, labels }: PeerListCardProps) {
if (entries.length === 0) return null
const activeCount = entries.filter((entry) => entry.status !== 'disconnected').length
- const peersLabel = activeCount === 1 ? '1 connected' : `${activeCount} connected`
+ const peersLabel = labels.connectedCount(activeCount)
return (
<html.section style={styles.section}>
<html.div style={styles.header}>
- <html.p style={styles.headerLabel}>Devices</html.p>
+ <html.p style={styles.headerLabel}>{labels.title}</html.p>
<html.p style={styles.headerCount}>{peersLabel}</html.p>
</html.div>
diff --git a/packages/components/src/components/SendFileListRow/SendFileListRow.tsx b/packages/components/src/components/SendFileListRow/SendFileListRow.tsx
index 73660e2..acff72c 100644
--- a/packages/components/src/components/SendFileListRow/SendFileListRow.tsx
+++ b/packages/components/src/components/SendFileListRow/SendFileListRow.tsx
@@ -9,7 +9,7 @@ import { formatFileSize } from '../../utils/formatFileSize'
export type FileRowStatusTone = 'muted' | 'active' | 'success'
export type FileRowProgressState = 'waiting' | 'uploading' | 'completed'
-export interface SendFileListRowProps {
+interface SendFileListRowBaseProps {
name: string
size?: number
description?: string
@@ -17,13 +17,23 @@ export interface SendFileListRowProps {
compact?: boolean
bare?: boolean
disabled?: boolean
- onRemove?: () => void
- trailing?: ReactNode
status?: { label: string; tone?: FileRowStatusTone }
progress?: FileRowProgressState
progressPercent?: number
}
+export type SendFileListRowProps =
+ | (SendFileListRowBaseProps & {
+ onRemove: () => void
+ removeLabel: string
+ trailing?: ReactNode
+ })
+ | (SendFileListRowBaseProps & {
+ onRemove?: undefined
+ removeLabel?: undefined
+ trailing?: ReactNode
+ })
+
const THUMB_STYLE_BY_KIND = {
image: styles.thumbImage,
video: styles.thumbVideo,
@@ -56,6 +66,7 @@ export function SendFileListRow({
isFirst = false,
disabled = false,
onRemove,
+ removeLabel,
trailing,
status,
progress,
@@ -131,7 +142,7 @@ export function SendFileListRow({
: (trailing ??
(onRemove ? (
<html.button
- aria-label={`Remove ${name}`}
+ aria-label={removeLabel}
onClick={onRemove}
style={[styles.removeButton, compact && styles.removeButtonCompact]}
type='button'
diff --git a/packages/components/src/theme/ThemeContext.tsx b/packages/components/src/theme/ThemeContext.tsx
index 5b4546e..f0beb00 100644
--- a/packages/components/src/theme/ThemeContext.tsx
+++ b/packages/components/src/theme/ThemeContext.tsx
@@ -1,9 +1,12 @@
-import { createContext, useContext, useState, type ReactNode } from 'react'
+import { createContext, useContext, useEffect, useMemo, useState, type ReactNode } from 'react'
import { css, html } from 'react-strict-dom'
import { darkTheme } from './themes/dark'
import { lightTheme } from './themes/light'
import { darkThemeStyle } from './themes/dark.css'
import { lightThemeStyle } from './themes/light.css'
+import { DEFAULT_FONT_FAMILY_KEY, getNativeFontFamilyName, type FontFamilyKey } from './fonts'
+import { getFontFamilyCssVariables, type FontFamilyCssVariables } from './fontCssVariables'
+import { fontThemeStyles } from './fontThemes.css'
import type { Theme } from './types'
import { ThemeType } from './types'
@@ -19,30 +22,79 @@ function getTheme(type: ThemeType): Theme {
}
}
-function getThemeStyle(type: ThemeType): HtmlDivStyle {
+function getThemeStyle(type: ThemeType) {
switch (type) {
case ThemeType.Light:
- return [lightThemeStyle] as unknown as HtmlDivStyle
+ return lightThemeStyle
case ThemeType.Dark:
default:
- return [darkThemeStyle] as unknown as HtmlDivStyle
+ return darkThemeStyle
}
}
+function getFontThemeStyle(fontFamily: FontFamilyKey) {
+ return fontThemeStyles[fontFamily] ?? fontThemeStyles[DEFAULT_FONT_FAMILY_KEY]
+}
+
+const FONT_CUSTOM_PROPERTIES = [
+ '--as-font-family-sans',
+ '--as-font-family-display',
+ '--as-font-family-mono'
+] as const
+
+interface FontRootSnapshot {
+ element: HTMLElement
+ customProperties: Record<(typeof FONT_CUSTOM_PROPERTIES)[number], string>
+ fontFamily: string
+}
+
+function applyFontFamilyCssVariables(element: HTMLElement, variables: FontFamilyCssVariables) {
+ for (const property of FONT_CUSTOM_PROPERTIES) {
+ element.style.setProperty(property, variables[property])
+ }
+ element.style.fontFamily = variables.fontFamily
+}
+
+function snapshotFontRoot(element: HTMLElement): FontRootSnapshot {
+ return {
+ element,
+ customProperties: {
+ '--as-font-family-sans': element.style.getPropertyValue('--as-font-family-sans'),
+ '--as-font-family-display': element.style.getPropertyValue('--as-font-family-display'),
+ '--as-font-family-mono': element.style.getPropertyValue('--as-font-family-mono')
+ },
+ fontFamily: element.style.fontFamily
+ }
+}
+
+function restoreFontRoot(snapshot: FontRootSnapshot) {
+ for (const property of FONT_CUSTOM_PROPERTIES) {
+ const value = snapshot.customProperties[property]
+ if (value) snapshot.element.style.setProperty(property, value)
+ else snapshot.element.style.removeProperty(property)
+ }
+ snapshot.element.style.fontFamily = snapshot.fontFamily
+}
+
interface ThemeContextValue {
theme: Theme
themeType: ThemeType
+ fontFamily: FontFamilyKey
+ fontFamilyName: string | undefined
setTheme: (theme: ThemeType) => void
}
const ThemeContext = createContext<ThemeContextValue>({
theme: darkTheme,
themeType: ThemeType.Dark,
+ fontFamily: DEFAULT_FONT_FAMILY_KEY,
+ fontFamilyName: getNativeFontFamilyName(DEFAULT_FONT_FAMILY_KEY),
setTheme: () => {}
})
interface ThemeProviderProps {
theme?: ThemeType
+ fontFamily?: FontFamilyKey
children: ReactNode
}
@@ -57,20 +109,39 @@ const styles = css.create({
export function ThemeProvider({
theme: initialTheme = ThemeType.Dark,
+ fontFamily = DEFAULT_FONT_FAMILY_KEY,
children
}: ThemeProviderProps) {
const [themeType, setThemeType] = useState<ThemeType>(initialTheme)
const themeStyle = getThemeStyle(themeType)
+ const fontThemeStyle = getFontThemeStyle(fontFamily)
+ const fontFamilyName = getNativeFontFamilyName(fontFamily)
+ const fontRootStyle = useMemo(() => getFontFamilyCssVariables(fontFamily), [fontFamily])
+
+ useEffect(() => {
+ if (typeof document === 'undefined') return
+
+ const roots = [document.documentElement, document.body].filter(Boolean)
+ const snapshots = roots.map(snapshotFontRoot)
+ roots.forEach((root) => applyFontFamilyCssVariables(root, fontRootStyle))
+
+ return () => snapshots.forEach(restoreFontRoot)
+ }, [fontRootStyle])
return (
<ThemeContext.Provider
value={{
theme: getTheme(themeType),
themeType,
+ fontFamily,
+ fontFamilyName,
setTheme: setThemeType
}}
>
- <html.div data-theme={themeType} style={themeStyle}>
+ <html.div
+ data-theme={themeType}
+ style={[themeStyle, fontThemeStyle, fontRootStyle] as unknown as HtmlDivStyle}
+ >
<html.div style={styles.root}>{children}</html.div>
</html.div>
</ThemeContext.Provider>
diff --git a/packages/components/src/theme/fontCssVariables.ts b/packages/components/src/theme/fontCssVariables.ts
new file mode 100644
index 0000000..6c1fa61
--- /dev/null
+++ b/packages/components/src/theme/fontCssVariables.ts
@@ -0,0 +1,40 @@
+import {
+ BUNDLED_FONT_FAMILIES,
+ DEFAULT_FONT_FAMILY_KEY,
+ MONO_FONT_FAMILY_CSS,
+ type FontFamilyKey
+} from './fonts'
+
+export interface FontFamilyCssVariables {
+ '--as-font-family-sans': string
+ '--as-font-family-display': string
+ '--as-font-family-mono': string
+ fontFamily: string
+}
+
+function getBundledCssFamily(fontFamily: FontFamilyKey) {
+ return (
+ BUNDLED_FONT_FAMILIES[fontFamily]?.cssFamily ??
+ BUNDLED_FONT_FAMILIES[DEFAULT_FONT_FAMILY_KEY].cssFamily
+ )
+}
+
+function quoteFontFamily(cssFamily: string) {
+ return `"${cssFamily.replace(/"/g, '\\"')}"`
+}
+
+function getCssFontFamilyValue(cssFamily: string) {
+ return cssFamily.includes(',') ? cssFamily : quoteFontFamily(cssFamily)
+}
+
+export function getFontFamilyCssVariables(fontFamily: FontFamilyKey): FontFamilyCssVariables {
+ const cssFamily = getBundledCssFamily(fontFamily)
+ const cssFontFamily = getCssFontFamilyValue(cssFamily)
+
+ return {
+ '--as-font-family-sans': cssFontFamily,
+ '--as-font-family-display': cssFontFamily,
+ '--as-font-family-mono': MONO_FONT_FAMILY_CSS,
+ fontFamily: cssFamily
+ }
+}
diff --git a/packages/components/src/theme/fontFamily.test.ts b/packages/components/src/theme/fontFamily.test.ts
new file mode 100644
index 0000000..9d22958
--- /dev/null
+++ b/packages/components/src/theme/fontFamily.test.ts
@@ -0,0 +1,201 @@
+import { existsSync, readFileSync } from 'node:fs'
+import { describe, expect, it } from 'vitest'
+
+import {
+ BUNDLED_FONT_FAMILIES,
+ LATIN_FONT_FAMILY_CSS,
+ MONO_FONT_FAMILY_CSS,
+ MONO_FONT_FAMILY_NATIVE,
+ getNativeFontFamilyName
+} from './fonts'
+import { getFontFamilyCssVariables } from './fontCssVariables'
+import { rawTokens } from './tokens.raw'
+import tokenSource from './tokens.json'
+
+describe('font family tokens', () => {
+ it('uses the native Latin stack for default sans and display UI text', () => {
+ expect(rawTokens.fontFamily.fontFamilySans).toBe(LATIN_FONT_FAMILY_CSS)
+ expect(rawTokens.fontFamily.fontFamilyDisplay).toBe(
+ '"SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif'
+ )
+ expect(rawTokens.fontFamily.fontFamilySans).not.toContain('AlterSend Sans')
+ expect(rawTokens.fontFamily.fontFamilyDisplay).not.toContain('AlterSend Sans')
+ })
+
+ it('uses a true monospace stack for mono UI text', () => {
+ expect(rawTokens.fontFamily.fontFamilyMono).toBe(MONO_FONT_FAMILY_CSS)
+ expect(rawTokens.fontFamily.fontFamilyMono).toContain('monospace')
+ expect(rawTokens.fontFamily.fontFamilyMono).toContain('"SFMono-Regular"')
+ expect(rawTokens.fontFamily.fontFamilyMono).toContain('"Menlo"')
+ expect(rawTokens.fontFamily.fontFamilyMono).toContain('"Monaco"')
+ expect(rawTokens.fontFamily.fontFamilyMono).toContain('"Consolas"')
+ expect(rawTokens.fontFamily.fontFamilyMono).toContain(',')
+ })
+
+ it('declares bundled font assets only for CJK script families', () => {
+ expect(Object.keys(BUNDLED_FONT_FAMILIES).sort()).toEqual([
+ 'japanese',
+ 'korean',
+ 'latin',
+ 'simplifiedChinese',
+ 'traditionalChinese'
+ ])
+ expect(BUNDLED_FONT_FAMILIES.latin.assetFileName).toBeUndefined()
+ expect(getNativeFontFamilyName('latin')).toBeUndefined()
+
+ for (const font of Object.values(BUNDLED_FONT_FAMILIES).filter((item) => item.assetFileName)) {
+ expect(font.cssFamily).toMatch(/^AlterSend Sans/)
+ expect(font.assetFileName).toMatch(/\.(ttf|otf)$/)
+ expect(
+ existsSync(new URL(`../../../../assets/fonts/${font.assetFileName}`, import.meta.url))
+ ).toBe(true)
+
+ if (font.boldAssetFileName) {
+ expect(font.boldAssetFileName).toMatch(/\.(ttf|otf)$/)
+ expect(
+ existsSync(new URL(`../../../../assets/fonts/${font.boldAssetFileName}`, import.meta.url))
+ ).toBe(true)
+ }
+ }
+ })
+
+ it('uses static regular and bold CJK font assets for native weight rendering', () => {
+ expect(BUNDLED_FONT_FAMILIES.japanese).toMatchObject({
+ assetFileName: 'NotoSans-JP-Regular.ttf',
+ boldAssetFileName: 'NotoSans-JP-Bold.ttf'
+ })
+ expect(BUNDLED_FONT_FAMILIES.korean).toMatchObject({
+ assetFileName: 'NotoSans-KR-Regular.ttf',
+ boldAssetFileName: 'NotoSans-KR-Bold.ttf'
+ })
+ expect(BUNDLED_FONT_FAMILIES.simplifiedChinese).toMatchObject({
+ assetFileName: 'NotoSans-SC-Regular.ttf',
+ boldAssetFileName: 'NotoSans-SC-Bold.ttf'
+ })
+ expect(BUNDLED_FONT_FAMILIES.traditionalChinese).toMatchObject({
+ assetFileName: 'NotoSans-TC-Regular.ttf',
+ boldAssetFileName: 'NotoSans-TC-Bold.ttf'
+ })
+ })
+
+ it('keeps native UI font stacks compatible with React Native', () => {
+ const nativeTokenSource = readFileSync(
+ new URL('./tokens.css.native.ts', import.meta.url),
+ 'utf8'
+ )
+
+ expect(nativeTokenSource).toContain('export const nativeFontFamilies')
+
+ expect(tokenSource.fontFamilyNative.ios.fontFamilyMono).toBe(MONO_FONT_FAMILY_NATIVE.ios)
+ expect(tokenSource.fontFamilyNative.android.fontFamilyMono).toBe(
+ MONO_FONT_FAMILY_NATIVE.android
+ )
+ expect(tokenSource.fontFamilyNative.default.fontFamilyMono).toBe(
+ MONO_FONT_FAMILY_NATIVE.default
+ )
+ expect(tokenSource.fontFamilyNative.ios.fontFamilySans).toBe('System')
+ expect(tokenSource.fontFamilyNative.ios.fontFamilyDisplay).toBe('System')
+ expect(tokenSource.fontFamilyNative.android.fontFamilySans).toBe('sans-serif')
+ expect(tokenSource.fontFamilyNative.android.fontFamilyDisplay).toBe('sans-serif')
+
+ for (const stack of Object.values(tokenSource.fontFamilyNative)) {
+ for (const fontFamily of Object.values(stack)) {
+ expect(fontFamily).not.toContain(',')
+ expect(fontFamily).not.toContain('"')
+ }
+ }
+ })
+
+ it('keeps Android TextInput away from clipped custom font metrics', () => {
+ const androidInputSource = readFileSync(
+ new URL('../components/Input/Input.android.tsx', import.meta.url),
+ 'utf8'
+ )
+ const webInputSource = readFileSync(
+ new URL('../components/Input/Input.tsx', import.meta.url),
+ 'utf8'
+ )
+ const getStyleBlock = (name: string, followingName: string) =>
+ androidInputSource.match(
+ new RegExp(`\\n ${name}: \\{([\\s\\S]*?)\\n \\},\\n ${followingName}`)
+ )?.[1]
+
+ const fieldStyleBlock = getStyleBlock('field', 'fieldInput')
+ const iconWrapperStyleBlock = getStyleBlock('iconWrapper', 'iconSlot')
+ const inputStyleBlock = androidInputSource.match(/\n input: \{([\s\S]*?)\n \},\n inputMono/)
+
+ expect(fieldStyleBlock).toBeDefined()
+ expect(fieldStyleBlock).not.toContain('height')
+ expect(fieldStyleBlock).not.toContain('overflow')
+ expect(fieldStyleBlock).toContain('minHeight: 48')
+ expect(iconWrapperStyleBlock).toBeDefined()
+ expect(iconWrapperStyleBlock).not.toContain('height')
+ expect(iconWrapperStyleBlock).not.toContain('overflow')
+ expect(iconWrapperStyleBlock).toContain('minHeight: 48')
+ expect(inputStyleBlock?.[1]).toBeDefined()
+ expect(inputStyleBlock?.[1]).not.toContain('includeFontPadding')
+ expect(inputStyleBlock?.[1]).not.toContain('lineHeight')
+ expect(inputStyleBlock?.[1]).toContain("textAlignVertical: 'center'")
+ expect(androidInputSource).toContain('underlineColorAndroid')
+ expect(androidInputSource).toContain("key={fontFamilyName ?? 'system'}")
+ expect(androidInputSource).toContain('fontFamilyStyle = fontFamilyName ?')
+ expect(webInputSource).not.toContain('includeFontPadding')
+ expect(webInputSource).not.toContain('textAlignVertical')
+ })
+
+ it('keeps mobile Metro pointed at component source so Android Input is selectable', () => {
+ const metroSource = readFileSync(
+ new URL('../../../../apps/mobile/metro.config.js', import.meta.url),
+ 'utf8'
+ )
+
+ expect(metroSource).toContain("'@altersend/components'")
+ expect(metroSource).toContain('packages/components/src/index.ts')
+ expect(metroSource).toContain('resolveRequest')
+ })
+
+ it('does not pass CSS-quoted font family names to React Native font themes', () => {
+ const webFontThemeSource = readFileSync(new URL('./fontThemes.css.ts', import.meta.url), 'utf8')
+ const nativeFontThemeSource = readFileSync(
+ new URL('./fontThemes.css.native.ts', import.meta.url),
+ 'utf8'
+ )
+
+ expect(webFontThemeSource).toContain('fontFamilySans: \'"AlterSend Sans KR"\'')
+ expect(webFontThemeSource).toContain('fontFamilyMono:\n \'ui-monospace, "SFMono-Regular"')
+ expect(webFontThemeSource).not.toContain('MONO_FONT_FAMILY_CSS')
+ expect(nativeFontThemeSource).toContain("fontFamilySans: 'AlterSend Sans KR'")
+ expect(nativeFontThemeSource).toContain("fontFamilyMono: 'monospace'")
+ expect(nativeFontThemeSource).not.toContain('nativeMonoFontFamily')
+ expect(nativeFontThemeSource).not.toContain('fontFamilySans: \'"AlterSend Sans KR"\'')
+ })
+
+ it('exposes Korean CSS variables for Tailwind and plain DOM text', () => {
+ const expectedFamilies = {
+ latin: LATIN_FONT_FAMILY_CSS,
+ japanese: 'AlterSend Sans JP',
+ korean: 'AlterSend Sans KR',
+ simplifiedChinese: 'AlterSend Sans SC',
+ traditionalChinese: 'AlterSend Sans TC'
+ } as const
+
+ for (const [fontFamilyKey, cssFamily] of Object.entries(expectedFamilies)) {
+ const expectedFamily = fontFamilyKey === 'latin' ? cssFamily : `"${cssFamily}"`
+ expect(getFontFamilyCssVariables(fontFamilyKey as keyof typeof expectedFamilies)).toEqual({
+ '--as-font-family-sans': expectedFamily,
+ '--as-font-family-display': expectedFamily,
+ '--as-font-family-mono': MONO_FONT_FAMILY_CSS,
+ fontFamily: cssFamily
+ })
+ }
+ })
+
+ it('centralizes web font synchronization in ThemeProvider', () => {
+ const themeContextSource = readFileSync(new URL('./ThemeContext.tsx', import.meta.url), 'utf8')
+
+ expect(themeContextSource).toContain('getFontFamilyCssVariables')
+ expect(themeContextSource).toContain('document.documentElement')
+ expect(themeContextSource).toContain('document.body')
+ expect(themeContextSource).toContain('fontThemeStyle')
+ })
+})
diff --git a/packages/components/src/theme/fontThemes.css.native.ts b/packages/components/src/theme/fontThemes.css.native.ts
new file mode 100644
index 0000000..d4d3f63
--- /dev/null
+++ b/packages/components/src/theme/fontThemes.css.native.ts
@@ -0,0 +1,51 @@
+import { css } from 'react-strict-dom'
+import { Platform } from 'react-native'
+import { tokens } from './tokens.css'
+import type { FontFamilyKey } from './fonts'
+
+type FontThemeStyle = ReturnType<typeof css.createTheme>
+
+const nativeSystemFontFamily =
+ Platform.select({
+ ios: 'System',
+ android: 'sans-serif',
+ default: 'sans-serif'
+ }) ?? 'sans-serif'
+
+const latinFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: nativeSystemFontFamily,
+ fontFamilyDisplay: nativeSystemFontFamily,
+ fontFamilyMono: 'monospace'
+})
+
+const japaneseFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: 'AlterSend Sans JP',
+ fontFamilyDisplay: 'AlterSend Sans JP',
+ fontFamilyMono: 'monospace'
+})
+
+const koreanFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: 'AlterSend Sans KR',
+ fontFamilyDisplay: 'AlterSend Sans KR',
+ fontFamilyMono: 'monospace'
+})
+
+const simplifiedChineseFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: 'AlterSend Sans SC',
+ fontFamilyDisplay: 'AlterSend Sans SC',
+ fontFamilyMono: 'monospace'
+})
+
+const traditionalChineseFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: 'AlterSend Sans TC',
+ fontFamilyDisplay: 'AlterSend Sans TC',
+ fontFamilyMono: 'monospace'
+})
+
+export const fontThemeStyles = {
+ latin: latinFontThemeStyle,
+ japanese: japaneseFontThemeStyle,
+ korean: koreanFontThemeStyle,
+ simplifiedChinese: simplifiedChineseFontThemeStyle,
+ traditionalChinese: traditionalChineseFontThemeStyle
+} satisfies Record<FontFamilyKey, FontThemeStyle>
diff --git a/packages/components/src/theme/fontThemes.css.ts b/packages/components/src/theme/fontThemes.css.ts
new file mode 100644
index 0000000..ba7a911
--- /dev/null
+++ b/packages/components/src/theme/fontThemes.css.ts
@@ -0,0 +1,48 @@
+import { css } from 'react-strict-dom'
+import { tokens } from './tokens.css'
+import type { FontFamilyKey } from './fonts'
+
+type FontThemeStyle = ReturnType<typeof css.createTheme>
+
+const latinFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: '"SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif',
+ fontFamilyDisplay: '"SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif',
+ fontFamilyMono:
+ 'ui-monospace, "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace'
+})
+
+const japaneseFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: '"AlterSend Sans JP"',
+ fontFamilyDisplay: '"AlterSend Sans JP"',
+ fontFamilyMono:
+ 'ui-monospace, "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace'
+})
+
+const koreanFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: '"AlterSend Sans KR"',
+ fontFamilyDisplay: '"AlterSend Sans KR"',
+ fontFamilyMono:
+ 'ui-monospace, "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace'
+})
+
+const simplifiedChineseFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: '"AlterSend Sans SC"',
+ fontFamilyDisplay: '"AlterSend Sans SC"',
+ fontFamilyMono:
+ 'ui-monospace, "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace'
+})
+
+const traditionalChineseFontThemeStyle = css.createTheme(tokens, {
+ fontFamilySans: '"AlterSend Sans TC"',
+ fontFamilyDisplay: '"AlterSend Sans TC"',
+ fontFamilyMono:
+ 'ui-monospace, "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace'
+})
+
+export const fontThemeStyles = {
+ latin: latinFontThemeStyle,
+ japanese: japaneseFontThemeStyle,
+ korean: koreanFontThemeStyle,
+ simplifiedChinese: simplifiedChineseFontThemeStyle,
+ traditionalChinese: traditionalChineseFontThemeStyle
+} satisfies Record<FontFamilyKey, FontThemeStyle>
diff --git a/packages/components/src/theme/fonts.ts b/packages/components/src/theme/fonts.ts
new file mode 100644
index 0000000..9e9a788
--- /dev/null
+++ b/packages/components/src/theme/fonts.ts
@@ -0,0 +1,57 @@
+export type FontFamilyKey =
+ | 'latin'
+ | 'japanese'
+ | 'korean'
+ | 'simplifiedChinese'
+ | 'traditionalChinese'
+
+export interface BundledFontFamily {
+ cssFamily: string
+ nativeFamily?: string
+ assetFileName?: string
+ boldAssetFileName?: string
+}
+
+export const DEFAULT_FONT_FAMILY_KEY: FontFamilyKey = 'latin'
+export const LATIN_FONT_FAMILY_CSS = '"SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif'
+export const MONO_FONT_FAMILY_CSS =
+ 'ui-monospace, "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace'
+export const MONO_FONT_FAMILY_NATIVE = {
+ ios: 'Menlo',
+ android: 'monospace',
+ default: 'monospace'
+} as const
+
+export const BUNDLED_FONT_FAMILIES: Record<FontFamilyKey, BundledFontFamily> = {
+ latin: {
+ cssFamily: LATIN_FONT_FAMILY_CSS
+ },
+ japanese: {
+ cssFamily: 'AlterSend Sans JP',
+ nativeFamily: 'AlterSend Sans JP',
+ assetFileName: 'NotoSans-JP-Regular.ttf',
+ boldAssetFileName: 'NotoSans-JP-Bold.ttf'
+ },
+ korean: {
+ cssFamily: 'AlterSend Sans KR',
+ nativeFamily: 'AlterSend Sans KR',
+ assetFileName: 'NotoSans-KR-Regular.ttf',
+ boldAssetFileName: 'NotoSans-KR-Bold.ttf'
+ },
+ simplifiedChinese: {
+ cssFamily: 'AlterSend Sans SC',
+ nativeFamily: 'AlterSend Sans SC',
+ assetFileName: 'NotoSans-SC-Regular.ttf',
+ boldAssetFileName: 'NotoSans-SC-Bold.ttf'
+ },
+ traditionalChinese: {
+ cssFamily: 'AlterSend Sans TC',
+ nativeFamily: 'AlterSend Sans TC',
+ assetFileName: 'NotoSans-TC-Regular.ttf',
+ boldAssetFileName: 'NotoSans-TC-Bold.ttf'
+ }
+} as const
+
+export function getNativeFontFamilyName(fontFamily: FontFamilyKey): string | undefined {
+ return BUNDLED_FONT_FAMILIES[fontFamily]?.nativeFamily
+}
diff --git a/packages/components/src/theme/index.ts b/packages/components/src/theme/index.ts
index 60358e9..908184f 100644
--- a/packages/components/src/theme/index.ts
+++ b/packages/components/src/theme/index.ts
@@ -5,3 +5,11 @@ export { ThemeProvider, useTheme } from './ThemeContext'
export { withAlpha } from './withAlpha'
export { fileTypeColors, type FileTypeColor, type FileTypeKey } from './fileTypeColors'
export { space, radius, fontSize, fontWeight, lineHeight, fontFamily } from './scales'
+export {
+ BUNDLED_FONT_FAMILIES,
+ DEFAULT_FONT_FAMILY_KEY,
+ LATIN_FONT_FAMILY_CSS,
+ getNativeFontFamilyName
+} from './fonts'
+export type { BundledFontFamily, FontFamilyKey } from './fonts'
+export { getFontFamilyCssVariables, type FontFamilyCssVariables } from './fontCssVariables'
diff --git a/packages/components/src/theme/tailwind-theme.css b/packages/components/src/theme/tailwind-theme.css
index abed9f8..9d56e5c 100644
--- a/packages/components/src/theme/tailwind-theme.css
+++ b/packages/components/src/theme/tailwind-theme.css
@@ -76,7 +76,7 @@
--as-line-height-relaxed: 1.5;
--as-font-family-sans: "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
--as-font-family-display: "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
- --as-font-family-mono: "IBM Plex Mono", "SFMono-Regular", "JetBrains Mono", Menlo, monospace;
+ --as-font-family-mono: ui-monospace, "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;
}
[data-theme='light'] {
diff --git a/packages/components/src/theme/tokens.css.native.ts b/packages/components/src/theme/tokens.css.native.ts
new file mode 100644
index 0000000..d45193d
--- /dev/null
+++ b/packages/components/src/theme/tokens.css.native.ts
@@ -0,0 +1,114 @@
+// AUTO-GENERATED — do not edit directly.
+// Source: src/theme/tokens.json | Generator: scripts/generate-tokens.mjs
+// Run `npm run generate-tokens` to update.
+
+import { Platform } from 'react-native';
+import { css } from 'react-strict-dom';
+
+export interface NativeFontFamilyStack {
+ fontFamilySans: string;
+ fontFamilyDisplay: string;
+ fontFamilyMono: string;
+}
+
+export const nativeFontFamilies = {
+ "ios": {
+ "fontFamilySans": "System",
+ "fontFamilyDisplay": "System",
+ "fontFamilyMono": "Menlo"
+ },
+ "android": {
+ "fontFamilySans": "sans-serif",
+ "fontFamilyDisplay": "sans-serif",
+ "fontFamilyMono": "monospace"
+ },
+ "default": {
+ "fontFamilySans": "sans-serif",
+ "fontFamilyDisplay": "sans-serif",
+ "fontFamilyMono": "monospace"
+ }
+} as Record<
+ 'ios' | 'android' | 'default',
+ NativeFontFamilyStack
+>;
+
+const nativeFontFamily =
+ Platform.select<NativeFontFamilyStack>(nativeFontFamilies) ?? nativeFontFamilies.default;
+
+export const tokens = css.defineVars({
+ colorBackground: '#16181d',
+ colorBackgroundSubtle: '#1b1f25',
+ colorSurfacePrimary: '#20242b',
+ colorSurfaceSecondary: '#252b33',
+ colorSurfaceTertiary: '#2d343d',
+ colorSurfaceHover: '#353d47',
+ colorSurfaceAccent: '#f3efe8',
+ colorBorderPrimary: 'rgba(255, 255, 255, 0.06)',
+ colorBorderStrong: 'rgba(255, 255, 255, 0.12)',
+ colorTextPrimary: '#f6f2eb',
+ colorTextSecondary: '#cbc4b8',
+ colorTextMuted: '#8f897e',
+ colorAccent: '#f3efe8',
+ colorAccentHover: '#ffffff',
+ colorAccentActive: '#ddd7cf',
+ colorOnAccent: '#141517',
+ colorSuccess: '#8ab86d',
+ colorSuccessSubtle: 'rgba(138, 184, 109, 0.12)',
+ colorWarning: '#d4a04a',
+ colorWarningSubtle: 'rgba(212, 160, 74, 0.12)',
+ colorDanger: '#d77171',
+ colorDangerSubtle: 'rgba(215, 113, 113, 0.12)',
+ colorInfo: '#608aff',
+ colorInfoSubtle: 'rgba(96, 138, 255, 0.12)',
+ colorAccentSubtle: 'rgba(243, 239, 232, 0.08)',
+ colorScrim: '#000000',
+ colorShadow: 'rgba(0, 0, 0, 0.18)',
+ colorHighlight: 'rgba(255, 255, 255, 0.22)',
+ colorFocusRing: '#d7d1c7',
+ space0: '0px',
+ space05: '2px',
+ space1: '4px',
+ space15: '6px',
+ space2: '8px',
+ space25: '10px',
+ space3: '12px',
+ space35: '14px',
+ space4: '16px',
+ space45: '18px',
+ space5: '20px',
+ space6: '24px',
+ space7: '28px',
+ space8: '32px',
+ space9: '36px',
+ space10: '40px',
+ space11: '44px',
+ space12: '48px',
+ space14: '56px',
+ radiusXs: '6px',
+ radiusSm: '8px',
+ radiusMd: '10px',
+ radiusLg: '12px',
+ radiusXl: '14px',
+ radius2xl: '16px',
+ radiusFull: '999px',
+ fontSizeXs: '11px',
+ fontSizeSm: '12px',
+ fontSizeMd: '13px',
+ fontSizeBase: '14px',
+ fontSizeLg: '15px',
+ fontSizeXl: '18px',
+ fontSize2xl: '20px',
+ fontWeightRegular: "400",
+ fontWeightMedium: "500",
+ fontWeightSemibold: "600",
+ fontWeightBold: "700",
+ lineHeightTight: "1.2",
+ lineHeightSnug: "1.35",
+ lineHeightNormal: "1.4",
+ lineHeightRelaxed: "1.5",
+ fontFamilySans: nativeFontFamily.fontFamilySans,
+ fontFamilyDisplay: nativeFontFamily.fontFamilyDisplay,
+ fontFamilyMono: nativeFontFamily.fontFamilyMono,
+});
+
+export type Tokens = typeof tokens;
diff --git a/packages/components/src/theme/tokens.css.ts b/packages/components/src/theme/tokens.css.ts
index 1f8062e..eeeaa07 100644
--- a/packages/components/src/theme/tokens.css.ts
+++ b/packages/components/src/theme/tokens.css.ts
@@ -77,7 +77,7 @@ export const tokens = css.defineVars({
lineHeightRelaxed: "1.5",
fontFamilySans: "\"SF Pro Text\", \"SF Pro Display\", \"Helvetica Neue\", sans-serif",
fontFamilyDisplay: "\"SF Pro Display\", \"SF Pro Text\", \"Helvetica Neue\", sans-serif",
- fontFamilyMono: "\"IBM Plex Mono\", \"SFMono-Regular\", \"JetBrains Mono\", Menlo, monospace",
+ fontFamilyMono: "ui-monospace, \"SFMono-Regular\", \"Menlo\", \"Monaco\", \"Consolas\", \"Liberation Mono\", \"Courier New\", monospace",
});
export type Tokens = typeof tokens;
diff --git a/packages/components/src/theme/tokens.json b/packages/components/src/theme/tokens.json
index 385f87b..ea5f840 100644
--- a/packages/components/src/theme/tokens.json
+++ b/packages/components/src/theme/tokens.json
@@ -117,6 +117,23 @@
"fontFamily": {
"fontFamilySans": "\"SF Pro Text\", \"SF Pro Display\", \"Helvetica Neue\", sans-serif",
"fontFamilyDisplay": "\"SF Pro Display\", \"SF Pro Text\", \"Helvetica Neue\", sans-serif",
- "fontFamilyMono": "\"IBM Plex Mono\", \"SFMono-Regular\", \"JetBrains Mono\", Menlo, monospace"
+ "fontFamilyMono": "ui-monospace, \"SFMono-Regular\", \"Menlo\", \"Monaco\", \"Consolas\", \"Liberation Mono\", \"Courier New\", monospace"
+ },
+ "fontFamilyNative": {
+ "ios": {
+ "fontFamilySans": "System",
+ "fontFamilyDisplay": "System",
+ "fontFamilyMono": "Menlo"
+ },
+ "android": {
+ "fontFamilySans": "sans-serif",
+ "fontFamilyDisplay": "sans-serif",
+ "fontFamilyMono": "monospace"
+ },
+ "default": {
+ "fontFamilySans": "sans-serif",
+ "fontFamilyDisplay": "sans-serif",
+ "fontFamilyMono": "monospace"
+ }
}
}
diff --git a/packages/components/src/theme/tokens.raw.ts b/packages/components/src/theme/tokens.raw.ts
index a4c955e..84c7c08 100644
--- a/packages/components/src/theme/tokens.raw.ts
+++ b/packages/components/src/theme/tokens.raw.ts
@@ -121,7 +121,7 @@ export const rawTokens = {
fontFamily: {
fontFamilySans: "\"SF Pro Text\", \"SF Pro Display\", \"Helvetica Neue\", sans-serif",
fontFamilyDisplay: "\"SF Pro Display\", \"SF Pro Text\", \"Helvetica Neue\", sans-serif",
- fontFamilyMono: "\"IBM Plex Mono\", \"SFMono-Regular\", \"JetBrains Mono\", Menlo, monospace",
+ fontFamilyMono: "ui-monospace, \"SFMono-Regular\", \"Menlo\", \"Monaco\", \"Consolas\", \"Liberation Mono\", \"Courier New\", monospace",
},
} as const;
diff --git a/packages/components/vitest.config.ts b/packages/components/vitest.config.ts
new file mode 100644
index 0000000..c7fde7a
--- /dev/null
+++ b/packages/components/vitest.config.ts
@@ -0,0 +1,7 @@
+import { defineConfig } from 'vitest/config'
+
+export default defineConfig({
+ test: {
+ include: ['src/**/*.test.ts']
+ }
+})
diff --git a/packages/core/src/client/worker-client.ts b/packages/core/src/client/worker-client.ts
index 5880b1d..8d76b31 100644
--- a/packages/core/src/client/worker-client.ts
+++ b/packages/core/src/client/worker-client.ts
@@ -3,6 +3,7 @@ import { API, decodeRPCPayload, encodeRPCPayload } from '../worklet/rpc/protocol
import type {
RPCResponse,
RendererTransferEvent,
+ TransferErrorCode,
TransferMethod,
TransferRPC,
WorkerTransferEvent
@@ -39,6 +40,20 @@ function toError(err: unknown, fallback: string) {
return err instanceof Error ? err : new Error(fallback)
}
+function createWorkerResponseError(response: Extract<RPCResponse<unknown>, { ok: false }>) {
+ const error = new Error(response.error.message) as Error & {
+ code?: TransferErrorCode
+ rpcCode?: string
+ transferErrorCode?: TransferErrorCode
+ }
+ error.rpcCode = response.error.code
+ if (response.error.transferErrorCode) {
+ error.code = response.error.transferErrorCode
+ error.transferErrorCode = response.error.transferErrorCode
+ }
+ return error
+}
+
class TransferWorkerClientCore {
public rpc: RPC
public ready: Promise<void>
@@ -131,7 +146,7 @@ class TransferWorkerClientCore {
}
if (!response.ok) {
- reject(new Error(response.error.message))
+ reject(createWorkerResponseError(response))
return
}
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 7473f98..b033e77 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -24,4 +24,5 @@ export type {
ShareFileRequest
} from './worklet/rpc/protocol'
-export type { TransferStatus } from './worklet/rpc/events'
+export { TRANSFER_ERROR_CODES } from './worklet/rpc/events'
+export type { TransferStatus, TransferErrorCode } from './worklet/rpc/events'
diff --git a/packages/core/src/worklet/rpc/events.ts b/packages/core/src/worklet/rpc/events.ts
index c539e2a..6607e01 100644
--- a/packages/core/src/worklet/rpc/events.ts
+++ b/packages/core/src/worklet/rpc/events.ts
@@ -17,6 +17,16 @@ export type TransferStatus =
export type TransferRole = 'sender' | 'receiver'
+export const TRANSFER_ERROR_CODES = {
+ peerUnreachable: 'peer_unreachable',
+ invalidTopic: 'invalid_topic',
+ joinFailed: 'join_failed',
+ transferFailed: 'transfer_failed',
+ downloadFailed: 'download_failed'
+} as const
+
+export type TransferErrorCode = (typeof TRANSFER_ERROR_CODES)[keyof typeof TRANSFER_ERROR_CODES]
+
export interface ReadyEvent {
type: 'ready'
}
@@ -49,6 +59,7 @@ export interface RoleEvent {
export interface ErrorEvent {
type: 'error'
message: string
+ code?: TransferErrorCode
}
export type TransferIPCMessage = ReadyEvent | TopicEvent | StatusEvent | RoleEvent | ErrorEvent
@@ -72,9 +83,10 @@ export function createRoleEvent(role: TransferRole | null): RoleEvent {
return { type: 'role', role }
}
-export function createErrorEvent(message: string): ErrorEvent {
+export function createErrorEvent(message: string, code?: TransferErrorCode): ErrorEvent {
return {
type: 'error',
- message
+ message,
+ ...(code ? { code } : {})
}
}
diff --git a/packages/core/src/worklet/rpc/protocol.ts b/packages/core/src/worklet/rpc/protocol.ts
index 43b3180..05c6f08 100644
--- a/packages/core/src/worklet/rpc/protocol.ts
+++ b/packages/core/src/worklet/rpc/protocol.ts
@@ -1,11 +1,18 @@
import b4a from 'b4a'
import type { FileOffer, PeerControlMessage } from '../transfer/control-channel'
-import type { ErrorEvent, ReadyEvent, RoleEvent, StatusEvent, TransferRole } from './events'
+import type {
+ ErrorEvent,
+ ReadyEvent,
+ RoleEvent,
+ StatusEvent,
+ TransferErrorCode,
+ TransferRole
+} from './events'
import { API, API_BY_VALUE } from './commands'
import type { TransferMethod } from './commands'
export { API, API_BY_VALUE }
-export type { TransferRole, TransferMethod }
+export type { TransferErrorCode, TransferRole, TransferMethod }
export interface DownloadFileRequest {
transferId: string
@@ -54,6 +61,7 @@ export interface DisconnectReply {
export interface RPCErrorPayload {
code: 'BAD_REQUEST' | 'UNKNOWN_COMMAND' | 'INTERNAL_ERROR'
message: string
+ transferErrorCode?: TransferErrorCode
}
interface RPCSuccessPayload<T> {
@@ -83,9 +91,12 @@ export interface TransferRPC {
}
export class BadRequestError extends Error {
- constructor(message: string) {
+ transferErrorCode?: TransferErrorCode
+
+ constructor(message: string, transferErrorCode?: TransferErrorCode) {
super(message)
this.name = 'BadRequestError'
+ this.transferErrorCode = transferErrorCode
}
}
@@ -123,13 +134,15 @@ export function encodeRPCSuccess<T>(value: T): string {
export function encodeRPCError(
message: string,
- code: RPCErrorPayload['code'] = 'INTERNAL_ERROR'
+ code: RPCErrorPayload['code'] = 'INTERNAL_ERROR',
+ transferErrorCode?: TransferErrorCode
): string {
return encodeRPCPayload({
ok: false,
error: {
code,
- message
+ message,
+ ...(transferErrorCode ? { transferErrorCode } : {})
}
})
}
diff --git a/packages/core/src/worklet/rpc/server.ts b/packages/core/src/worklet/rpc/server.ts
index 7ff01a8..213e5cf 100644
--- a/packages/core/src/worklet/rpc/server.ts
+++ b/packages/core/src/worklet/rpc/server.ts
@@ -1,5 +1,5 @@
import RPC, { type RPCRequest } from 'bare-rpc'
-import { createErrorEvent } from './events'
+import { createErrorEvent, TRANSFER_ERROR_CODES } from './events'
import {
API_BY_VALUE,
BadRequestError,
@@ -30,7 +30,7 @@ export function createTransferWorkerRPCServer(
if (err instanceof BadRequestError || err instanceof AbortError) return null
const failure = toError(err)
console.error('Core: Command queue error', failure)
- emitEvent(createErrorEvent(failure.message))
+ emitEvent(createErrorEvent(failure.message, TRANSFER_ERROR_CODES.transferFailed))
return null
})
return next
@@ -53,7 +53,7 @@ export function createTransferWorkerRPCServer(
req.reply(encodeRPCSuccess(reply))
} catch (err: unknown) {
if (err instanceof BadRequestError) {
- req.reply(encodeRPCError(err.message, 'BAD_REQUEST'))
+ req.reply(encodeRPCError(err.message, 'BAD_REQUEST', err.transferErrorCode))
return
}
if (err instanceof AbortError) {
diff --git a/packages/core/src/worklet/transfer/orchestrator.ts b/packages/core/src/worklet/transfer/orchestrator.ts
index 9eabe75..3ddb726 100644
--- a/packages/core/src/worklet/transfer/orchestrator.ts
+++ b/packages/core/src/worklet/transfer/orchestrator.ts
@@ -6,6 +6,8 @@ import {
createErrorEvent,
createRoleEvent,
createStatusEvent,
+ TRANSFER_ERROR_CODES,
+ type TransferErrorCode,
type TransferIPCMessage,
type TransferRole,
type TransferStatus,
@@ -216,8 +218,11 @@ export class TransferOrchestrator implements TransferRPC {
this.emitIPC(createStatusEvent(state, extra))
}
- private sendError(message: string): void {
- this.emitIPC(createErrorEvent(message))
+ private sendError(
+ message: string,
+ code: TransferErrorCode = TRANSFER_ERROR_CODES.transferFailed
+ ): void {
+ this.emitIPC(createErrorEvent(message, code))
}
private onDownloadStart(event: DownloadLifecycleEvent): void {
@@ -243,7 +248,7 @@ export class TransferOrchestrator implements TransferRPC {
message
})
this.swarm.broadcast(createDownloadFailedMessage({ ...event, message }))
- this.sendError(message)
+ this.sendError(message, TRANSFER_ERROR_CODES.downloadFailed)
}
private getDownloaderCallbacks(): DownloaderCallbacks {
@@ -267,7 +272,7 @@ export class TransferOrchestrator implements TransferRPC {
throw new BadRequestError('Missing topic')
}
if (!isValidHexKey(topic)) {
- throw new BadRequestError('Invalid topic format')
+ throw new BadRequestError('Invalid topic format', TRANSFER_ERROR_CODES.invalidTopic)
}
if (this.role === 'sender') {
throw new BadRequestError('Cannot join a session while sharing files')
diff --git a/packages/domain/package.json b/packages/domain/package.json
index 7793148..4c0414b 100644
--- a/packages/domain/package.json
+++ b/packages/domain/package.json
@@ -33,7 +33,6 @@
},
"devDependencies": {
"@types/react": "^19.0.0",
- "i18next": "^26.2.0",
"react": "19.2.0",
"typescript": "^5.9.3",
"vitest": "^4.1.8",
diff --git a/packages/domain/src/onboarding.ts b/packages/domain/src/onboarding.ts
index b80ab2d..164c126 100644
--- a/packages/domain/src/onboarding.ts
+++ b/packages/domain/src/onboarding.ts
@@ -9,37 +9,23 @@ export const githubUrl = 'https://github.com/denislupookov/altersend'
export const discordUrl = 'https://discord.gg/R6tmrk85Vx'
export interface OnboardingSlideLink {
- label: string
url: string
}
export interface OnboardingSlide {
kind: OnboardingSlideKind
- title: string
- subtitle: string
link?: OnboardingSlideLink
}
export const onboardingSlides: OnboardingSlide[] = [
{
- kind: 'pairing',
- title: 'Files, directly between devices.',
- subtitle:
- 'One device sends, the other receives. A short code connects them so files can stream directly.'
+ kind: 'pairing'
},
{
- kind: 'keep-open',
- title: 'Keep both apps open.',
- subtitle:
- 'Files stream directly between devices — there is no cloud. Closing or backgrounding the app will cancel the transfer.'
+ kind: 'keep-open'
},
{
kind: 'privacy',
- title: 'End-to-end encrypted.',
- subtitle:
- 'No servers, no copies, no middlemen. Your files travel peer-to-peer between you and the recipient.',
- link: { label: 'Read our privacy policy', url: privacyPolicyUrl }
+ link: { url: privacyPolicyUrl }
}
]
-
-export const senderKeepOpenHint = 'Closing the app cancels the transfer.'
diff --git a/packages/domain/src/receive/downloadModel.ts b/packages/domain/src/receive/downloadModel.ts
index e2e7002..d2f2440 100644
--- a/packages/domain/src/receive/downloadModel.ts
+++ b/packages/domain/src/receive/downloadModel.ts
@@ -20,7 +20,11 @@ export type DownloadRowStatusTone = 'muted' | 'active' | 'success'
export interface DownloadRowDisplay {
description: string | undefined
progressPercent: number | undefined
- status: { label: string; tone: DownloadRowStatusTone }
+ status: {
+ kind: 'saved' | 'failed' | 'progress' | 'ready'
+ tone: DownloadRowStatusTone
+ message?: string
+ }
percent: number
isActive: boolean
isCompleted: boolean
@@ -76,7 +80,7 @@ export function getDownloadRowDisplay(
return {
description: undefined,
progressPercent: 100,
- status: { label: 'Saved', tone: 'success' },
+ status: { kind: 'saved', tone: 'success' },
percent: 100,
isActive: false,
isCompleted: true
@@ -87,7 +91,7 @@ export function getDownloadRowDisplay(
return {
description: undefined,
progressPercent: state.bytesTransferred > 0 ? percent : undefined,
- status: { label: state.message ?? 'Failed', tone: 'muted' },
+ status: { kind: 'failed', tone: 'muted', message: state.message },
percent,
isActive: false,
isCompleted: false
@@ -98,7 +102,7 @@ export function getDownloadRowDisplay(
return {
description: `${formatFileSize(state!.bytesTransferred)} / ${formatFileSize(totalBytes)}`,
progressPercent: percent,
- status: { label: `${percent}%`, tone: percent > 0 ? 'active' : 'muted' },
+ status: { kind: 'progress', tone: percent > 0 ? 'active' : 'muted' },
percent,
isActive: true,
isCompleted: false
@@ -108,7 +112,7 @@ export function getDownloadRowDisplay(
return {
description: undefined,
progressPercent: undefined,
- status: { label: 'Ready', tone: 'muted' },
+ status: { kind: 'ready', tone: 'muted' },
percent: 0,
isActive: false,
isCompleted: false
diff --git a/packages/domain/src/receive/pageUi.ts b/packages/domain/src/receive/pageUi.ts
index 6681443..de2e067 100644
--- a/packages/domain/src/receive/pageUi.ts
+++ b/packages/domain/src/receive/pageUi.ts
@@ -1,4 +1,4 @@
-import type { TransferRole } from '@altersend/domain'
+import type { TransferRole } from '@altersend/core'
import { formatFileSize } from '../format'
export type ReceiveStep =
@@ -9,12 +9,9 @@ export type ReceiveStep =
| 'interrupted'
| 'completed'
-export interface ReceivePageCopy {
- title: string
- description: string
-}
+type Translate = (key: string, options?: Record<string, unknown>) => string
-export interface ReceiveConnectedPanelCopy {
+export interface ReceivePageCopy {
title: string
description: string
}
@@ -58,41 +55,44 @@ export function getReceiveStep({
}
export function getReceivePageCopy(
+ t: Translate,
step: ReceiveStep,
incomingCount: number,
- totalBytes = 0
+ totalBytes: number
): ReceivePageCopy {
switch (step) {
case 'join':
return {
- title: 'Receive files',
- description: 'Enter a 64-character connection code from the sender to stream their files.'
+ title: t('receive:page.join.title'),
+ description: t('receive:page.join.description')
}
case 'connecting':
return {
- title: 'Connecting',
- description: 'Establishing a secure session with the sender.'
+ title: t('receive:page.connecting.title'),
+ description: t('receive:page.connecting.description')
}
case 'incoming_transfer':
return {
- title: 'Files available',
- description: `${incomingCount} ${incomingCount === 1 ? 'file' : 'files'} · ${formatFileSize(totalBytes)}`
+ title: t('receive:page.incomingTransfer.title'),
+ description: t('receive:page.incomingTransfer.description', {
+ count: incomingCount,
+ size: formatFileSize(totalBytes)
+ })
}
case 'completed':
return {
- title: incomingCount === 1 ? 'File received' : 'Files received',
+ title: t('receive:page.completed.title', { count: incomingCount }),
description: ''
}
case 'reconnecting':
return {
- title: 'Reconnecting',
- description:
- 'Reconnecting to the session. Files will be available again as soon as the link is restored.'
+ title: t('receive:page.reconnecting.title'),
+ description: t('receive:page.reconnecting.description')
}
case 'interrupted':
return {
- title: 'Transfer incomplete',
- description: 'The sender left before all files arrived.'
+ title: t('receive:page.interrupted.title'),
+ description: t('receive:page.interrupted.description')
}
default: {
const exhaustiveCheck: never = step
@@ -101,28 +101,6 @@ export function getReceivePageCopy(
}
}
-export function getConnectedPanelCopy(step: ReceiveStep): ReceiveConnectedPanelCopy | null {
- switch (step) {
- case 'incoming_transfer':
- return {
- title: 'Files ready',
- description: 'The sender has shared files. Review them and start each download when ready.'
- }
- case 'completed':
- return null
- case 'reconnecting':
- case 'interrupted':
- return null
- case 'join':
- case 'connecting':
- return null
- default: {
- const exhaustiveCheck: never = step
- return exhaustiveCheck
- }
- }
-}
-
export function isConnectedStep(step: ReceiveStep): boolean {
switch (step) {
case 'incoming_transfer':
diff --git a/packages/domain/src/send/pageUi.ts b/packages/domain/src/send/pageUi.ts
index 07e6224..b168e94 100644
--- a/packages/domain/src/send/pageUi.ts
+++ b/packages/domain/src/send/pageUi.ts
@@ -2,56 +2,34 @@ export type SendStep = 'selecting' | 'preparing' | 'waiting_for_receiver' | 'rec
export type SendDraftPhase = 'empty' | 'selected' | 'preparing' | 'ready'
+type Translate = (key: string, options?: Record<string, unknown>) => string
+
export interface SendPageCopy {
title: string
description: string
}
-export interface SendShareStatus {
- label: string
- tone: 'muted' | 'success'
-}
-import type { TFunction } from 'i18next'
-
-export function getSendPageCopy(step: SendStep, t: TFunction<'send'>): SendPageCopy {
+export function getSendPageCopy(t: Translate, step: SendStep): SendPageCopy {
switch (step) {
case 'selecting':
return {
- title: t('steps.selecting.title'),
- description: t('steps.selecting.description')
+ title: t('send:page.selecting.title'),
+ description: t('send:page.selecting.description')
}
case 'preparing':
return {
- title: t('steps.preparing.title'),
- description: t('steps.preparing.description')
+ title: t('send:page.preparing.title'),
+ description: t('send:page.preparing.description')
}
- case 'waiting_for_receiver':
- case 'receiver_connected':
- return {
- title: t('steps.waiting_for_receiver.title'),
- description: t('steps.waiting_for_receiver.description')
- }
- default: {
- const exhaustiveCheck: never = step
- return exhaustiveCheck
- }
- }
-}
-
-export function getSendShareStatus(step: SendStep, t: TFunction<'send'>): SendShareStatus | null {
- switch (step) {
- case 'selecting':
- case 'preparing':
- return null
case 'waiting_for_receiver':
return {
- label: t('status.waiting_for_peer'),
- tone: 'muted'
+ title: t('send:page.waitingForReceiver.title'),
+ description: t('send:page.waitingForReceiver.description')
}
case 'receiver_connected':
return {
- label: t('status.peer_connected'),
- tone: 'success'
+ title: t('send:page.receiverConnected.title'),
+ description: t('send:page.receiverConnected.description')
}
default: {
const exhaustiveCheck: never = step
diff --git a/packages/domain/src/send/peerListUi.ts b/packages/domain/src/send/peerListUi.ts
index 62258fc..5997cc5 100644
--- a/packages/domain/src/send/peerListUi.ts
+++ b/packages/domain/src/send/peerListUi.ts
@@ -1,46 +1,42 @@
-import { formatFileSize } from '../format'
import type { ConnectedPeer, PeerDownloadEvent, PeerListStatus, PeerStatusData } from './shareModel'
import { derivePeerStatus } from './shareModel'
+export type PeerListEntryDetail =
+ | { type: 'failed-file'; fileName: string }
+ | { type: 'completed-files'; count: number }
+ | { type: 'completed-done'; count: number }
+ | { type: 'progress-bytes'; transferredBytes: number; totalBytes: number }
+ | { type: 'in-flight-file'; fileName: string }
+
export interface PeerListEntry {
peerKey: string
shortKey: string
status: PeerListStatus
- statusLabel: string
- detail: string | null
+ detail: PeerListEntryDetail | null
progressPercent?: number
sortKey: number
}
-function getStatusLabel(data: PeerStatusData): string {
- switch (data.status) {
- case 'failed':
- return 'Failed'
- case 'downloaded':
- return 'Downloaded'
- case 'disconnected':
- return 'Disconnected'
- case 'online':
- return 'Online'
- case 'downloading':
- return data.progressPercent != null ? `Downloading ${data.progressPercent}%` : 'Downloading'
- }
-}
-
-function getStatusDetail(data: PeerStatusData): string | null {
+function getStatusDetail(data: PeerStatusData): PeerListEntryDetail | null {
switch (data.status) {
case 'failed':
- return data.failedFileName ?? null
+ return data.failedFileName ? { type: 'failed-file', fileName: data.failedFileName } : null
case 'downloaded':
- return `${data.completedCount} ${data.completedCount === 1 ? 'file' : 'files'}`
+ return { type: 'completed-files', count: data.completedCount }
case 'disconnected':
case 'online':
- return data.completedCount > 0 ? `${data.completedCount} done` : null
+ return data.completedCount > 0 ? { type: 'completed-done', count: data.completedCount } : null
case 'downloading':
if (data.transferredBytes != null && data.totalForDisplay != null) {
- return `${formatFileSize(data.transferredBytes)} / ${formatFileSize(data.totalForDisplay)}`
+ return {
+ type: 'progress-bytes',
+ transferredBytes: data.transferredBytes,
+ totalBytes: data.totalForDisplay
+ }
}
- return data.inFlightFileName ?? null
+ return data.inFlightFileName
+ ? { type: 'in-flight-file', fileName: data.inFlightFileName }
+ : null
}
}
@@ -71,7 +67,6 @@ export function getPeerListEntries(
peerKey,
shortKey: peerKey.slice(0, 6),
status: data.status,
- statusLabel: getStatusLabel(data),
detail: getStatusDetail(data),
progressPercent: data.progressPercent,
sortKey: data.sortKey || tracked?.connectedAt || 0
diff --git a/packages/domain/src/send/uploadItemUi.ts b/packages/domain/src/send/uploadItemUi.ts
index 087e2e9..41ba643 100644
--- a/packages/domain/src/send/uploadItemUi.ts
+++ b/packages/domain/src/send/uploadItemUi.ts
@@ -1,9 +1,11 @@
import type { SenderUploadItem } from './draftTypes'
-export function getStatusLabel(item: Pick<SenderUploadItem, 'status'>) {
- if (item.status === 'completed') return 'Uploaded'
- if (item.status === 'uploading') return 'Uploading...'
- return 'Waiting'
+type Translate = (key: string, options?: Record<string, unknown>) => string
+
+export function getStatusLabel(t: Translate, item: Pick<SenderUploadItem, 'status'>) {
+ if (item.status === 'completed') return t('send:status.uploaded')
+ if (item.status === 'uploading') return t('send:status.uploading')
+ return t('send:status.waiting')
}
export function getStatusTone(
diff --git a/packages/domain/src/transfer/binding.ts b/packages/domain/src/transfer/binding.ts
index 58c6c0c..6f34a17 100644
--- a/packages/domain/src/transfer/binding.ts
+++ b/packages/domain/src/transfer/binding.ts
@@ -1,4 +1,6 @@
import { dispatchToTransferStore } from './store'
+import { getTransferDebugMessage, getTransferErrorCode } from './errors'
+import { TRANSFER_ERROR_CODES } from './types'
import type { SharingStatusEvent } from '../send/draftModel'
import type { RendererTransferEvent, TransferRPC } from '@altersend/core'
@@ -45,7 +47,11 @@ function dispatchRendererEvent(event: RendererTransferEvent): void {
case 'role':
return dispatchToTransferStore({ type: 'role_changed', role: event.role })
case 'error':
- return dispatchToTransferStore({ type: 'set_error', message: event.message })
+ return dispatchToTransferStore({
+ type: 'set_error',
+ code: event.code ?? TRANSFER_ERROR_CODES.transferFailed,
+ message: event.message
+ })
}
}
@@ -110,7 +116,8 @@ export function bindTransferApi(
reportError('bindTransferApi.startP2P', err)
dispatchToTransferStore({
type: 'boot_failed',
- message: err instanceof Error ? err.message : String(err)
+ code: getTransferErrorCode(err, TRANSFER_ERROR_CODES.transferFailed),
+ message: getTransferDebugMessage(err)
})
})
diff --git a/packages/domain/src/transfer/commands.ts b/packages/domain/src/transfer/commands.ts
index 32b02dc..3729d0f 100644
--- a/packages/domain/src/transfer/commands.ts
+++ b/packages/domain/src/transfer/commands.ts
@@ -1,5 +1,7 @@
import { dispatchToTransferStore, transferStore } from './store'
import { getTransferApi, reportError } from './binding'
+import { getTransferDebugMessage, getTransferErrorCode } from './errors'
+import { TRANSFER_ERROR_CODES, type TransferErrorCode } from './types'
import { createInitialUploadItems, getPhaseFromSelection } from '../send/draftModel'
import type { SelectedFile } from '../send/draftTypes'
import type {
@@ -10,10 +12,12 @@ import type {
ShareFilesReply
} from '@altersend/core'
-const errorMessage = (e: unknown): string => (e instanceof Error ? e.message : String(e))
-
-const setError = (message: string): void => {
- dispatchToTransferStore({ type: 'set_error', message })
+const setError = (code: TransferErrorCode, error: unknown): void => {
+ dispatchToTransferStore({
+ type: 'set_error',
+ code: getTransferErrorCode(error, code),
+ message: getTransferDebugMessage(error)
+ })
}
export const clearSession = async (): Promise<void> => {
@@ -22,7 +26,7 @@ export const clearSession = async (): Promise<void> => {
await getTransferApi().worker.disconnect()
} catch (error) {
reportError('clearSession', error)
- setError(errorMessage(error))
+ setError(TRANSFER_ERROR_CODES.transferFailed, error)
}
}
@@ -33,7 +37,7 @@ export const startSendSession = async (): Promise<string> => {
return topic
} catch (error) {
reportError('startSendSession', error)
- setError(errorMessage(error))
+ setError(TRANSFER_ERROR_CODES.transferFailed, error)
throw error
}
}
@@ -44,7 +48,11 @@ export const joinSession = async (topic: string): Promise<JoinReply> => {
return await getTransferApi().worker.join(topic)
} catch (error) {
reportError('joinSession', error)
- dispatchToTransferStore({ type: 'join_failed', message: errorMessage(error) })
+ dispatchToTransferStore({
+ type: 'join_failed',
+ code: getTransferErrorCode(error, TRANSFER_ERROR_CODES.joinFailed),
+ message: getTransferDebugMessage(error)
+ })
throw error
}
}
@@ -56,7 +64,7 @@ export const shareFiles = async (files: ShareFileRequest[]): Promise<ShareFilesR
} catch (error) {
reportError('shareFiles', error)
dispatchToTransferStore({ type: 'role_changed', role: null })
- setError(errorMessage(error))
+ setError(TRANSFER_ERROR_CODES.transferFailed, error)
throw error
}
}
@@ -66,7 +74,7 @@ export const downloadFiles = async (files: DownloadFileRequest[]): Promise<Downl
return await getTransferApi().worker.downloadFiles(files)
} catch (error) {
reportError('downloadFiles', error)
- setError(errorMessage(error))
+ setError(TRANSFER_ERROR_CODES.downloadFailed, error)
throw error
}
}
@@ -121,6 +129,6 @@ export const continueShare = async (files: SelectedFile[]): Promise<void> => {
type: 'set_draft_phase',
phase: getPhaseFromSelection(files.length)
})
- setError(errorMessage(error))
+ setError(TRANSFER_ERROR_CODES.transferFailed, error)
}
}
diff --git a/packages/domain/src/transfer/errors.ts b/packages/domain/src/transfer/errors.ts
new file mode 100644
index 0000000..2517eb0
--- /dev/null
+++ b/packages/domain/src/transfer/errors.ts
@@ -0,0 +1,63 @@
+import { TRANSFER_ERROR_CODES, type TransferErrorCode } from './types'
+
+const TRANSFER_ERROR_CODE_SET = new Set<string>(Object.values(TRANSFER_ERROR_CODES))
+
+type Translate = (key: string, options?: Record<string, unknown>) => string
+
+export function getTransferDebugMessage(error: unknown): string {
+ return error instanceof Error ? error.message : String(error)
+}
+
+export function isTransferErrorCode(value: unknown): value is TransferErrorCode {
+ return typeof value === 'string' && TRANSFER_ERROR_CODE_SET.has(value)
+}
+
+export function getTransferErrorCode(
+ error: unknown,
+ fallback: TransferErrorCode = TRANSFER_ERROR_CODES.transferFailed
+): TransferErrorCode {
+ if (
+ error &&
+ typeof error === 'object' &&
+ 'code' in error &&
+ isTransferErrorCode((error as { code?: unknown }).code)
+ ) {
+ return (error as { code: TransferErrorCode }).code
+ }
+
+ if (
+ error &&
+ typeof error === 'object' &&
+ 'transferErrorCode' in error &&
+ isTransferErrorCode((error as { transferErrorCode?: unknown }).transferErrorCode)
+ ) {
+ return (error as { transferErrorCode: TransferErrorCode }).transferErrorCode
+ }
+
+ return fallback
+}
+
+export function getDisplayError(
+ t: Translate,
+ code: TransferErrorCode | null,
+ options: { invalidTopicKey?: string } = {}
+) {
+ if (!code) return null
+
+ switch (code) {
+ case TRANSFER_ERROR_CODES.invalidTopic:
+ return t(options.invalidTopicKey ?? 'receive:errors.invalidCode')
+ case TRANSFER_ERROR_CODES.joinFailed:
+ return t('errors:transfer.joinFailed')
+ case TRANSFER_ERROR_CODES.peerUnreachable:
+ return t('errors:transfer.peerUnreachable')
+ case TRANSFER_ERROR_CODES.downloadFailed:
+ return t('errors:transfer.downloadFailed')
+ case TRANSFER_ERROR_CODES.transferFailed:
+ return t('errors:transfer.transferFailed')
+ default: {
+ const exhaustiveCheck: never = code
+ return exhaustiveCheck
+ }
+ }
+}
diff --git a/packages/domain/src/transfer/index.ts b/packages/domain/src/transfer/index.ts
index 3620ca3..634d0d1 100644
--- a/packages/domain/src/transfer/index.ts
+++ b/packages/domain/src/transfer/index.ts
@@ -1,5 +1,6 @@
export * from './types'
export * from './reducer'
+export * from './errors'
export * from './store'
export * from './commands'
export {
diff --git a/packages/domain/src/transfer/reducer.test.ts b/packages/domain/src/transfer/reducer.test.ts
index 87e3196..d374141 100644
--- a/packages/domain/src/transfer/reducer.test.ts
+++ b/packages/domain/src/transfer/reducer.test.ts
@@ -1,5 +1,9 @@
import { describe, expect, it } from 'vitest'
-import { initialTransferSessionState, transferSessionReducer } from './reducer'
+import {
+ TRANSFER_ERROR_CODES,
+ initialTransferSessionState,
+ transferSessionReducer
+} from './reducer'
import type { TransferAction, TransferSessionState } from './types'
import type { IncomingFileOffer } from '@altersend/core'
@@ -27,12 +31,15 @@ describe('transferSessionReducer — lifecycle', () => {
})
it('clears errorMessage on booted when one is present', () => {
- const state = make({ errorMessage: 'old' })
- expect(apply(state, { type: 'booted' }).errorMessage).toBeNull()
+ const state = make({ errorCode: TRANSFER_ERROR_CODES.transferFailed, errorMessage: 'old' })
+ const next = apply(state, { type: 'booted' })
+ expect(next.errorCode).toBeNull()
+ expect(next.errorMessage).toBeNull()
})
- it('sets errorMessage on boot_failed', () => {
+ it('sets a typed error on boot_failed', () => {
const next = apply(make(), { type: 'boot_failed', message: 'boom' })
+ expect(next.errorCode).toBe(TRANSFER_ERROR_CODES.transferFailed)
expect(next.errorMessage).toBe('boom')
})
})
@@ -101,13 +108,14 @@ describe('transferSessionReducer — connection', () => {
expect(apply(make(), { type: 'reconnecting' }).isReconnecting).toBe(true)
})
- it('join_failed clears the session and stores the error', () => {
+ it('join_failed clears the session and stores a typed error', () => {
const next = apply(make({ role: 'receiver', connectionState: 'joining' }), {
type: 'join_failed',
message: 'no host'
})
expect(next.role).toBeNull()
expect(next.connectionState).toBe('disconnected')
+ expect(next.errorCode).toBe(TRANSFER_ERROR_CODES.joinFailed)
expect(next.errorMessage).toBe('no host')
})
})
@@ -133,7 +141,8 @@ describe('transferSessionReducer — peer_unreachable', () => {
expect(next.role).toBeNull()
expect(next.connectionState).toBe('disconnected')
expect(next.topic).toBe('')
- expect(next.errorMessage).toMatch(/Couldn't reach the sender/)
+ expect(next.errorCode).toBe(TRANSFER_ERROR_CODES.peerUnreachable)
+ expect(next.errorMessage).toBeNull()
})
})
@@ -208,6 +217,41 @@ describe('transferSessionReducer — receive flow', () => {
expect(next).toBe(state)
})
+ it('receive_download_event preserves an existing transfer error on non-failed updates', () => {
+ const state = apply(make({ role: 'receiver' }), {
+ type: 'transfer_ready',
+ files: [offer('a', 'a.txt')]
+ })
+ const failed = apply(state, {
+ type: 'receive_download_event',
+ event: {
+ type: 'status',
+ state: 'download-failed',
+ transferId: 'tx-1',
+ fileId: 'a',
+ file: 'a.txt',
+ path: '/files/a.txt',
+ message: 'disk full'
+ }
+ })
+ const next = apply(failed, {
+ type: 'receive_download_event',
+ event: {
+ type: 'status',
+ state: 'downloading',
+ transferId: 'tx-1',
+ fileId: 'a',
+ file: 'a.txt',
+ path: '/files/a.txt',
+ totalBytes: 1024,
+ bytesTransferred: 512
+ }
+ })
+
+ expect(next.errorCode).toBe(TRANSFER_ERROR_CODES.downloadFailed)
+ expect(next.errorMessage).toBe('disk full')
+ })
+
it('download_routed is a no-op when role is not receiver', () => {
const state = make({ role: 'sender' })
const next = apply(state, {
@@ -258,11 +302,22 @@ describe('transferSessionReducer — sender guards', () => {
})
describe('transferSessionReducer — misc', () => {
- it('set_error sets the error message', () => {
+ it('set_error sets a typed generic transfer error by default', () => {
const next = apply(make(), { type: 'set_error', message: 'broken' })
+ expect(next.errorCode).toBe(TRANSFER_ERROR_CODES.transferFailed)
expect(next.errorMessage).toBe('broken')
})
+ it('set_error can store a typed download error', () => {
+ const next = apply(make(), {
+ type: 'set_error',
+ code: TRANSFER_ERROR_CODES.downloadFailed,
+ message: 'disk full'
+ })
+ expect(next.errorCode).toBe(TRANSFER_ERROR_CODES.downloadFailed)
+ expect(next.errorMessage).toBe('disk full')
+ })
+
it('role_changed: null clears all session-specific fields', () => {
const state = make({
role: 'sender',
diff --git a/packages/domain/src/transfer/reducer.ts b/packages/domain/src/transfer/reducer.ts
index f0a63bc..fae2042 100644
--- a/packages/domain/src/transfer/reducer.ts
+++ b/packages/domain/src/transfer/reducer.ts
@@ -6,8 +6,11 @@ import {
} from '../receive/downloadModel'
import { applySharingProgress, getPhaseFromSelection, mergeSelectedFiles } from '../send/draftModel'
import { applyPeerDownloadEvent } from '../send/shareModel'
+import { TRANSFER_ERROR_CODES } from './types'
import type { ConnectionState, TransferAction, TransferSessionState } from './types'
+export { TRANSFER_ERROR_CODES } from './types'
+
export const initialTransferSessionState: TransferSessionState = {
topic: '',
connectionState: 'disconnected',
@@ -21,9 +24,16 @@ export const initialTransferSessionState: TransferSessionState = {
uploadItems: [],
peerDownloads: {},
connectedPeers: {},
+ errorCode: null,
errorMessage: null
}
+function clearError(state: TransferSessionState): TransferSessionState {
+ return state.errorCode === null && state.errorMessage === null
+ ? state
+ : { ...state, errorCode: null, errorMessage: null }
+}
+
function mergeIncomingFileOffers(
current: TransferSessionState['incomingFileOffers'],
nextFiles: TransferSessionState['incomingFileOffers']
@@ -50,6 +60,7 @@ function endSession(state: TransferSessionState): TransferSessionState {
connectionState: 'disconnected',
peerCount: 0,
topic: '',
+ errorCode: null,
errorMessage: null
}
}
@@ -61,9 +72,13 @@ export function transferSessionReducer(
switch (action.type) {
// ─── Lifecycle ────────────────────────────────────────────────
case 'booted':
- return state.errorMessage === null ? state : { ...state, errorMessage: null }
+ return clearError(state)
case 'boot_failed':
- return { ...state, errorMessage: action.message }
+ return {
+ ...state,
+ errorCode: action.code ?? TRANSFER_ERROR_CODES.transferFailed,
+ errorMessage: action.message
+ }
// ─── Connection ───────────────────────────────────────────────
case 'status_changed':
@@ -71,11 +86,17 @@ export function transferSessionReducer(
case 'disconnected':
return endSession(state)
case 'joining':
- return { ...state, connectionState: 'joining', errorMessage: null }
+ return { ...state, connectionState: 'joining', errorCode: null, errorMessage: null }
case 'joined': {
const peerCount = typeof action.peers === 'number' ? action.peers : state.peerCount
const resolved: ConnectionState = peerCount > 0 ? 'peer-connected' : 'joined'
- return { ...state, connectionState: resolved, peerCount, errorMessage: null }
+ return {
+ ...state,
+ connectionState: resolved,
+ peerCount,
+ errorCode: null,
+ errorMessage: null
+ }
}
case 'peer-connected': {
const peerCount = action.peers ?? 1
@@ -84,6 +105,7 @@ export function transferSessionReducer(
connectionState: 'peer-connected',
peerCount,
isReconnecting: false,
+ errorCode: null,
errorMessage: null
}
}
@@ -103,12 +125,20 @@ export function transferSessionReducer(
uploadItems: [],
peerDownloads: {},
connectedPeers: {},
+ errorCode: action.code ?? TRANSFER_ERROR_CODES.joinFailed,
errorMessage: action.message
}
// ─── Send flow ────────────────────────────────────────────────
case 'share_requested':
- return { ...state, role: 'sender', peerDownloads: {}, connectedPeers: {}, errorMessage: null }
+ return {
+ ...state,
+ role: 'sender',
+ peerDownloads: {},
+ connectedPeers: {},
+ errorCode: null,
+ errorMessage: null
+ }
case 'session_hosted':
return { ...state, topic: action.topic }
case 'add_selected_files': {
@@ -151,6 +181,7 @@ export function transferSessionReducer(
return {
...state,
uploadItems: applySharingProgress(state.uploadItems, action.event),
+ errorCode: null,
errorMessage: null
}
case 'peer_download_event':
@@ -196,6 +227,7 @@ export function transferSessionReducer(
connectedPeers: {},
connectionState: 'joining',
peerCount: 0,
+ errorCode: null,
errorMessage: null
}
case 'transfer_ready': {
@@ -208,6 +240,7 @@ export function transferSessionReducer(
state.receiveDownloadStates,
incomingFileOffers
),
+ errorCode: null,
errorMessage: null
}
}
@@ -224,10 +257,14 @@ export function transferSessionReducer(
return {
...state,
receiveDownloadStates: nextDownloadStates,
+ errorCode: TRANSFER_ERROR_CODES.downloadFailed,
errorMessage: action.event.message ?? state.errorMessage
}
}
- return { ...state, receiveDownloadStates: nextDownloadStates, errorMessage: null }
+ return {
+ ...state,
+ receiveDownloadStates: nextDownloadStates
+ }
}
case 'download_routed':
if (state.role !== 'receiver') return state
@@ -251,7 +288,8 @@ export function transferSessionReducer(
isReconnecting: false,
topic: '',
connectedPeers: {},
- errorMessage: "Couldn't reach the sender. Check the code and try again."
+ errorCode: TRANSFER_ERROR_CODES.peerUnreachable,
+ errorMessage: null
}
// ─── Misc ─────────────────────────────────────────────────────
@@ -272,7 +310,11 @@ export function transferSessionReducer(
: {})
}
case 'set_error':
- return { ...state, errorMessage: action.message }
+ return {
+ ...state,
+ errorCode: action.code ?? TRANSFER_ERROR_CODES.transferFailed,
+ errorMessage: action.message
+ }
default: {
const exhaustiveCheck: never = action
diff --git a/packages/domain/src/transfer/types.ts b/packages/domain/src/transfer/types.ts
index d8cc90a..31288f4 100644
--- a/packages/domain/src/transfer/types.ts
+++ b/packages/domain/src/transfer/types.ts
@@ -1,4 +1,10 @@
-import type { IncomingFileOffer, RendererTransferEvent, TransferRole } from '@altersend/core'
+import {
+ TRANSFER_ERROR_CODES,
+ type IncomingFileOffer,
+ type RendererTransferEvent,
+ type TransferErrorCode,
+ type TransferRole
+} from '@altersend/core'
import type {
DownloadItemState,
ReceiveDownloadStatusEvent,
@@ -10,6 +16,8 @@ import type { SelectedFile, SenderUploadItem } from '../send/draftTypes'
import type { SendDraftPhase } from '../send/pageUi'
export type { TransferRole }
+export { TRANSFER_ERROR_CODES }
+export type { TransferErrorCode }
export type ConnectionState = 'disconnected' | 'joining' | 'joined' | 'peer-connected'
@@ -26,18 +34,19 @@ export interface TransferSessionState {
uploadItems: SenderUploadItem[]
peerDownloads: Record<string, PeerDownloadEvent>
connectedPeers: Record<string, ConnectedPeer>
+ errorCode: TransferErrorCode | null
errorMessage: string | null
}
export type TransferAction =
| { type: 'booted' }
- | { type: 'boot_failed'; message: string }
+ | { type: 'boot_failed'; code?: TransferErrorCode; message: string }
| { type: 'session_hosted'; topic: string }
| { type: 'join_requested' }
| { type: 'share_requested' }
- | { type: 'join_failed'; message: string }
+ | { type: 'join_failed'; code?: TransferErrorCode; message: string }
| { type: 'clear_session' }
- | { type: 'set_error'; message: string }
+ | { type: 'set_error'; code?: TransferErrorCode; message: string }
| { type: 'status_changed'; state: ConnectionState; peers?: number }
| { type: 'role_changed'; role: TransferRole | null }
| { type: 'apply_sharing_progress'; event: SharingStatusEvent }
diff --git a/packages/locales/README.md b/packages/locales/README.md
index b60789d..870f5c5 100644
--- a/packages/locales/README.md
+++ b/packages/locales/README.md
@@ -1,67 +1,54 @@
# @altersend/locales
-This package centralizes the internationalization (i18n) infrastructure for the AlterSend application, allowing translations to be shared seamlessly between the React Native (mobile) and Electron (desktop) clients.
+Shared internationalization infrastructure for AlterSend desktop and mobile.
-## Architecture Guidelines
+## Contracts
-To maintain a clean separation of concerns and avoid unnecessary dependencies, this package adheres to the following principles:
+- Locale codes are concrete BCP 47-style codes such as `en-US`, `pt-BR`, and `ja-JP`.
+- Saved locale state is app-owned and uses `LocalePreference = 'system' | SupportedLocaleCode`.
+- `resolveActiveLocalePreference(preference, systemLocales)` converts saved preference plus system locales into the active concrete locale.
+- When `isMultiLangEnabled` is false, the active locale resolves to `en-US` and language picker UI stays hidden.
+- `packages/domain` stays runtime-agnostic and does not import i18next.
-1. **Shared JSON Dictionaries**: All language strings are stored as JSON files split by context/feature (e.g., `common`, `send`, `receive`). These are located in `src/locales/<code>/`.
-2. **Framework-Agnostic Core**: Initialization uses vanilla `i18next` (`src/config.ts`).
-3. **Thin React Bindings**: We re-export `useTranslation` from `react-i18next` — the standard, concurrent-safe React binding — rather than maintaining a bespoke hook.
-4. **Lean on Intl**: For formatting numbers, dates, and file sizes, we lean on the platform's built-in `Intl` APIs rather than pulling in large formatting libraries (like moment or date-fns).
+## Catalogs
-## Production-ready gating
+Resources live in `src/locales/<locale>/` and are split by namespace:
-Each language ships a `src/locales/<code>/meta.json`:
+- `common`
+- `send`
+- `receive`
+- `settings`
+- `onboarding`
+- `feedback`
+- `errors`
+- `native`
-```json
-{ "label": "English", "productionReady": true, "dir": "ltr" }
-```
-
-`src/languages.ts` aggregates these into a registry. Only **production-ready** languages are surfaced to users:
-
-- `LANGUAGES` — every registered language (ready or not).
-- `PICKABLE_LANGUAGES` — production-ready only; this is what the Settings picker renders.
-
-This is how the app stays English-only while the full pipeline is wired: `en` is ready, everything else (`pt-BR`, future RTL languages, …) stays hidden until its `productionReady` flag is flipped. `resolveSupportedLocale()` also resolves only to pickable languages, so system detection or a stale persisted value can never land on a not-yet-ready locale.
+Every locale must keep the same namespace and key set as `en-US`. Resource tests reject missing keys, empty strings, missing plural forms, and untranslated English leftovers outside the explicit allowlist.
## Usage
-### In components (reactive)
-
-Scope the hook to the namespace you need; keys are then checked at compile time:
-
```tsx
import { useTranslation } from '@altersend/locales'
-function SendHeader() {
- const { t } = useTranslation('send')
- // `t('steps.nope')` would be a TypeScript error.
- return <h1>{t('steps.selecting.title')}</h1>
+function Header() {
+ const { t } = useTranslation(['send'])
+ return <h1>{t('send:page.select.title')}</h1>
}
```
-### Outside React
-
-Use the initialized instance directly. Namespaced keys use the `ns:key` form:
+Outside React, use `i18nextInstance` or the package helpers:
```ts
-import { i18nextInstance } from '@altersend/locales'
+import { changeI18nLanguage, initI18n, resolveActiveLocalePreference } from '@altersend/locales'
-i18nextInstance.t('buttons.cancel') // default `common` namespace
-i18nextInstance.t('send:steps.selecting.title') // explicit namespace
+await initI18n(resolveActiveLocalePreference(savedPreference, systemLocales))
+await changeI18nLanguage('en-US')
```
-### Switching language
-
-Locale state lives in the domain settings store (`@altersend/domain`), not here. Call `changeLocale(code)` from the domain package — it normalizes the input, updates the store, and calls `i18next.changeLanguage`.
-
-## Adding a new language
-
-To add a language (e.g., Brazilian Portuguese — `pt-BR`):
+## Adding A Locale
-1. Create `src/locales/pt-BR/` with a `meta.json` (`productionReady: false` until complete) and a translated copy of each namespace file (`common.json`, `send.json`, …).
-2. Register it in the `REGISTRY` in `src/languages.ts` and add its resources to `src/config.ts`.
-3. Translate and review the strings.
-4. Flip `productionReady` to `true` in its `meta.json` — it now appears in the picker.
+1. Add the locale to `SUPPORTED_LOCALES` in `src/locale.ts`.
+2. Add translated namespace files under `src/locales/<locale>/`.
+3. Register the resources in `src/resources.ts`.
+4. Add native metadata in the `native` namespace when needed.
+5. Run the locale tests before exposing the language.
diff --git a/packages/locales/src/config.ts b/packages/locales/src/config.ts
deleted file mode 100644
index c6ecee6..0000000
--- a/packages/locales/src/config.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import i18next from 'i18next'
-import { initReactI18next } from 'react-i18next'
-import common from './locales/en-US/common.json'
-import send from './locales/en-US/send.json'
-import { getInitialLocale } from './utils'
-
-const resources = {
- 'en-US': {
- common,
- send
- }
-}
-
-// Resources are bundled (no async backend), so v26 initializes synchronously.
-// `useSuspense: false` keeps React Native from suspending on a translation read;
-// react-i18next re-renders consumers once initialization settles regardless.
-void i18next
- .use(initReactI18next)
- .init({
- resources,
- lng: getInitialLocale(),
- fallbackLng: 'en-US',
- ns: ['common', 'send'],
- defaultNS: 'common',
- interpolation: { escapeValue: false },
- react: { useSuspense: false }
- })
- .catch((error) => {
- console.error('i18next initialization failed', error)
- })
-
-export default i18next
diff --git a/packages/locales/src/desktop-select-behavior.test.ts b/packages/locales/src/desktop-select-behavior.test.ts
new file mode 100644
index 0000000..6fd18b7
--- /dev/null
+++ b/packages/locales/src/desktop-select-behavior.test.ts
@@ -0,0 +1,60 @@
+import { describe, expect, it } from 'vitest'
+
+const selectBehaviorModulePath = new URL(
+ '../../../apps/desktop/src/renderer/components/selectBehavior.ts',
+ import.meta.url
+).pathname
+
+describe('desktop Select behavior', () => {
+ it('closes the listbox before notifying consumers about a changed option', async () => {
+ const { chooseSelectOption } = await import(/* @vite-ignore */ selectBehaviorModulePath)
+ const events: string[] = []
+
+ chooseSelectOption({
+ option: { value: 'ko-KR', label: 'Korean' },
+ currentValue: 'en-US',
+ close: () => events.push('close'),
+ onChange: (value: string) => events.push(`change:${value}`)
+ })
+
+ expect(events).toEqual(['close', 'change:ko-KR'])
+ })
+
+ it('closes the listbox without firing onChange when the current option is selected', async () => {
+ const { chooseSelectOption } = await import(/* @vite-ignore */ selectBehaviorModulePath)
+ const events: string[] = []
+
+ chooseSelectOption({
+ option: { value: 'en-US', label: 'English' },
+ currentValue: 'en-US',
+ close: () => events.push('close'),
+ onChange: (value: string) => events.push(`change:${value}`)
+ })
+
+ expect(events).toEqual(['close'])
+ })
+
+ it('handles keyboard navigation without relying on the native select popup', async () => {
+ const { getNextSelectKeyboardState } = await import(/* @vite-ignore */ selectBehaviorModulePath)
+
+ expect(
+ getNextSelectKeyboardState({
+ key: 'ArrowDown',
+ open: true,
+ selectedIndex: 0,
+ highlightedIndex: 0,
+ optionCount: 3
+ })
+ ).toEqual({ action: 'highlight', highlightedIndex: 1, preventDefault: true })
+
+ expect(
+ getNextSelectKeyboardState({
+ key: 'Escape',
+ open: true,
+ selectedIndex: 0,
+ highlightedIndex: 1,
+ optionCount: 3
+ })
+ ).toEqual({ action: 'close', preventDefault: true })
+ })
+})
diff --git a/packages/locales/src/desktop-select-source.test.ts b/packages/locales/src/desktop-select-source.test.ts
new file mode 100644
index 0000000..5b12e6b
--- /dev/null
+++ b/packages/locales/src/desktop-select-source.test.ts
@@ -0,0 +1,70 @@
+import { readFileSync } from 'node:fs'
+import { describe, expect, it } from 'vitest'
+
+const desktopPackageJson = JSON.parse(
+ readFileSync(new URL('../../../apps/desktop/package.json', import.meta.url), 'utf8')
+) as {
+ scripts: Record<string, string>
+}
+const selectSource = readFileSync(
+ new URL('../../../apps/desktop/src/renderer/components/Select.tsx', import.meta.url),
+ 'utf8'
+)
+const selectBehaviorSource = readFileSync(
+ new URL('../../../apps/desktop/src/renderer/components/selectBehavior.ts', import.meta.url),
+ 'utf8'
+)
+const desktopMainSource = readFileSync(
+ new URL('../../../apps/desktop/src/renderer/main.tsx', import.meta.url),
+ 'utf8'
+)
+const desktopIndexCssSource = readFileSync(
+ new URL('../../../apps/desktop/src/renderer/index.css', import.meta.url),
+ 'utf8'
+)
+const footerBarSource = readFileSync(
+ new URL('../../../apps/desktop/src/renderer/pages/TransferPage/FooterBar.tsx', import.meta.url),
+ 'utf8'
+)
+
+describe('desktop Select implementation', () => {
+ it('uses an app-controlled listbox instead of the native select popup', () => {
+ expect(selectSource).not.toContain('<select')
+ expect(selectSource).toContain("role='listbox'")
+ expect(selectSource).toContain("role='option'")
+ })
+
+ it('keeps locale font synchronization inside the shared ThemeProvider', () => {
+ expect(desktopMainSource).not.toContain('getFontFamilyCssVariables')
+ expect(desktopMainSource).not.toContain('fontVariables')
+ expect(desktopMainSource).not.toContain('<div style={fontVariables}>')
+ })
+
+ it('forces plain form controls to inherit the locale font', () => {
+ expect(desktopIndexCssSource).toMatch(
+ /button,\s*\n\s*input,\s*\n\s*select,\s*\n\s*textarea\s*\{\s*\n\s*font: inherit;\s*\n\s*\}/
+ )
+ })
+
+ it('supports per-option fonts for multilingual language names', () => {
+ expect(selectBehaviorSource).toContain('fontFamily?: string')
+ expect(selectSource).toContain(
+ 'style={option.fontFamily ? { fontFamily: option.fontFamily } : undefined}'
+ )
+ expect(footerBarSource).toContain('getLocaleFontFamily')
+ expect(footerBarSource).toContain('getFontFamilyCssVariables')
+ expect(footerBarSource).toContain('fontFamily: getLocaleOptionFontFamily(option)')
+ })
+
+ it('keeps the desktop build script portable across Windows and Unix shells', () => {
+ expect(desktopPackageJson.scripts.build).not.toMatch(/\bcp\b/)
+ expect(desktopPackageJson.scripts.build).toContain('node scripts/copy-preload.cjs')
+
+ const copyScript = readFileSync(
+ new URL('../../../apps/desktop/scripts/copy-preload.cjs', import.meta.url),
+ 'utf8'
+ )
+ expect(copyScript).toContain('copyFileSync')
+ expect(copyScript).toContain('mkdirSync')
+ })
+})
diff --git a/packages/locales/src/i18n-augmentation.ts b/packages/locales/src/i18n-augmentation.ts
index 65f00d3..44a3a88 100644
--- a/packages/locales/src/i18n-augmentation.ts
+++ b/packages/locales/src/i18n-augmentation.ts
@@ -1,19 +1,21 @@
import common from './locales/en-US/common.json'
+import errors from './locales/en-US/errors.json'
+import feedback from './locales/en-US/feedback.json'
+import native from './locales/en-US/native.json'
+import onboarding from './locales/en-US/onboarding.json'
+import receive from './locales/en-US/receive.json'
import send from './locales/en-US/send.json'
+import settings from './locales/en-US/settings.json'
-/**
- * Shape of the bundled English resources, used as the source of truth for
- * compile-time key checking of `t(...)`.
- *
- * This lives in a real `.ts` module (not an ambient `.d.ts`) and is re-exported
- * from `index.ts` so the `declare module` augmentation below is emitted to
- * `dist` and actually reaches consumers (`domain`, the apps). An input `.d.ts`
- * is not copied to `dist` by `tsc`, so the augmentation would otherwise apply
- * only inside this package and silently provide no safety downstream.
- */
export interface Resources {
common: typeof common
+ errors: typeof errors
+ feedback: typeof feedback
+ native: typeof native
+ onboarding: typeof onboarding
+ receive: typeof receive
send: typeof send
+ settings: typeof settings
}
declare module 'i18next' {
diff --git a/packages/locales/src/i18n.test.ts b/packages/locales/src/i18n.test.ts
new file mode 100644
index 0000000..42ddeae
--- /dev/null
+++ b/packages/locales/src/i18n.test.ts
@@ -0,0 +1,27 @@
+import { describe, expect, it } from 'vitest'
+import { changeI18nLanguage, i18nextInstance, initI18n } from './i18n'
+
+describe.sequential('i18n runtime', () => {
+ it('initializes and switches languages', async () => {
+ await initI18n('en-US')
+ expect(i18nextInstance.language).toBe('en-US')
+ expect(i18nextInstance.t('common:labels.language')).toBe('Language')
+
+ await changeI18nLanguage('ja-JP')
+ expect(i18nextInstance.language).toBe('ja-JP')
+ expect(i18nextInstance.t('common:labels.language')).toBe('言語')
+
+ await changeI18nLanguage('en-GB')
+ expect(i18nextInstance.language).toBe('en-GB')
+ expect(i18nextInstance.t('common:labels.language')).toBe('Language')
+ })
+
+ it('resolves pluralized copy through i18next count rules', async () => {
+ await initI18n('en-US')
+
+ expect(i18nextInstance.t('common:files.count', { count: 1 })).toBe('1 file')
+ expect(i18nextInstance.t('common:files.count', { count: 2 })).toBe('2 files')
+ expect(i18nextInstance.t('send:actions.sendFiles', { count: 1 })).toBe('Send 1 file')
+ expect(i18nextInstance.t('send:actions.sendFiles', { count: 2 })).toBe('Send 2 files')
+ })
+})
diff --git a/packages/locales/src/i18n.ts b/packages/locales/src/i18n.ts
new file mode 100644
index 0000000..a31c54a
--- /dev/null
+++ b/packages/locales/src/i18n.ts
@@ -0,0 +1,38 @@
+import i18next, { type i18n, type Resource } from 'i18next'
+import { initReactI18next } from 'react-i18next'
+import { DEFAULT_LOCALE, type SupportedLocaleCode } from './locale'
+import { RESOURCES } from './resources'
+
+export const i18nextInstance: i18n = i18next.createInstance()
+
+let initPromise: Promise<void> | null = null
+
+export function initI18n(locale: SupportedLocaleCode = DEFAULT_LOCALE): Promise<i18n> {
+ if (!initPromise) {
+ initPromise = i18nextInstance
+ .use(initReactI18next)
+ .init({
+ resources: RESOURCES as unknown as Resource,
+ lng: locale,
+ fallbackLng: DEFAULT_LOCALE,
+ defaultNS: 'common',
+ ns: Object.keys(RESOURCES[DEFAULT_LOCALE]),
+ interpolation: { escapeValue: false },
+ react: { useSuspense: false }
+ })
+ .then(() => undefined)
+ }
+
+ const pendingInit = initPromise!
+ return pendingInit.then(async () => {
+ if (i18nextInstance.language !== locale) {
+ await i18nextInstance.changeLanguage(locale)
+ }
+ return i18nextInstance
+ })
+}
+
+export async function changeI18nLanguage(locale: SupportedLocaleCode): Promise<void> {
+ await initI18n(locale)
+ await i18nextInstance.changeLanguage(locale)
+}
diff --git a/packages/locales/src/index.ts b/packages/locales/src/index.ts
index 023f137..f9836ab 100644
--- a/packages/locales/src/index.ts
+++ b/packages/locales/src/index.ts
@@ -1,7 +1,19 @@
-export { default as i18nextInstance } from './config'
-export { useTranslation } from 'react-i18next'
-export * from './languages'
-export * from './utils'
-// Re-exported so the `declare module 'i18next'` augmentation in this module is
-// emitted to `dist` and applied in consuming packages (typed `t` keys).
+import { useTranslation as useReactTranslation } from 'react-i18next'
+export { Trans } from 'react-i18next'
+export * from './i18n'
+export * from './locale'
+export * from './resources'
export type { Resources } from './i18n-augmentation'
+
+type TranslationOptions = Record<string, unknown>
+
+export function useTranslation(namespaces?: string | string[]) {
+ const { t, i18n, ready } = useReactTranslation(namespaces as never)
+ const translate = t as unknown as (key: string, options?: TranslationOptions) => string
+
+ return {
+ t: translate,
+ i18n,
+ ready
+ }
+}
diff --git a/packages/locales/src/languages.test.ts b/packages/locales/src/languages.test.ts
deleted file mode 100644
index 368a20f..0000000
--- a/packages/locales/src/languages.test.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { LANGUAGES, PICKABLE_LANGUAGES, getLanguage, isPickable, isRTL } from './languages'
-
-describe('language registry', () => {
- it('registers English and Brazilian Portuguese', () => {
- expect(LANGUAGES.map((l) => l.code).sort()).toEqual(['en-US', 'pt-BR'])
- })
-
- it('only offers production-ready languages in the picker', () => {
- expect(PICKABLE_LANGUAGES.map((l) => l.code)).toEqual(['en-US'])
- expect(isPickable('en-US')).toBe(true)
- // pt-BR is registered but not production-ready yet → hidden from the picker.
- expect(isPickable('pt-BR')).toBe(false)
- })
-
- it('exposes label and direction metadata', () => {
- expect(getLanguage('en-US')).toMatchObject({ label: 'English', dir: 'ltr' })
- expect(getLanguage('pt-BR')).toMatchObject({ dir: 'ltr', productionReady: false })
- expect(getLanguage('xx')).toBeUndefined()
- })
-
- it('derives RTL from registry metadata', () => {
- expect(isRTL('en-US')).toBe(false)
- expect(isRTL('pt-BR')).toBe(false)
- // Unregistered tags are treated as LTR (they are never selectable anyway).
- expect(isRTL('ar')).toBe(false)
- })
-})
diff --git a/packages/locales/src/languages.ts b/packages/locales/src/languages.ts
deleted file mode 100644
index 935adb6..0000000
--- a/packages/locales/src/languages.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import enMeta from './locales/en-US/meta.json'
-import ptBrMeta from './locales/pt-BR/meta.json'
-
-export type TextDirection = 'ltr' | 'rtl'
-
-export interface LanguageMeta {
- /** Native display name shown in the language picker. */
- label: string
- /**
- * Whether the language is complete enough to be offered to users. Only
- * production-ready languages appear in the picker; everything else (partial
- * translations, untested RTL layouts, …) stays hidden until promoted.
- */
- productionReady: boolean
- /** Writing direction. RTL languages stay hidden until layout support lands. */
- dir: TextDirection
-}
-
-export interface Language extends LanguageMeta {
- code: string
-}
-
-/**
- * Registry of every known language, keyed by BCP-47 code, including ones that
- * are not yet production-ready. Each entry's metadata lives next to its
- * translations in `locales/<code>/meta.json` so adding a language is a single
- * self-contained folder.
- */
-const REGISTRY = {
- 'en-US': enMeta,
- 'pt-BR': ptBrMeta
-}
-
-export type SupportedLanguageCode = keyof typeof REGISTRY
-
-export type LocalePreference = 'system' | SupportedLanguageCode
-
-export const DEFAULT_LANGUAGE = 'en-US'
-
-/**
- * Release gate for the language-picker UI. While `false`, the in-app language
- * selection is hidden (desktop Settings + mobile Settings) so the app stays
- * single-language until translations ship; the i18n infrastructure stays wired
- * underneath. Flip to `true` to expose the picker.
- */
-export const MULTI_LANG_ENABLED = false
-
-// `dir` widens to `string` when imported from JSON, so it is narrowed here.
-function toLanguage(
- code: string,
- meta: { label: string; productionReady: boolean; dir: string }
-): Language {
- return {
- code,
- label: meta.label,
- productionReady: meta.productionReady,
- dir: meta.dir === 'rtl' ? 'rtl' : 'ltr'
- }
-}
-
-/** All registered languages (ready or not). */
-export const LANGUAGES: Language[] = Object.entries(REGISTRY).map(([code, meta]) =>
- toLanguage(code, meta)
-)
-
-/** Languages offered in the picker — production-ready only. */
-export const PICKABLE_LANGUAGES: Language[] = LANGUAGES.filter((l) => l.productionReady)
-
-export function getLanguage(code: string): Language | undefined {
- return LANGUAGES.find((l) => l.code === code)
-}
-
-/** Whether `code` is registered and production-ready (i.e. user-selectable). */
-export function isPickable(code: string): boolean {
- return PICKABLE_LANGUAGES.some((l) => l.code === code)
-}
-
-/** Right-to-left check driven by the registry (single source of truth). */
-export function isRTL(code: string): boolean {
- return getLanguage(code)?.dir === 'rtl'
-}
diff --git a/packages/locales/src/locale.test.ts b/packages/locales/src/locale.test.ts
new file mode 100644
index 0000000..7668c1b
--- /dev/null
+++ b/packages/locales/src/locale.test.ts
@@ -0,0 +1,101 @@
+import { describe, expect, it } from 'vitest'
+import {
+ DEFAULT_LOCALE,
+ LOCALE_OPTIONS,
+ SUPPORTED_LOCALES,
+ getLocaleByCode,
+ getLocaleFontFamily,
+ isMultiLangEnabled,
+ isLocalePreference,
+ resolveActiveLocalePreference,
+ resolveLocalePreference
+} from './locale'
+
+describe('locale registry', () => {
+ it('registers the production-ready locale set in picker order', () => {
+ expect(SUPPORTED_LOCALES.map((locale) => locale.code)).toEqual([
+ 'en-US',
+ 'en-GB',
+ 'de-DE',
+ 'es-419',
+ 'es-ES',
+ 'fr-FR',
+ 'it-IT',
+ 'pt-BR',
+ 'ja-JP',
+ 'ko-KR',
+ 'zh-CN',
+ 'zh-TW'
+ ])
+ })
+
+ it('puts the system option first in picker options', () => {
+ expect(LOCALE_OPTIONS[0]).toMatchObject({ preference: 'system' })
+ expect(LOCALE_OPTIONS.slice(1).map((option) => option.preference)).toEqual(
+ SUPPORTED_LOCALES.map((locale) => locale.code)
+ )
+ })
+
+ it('validates locale preferences', () => {
+ expect(isLocalePreference('system')).toBe(true)
+ expect(isLocalePreference('es-419')).toBe(true)
+ expect(isLocalePreference('es-MX')).toBe(false)
+ })
+
+ it('looks up locale metadata by code', () => {
+ expect(getLocaleByCode('ja-JP')).toMatchObject({
+ code: 'ja-JP',
+ nativeName: '日本語',
+ dir: 'ltr'
+ })
+ expect(getLocaleByCode('ar')).toBeUndefined()
+ })
+
+ it('maps CJK locales to bundled script font families', () => {
+ expect(getLocaleFontFamily('ja-JP')).toBe('japanese')
+ expect(getLocaleFontFamily('ko-KR')).toBe('korean')
+ expect(getLocaleFontFamily('zh-CN')).toBe('simplifiedChinese')
+ expect(getLocaleFontFamily('zh-TW')).toBe('traditionalChinese')
+ })
+})
+
+describe('resolveLocalePreference', () => {
+ it('keeps an explicit supported locale', () => {
+ expect(resolveLocalePreference('en-GB', ['ja-JP'])).toBe('en-GB')
+ })
+
+ it('uses the first matching system locale for system preference', () => {
+ expect(resolveLocalePreference('system', ['fr-CA', 'de-DE'])).toBe('fr-FR')
+ })
+
+ it('normalizes common language and regional tags', () => {
+ expect(resolveLocalePreference('system', ['en'])).toBe('en-US')
+ expect(resolveLocalePreference('system', ['en-AU'])).toBe('en-US')
+ expect(resolveLocalePreference('system', ['ja'])).toBe('ja-JP')
+ expect(resolveLocalePreference('system', ['ko'])).toBe('ko-KR')
+ expect(resolveLocalePreference('system', ['zh-Hans'])).toBe('zh-CN')
+ expect(resolveLocalePreference('system', ['zh-Hant'])).toBe('zh-TW')
+ expect(resolveLocalePreference('system', ['zh-HK'])).toBe('zh-TW')
+ expect(resolveLocalePreference('system', ['es-MX'])).toBe('es-419')
+ expect(resolveLocalePreference('system', ['es-AR'])).toBe('es-419')
+ expect(resolveLocalePreference('system', ['es'])).toBe('es-419')
+ expect(resolveLocalePreference('system', ['pt'])).toBe('pt-BR')
+ })
+
+ it('falls back to en-US for unsupported or empty inputs', () => {
+ expect(resolveLocalePreference('system', ['ru-RU'])).toBe(DEFAULT_LOCALE)
+ expect(resolveLocalePreference('system', [])).toBe(DEFAULT_LOCALE)
+ expect(resolveLocalePreference('not-a-locale', ['ja-JP'])).toBe(DEFAULT_LOCALE)
+ })
+})
+
+describe('release-gated locale activation', () => {
+ it('keeps multi-language UI disabled until release', () => {
+ expect(isMultiLangEnabled).toBe(false)
+ })
+
+ it('forces en-US while multi-language support is release-gated', () => {
+ expect(resolveActiveLocalePreference('ja-JP', ['ja-JP'])).toBe(DEFAULT_LOCALE)
+ expect(resolveActiveLocalePreference('system', ['ko-KR'])).toBe(DEFAULT_LOCALE)
+ })
+})
diff --git a/packages/locales/src/locale.ts b/packages/locales/src/locale.ts
new file mode 100644
index 0000000..e4f9774
--- /dev/null
+++ b/packages/locales/src/locale.ts
@@ -0,0 +1,222 @@
+import releaseConfig from './release.json'
+
+export const DEFAULT_LOCALE = 'en-US'
+export const SYSTEM_LOCALE_PREFERENCE = 'system'
+export const isMultiLangEnabled: boolean = releaseConfig.isMultiLangEnabled
+
+export type TextDirection = 'ltr' | 'rtl'
+export type LocaleFontFamily =
+ | 'latin'
+ | 'japanese'
+ | 'korean'
+ | 'simplifiedChinese'
+ | 'traditionalChinese'
+
+export type SupportedLocaleCode =
+ | 'en-US'
+ | 'en-GB'
+ | 'ja-JP'
+ | 'ko-KR'
+ | 'zh-CN'
+ | 'zh-TW'
+ | 'fr-FR'
+ | 'de-DE'
+ | 'it-IT'
+ | 'pt-BR'
+ | 'es-419'
+ | 'es-ES'
+
+export type LocalePreference = typeof SYSTEM_LOCALE_PREFERENCE | SupportedLocaleCode
+
+export interface SupportedLocale {
+ code: SupportedLocaleCode
+ englishName: string
+ nativeName: string
+ dir: TextDirection
+ fontFamily: LocaleFontFamily
+}
+
+export interface LocaleOption {
+ preference: LocalePreference
+ label: string
+ nativeName?: string
+ resolvedCode?: SupportedLocaleCode
+}
+
+export const SUPPORTED_LOCALES: SupportedLocale[] = [
+ {
+ code: 'en-US',
+ englishName: 'English (US)',
+ nativeName: 'English (US)',
+ dir: 'ltr',
+ fontFamily: 'latin'
+ },
+ {
+ code: 'en-GB',
+ englishName: 'English (UK)',
+ nativeName: 'English (UK)',
+ dir: 'ltr',
+ fontFamily: 'latin'
+ },
+ {
+ code: 'de-DE',
+ englishName: 'German',
+ nativeName: 'Deutsch',
+ dir: 'ltr',
+ fontFamily: 'latin'
+ },
+ {
+ code: 'es-419',
+ englishName: 'Spanish (Latin America)',
+ nativeName: 'Español (Latinoamérica)',
+ dir: 'ltr',
+ fontFamily: 'latin'
+ },
+ {
+ code: 'es-ES',
+ englishName: 'Spanish (Spain)',
+ nativeName: 'Español (España)',
+ dir: 'ltr',
+ fontFamily: 'latin'
+ },
+ {
+ code: 'fr-FR',
+ englishName: 'French',
+ nativeName: 'Français',
+ dir: 'ltr',
+ fontFamily: 'latin'
+ },
+ {
+ code: 'it-IT',
+ englishName: 'Italian',
+ nativeName: 'Italiano',
+ dir: 'ltr',
+ fontFamily: 'latin'
+ },
+ {
+ code: 'pt-BR',
+ englishName: 'Portuguese (Brazil)',
+ nativeName: 'Português (Brasil)',
+ dir: 'ltr',
+ fontFamily: 'latin'
+ },
+ {
+ code: 'ja-JP',
+ englishName: 'Japanese',
+ nativeName: '日本語',
+ dir: 'ltr',
+ fontFamily: 'japanese'
+ },
+ {
+ code: 'ko-KR',
+ englishName: 'Korean',
+ nativeName: '한국어',
+ dir: 'ltr',
+ fontFamily: 'korean'
+ },
+ {
+ code: 'zh-CN',
+ englishName: 'Chinese (Simplified)',
+ nativeName: '简体中文',
+ dir: 'ltr',
+ fontFamily: 'simplifiedChinese'
+ },
+ {
+ code: 'zh-TW',
+ englishName: 'Chinese (Traditional)',
+ nativeName: '繁體中文',
+ dir: 'ltr',
+ fontFamily: 'traditionalChinese'
+ }
+]
+
+const SUPPORTED_CODES = new Set<string>(SUPPORTED_LOCALES.map((locale) => locale.code))
+
+export const LOCALE_OPTIONS: LocaleOption[] = [
+ { preference: SYSTEM_LOCALE_PREFERENCE, label: 'System default' },
+ ...SUPPORTED_LOCALES.map((locale) => ({
+ preference: locale.code,
+ label: locale.englishName,
+ nativeName: locale.nativeName,
+ resolvedCode: locale.code
+ }))
+]
+
+export function getLocaleByCode(code: string): SupportedLocale | undefined {
+ return SUPPORTED_LOCALES.find((locale) => locale.code === code)
+}
+
+export function getLocaleFontFamily(code: SupportedLocaleCode): LocaleFontFamily {
+ return getLocaleByCode(code)?.fontFamily ?? 'latin'
+}
+
+export function isSupportedLocaleCode(
+ code: string | null | undefined
+): code is SupportedLocaleCode {
+ return typeof code === 'string' && SUPPORTED_CODES.has(code)
+}
+
+export function isLocalePreference(value: string | null | undefined): value is LocalePreference {
+ return value === SYSTEM_LOCALE_PREFERENCE || isSupportedLocaleCode(value)
+}
+
+export function normalizeLocalePreference(value: string | null | undefined): LocalePreference {
+ return isLocalePreference(value) ? value : SYSTEM_LOCALE_PREFERENCE
+}
+
+function normalizeTag(tag: string): string {
+ return tag.trim().replace(/_/g, '-')
+}
+
+function resolveSystemLocaleTag(tag: string): SupportedLocaleCode | null {
+ const normalized = normalizeTag(tag)
+ if (!normalized) return null
+
+ if (isSupportedLocaleCode(normalized)) return normalized
+
+ const lower = normalized.toLowerCase()
+ if (lower === 'en' || lower.startsWith('en-')) return 'en-US'
+ if (lower === 'ja' || lower.startsWith('ja-')) return 'ja-JP'
+ if (lower === 'ko' || lower.startsWith('ko-')) return 'ko-KR'
+ if (lower === 'fr' || lower.startsWith('fr-')) return 'fr-FR'
+ if (lower === 'de' || lower.startsWith('de-')) return 'de-DE'
+ if (lower === 'it' || lower.startsWith('it-')) return 'it-IT'
+ if (lower === 'pt' || lower.startsWith('pt-')) return 'pt-BR'
+ if (lower === 'es' || lower.startsWith('es-')) {
+ return lower === 'es-es' ? 'es-ES' : 'es-419'
+ }
+ if (lower === 'zh' || lower.includes('hans') || lower === 'zh-cn' || lower === 'zh-sg') {
+ return 'zh-CN'
+ }
+ if (lower.includes('hant') || lower === 'zh-tw' || lower === 'zh-hk' || lower === 'zh-mo') {
+ return 'zh-TW'
+ }
+
+ return null
+}
+
+export function resolveLocalePreference(
+ preference: string | null | undefined,
+ systemLocales: readonly string[]
+): SupportedLocaleCode {
+ if (isSupportedLocaleCode(preference)) return preference
+
+ if (preference !== SYSTEM_LOCALE_PREFERENCE && preference != null) {
+ return DEFAULT_LOCALE
+ }
+
+ for (const tag of systemLocales) {
+ const resolved = resolveSystemLocaleTag(tag)
+ if (resolved) return resolved
+ }
+
+ return DEFAULT_LOCALE
+}
+
+export function resolveActiveLocalePreference(
+ preference: string | null | undefined,
+ systemLocales: readonly string[]
+): SupportedLocaleCode {
+ if (!isMultiLangEnabled) return DEFAULT_LOCALE
+ return resolveLocalePreference(preference, systemLocales)
+}
diff --git a/packages/locales/src/locales/de-DE/common.json b/packages/locales/src/locales/de-DE/common.json
new file mode 100644
index 0000000..d4380f7
--- /dev/null
+++ b/packages/locales/src/locales/de-DE/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "Direkte Dateiübertragung",
+ "welcome": "Willkommen bei AlterSend",
+ "loadingTagline": "Dateien werden direkt zwischen deinen Geräten übertragen.\nKeine Server, keine Kopien, keine Vermittler."
+ },
+ "actions": {
+ "back": "Zurück",
+ "continue": "Weiter",
+ "getStarted": "Loslegen",
+ "cancel": "Abbrechen",
+ "clear": "Löschen",
+ "close": "Schließen",
+ "copy": "Kopieren",
+ "copied": "Kopiert",
+ "connect": "Verbinden",
+ "connecting": "Verbinden…",
+ "done": "Fertig",
+ "endSession": "Sitzung beenden",
+ "restart": "Neu starten",
+ "tryAgain": "Erneut versuchen",
+ "dismiss": "Schließen",
+ "openSettings": "Einstellungen öffnen",
+ "update": "Aktualisieren",
+ "downloadAll": "Alles herunterladen",
+ "skip": "Überspringen"
+ },
+ "labels": {
+ "settings": "Einstellungen",
+ "language": "Sprache",
+ "systemDefault": "Systemstandard",
+ "camera": "Kamera",
+ "statusBar": "Statusleiste",
+ "transferMode": "Übertragungsmodus",
+ "version": "Versionsnummer",
+ "platform": "Plattform",
+ "desktop": "Desktop-App",
+ "mobile": "Mobilgerät",
+ "send": "Senden",
+ "receive": "Empfangen",
+ "connectionCode": "Verbindungscode"
+ },
+ "files": {
+ "count_one": "{{count}} Datei",
+ "count_other": "{{count}} Dateien",
+ "photos": "Fotos",
+ "files": "Dateien",
+ "downloads": "Dateien › Downloads",
+ "photosAndAlterSend": "Ordner „Fotos + AlterSend“.",
+ "alterSendFolder": "Ordner AlterSend"
+ },
+ "update": {
+ "ready": "Update bereit",
+ "available": "Update verfügbar",
+ "restart": "Neu starten",
+ "update": "Aktualisieren",
+ "restartFailed": "Neustart fehlgeschlagen – bitte beenden und erneut öffnen"
+ },
+ "status": {
+ "connected": "Verbunden"
+ },
+ "confirm": {
+ "leaveShareSession": "Durch das Verlassen wird Ihre aktive Freigabesitzung beendet. Weitermachen?",
+ "leaveReceiveSession": "Durch das Verlassen wird Ihre aktive Empfangssitzung beendet. Weitermachen?"
+ }
+}
diff --git a/packages/locales/src/locales/de-DE/errors.json b/packages/locales/src/locales/de-DE/errors.json
new file mode 100644
index 0000000..278f2ff
--- /dev/null
+++ b/packages/locales/src/locales/de-DE/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "Etwas ist schief gelaufen",
+ "desktopDescription": "AlterSend ist auf einen unerwarteten Fehler gestoßen und muss neu gestartet werden. Der Übertragungsdienst ist möglicherweise instabil, daher ist ein Neustart die sicherste Option.",
+ "mobileDescription": "AlterSend hat einen unerwarteten Fehler festgestellt. Versuchen Sie es erneut oder schließen Sie die App und öffnen Sie sie erneut, wenn das Problem weiterhin besteht.",
+ "restartAlterSend": "Starten Sie AlterSend neu",
+ "tryAgain": "Versuchen Sie es erneut"
+ },
+ "bridgeUnavailable": {
+ "title": "Desktop-Verbindung nicht verfügbar",
+ "description": "Dieses Fenster ist nicht mit der Desktop-App verbunden. Starten Sie AlterSend über die Desktop-App neu.",
+ "status": "Desktop-Verbindung nicht verfügbar"
+ },
+ "transfer": {
+ "invalidTopic": "Der Verbindungscode ist ungültig.",
+ "joinFailed": "Der Sitzung konnte nicht beigetreten werden.",
+ "peerUnreachable": "Der Sender ist nicht erreichbar. Prüfen Sie den Code und versuchen Sie es erneut.",
+ "transferFailed": "Die Übertragung ist fehlgeschlagen. Versuchen Sie es erneut.",
+ "downloadFailed": "Der Download ist fehlgeschlagen. Versuchen Sie es erneut."
+ }
+}
diff --git a/packages/locales/src/locales/de-DE/feedback.json b/packages/locales/src/locales/de-DE/feedback.json
new file mode 100644
index 0000000..71b161c
--- /dev/null
+++ b/packages/locales/src/locales/de-DE/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "Rückmeldung",
+ "types": {
+ "bug": "Fehlerbericht",
+ "feature": "Funktionsanfrage",
+ "general": "Allgemein"
+ },
+ "placeholders": {
+ "bug": "Beschreiben Sie, was passiert ist und wie Sie es reproduzieren können...",
+ "desktopBug": "Beschreiben Sie, was schief gelaufen ist...",
+ "feature": "Was würden Sie gerne in AlterSend sehen?",
+ "desktopFeature": "Was möchten Sie sehen?",
+ "general": "Teilen Sie Ihre Gedanken mit..."
+ },
+ "actions": {
+ "send": "Feedback senden",
+ "sending": "Senden…"
+ },
+ "states": {
+ "sent": "Vielen Dank für Ihr Feedback!",
+ "failed": "Senden fehlgeschlagen. Überprüfen Sie Ihre Verbindung.",
+ "received": "Dein Feedback wurde empfangen."
+ }
+}
diff --git a/packages/locales/src/locales/de-DE/index.ts b/packages/locales/src/locales/de-DE/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/de-DE/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/de-DE/native.json b/packages/locales/src/locales/de-DE/native.json
new file mode 100644
index 0000000..76fbe8d
--- /dev/null
+++ b/packages/locales/src/locales/de-DE/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend verwendet Ihre Kamera, um QR-Verbindungscodes zu scannen.",
+ "localNetwork": "AlterSend nutzt Ihr lokales Netzwerk, um Geräte in der Nähe zu finden und Dateien direkt zu übertragen.",
+ "photoRead": "AlterSend liest Ihre Fotobibliothek, sodass Sie Fotos und Videos auswählen und an ein anderes Gerät senden können.",
+ "photoSave": "AlterSend speichert empfangene Bilder und Videos in Ihrer Fotobibliothek."
+ }
+}
diff --git a/packages/locales/src/locales/de-DE/onboarding.json b/packages/locales/src/locales/de-DE/onboarding.json
new file mode 100644
index 0000000..122c1f5
--- /dev/null
+++ b/packages/locales/src/locales/de-DE/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "Dateien direkt zwischen Geräten.",
+ "description": "Ein Gerät sendet, das andere empfängt. Ein kurzer Code verbindet sie, sodass Dateien direkt gestreamt werden können."
+ },
+ "keepOpen": {
+ "title": "Lassen Sie beide Apps geöffnet.",
+ "description": "Dateien werden direkt zwischen Geräten gestreamt – es gibt keine Cloud. Wenn Sie die App schließen oder im Hintergrund laufen lassen, wird die Übertragung abgebrochen."
+ },
+ "encrypted": {
+ "title": "Ende-zu-Ende verschlüsselt.",
+ "description": "Keine Server, keine Kopien, keine Zwischenhändler. Ihre Dateien werden direkt zwischen Ihnen und dem Empfänger übertragen.",
+ "link": "Lesen Sie unsere Datenschutzbestimmungen"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/de-DE/receive.json b/packages/locales/src/locales/de-DE/receive.json
new file mode 100644
index 0000000..1cce2ca
--- /dev/null
+++ b/packages/locales/src/locales/de-DE/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "Empfangen",
+ "join": {
+ "title": "Dateien empfangen",
+ "description": "Geben Sie einen 64-stelligen Verbindungscode vom Absender ein, um dessen Dateien zu streamen.",
+ "mobileDescription": "Scanne oder importiere den QR-Code des Senders oder füge den 64-Zeichen-Code ein, um die Übertragung zu starten."
+ },
+ "connecting": {
+ "title": "Verbinden",
+ "description": "Aufbau einer sicheren Sitzung mit dem Absender."
+ },
+ "incomingTransfer": {
+ "title": "Dateien verfügbar",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} Datei · {{size}}",
+ "description_other": "{{count}} Dateien · {{size}}"
+ },
+ "completed": {
+ "title_one": "Datei erhalten",
+ "title_other": "Dateien erhalten",
+ "downloadsComplete": "Downloads abgeschlossen"
+ },
+ "reconnecting": {
+ "title": "Wieder verbinden",
+ "description": "Erneute Verbindung zur Sitzung. Sobald die Verknüpfung wiederhergestellt ist, stehen die Dateien wieder zur Verfügung.",
+ "panelDescription": "Verbindung unterbrochen. Sitzung wird wieder betreten…"
+ },
+ "interrupted": {
+ "title": "Übertragung unvollständig",
+ "description": "Der Absender ist gegangen, bevor alle Dateien angekommen sind."
+ },
+ "handshake": {
+ "title": "Verbindung läuft",
+ "description": "Abschluss des sicheren Handshakes mit dem Absender."
+ },
+ "sessionEnded": {
+ "title": "Sitzung beendet",
+ "description": "Kehren Sie zurück, um eine neue Übertragung zu starten."
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "Dateien bereit",
+ "filesReadyDescription": "Der Absender hat freigegebene Dateien. Überprüfen Sie sie und starten Sie jeden Download, wenn Sie bereit sind.",
+ "receivedFiles": "Empfangene Dateien"
+ },
+ "form": {
+ "codeLabel": "Verbindungscode",
+ "codePlaceholder": "64-stelligen Code einfügen…",
+ "orPasteCode": "oder Code einfügen"
+ },
+ "actions": {
+ "scanQr": "Scannen Sie den QR-Code",
+ "allowCamera": "Kamera zulassen",
+ "downloadAll": "Alles herunterladen",
+ "view": "Ansicht",
+ "play": "Wiedergeben",
+ "open": "Offen",
+ "scanQrHint": "Lies den QR-Code des Senders mit der Webcam",
+ "downloadingPercent": "Wird heruntergeladen {{percent}} %",
+ "downloadAllWithSize": "Alle herunterladen ({{size}})",
+ "showInFinder": "Im Finder anzeigen",
+ "backToHome": "Zur Startseite",
+ "viewPhotos": "Fotos ansehen",
+ "scanOrImportQr": "QR scannen oder importieren",
+ "scanOrImportQrHintDesktop": "Webcam verwenden oder ein gespeichertes QR-Bild importieren",
+ "scanOrImportQrHintMobile": "Kamera verwenden oder ein gespeichertes Bild importieren",
+ "importImage": "Bild importieren",
+ "importFromImage": "Aus Bild importieren"
+ },
+ "errors": {
+ "invalidCode": "Geben Sie einen gültigen 64-stelligen Hex-Code ein.",
+ "invalidKey": "Geben Sie einen gültigen 64-stelligen Hex-Schlüssel ein.",
+ "joinFailed": "Der Sitzung konnte nicht beigetreten werden.",
+ "unreachable": "Der Absender konnte nicht erreicht werden. Überprüfen Sie den Code und versuchen Sie es erneut.",
+ "unsupportedQrTitle": "Nicht unterstützter QR-Code",
+ "unsupportedQrHint": "Scannen Sie einen AlterSend-Verbindungscode.",
+ "mobileJoinFailedTitle": "Der Sitzung konnte nicht beigetreten werden",
+ "mobileJoinFailedHint": "Versuchen Sie erneut zu scannen oder fügen Sie den Code manuell ein.",
+ "cameraUnavailable": "Kamera nicht verfügbar.",
+ "cameraCouldNotStart": "Die Kamera konnte nicht gestartet werden. Fügen Sie stattdessen den Verbindungscode ein.",
+ "downloadFailed": "Fehlgeschlagen",
+ "didntArrive": "Nicht angekommen",
+ "transferIssue": "Übertragungsproblem",
+ "imageNoQrTitle": "Kein QR-Code gefunden",
+ "imageNoQrHint": "Wähle ein Bild aus, das einen AlterSend-QR-Code zeigt.",
+ "imageUnsupportedQrHint": "Dieses Bild ist kein AlterSend-Verbindungscode.",
+ "imageReadFailedTitle": "Dieses Bild konnte nicht gelesen werden"
+ },
+ "camera": {
+ "preparingTitle": "Kamera vorbereiten",
+ "preparingDescription": "Überprüfen Sie den Kamerazugriff, damit Sie den QR-Code des Absenders scannen können.",
+ "accessNeededTitle": "Kamerazugriff erforderlich",
+ "accessNeededDescription": "Erlauben Sie der Kamera den Zugriff, um den QR-Verbindungscode eines Absenders zu scannen.",
+ "scanTitle": "Scannen Sie den QR-Code",
+ "scanDescription": "Zentrieren Sie den QR-Code des Absenders innerhalb des Rahmens. AlterSend stellt automatisch eine Verbindung her.",
+ "desktopHint": "Richten Sie den QR-Code des Absenders auf die Webcam – AlterSend stellt automatisch eine Verbindung her.",
+ "blockedTitle": "Kamerazugriff blockiert",
+ "blockedHint": "Erlauben Sie in Ihren Systemeinstellungen den Kamerazugriff für AlterSend und versuchen Sie es dann erneut. Sie können stattdessen auch den Code einfügen.",
+ "noneTitle": "Keine Kamera gefunden",
+ "noneHint": "Schließen Sie zum Scannen eine Webcam an oder fügen Sie stattdessen den Verbindungscode ein.",
+ "unavailableTitle": "Kamera nicht verfügbar",
+ "starting": "Kamera wird gestartet…",
+ "enableTitle": "Kamerazugriff aktivieren",
+ "enableDescription": "Dies wird nur zum Scannen des QR-Codes des Senders benötigt. Du kannst auch zurückgehen und den Code manuell einfügen.",
+ "usePastedCode": "Stattdessen eingefügten Code verwenden",
+ "joiningDescription": "Tritt der Sitzung des Senders bei.",
+ "scanImportTitle": "QR scannen oder importieren",
+ "scanImportDescription": "Richte den QR-Code des Senders im Rahmen aus oder importiere ein gespeichertes Bild. AlterSend verbindet automatisch.",
+ "desktopImportHint": "Richte den QR-Code des Senders im Rahmen aus oder importiere ein gespeichertes Bild. AlterSend verbindet automatisch.",
+ "enableImportDescription": "Die Kamera wird nur zum Scannen eines QR-Codes benötigt. Du kannst auch ein gespeichertes Bild importieren oder den Code manuell einfügen."
+ },
+ "status": {
+ "ready": "Bereit",
+ "saved": "Gespeichert",
+ "failed": "Fehlgeschlagen",
+ "downloadingPercent": "{{percent}} % wird heruntergeladen",
+ "percent": "{{percent}} %",
+ "waitingForFiles": "Warte auf Dateien vom Sender…"
+ },
+ "summary": {
+ "receivedCount_one": "{{completed}} von {{count}} Datei erhalten",
+ "receivedCount_other": "{{completed}} von {{count}} Dateien erhalten",
+ "savedToPhotos_one": "Unter Fotos gespeichert",
+ "savedToPhotos_other": "{{count}} in Fotos gespeichert",
+ "savedInFiles_one": "In Dateien gespeichert",
+ "savedInFiles_other": "{{count}} in Dateien gespeichert",
+ "tapToView": "Zum Ansehen antippen",
+ "saved": "gespeichert",
+ "savedToLocation": "gespeichert in {{location}}",
+ "receivedProgress": "{{completed}} von {{count}} empfangen",
+ "senderLeftBeforeFinishing": "Der Sender hat die Sitzung vor dem Abschluss verlassen.",
+ "filesSaved_one": "{{count}} Datei gespeichert",
+ "filesSaved_other": "{{count}} Dateien gespeichert"
+ }
+}
diff --git a/packages/locales/src/locales/de-DE/send.json b/packages/locales/src/locales/de-DE/send.json
new file mode 100644
index 0000000..6fc5109
--- /dev/null
+++ b/packages/locales/src/locales/de-DE/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "Dateien senden",
+ "description": "Wählen Sie eine oder mehrere Dateien aus und generieren Sie einen Einmalcode für eine direkte verschlüsselte Übertragung."
+ },
+ "preparing": {
+ "title": "Transfer vorbereiten",
+ "description": "Vorbereiten der ausgewählten Dateien, bevor der Freigabecode angezeigt wird."
+ },
+ "waitingForReceiver": {
+ "title": "Teilen Sie den Code",
+ "description": "Senden Sie den Code oder QR an Ihren Empfänger, um die Übertragung zu starten."
+ },
+ "receiverConnected": {
+ "title": "Teilen Sie den Code",
+ "description": "Senden Sie den Code oder QR an Ihren Empfänger, um die Übertragung zu starten."
+ }
+ },
+ "actions": {
+ "sendFiles_one": "{{count}} Datei senden",
+ "sendFiles_other": "{{count}} Dateien senden",
+ "addFiles": "Dateien hinzufügen",
+ "addMoreFiles": "Fügen Sie weitere Dateien hinzu",
+ "dragAndDrop": "Ziehen und ablegen",
+ "clear": "Klar",
+ "endSession": "Sitzung beenden",
+ "pickFilesTitle": "Dateien hinzufügen",
+ "pickPhotos": "Fotos",
+ "pickFiles": "Dateien"
+ },
+ "status": {
+ "waitingForPeer": "Warten auf Empfänger",
+ "peerConnected": "Empfänger verbunden",
+ "uploadComplete": "Hochladen abgeschlossen",
+ "uploadingFiles": "Hochladen von Dateien",
+ "uploaded": "Hochgeladen",
+ "uploading": "Hochladen…",
+ "waiting": "Warten",
+ "failed": "Fehlgeschlagen",
+ "downloaded": "Heruntergeladen",
+ "disconnected": "Nicht verbunden",
+ "online": "Verbunden",
+ "downloading": "Herunterladen",
+ "downloadingPercent": "{{percent}} % wird heruntergeladen"
+ },
+ "connection": {
+ "placeholder": "Sicherer Schlüssel wird generiert…",
+ "copyLabel": "Verbindungscode kopieren",
+ "showQrLabel": "QR-Code anzeigen",
+ "qrCodeLabel": "QR-Code für Verbindungsschlüssel",
+ "qrModalDescription": "Öffnen Sie AlterSend auf einem anderen Gerät und scannen Sie diesen Code",
+ "copiedToast": "In die Zwischenablage kopiert",
+ "scanToConnect": "Zum Verbinden scannen",
+ "orScan": "oder scannen",
+ "generating": "Wird erstellt…",
+ "waitingForConnection": "Warte auf Verbindung…"
+ },
+ "errors": {
+ "folderUnsupported": "Ordner werden noch nicht unterstützt. Bitte wählen Sie nur Dateien aus.",
+ "failedPickFiles": "Dateien konnten nicht ausgewählt werden",
+ "failedPickPhotos": "Fotos konnten nicht ausgewählt werden"
+ },
+ "hints": {
+ "keepOpen": "Durch das Schließen der App wird die Übertragung abgebrochen."
+ },
+ "preparing": {
+ "uploadedCount_one": "{{completed}} von {{count}} Datei hochgeladen",
+ "uploadedCount_other": "{{completed}} von {{count}} Dateien hochgeladen"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} abgeschlossen",
+ "completedDone_other": "{{count}} abgeschlossen",
+ "devices": "Geräte",
+ "connectedCount_one": "{{count}} verbunden",
+ "connectedCount_other": "{{count}} verbunden"
+ },
+ "dropzone": {
+ "addMoreDescription": "oder klicken, um <link>weitere hinzuzufügen</link>",
+ "browseDescription": "oder klicken zum <link>Durchsuchen</link>",
+ "tapAddMoreDescription": "Tippen, um <link>weitere hinzuzufügen</link>",
+ "tapBrowseDescription": "Tippen zum <link>Durchsuchen</link>",
+ "orClickTo": "oder klicken zum",
+ "tapTo": "Tippen zum",
+ "addMoreLink": "weitere hinzufügen",
+ "browseLink": "Durchsuchen"
+ },
+ "files": {
+ "removeLabel": "Entfernen Sie {{name}}"
+ }
+}
diff --git a/packages/locales/src/locales/de-DE/settings.json b/packages/locales/src/locales/de-DE/settings.json
new file mode 100644
index 0000000..586d4a8
--- /dev/null
+++ b/packages/locales/src/locales/de-DE/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "Einstellungen",
+ "languageTitle": "Sprache",
+ "languageHint": "Wählen Sie die von AlterSend verwendete Sprache.",
+ "sections": {
+ "privacy": "Datenschutz",
+ "support": "Unterstützung",
+ "about": "Info"
+ },
+ "crashReports": {
+ "label": "Absturzberichte",
+ "description": "Teilen Sie anonyme Absturzdaten, um AlterSend zu verbessern"
+ },
+ "rows": {
+ "feedback": "Rückmeldung",
+ "feedbackHint": "Melden Sie ein Problem oder schlagen Sie eine Funktion vor",
+ "discord": "Discord",
+ "discordHint": "Treten Sie der Community bei",
+ "contact": "Kontaktieren Sie uns",
+ "privacyPolicy": "Datenschutzrichtlinie",
+ "privacyPolicyHint": "Wie AlterSend mit Ihren Daten umgeht",
+ "terms": "Nutzungsbedingungen",
+ "termsHint": "Regeln für die Verwendung von AlterSend",
+ "website": "Webseite"
+ },
+ "legal": {
+ "terms": "Nutzungsbedingungen",
+ "privacy": "Datenschutzerklärung",
+ "sentence": "<terms>Nutzungsbedingungen</terms> und <privacy>Datenschutzerklärung</privacy>."
+ }
+}
diff --git a/packages/locales/src/locales/en-GB/common.json b/packages/locales/src/locales/en-GB/common.json
new file mode 100644
index 0000000..8e8650c
--- /dev/null
+++ b/packages/locales/src/locales/en-GB/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "Peer-to-peer file transfer",
+ "welcome": "Welcome to AlterSend",
+ "loadingTagline": "Files travel directly between your devices.\nNo servers, no copies, no middlemen."
+ },
+ "actions": {
+ "back": "Back",
+ "continue": "Continue",
+ "getStarted": "Get started",
+ "cancel": "Cancel",
+ "clear": "Clear",
+ "close": "Close",
+ "copy": "Copy",
+ "copied": "Copied",
+ "connect": "Connect",
+ "connecting": "Connecting…",
+ "done": "Done",
+ "endSession": "End session",
+ "restart": "Restart",
+ "tryAgain": "Try again",
+ "dismiss": "Dismiss",
+ "openSettings": "Open settings",
+ "update": "Update",
+ "downloadAll": "Download all",
+ "skip": "Skip"
+ },
+ "labels": {
+ "settings": "Settings",
+ "language": "Language",
+ "systemDefault": "System default",
+ "camera": "Camera",
+ "statusBar": "Status bar",
+ "transferMode": "Transfer mode",
+ "version": "Version",
+ "platform": "Platform",
+ "desktop": "Desktop",
+ "mobile": "Mobile",
+ "send": "Send",
+ "receive": "Receive",
+ "connectionCode": "Connection code"
+ },
+ "files": {
+ "count_one": "{{count}} file",
+ "count_other": "{{count}} files",
+ "photos": "Photos",
+ "files": "Files",
+ "downloads": "Files › Downloads",
+ "photosAndAlterSend": "Photos + AlterSend folder",
+ "alterSendFolder": "AlterSend folder"
+ },
+ "update": {
+ "ready": "Update ready",
+ "available": "Update available",
+ "restart": "Restart",
+ "update": "Update",
+ "restartFailed": "Restart failed — please quit and reopen"
+ },
+ "status": {
+ "connected": "Connected"
+ },
+ "confirm": {
+ "leaveShareSession": "Leaving will end your active share session. Continue?",
+ "leaveReceiveSession": "Leaving will end your active receive session. Continue?"
+ }
+}
diff --git a/packages/locales/src/locales/en-GB/errors.json b/packages/locales/src/locales/en-GB/errors.json
new file mode 100644
index 0000000..9585ee8
--- /dev/null
+++ b/packages/locales/src/locales/en-GB/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "Something went wrong",
+ "desktopDescription": "AlterSend hit an unexpected error and needs to restart. The transfer worker may be in an inconsistent state, so a restart is the safest option.",
+ "mobileDescription": "AlterSend hit an unexpected error. Try again, or close and reopen the app if the problem persists.",
+ "restartAlterSend": "Restart AlterSend",
+ "tryAgain": "Try again"
+ },
+ "bridgeUnavailable": {
+ "title": "Electron bridge unavailable",
+ "description": "This renderer is running without the desktop bridge. Restart AlterSend from the desktop app.",
+ "status": "Bridge unavailable"
+ },
+ "transfer": {
+ "invalidTopic": "The connection code is invalid.",
+ "joinFailed": "Could not join the session.",
+ "peerUnreachable": "Couldn't reach the sender. Check the code and try again.",
+ "transferFailed": "Transfer failed. Try again.",
+ "downloadFailed": "Download failed. Try again."
+ }
+}
diff --git a/packages/locales/src/locales/en-GB/feedback.json b/packages/locales/src/locales/en-GB/feedback.json
new file mode 100644
index 0000000..09e6364
--- /dev/null
+++ b/packages/locales/src/locales/en-GB/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "Feedback",
+ "types": {
+ "bug": "Bug report",
+ "feature": "Feature request",
+ "general": "General"
+ },
+ "placeholders": {
+ "bug": "Describe what happened and how to reproduce it…",
+ "desktopBug": "Describe what went wrong…",
+ "feature": "What would you like to see in AlterSend?",
+ "desktopFeature": "What would you like to see?",
+ "general": "Share your thoughts…"
+ },
+ "actions": {
+ "send": "Send feedback",
+ "sending": "Sending…"
+ },
+ "states": {
+ "sent": "Thanks for your feedback!",
+ "failed": "Failed to send. Check your connection.",
+ "received": "Your feedback has been received."
+ }
+}
diff --git a/packages/locales/src/locales/en-GB/index.ts b/packages/locales/src/locales/en-GB/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/en-GB/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/en-GB/native.json b/packages/locales/src/locales/en-GB/native.json
new file mode 100644
index 0000000..b67ef06
--- /dev/null
+++ b/packages/locales/src/locales/en-GB/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend uses your camera to scan connection QR codes.",
+ "localNetwork": "AlterSend uses your local network to discover nearby devices for peer-to-peer file transfer.",
+ "photoRead": "AlterSend reads your photo library so you can pick photos and videos to send to another device.",
+ "photoSave": "AlterSend saves received images and videos to your photo library."
+ }
+}
diff --git a/packages/locales/src/locales/en-GB/onboarding.json b/packages/locales/src/locales/en-GB/onboarding.json
new file mode 100644
index 0000000..33c331c
--- /dev/null
+++ b/packages/locales/src/locales/en-GB/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "Files, directly between devices.",
+ "description": "One device sends, the other receives. A short code connects them so files can stream directly."
+ },
+ "keepOpen": {
+ "title": "Keep both apps open.",
+ "description": "Files stream directly between devices — there is no cloud. Closing or backgrounding the app will cancel the transfer."
+ },
+ "encrypted": {
+ "title": "End-to-end encrypted.",
+ "description": "No servers, no copies, no middlemen. Your files travel peer-to-peer between you and the recipient.",
+ "link": "Read our privacy policy"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/en-GB/receive.json b/packages/locales/src/locales/en-GB/receive.json
new file mode 100644
index 0000000..056bfb0
--- /dev/null
+++ b/packages/locales/src/locales/en-GB/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "Receive",
+ "join": {
+ "title": "Receive files",
+ "description": "Enter a 64-character connection code from the sender to stream their files.",
+ "mobileDescription": "Scan or import a sender's QR, or paste their 64-character code to start streaming."
+ },
+ "connecting": {
+ "title": "Connecting",
+ "description": "Establishing a secure session with the sender."
+ },
+ "incomingTransfer": {
+ "title": "Files available",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} file · {{size}}",
+ "description_other": "{{count}} files · {{size}}"
+ },
+ "completed": {
+ "title_one": "File received",
+ "title_other": "Files received",
+ "downloadsComplete": "Downloads complete"
+ },
+ "reconnecting": {
+ "title": "Reconnecting",
+ "description": "Reconnecting to the session. Files will be available again as soon as the link is restored.",
+ "panelDescription": "Connection dropped. Rejoining the session…"
+ },
+ "interrupted": {
+ "title": "Transfer incomplete",
+ "description": "The sender left before all files arrived."
+ },
+ "handshake": {
+ "title": "Connection in progress",
+ "description": "Completing the secure handshake with the sender."
+ },
+ "sessionEnded": {
+ "title": "Session ended",
+ "description": "Return to start a new transfer."
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "Files ready",
+ "filesReadyDescription": "The sender has shared files. Review them and start each download when ready.",
+ "receivedFiles": "Received files"
+ },
+ "form": {
+ "codeLabel": "Connection code",
+ "codePlaceholder": "Paste 64-char code…",
+ "orPasteCode": "or paste code"
+ },
+ "actions": {
+ "scanQr": "Scan QR code",
+ "allowCamera": "Allow camera",
+ "downloadAll": "Download all",
+ "view": "View",
+ "play": "Play",
+ "open": "Open",
+ "scanQrHint": "Use the webcam to read the sender's QR",
+ "downloadingPercent": "Downloading {{percent}}%",
+ "downloadAllWithSize": "Download all ({{size}})",
+ "showInFinder": "Show in Finder",
+ "backToHome": "Back to home",
+ "viewPhotos": "View Photos",
+ "scanOrImportQr": "Scan or import QR",
+ "scanOrImportQrHintDesktop": "Use the webcam, or import a saved QR image",
+ "scanOrImportQrHintMobile": "Use the camera, or import a saved image",
+ "importImage": "Import image",
+ "importFromImage": "Import from image"
+ },
+ "errors": {
+ "invalidCode": "Enter a valid 64-character hex code.",
+ "invalidKey": "Enter a valid 64-character hex key.",
+ "joinFailed": "Could not join the session.",
+ "unreachable": "Couldn't reach the sender. Check the code and try again.",
+ "unsupportedQrTitle": "Unsupported QR code",
+ "unsupportedQrHint": "Scan an AlterSend connection code.",
+ "mobileJoinFailedTitle": "Couldn’t join session",
+ "mobileJoinFailedHint": "Try scanning again or paste the code manually.",
+ "cameraUnavailable": "Camera unavailable.",
+ "cameraCouldNotStart": "The camera could not be started. Paste the connection code instead.",
+ "downloadFailed": "Failed",
+ "didntArrive": "Didn't arrive",
+ "transferIssue": "Transfer issue",
+ "imageNoQrTitle": "No QR code found",
+ "imageNoQrHint": "Pick an image that shows an AlterSend QR code.",
+ "imageUnsupportedQrHint": "That image isn’t an AlterSend connection code.",
+ "imageReadFailedTitle": "Couldn’t read that image"
+ },
+ "camera": {
+ "preparingTitle": "Preparing camera",
+ "preparingDescription": "Checking camera access so you can scan the sender’s QR code.",
+ "accessNeededTitle": "Camera access needed",
+ "accessNeededDescription": "Allow camera access to scan a sender’s connection QR code.",
+ "scanTitle": "Scan QR code",
+ "scanDescription": "Center the sender’s QR code inside the frame. AlterSend will connect automatically.",
+ "desktopHint": "Point the sender’s QR code at the webcam — AlterSend connects automatically.",
+ "blockedTitle": "Camera access blocked",
+ "blockedHint": "Allow camera access for AlterSend in your system settings, then try again. You can also paste the code instead.",
+ "noneTitle": "No camera found",
+ "noneHint": "Connect a webcam to scan, or paste the connection code instead.",
+ "unavailableTitle": "Camera unavailable",
+ "starting": "Starting camera…",
+ "enableTitle": "Enable camera access",
+ "enableDescription": "You only need this to scan the sender's QR code. You can still go back and paste the code manually.",
+ "usePastedCode": "Use pasted code instead",
+ "joiningDescription": "Joining the sender's session.",
+ "scanImportTitle": "Scan or import QR",
+ "scanImportDescription": "Centre the sender’s QR in the frame, or import a saved image. AlterSend connects automatically.",
+ "desktopImportHint": "Centre the sender’s QR in the frame, or import a saved image. AlterSend connects automatically.",
+ "enableImportDescription": "The camera is only needed to scan a QR. You can also import a saved image or paste the code manually."
+ },
+ "status": {
+ "ready": "Ready",
+ "saved": "Saved",
+ "failed": "Failed",
+ "downloadingPercent": "Downloading {{percent}}%",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "Waiting for files from sender…"
+ },
+ "summary": {
+ "receivedCount_one": "Received {{completed}} of {{count}} file",
+ "receivedCount_other": "Received {{completed}} of {{count}} files",
+ "savedToPhotos_one": "Saved to Photos",
+ "savedToPhotos_other": "{{count}} saved to Photos",
+ "savedInFiles_one": "Saved in Files",
+ "savedInFiles_other": "{{count}} saved in Files",
+ "tapToView": "Tap to view",
+ "saved": "saved",
+ "savedToLocation": "saved to {{location}}",
+ "receivedProgress": "{{completed}} of {{count}} received",
+ "senderLeftBeforeFinishing": "The sender left before finishing.",
+ "filesSaved_one": "{{count}} file saved",
+ "filesSaved_other": "{{count}} files saved"
+ }
+}
diff --git a/packages/locales/src/locales/en-GB/send.json b/packages/locales/src/locales/en-GB/send.json
new file mode 100644
index 0000000..a0caeb7
--- /dev/null
+++ b/packages/locales/src/locales/en-GB/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "Send files",
+ "description": "Choose one or more files and generate a one-time code for a direct encrypted transfer."
+ },
+ "preparing": {
+ "title": "Preparing transfer",
+ "description": "Preparing the selected files before the share code is revealed."
+ },
+ "waitingForReceiver": {
+ "title": "Share the code",
+ "description": "Send the code or QR to your recipient to start the transfer."
+ },
+ "receiverConnected": {
+ "title": "Share the code",
+ "description": "Send the code or QR to your recipient to start the transfer."
+ }
+ },
+ "actions": {
+ "sendFiles_one": "Send {{count}} file",
+ "sendFiles_other": "Send {{count}} files",
+ "addFiles": "Add files",
+ "addMoreFiles": "Add more files",
+ "dragAndDrop": "Drag and drop",
+ "clear": "Clear",
+ "endSession": "End session",
+ "pickFilesTitle": "Add files",
+ "pickPhotos": "Photos",
+ "pickFiles": "Files"
+ },
+ "status": {
+ "waitingForPeer": "Waiting for peer",
+ "peerConnected": "Peer connected",
+ "uploadComplete": "Upload complete",
+ "uploadingFiles": "Uploading files",
+ "uploaded": "Uploaded",
+ "uploading": "Uploading…",
+ "waiting": "Waiting",
+ "failed": "Failed",
+ "downloaded": "Downloaded",
+ "disconnected": "Disconnected",
+ "online": "Online",
+ "downloading": "Downloading",
+ "downloadingPercent": "Downloading {{percent}}%"
+ },
+ "connection": {
+ "placeholder": "Generating secure key…",
+ "copyLabel": "Copy connection code",
+ "showQrLabel": "Show QR code",
+ "qrCodeLabel": "QR code for connection key",
+ "qrModalDescription": "Open AlterSend on another device and scan this code",
+ "copiedToast": "Copied to clipboard",
+ "scanToConnect": "Scan to connect",
+ "orScan": "or scan",
+ "generating": "Generating…",
+ "waitingForConnection": "Waiting for a connection…"
+ },
+ "errors": {
+ "folderUnsupported": "Folders aren't supported yet. Please select files only.",
+ "failedPickFiles": "Failed to pick files",
+ "failedPickPhotos": "Failed to pick photos"
+ },
+ "hints": {
+ "keepOpen": "Closing the app cancels the transfer."
+ },
+ "preparing": {
+ "uploadedCount_one": "{{completed}} of {{count}} file uploaded",
+ "uploadedCount_other": "{{completed}} of {{count}} files uploaded"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} done",
+ "completedDone_other": "{{count}} done",
+ "devices": "Devices",
+ "connectedCount_one": "{{count}} connected",
+ "connectedCount_other": "{{count}} connected"
+ },
+ "dropzone": {
+ "addMoreDescription": "or click to <link>add more</link>",
+ "browseDescription": "or click to <link>browse</link>",
+ "tapAddMoreDescription": "Tap to <link>add more</link>",
+ "tapBrowseDescription": "Tap to <link>browse</link>",
+ "orClickTo": "or click to",
+ "tapTo": "Tap to",
+ "addMoreLink": "add more",
+ "browseLink": "browse"
+ },
+ "files": {
+ "removeLabel": "Remove {{name}}"
+ }
+}
diff --git a/packages/locales/src/locales/en-GB/settings.json b/packages/locales/src/locales/en-GB/settings.json
new file mode 100644
index 0000000..636eb96
--- /dev/null
+++ b/packages/locales/src/locales/en-GB/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "Settings",
+ "languageTitle": "Language",
+ "languageHint": "Choose the language used by AlterSend.",
+ "sections": {
+ "privacy": "Privacy",
+ "support": "Support",
+ "about": "About"
+ },
+ "crashReports": {
+ "label": "Crash reports",
+ "description": "Share anonymous crash data to help improve AlterSend"
+ },
+ "rows": {
+ "feedback": "Feedback",
+ "feedbackHint": "Report a problem or suggest a feature",
+ "discord": "Discord",
+ "discordHint": "Join the community",
+ "contact": "Contact us",
+ "privacyPolicy": "Privacy policy",
+ "privacyPolicyHint": "How AlterSend handles your data",
+ "terms": "Terms of service",
+ "termsHint": "Rules for using AlterSend",
+ "website": "Website"
+ },
+ "legal": {
+ "terms": "Terms of Use",
+ "privacy": "Privacy Statement",
+ "sentence": "<terms>Terms of Use</terms> and <privacy>Privacy Statement</privacy>."
+ }
+}
diff --git a/packages/locales/src/locales/en-US/common.json b/packages/locales/src/locales/en-US/common.json
index c0c69bb..8e8650c 100644
--- a/packages/locales/src/locales/en-US/common.json
+++ b/packages/locales/src/locales/en-US/common.json
@@ -1,7 +1,67 @@
{
- "buttons": {
+ "app": {
+ "name": "AlterSend",
+ "tagline": "Peer-to-peer file transfer",
+ "welcome": "Welcome to AlterSend",
+ "loadingTagline": "Files travel directly between your devices.\nNo servers, no copies, no middlemen."
+ },
+ "actions": {
"back": "Back",
- "confirm": "Confirm",
- "cancel": "Cancel"
+ "continue": "Continue",
+ "getStarted": "Get started",
+ "cancel": "Cancel",
+ "clear": "Clear",
+ "close": "Close",
+ "copy": "Copy",
+ "copied": "Copied",
+ "connect": "Connect",
+ "connecting": "Connecting…",
+ "done": "Done",
+ "endSession": "End session",
+ "restart": "Restart",
+ "tryAgain": "Try again",
+ "dismiss": "Dismiss",
+ "openSettings": "Open settings",
+ "update": "Update",
+ "downloadAll": "Download all",
+ "skip": "Skip"
+ },
+ "labels": {
+ "settings": "Settings",
+ "language": "Language",
+ "systemDefault": "System default",
+ "camera": "Camera",
+ "statusBar": "Status bar",
+ "transferMode": "Transfer mode",
+ "version": "Version",
+ "platform": "Platform",
+ "desktop": "Desktop",
+ "mobile": "Mobile",
+ "send": "Send",
+ "receive": "Receive",
+ "connectionCode": "Connection code"
+ },
+ "files": {
+ "count_one": "{{count}} file",
+ "count_other": "{{count}} files",
+ "photos": "Photos",
+ "files": "Files",
+ "downloads": "Files › Downloads",
+ "photosAndAlterSend": "Photos + AlterSend folder",
+ "alterSendFolder": "AlterSend folder"
+ },
+ "update": {
+ "ready": "Update ready",
+ "available": "Update available",
+ "restart": "Restart",
+ "update": "Update",
+ "restartFailed": "Restart failed — please quit and reopen"
+ },
+ "status": {
+ "connected": "Connected"
+ },
+ "confirm": {
+ "leaveShareSession": "Leaving will end your active share session. Continue?",
+ "leaveReceiveSession": "Leaving will end your active receive session. Continue?"
}
}
diff --git a/packages/locales/src/locales/en-US/errors.json b/packages/locales/src/locales/en-US/errors.json
new file mode 100644
index 0000000..9585ee8
--- /dev/null
+++ b/packages/locales/src/locales/en-US/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "Something went wrong",
+ "desktopDescription": "AlterSend hit an unexpected error and needs to restart. The transfer worker may be in an inconsistent state, so a restart is the safest option.",
+ "mobileDescription": "AlterSend hit an unexpected error. Try again, or close and reopen the app if the problem persists.",
+ "restartAlterSend": "Restart AlterSend",
+ "tryAgain": "Try again"
+ },
+ "bridgeUnavailable": {
+ "title": "Electron bridge unavailable",
+ "description": "This renderer is running without the desktop bridge. Restart AlterSend from the desktop app.",
+ "status": "Bridge unavailable"
+ },
+ "transfer": {
+ "invalidTopic": "The connection code is invalid.",
+ "joinFailed": "Could not join the session.",
+ "peerUnreachable": "Couldn't reach the sender. Check the code and try again.",
+ "transferFailed": "Transfer failed. Try again.",
+ "downloadFailed": "Download failed. Try again."
+ }
+}
diff --git a/packages/locales/src/locales/en-US/feedback.json b/packages/locales/src/locales/en-US/feedback.json
new file mode 100644
index 0000000..09e6364
--- /dev/null
+++ b/packages/locales/src/locales/en-US/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "Feedback",
+ "types": {
+ "bug": "Bug report",
+ "feature": "Feature request",
+ "general": "General"
+ },
+ "placeholders": {
+ "bug": "Describe what happened and how to reproduce it…",
+ "desktopBug": "Describe what went wrong…",
+ "feature": "What would you like to see in AlterSend?",
+ "desktopFeature": "What would you like to see?",
+ "general": "Share your thoughts…"
+ },
+ "actions": {
+ "send": "Send feedback",
+ "sending": "Sending…"
+ },
+ "states": {
+ "sent": "Thanks for your feedback!",
+ "failed": "Failed to send. Check your connection.",
+ "received": "Your feedback has been received."
+ }
+}
diff --git a/packages/locales/src/locales/en-US/index.ts b/packages/locales/src/locales/en-US/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/en-US/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/en-US/meta.json b/packages/locales/src/locales/en-US/meta.json
deleted file mode 100644
index 2affd61..0000000
--- a/packages/locales/src/locales/en-US/meta.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "label": "English",
- "productionReady": true,
- "dir": "ltr"
-}
diff --git a/packages/locales/src/locales/en-US/native.json b/packages/locales/src/locales/en-US/native.json
new file mode 100644
index 0000000..b67ef06
--- /dev/null
+++ b/packages/locales/src/locales/en-US/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend uses your camera to scan connection QR codes.",
+ "localNetwork": "AlterSend uses your local network to discover nearby devices for peer-to-peer file transfer.",
+ "photoRead": "AlterSend reads your photo library so you can pick photos and videos to send to another device.",
+ "photoSave": "AlterSend saves received images and videos to your photo library."
+ }
+}
diff --git a/packages/locales/src/locales/en-US/onboarding.json b/packages/locales/src/locales/en-US/onboarding.json
new file mode 100644
index 0000000..33c331c
--- /dev/null
+++ b/packages/locales/src/locales/en-US/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "Files, directly between devices.",
+ "description": "One device sends, the other receives. A short code connects them so files can stream directly."
+ },
+ "keepOpen": {
+ "title": "Keep both apps open.",
+ "description": "Files stream directly between devices — there is no cloud. Closing or backgrounding the app will cancel the transfer."
+ },
+ "encrypted": {
+ "title": "End-to-end encrypted.",
+ "description": "No servers, no copies, no middlemen. Your files travel peer-to-peer between you and the recipient.",
+ "link": "Read our privacy policy"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/en-US/receive.json b/packages/locales/src/locales/en-US/receive.json
new file mode 100644
index 0000000..3f935b5
--- /dev/null
+++ b/packages/locales/src/locales/en-US/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "Receive",
+ "join": {
+ "title": "Receive files",
+ "description": "Enter a 64-character connection code from the sender to stream their files.",
+ "mobileDescription": "Scan or import a sender's QR, or paste their 64-character code to start streaming."
+ },
+ "connecting": {
+ "title": "Connecting",
+ "description": "Establishing a secure session with the sender."
+ },
+ "incomingTransfer": {
+ "title": "Files available",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} file · {{size}}",
+ "description_other": "{{count}} files · {{size}}"
+ },
+ "completed": {
+ "title_one": "File received",
+ "title_other": "Files received",
+ "downloadsComplete": "Downloads complete"
+ },
+ "reconnecting": {
+ "title": "Reconnecting",
+ "description": "Reconnecting to the session. Files will be available again as soon as the link is restored.",
+ "panelDescription": "Connection dropped. Rejoining the session…"
+ },
+ "interrupted": {
+ "title": "Transfer incomplete",
+ "description": "The sender left before all files arrived."
+ },
+ "handshake": {
+ "title": "Connection in progress",
+ "description": "Completing the secure handshake with the sender."
+ },
+ "sessionEnded": {
+ "title": "Session ended",
+ "description": "Return to start a new transfer."
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "Files ready",
+ "filesReadyDescription": "The sender has shared files. Review them and start each download when ready.",
+ "receivedFiles": "Received files"
+ },
+ "form": {
+ "codeLabel": "Connection code",
+ "codePlaceholder": "Paste 64-char code…",
+ "orPasteCode": "or paste code"
+ },
+ "actions": {
+ "scanQr": "Scan QR code",
+ "allowCamera": "Allow camera",
+ "downloadAll": "Download all",
+ "view": "View",
+ "play": "Play",
+ "open": "Open",
+ "scanQrHint": "Use the webcam to read the sender's QR",
+ "downloadingPercent": "Downloading {{percent}}%",
+ "downloadAllWithSize": "Download all ({{size}})",
+ "showInFinder": "Show in Finder",
+ "backToHome": "Back to home",
+ "viewPhotos": "View Photos",
+ "scanOrImportQr": "Scan or import QR",
+ "scanOrImportQrHintDesktop": "Use the webcam, or import a saved QR image",
+ "scanOrImportQrHintMobile": "Use the camera, or import a saved image",
+ "importImage": "Import image",
+ "importFromImage": "Import from image"
+ },
+ "errors": {
+ "invalidCode": "Enter a valid 64-character hex code.",
+ "invalidKey": "Enter a valid 64-character hex key.",
+ "joinFailed": "Could not join the session.",
+ "unreachable": "Couldn't reach the sender. Check the code and try again.",
+ "unsupportedQrTitle": "Unsupported QR code",
+ "unsupportedQrHint": "Scan an AlterSend connection code.",
+ "mobileJoinFailedTitle": "Couldn’t join session",
+ "mobileJoinFailedHint": "Try scanning again or paste the code manually.",
+ "cameraUnavailable": "Camera unavailable.",
+ "cameraCouldNotStart": "The camera could not be started. Paste the connection code instead.",
+ "downloadFailed": "Failed",
+ "didntArrive": "Didn't arrive",
+ "transferIssue": "Transfer issue",
+ "imageNoQrTitle": "No QR code found",
+ "imageNoQrHint": "Pick an image that shows an AlterSend QR code.",
+ "imageUnsupportedQrHint": "That image isn’t an AlterSend connection code.",
+ "imageReadFailedTitle": "Couldn’t read that image"
+ },
+ "camera": {
+ "preparingTitle": "Preparing camera",
+ "preparingDescription": "Checking camera access so you can scan the sender’s QR code.",
+ "accessNeededTitle": "Camera access needed",
+ "accessNeededDescription": "Allow camera access to scan a sender’s connection QR code.",
+ "scanTitle": "Scan QR code",
+ "scanDescription": "Center the sender’s QR code inside the frame. AlterSend will connect automatically.",
+ "desktopHint": "Point the sender’s QR code at the webcam — AlterSend connects automatically.",
+ "blockedTitle": "Camera access blocked",
+ "blockedHint": "Allow camera access for AlterSend in your system settings, then try again. You can also paste the code instead.",
+ "noneTitle": "No camera found",
+ "noneHint": "Connect a webcam to scan, or paste the connection code instead.",
+ "unavailableTitle": "Camera unavailable",
+ "starting": "Starting camera…",
+ "enableTitle": "Enable camera access",
+ "enableDescription": "You only need this to scan the sender's QR code. You can still go back and paste the code manually.",
+ "usePastedCode": "Use pasted code instead",
+ "joiningDescription": "Joining the sender's session.",
+ "scanImportTitle": "Scan or import QR",
+ "scanImportDescription": "Center the sender’s QR in the frame, or import a saved image. AlterSend connects automatically.",
+ "desktopImportHint": "Center the sender’s QR in the frame, or import a saved image. AlterSend connects automatically.",
+ "enableImportDescription": "The camera is only needed to scan a QR. You can also import a saved image or paste the code manually."
+ },
+ "status": {
+ "ready": "Ready",
+ "saved": "Saved",
+ "failed": "Failed",
+ "downloadingPercent": "Downloading {{percent}}%",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "Waiting for files from sender…"
+ },
+ "summary": {
+ "receivedCount_one": "Received {{completed}} of {{count}} file",
+ "receivedCount_other": "Received {{completed}} of {{count}} files",
+ "savedToPhotos_one": "Saved to Photos",
+ "savedToPhotos_other": "{{count}} saved to Photos",
+ "savedInFiles_one": "Saved in Files",
+ "savedInFiles_other": "{{count}} saved in Files",
+ "tapToView": "Tap to view",
+ "saved": "saved",
+ "savedToLocation": "saved to {{location}}",
+ "receivedProgress": "{{completed}} of {{count}} received",
+ "senderLeftBeforeFinishing": "The sender left before finishing.",
+ "filesSaved_one": "{{count}} file saved",
+ "filesSaved_other": "{{count}} files saved"
+ }
+}
diff --git a/packages/locales/src/locales/en-US/send.json b/packages/locales/src/locales/en-US/send.json
index 7e42a58..a0caeb7 100644
--- a/packages/locales/src/locales/en-US/send.json
+++ b/packages/locales/src/locales/en-US/send.json
@@ -1,5 +1,5 @@
{
- "steps": {
+ "page": {
"selecting": {
"title": "Send files",
"description": "Choose one or more files and generate a one-time code for a direct encrypted transfer."
@@ -8,17 +8,84 @@
"title": "Preparing transfer",
"description": "Preparing the selected files before the share code is revealed."
},
- "waiting_for_receiver": {
+ "waitingForReceiver": {
"title": "Share the code",
"description": "Send the code or QR to your recipient to start the transfer."
},
- "receiver_connected": {
+ "receiverConnected": {
"title": "Share the code",
"description": "Send the code or QR to your recipient to start the transfer."
}
},
+ "actions": {
+ "sendFiles_one": "Send {{count}} file",
+ "sendFiles_other": "Send {{count}} files",
+ "addFiles": "Add files",
+ "addMoreFiles": "Add more files",
+ "dragAndDrop": "Drag and drop",
+ "clear": "Clear",
+ "endSession": "End session",
+ "pickFilesTitle": "Add files",
+ "pickPhotos": "Photos",
+ "pickFiles": "Files"
+ },
"status": {
- "waiting_for_peer": "Waiting for peer",
- "peer_connected": "Peer connected"
+ "waitingForPeer": "Waiting for peer",
+ "peerConnected": "Peer connected",
+ "uploadComplete": "Upload complete",
+ "uploadingFiles": "Uploading files",
+ "uploaded": "Uploaded",
+ "uploading": "Uploading…",
+ "waiting": "Waiting",
+ "failed": "Failed",
+ "downloaded": "Downloaded",
+ "disconnected": "Disconnected",
+ "online": "Online",
+ "downloading": "Downloading",
+ "downloadingPercent": "Downloading {{percent}}%"
+ },
+ "connection": {
+ "placeholder": "Generating secure key…",
+ "copyLabel": "Copy connection code",
+ "showQrLabel": "Show QR code",
+ "qrCodeLabel": "QR code for connection key",
+ "qrModalDescription": "Open AlterSend on another device and scan this code",
+ "copiedToast": "Copied to clipboard",
+ "scanToConnect": "Scan to connect",
+ "orScan": "or scan",
+ "generating": "Generating…",
+ "waitingForConnection": "Waiting for a connection…"
+ },
+ "errors": {
+ "folderUnsupported": "Folders aren't supported yet. Please select files only.",
+ "failedPickFiles": "Failed to pick files",
+ "failedPickPhotos": "Failed to pick photos"
+ },
+ "hints": {
+ "keepOpen": "Closing the app cancels the transfer."
+ },
+ "preparing": {
+ "uploadedCount_one": "{{completed}} of {{count}} file uploaded",
+ "uploadedCount_other": "{{completed}} of {{count}} files uploaded"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} done",
+ "completedDone_other": "{{count}} done",
+ "devices": "Devices",
+ "connectedCount_one": "{{count}} connected",
+ "connectedCount_other": "{{count}} connected"
+ },
+ "dropzone": {
+ "addMoreDescription": "or click to <link>add more</link>",
+ "browseDescription": "or click to <link>browse</link>",
+ "tapAddMoreDescription": "Tap to <link>add more</link>",
+ "tapBrowseDescription": "Tap to <link>browse</link>",
+ "orClickTo": "or click to",
+ "tapTo": "Tap to",
+ "addMoreLink": "add more",
+ "browseLink": "browse"
+ },
+ "files": {
+ "removeLabel": "Remove {{name}}"
}
}
diff --git a/packages/locales/src/locales/en-US/settings.json b/packages/locales/src/locales/en-US/settings.json
new file mode 100644
index 0000000..636eb96
--- /dev/null
+++ b/packages/locales/src/locales/en-US/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "Settings",
+ "languageTitle": "Language",
+ "languageHint": "Choose the language used by AlterSend.",
+ "sections": {
+ "privacy": "Privacy",
+ "support": "Support",
+ "about": "About"
+ },
+ "crashReports": {
+ "label": "Crash reports",
+ "description": "Share anonymous crash data to help improve AlterSend"
+ },
+ "rows": {
+ "feedback": "Feedback",
+ "feedbackHint": "Report a problem or suggest a feature",
+ "discord": "Discord",
+ "discordHint": "Join the community",
+ "contact": "Contact us",
+ "privacyPolicy": "Privacy policy",
+ "privacyPolicyHint": "How AlterSend handles your data",
+ "terms": "Terms of service",
+ "termsHint": "Rules for using AlterSend",
+ "website": "Website"
+ },
+ "legal": {
+ "terms": "Terms of Use",
+ "privacy": "Privacy Statement",
+ "sentence": "<terms>Terms of Use</terms> and <privacy>Privacy Statement</privacy>."
+ }
+}
diff --git a/packages/locales/src/locales/es-419/common.json b/packages/locales/src/locales/es-419/common.json
new file mode 100644
index 0000000..2815860
--- /dev/null
+++ b/packages/locales/src/locales/es-419/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "Transferencia directa de archivos",
+ "welcome": "Te damos la bienvenida a AlterSend",
+ "loadingTagline": "Los archivos viajan directamente entre tus dispositivos.\nSin servidores, sin copias, sin intermediarios."
+ },
+ "actions": {
+ "back": "Atrás",
+ "continue": "Continuar",
+ "getStarted": "Comenzar",
+ "cancel": "Cancelar",
+ "clear": "Borrar",
+ "close": "Cerrar",
+ "copy": "Copiar",
+ "copied": "Copiado",
+ "connect": "Conectar",
+ "connecting": "Conectando…",
+ "done": "Listo",
+ "endSession": "Finalizar sesión",
+ "restart": "Reiniciar",
+ "tryAgain": "Intentar de nuevo",
+ "dismiss": "Descartar",
+ "openSettings": "Abrir configuración",
+ "update": "Actualizar",
+ "downloadAll": "Descargar todo",
+ "skip": "Omitir"
+ },
+ "labels": {
+ "settings": "Configuración",
+ "language": "Idioma",
+ "systemDefault": "Predeterminado del sistema",
+ "camera": "Cámara",
+ "statusBar": "barra de estado",
+ "transferMode": "Modo de transferencia",
+ "version": "Versión",
+ "platform": "Plataforma",
+ "desktop": "Desktop",
+ "mobile": "Celular",
+ "send": "Enviar",
+ "receive": "Recibir",
+ "connectionCode": "Código de conexión"
+ },
+ "files": {
+ "count_one": "{{count}} archivo",
+ "count_other": "{{count}} archivos",
+ "photos": "Fotos",
+ "files": "Archivos",
+ "downloads": "Archivos › Descargas",
+ "photosAndAlterSend": "Fotos + carpeta AlterSend",
+ "alterSendFolder": "Carpeta AlterSend"
+ },
+ "update": {
+ "ready": "Actualización lista",
+ "available": "Actualización disponible",
+ "restart": "Reiniciar",
+ "update": "Actualizar",
+ "restartFailed": "Error al reiniciar: salga y vuelva a abrir"
+ },
+ "status": {
+ "connected": "Conectado"
+ },
+ "confirm": {
+ "leaveShareSession": "Al salir, finalizará su sesión activa para compartir. ¿Continuar?",
+ "leaveReceiveSession": "Al salir, finalizará su sesión de recepción activa. ¿Continuar?"
+ }
+}
diff --git a/packages/locales/src/locales/es-419/errors.json b/packages/locales/src/locales/es-419/errors.json
new file mode 100644
index 0000000..2619589
--- /dev/null
+++ b/packages/locales/src/locales/es-419/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "algo salió mal",
+ "desktopDescription": "AlterSend encontró un error inesperado y necesita reiniciarse. El servicio de transferencia puede estar inestable, por lo que reiniciar es la opción más segura.",
+ "mobileDescription": "AlterSend encontró un error inesperado. Inténtalo de nuevo o cierra y vuelve a abrir la aplicación si el problema persiste.",
+ "restartAlterSend": "Reiniciar AlterSend",
+ "tryAgain": "Inténtalo de nuevo"
+ },
+ "bridgeUnavailable": {
+ "title": "Conexión de escritorio no disponible",
+ "description": "Esta ventana no está conectada a la app de escritorio. Reinicia AlterSend desde la app de escritorio.",
+ "status": "Conexión de escritorio no disponible"
+ },
+ "transfer": {
+ "invalidTopic": "El código de conexión no es válido.",
+ "joinFailed": "No se pudo unir a la sesión.",
+ "peerUnreachable": "No se pudo conectar con el remitente. Revisa el código e inténtalo de nuevo.",
+ "transferFailed": "La transferencia falló. Inténtalo de nuevo.",
+ "downloadFailed": "La descarga falló. Inténtalo de nuevo."
+ }
+}
diff --git a/packages/locales/src/locales/es-419/feedback.json b/packages/locales/src/locales/es-419/feedback.json
new file mode 100644
index 0000000..f296da6
--- /dev/null
+++ b/packages/locales/src/locales/es-419/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "Comentarios",
+ "types": {
+ "bug": "Informe de error",
+ "feature": "Solicitud de función",
+ "general": "generales"
+ },
+ "placeholders": {
+ "bug": "Describe lo que pasó y cómo reproducirlo...",
+ "desktopBug": "Describe lo que salió mal...",
+ "feature": "¿Qué te gustaría ver en AlterSend?",
+ "desktopFeature": "¿Qué te gustaría ver?",
+ "general": "Comparte tus pensamientos..."
+ },
+ "actions": {
+ "send": "Enviar comentarios",
+ "sending": "Enviando…"
+ },
+ "states": {
+ "sent": "¡Gracias por tus comentarios!",
+ "failed": "No se pudo enviar. Comprueba tu conexión.",
+ "received": "Recibimos tus comentarios."
+ }
+}
diff --git a/packages/locales/src/locales/es-419/index.ts b/packages/locales/src/locales/es-419/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/es-419/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/es-419/native.json b/packages/locales/src/locales/es-419/native.json
new file mode 100644
index 0000000..0381b25
--- /dev/null
+++ b/packages/locales/src/locales/es-419/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend usa tu cámara para escanear códigos de conexión QR.",
+ "localNetwork": "AlterSend usa la red local para encontrar dispositivos cercanos y transferir archivos directamente.",
+ "photoRead": "AlterSend lee tu biblioteca de fotos para que puedas elegir fotos y videos para enviarlos a otro dispositivo.",
+ "photoSave": "AlterSend guarda las imágenes y los videos recibidos en su biblioteca de fotos."
+ }
+}
diff --git a/packages/locales/src/locales/es-419/onboarding.json b/packages/locales/src/locales/es-419/onboarding.json
new file mode 100644
index 0000000..1a9c8a0
--- /dev/null
+++ b/packages/locales/src/locales/es-419/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "Archivos, directamente entre dispositivos.",
+ "description": "Un dispositivo envía, el otro recibe. Un código corto los conecta para que los archivos puedan transmitirse directamente."
+ },
+ "keepOpen": {
+ "title": "Mantenga ambas aplicaciones abiertas.",
+ "description": "Los archivos se transmiten directamente entre dispositivos: no hay nube. Cerrar o poner en segundo plano la aplicación cancelará la transferencia."
+ },
+ "encrypted": {
+ "title": "Cifrado de extremo a extremo.",
+ "description": "Sin servidores, sin copias, sin intermediarios. Tus archivos viajan directamente entre tú y el destinatario.",
+ "link": "Lea nuestra política de privacidad"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/es-419/receive.json b/packages/locales/src/locales/es-419/receive.json
new file mode 100644
index 0000000..2faeee9
--- /dev/null
+++ b/packages/locales/src/locales/es-419/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "Recibir",
+ "join": {
+ "title": "Recibir archivos",
+ "description": "Ingrese un código de conexión de 64 caracteres del remitente para transmitir sus archivos.",
+ "mobileDescription": "Escanea o importa el QR del remitente, o pega su código de 64 caracteres para iniciar la transferencia."
+ },
+ "connecting": {
+ "title": "Conectando",
+ "description": "Establecer una sesión segura con el remitente."
+ },
+ "incomingTransfer": {
+ "title": "Archivos disponibles",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} archivo · {{size}}",
+ "description_other": "{{count}} archivos · {{size}}"
+ },
+ "completed": {
+ "title_one": "Archivo recibido",
+ "title_other": "Archivos recibidos",
+ "downloadsComplete": "Descargas completas"
+ },
+ "reconnecting": {
+ "title": "Reconectando",
+ "description": "Reconectándose a la sesión. Los archivos volverán a estar disponibles tan pronto como se restablezca el enlace.",
+ "panelDescription": "La conexión se interrumpió. Reingresando a la sesión…"
+ },
+ "interrupted": {
+ "title": "Transferencia incompleta",
+ "description": "El remitente se fue antes de que llegaran todos los archivos."
+ },
+ "handshake": {
+ "title": "Conexión en progreso",
+ "description": "Completar el apretón de manos seguro con el remitente."
+ },
+ "sessionEnded": {
+ "title": "Sesión finalizada",
+ "description": "Regrese para iniciar una nueva transferencia."
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "Archivos listos",
+ "filesReadyDescription": "El remitente ha compartido archivos. Revíselos e inicie cada descarga cuando esté listo.",
+ "receivedFiles": "Archivos recibidos"
+ },
+ "form": {
+ "codeLabel": "Código de conexión",
+ "codePlaceholder": "Pegue el código de 64 caracteres...",
+ "orPasteCode": "o pega el código"
+ },
+ "actions": {
+ "scanQr": "Escanear código QR",
+ "allowCamera": "Permitir cámara",
+ "downloadAll": "Descargar todo",
+ "view": "Ver",
+ "play": "Reproducir",
+ "open": "Abierto",
+ "scanQrHint": "Usa la cámara web para leer el QR del remitente",
+ "downloadingPercent": "Descargando {{percent}}%",
+ "downloadAllWithSize": "Descargar todo ({{size}})",
+ "showInFinder": "Mostrar en Finder",
+ "backToHome": "Volver al inicio",
+ "viewPhotos": "Ver fotos",
+ "scanOrImportQr": "Escanear o importar QR",
+ "scanOrImportQrHintDesktop": "Usa la cámara web o importa una imagen QR guardada",
+ "scanOrImportQrHintMobile": "Usa la cámara o importa una imagen guardada",
+ "importImage": "Importar imagen",
+ "importFromImage": "Importar desde imagen"
+ },
+ "errors": {
+ "invalidCode": "Ingrese un código hexadecimal válido de 64 caracteres.",
+ "invalidKey": "Ingrese una clave hexadecimal válida de 64 caracteres.",
+ "joinFailed": "No se pudo unir a la sesión.",
+ "unreachable": "No se pudo comunicar con el remitente. Verifique el código e inténtelo nuevamente.",
+ "unsupportedQrTitle": "Código QR no admitido",
+ "unsupportedQrHint": "Escanea un código de conexión AlterSend.",
+ "mobileJoinFailedTitle": "No se pudo unir a la sesión",
+ "mobileJoinFailedHint": "Intente escanear nuevamente o pegue el código manualmente.",
+ "cameraUnavailable": "Cámara no disponible.",
+ "cameraCouldNotStart": "No se pudo iniciar la cámara. Pegue el código de conexión en su lugar.",
+ "downloadFailed": "Fallido",
+ "didntArrive": "no llego",
+ "transferIssue": "Problema de transferencia",
+ "imageNoQrTitle": "No se encontró ningún código QR",
+ "imageNoQrHint": "Elige una imagen que muestre un código QR de AlterSend.",
+ "imageUnsupportedQrHint": "Esa imagen no es un código de conexión de AlterSend.",
+ "imageReadFailedTitle": "No se pudo leer esa imagen"
+ },
+ "camera": {
+ "preparingTitle": "Preparando la cámara",
+ "preparingDescription": "Comprobando el acceso a la cámara para poder escanear el código QR del remitente.",
+ "accessNeededTitle": "Se necesita acceso a la cámara",
+ "accessNeededDescription": "Permitir el acceso a la cámara para escanear el código QR de conexión de un remitente.",
+ "scanTitle": "Escanear código QR",
+ "scanDescription": "Centra el código QR del remitente dentro del marco. AlterSend se conectará automáticamente.",
+ "desktopHint": "Apunta el código QR del remitente a la cámara web: AlterSend se conecta automáticamente.",
+ "blockedTitle": "Acceso a la cámara bloqueado",
+ "blockedHint": "Permite el acceso a la cámara para AlterSend en la configuración de tu sistema y vuelve a intentarlo. También puedes pegar el código.",
+ "noneTitle": "No se encontró ninguna cámara",
+ "noneHint": "Conecte una cámara web para escanear o pegue el código de conexión.",
+ "unavailableTitle": "Cámara no disponible",
+ "starting": "Iniciando cámara…",
+ "enableTitle": "Activar acceso a la cámara",
+ "enableDescription": "Solo se necesita para escanear el QR del remitente. También puedes volver y pegar el código manualmente.",
+ "usePastedCode": "Usar el código pegado",
+ "joiningDescription": "Uniéndose a la sesión del remitente.",
+ "scanImportTitle": "Escanear o importar QR",
+ "scanImportDescription": "Centra el QR del remitente en el marco o importa una imagen guardada. AlterSend se conecta automáticamente.",
+ "desktopImportHint": "Centra el QR del remitente en el marco o importa una imagen guardada. AlterSend se conecta automáticamente.",
+ "enableImportDescription": "La cámara solo se necesita para escanear un QR. También puedes importar una imagen guardada o pegar el código manualmente."
+ },
+ "status": {
+ "ready": "Listo",
+ "saved": "Guardado",
+ "failed": "Fallido",
+ "downloadingPercent": "Descargando {{percent}}%",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "Esperando archivos del remitente…"
+ },
+ "summary": {
+ "receivedCount_one": "Se recibió {{completed}} de {{count}} archivo",
+ "receivedCount_other": "Se recibió {{completed}} de {{count}} archivos",
+ "savedToPhotos_one": "Guardado en fotos",
+ "savedToPhotos_other": "{{count}} guardados en Fotos",
+ "savedInFiles_one": "Guardado en archivos",
+ "savedInFiles_other": "{{count}} guardados en Archivos",
+ "tapToView": "Toca para ver",
+ "saved": "guardado",
+ "savedToLocation": "guardado en {{location}}",
+ "receivedProgress": "{{completed}} de {{count}} recibidos",
+ "senderLeftBeforeFinishing": "El remitente salió antes de terminar.",
+ "filesSaved_one": "{{count}} archivo guardado",
+ "filesSaved_other": "{{count}} archivos guardados"
+ }
+}
diff --git a/packages/locales/src/locales/es-419/send.json b/packages/locales/src/locales/es-419/send.json
new file mode 100644
index 0000000..b245184
--- /dev/null
+++ b/packages/locales/src/locales/es-419/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "Enviar archivos",
+ "description": "Elija uno o más archivos y genere un código único para una transferencia cifrada directa."
+ },
+ "preparing": {
+ "title": "Preparando la transferencia",
+ "description": "Preparar los archivos seleccionados antes de que se revele el código compartido."
+ },
+ "waitingForReceiver": {
+ "title": "Comparte el código",
+ "description": "Envía el código o QR a tu destinatario para iniciar la transferencia."
+ },
+ "receiverConnected": {
+ "title": "Comparte el código",
+ "description": "Envía el código o QR a tu destinatario para iniciar la transferencia."
+ }
+ },
+ "actions": {
+ "sendFiles_one": "Enviar {{count}} archivo",
+ "sendFiles_other": "Enviar {{count}} archivos",
+ "addFiles": "Agregar archivos",
+ "addMoreFiles": "Agregar más archivos",
+ "dragAndDrop": "Arrastrar y soltar",
+ "clear": "Borrar",
+ "endSession": "Finalizar sesión",
+ "pickFilesTitle": "Agregar archivos",
+ "pickPhotos": "Fotos",
+ "pickFiles": "Archivos"
+ },
+ "status": {
+ "waitingForPeer": "Esperando al destinatario",
+ "peerConnected": "Destinatario conectado",
+ "uploadComplete": "Subida completa",
+ "uploadingFiles": "Subiendo archivos",
+ "uploaded": "subido",
+ "uploading": "Subiendo…",
+ "waiting": "esperando",
+ "failed": "Fallido",
+ "downloaded": "Descargado",
+ "disconnected": "desconectado",
+ "online": "En línea",
+ "downloading": "Descargando",
+ "downloadingPercent": "Descargando {{percent}}%"
+ },
+ "connection": {
+ "placeholder": "Generando clave segura…",
+ "copyLabel": "Copiar código de conexión",
+ "showQrLabel": "Mostrar código QR",
+ "qrCodeLabel": "Código QR para la clave de conexión",
+ "qrModalDescription": "Abre AlterSend en otro dispositivo y escanea este código",
+ "copiedToast": "Copiado al portapapeles",
+ "scanToConnect": "Escanea para conectar",
+ "orScan": "o escanea",
+ "generating": "Generando…",
+ "waitingForConnection": "Esperando una conexión…"
+ },
+ "errors": {
+ "folderUnsupported": "Las carpetas aún no son compatibles. Seleccione solo archivos.",
+ "failedPickFiles": "No se pudieron seleccionar archivos",
+ "failedPickPhotos": "No se pudieron seleccionar las fotos"
+ },
+ "hints": {
+ "keepOpen": "Cerrar la aplicación cancela la transferencia."
+ },
+ "preparing": {
+ "uploadedCount_one": "{{completed}} de {{count}} archivo subido",
+ "uploadedCount_other": "{{completed}} de {{count}} archivos subidos"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} completado",
+ "completedDone_other": "{{count}} completados",
+ "devices": "Dispositivos",
+ "connectedCount_one": "{{count}} conectado",
+ "connectedCount_other": "{{count}} conectados"
+ },
+ "dropzone": {
+ "addMoreDescription": "o haz clic para <link>agregar más</link>",
+ "browseDescription": "o haz clic para <link>buscar</link>",
+ "tapAddMoreDescription": "Toca para <link>agregar más</link>",
+ "tapBrowseDescription": "Toca para <link>buscar</link>",
+ "orClickTo": "o haz clic para",
+ "tapTo": "Toca para",
+ "addMoreLink": "agregar más",
+ "browseLink": "buscar"
+ },
+ "files": {
+ "removeLabel": "Eliminar {{name}}"
+ }
+}
diff --git a/packages/locales/src/locales/es-419/settings.json b/packages/locales/src/locales/es-419/settings.json
new file mode 100644
index 0000000..a7727de
--- /dev/null
+++ b/packages/locales/src/locales/es-419/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "Configuración",
+ "languageTitle": "Idioma",
+ "languageHint": "Elige el idioma utilizado por AlterSend.",
+ "sections": {
+ "privacy": "Privacidad",
+ "support": "Soporte",
+ "about": "Acerca de"
+ },
+ "crashReports": {
+ "label": "Informes de fallos",
+ "description": "Comparte datos anónimos sobre fallos para ayudar a mejorar AlterSend"
+ },
+ "rows": {
+ "feedback": "Comentarios",
+ "feedbackHint": "Informar un problema o sugerir una característica",
+ "discord": "Discord",
+ "discordHint": "Únete a la comunidad",
+ "contact": "Contáctenos",
+ "privacyPolicy": "Política de privacidad",
+ "privacyPolicyHint": "Cómo AlterSend maneja tus datos",
+ "terms": "Términos de servicio",
+ "termsHint": "Reglas para usar AlterSend",
+ "website": "Sitio web"
+ },
+ "legal": {
+ "terms": "Términos de uso",
+ "privacy": "Declaración de privacidad",
+ "sentence": "<terms>Términos de uso</terms> y <privacy>Declaración de privacidad</privacy>."
+ }
+}
diff --git a/packages/locales/src/locales/es-ES/common.json b/packages/locales/src/locales/es-ES/common.json
new file mode 100644
index 0000000..9efab1a
--- /dev/null
+++ b/packages/locales/src/locales/es-ES/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "Transferencia directa de archivos",
+ "welcome": "Te damos la bienvenida a AlterSend",
+ "loadingTagline": "Los archivos viajan directamente entre tus dispositivos.\nSin servidores, sin copias, sin intermediarios."
+ },
+ "actions": {
+ "back": "Atrás",
+ "continue": "Continuar",
+ "getStarted": "Empezar",
+ "cancel": "Cancelar",
+ "clear": "Borrar",
+ "close": "Cerrar",
+ "copy": "Copiar",
+ "copied": "Copiado",
+ "connect": "Conectar",
+ "connecting": "Conectando…",
+ "done": "Listo",
+ "endSession": "Finalizar sesión",
+ "restart": "Reiniciar",
+ "tryAgain": "Intentarlo de nuevo",
+ "dismiss": "Descartar",
+ "openSettings": "Abrir configuración",
+ "update": "Actualizar",
+ "downloadAll": "Descargar todo",
+ "skip": "Omitir"
+ },
+ "labels": {
+ "settings": "Ajustes",
+ "language": "Idioma",
+ "systemDefault": "Predeterminado del sistema",
+ "camera": "Cámara",
+ "statusBar": "barra de estado",
+ "transferMode": "Modo de transferencia",
+ "version": "Versión",
+ "platform": "Plataforma",
+ "desktop": "Desktop",
+ "mobile": "Móvil",
+ "send": "Enviar",
+ "receive": "Recibir",
+ "connectionCode": "Código de conexión"
+ },
+ "files": {
+ "count_one": "{{count}} archivo",
+ "count_other": "{{count}} archivos",
+ "photos": "Fotos",
+ "files": "Archivos",
+ "downloads": "Archivos › Descargas",
+ "photosAndAlterSend": "Fotos + carpeta AlterSend",
+ "alterSendFolder": "Carpeta AlterSend"
+ },
+ "update": {
+ "ready": "Actualización lista",
+ "available": "Actualización disponible",
+ "restart": "Reiniciar",
+ "update": "Actualizar",
+ "restartFailed": "Error al reiniciar: salga y vuelva a abrir"
+ },
+ "status": {
+ "connected": "Conectado"
+ },
+ "confirm": {
+ "leaveShareSession": "Al salir, finalizará su sesión activa para compartir. ¿Continuar?",
+ "leaveReceiveSession": "Al salir, finalizará su sesión de recepción activa. ¿Continuar?"
+ }
+}
diff --git a/packages/locales/src/locales/es-ES/errors.json b/packages/locales/src/locales/es-ES/errors.json
new file mode 100644
index 0000000..2c279c6
--- /dev/null
+++ b/packages/locales/src/locales/es-ES/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "algo salió mal",
+ "desktopDescription": "AlterSend encontró un error inesperado y necesita reiniciarse. El servicio de transferencia puede estar inestable, por lo que reiniciar es la opción más segura.",
+ "mobileDescription": "AlterSend encontró un error inesperado. Inténtalo de nuevo o cierra y vuelve a abrir la aplicación si el problema persiste.",
+ "restartAlterSend": "Reiniciar AlterSend",
+ "tryAgain": "Inténtalo de nuevo"
+ },
+ "bridgeUnavailable": {
+ "title": "Conexión de escritorio no disponible",
+ "description": "Esta ventana no está conectada a la app de escritorio. Reinicia AlterSend desde la app de escritorio.",
+ "status": "Conexión de escritorio no disponible"
+ },
+ "transfer": {
+ "invalidTopic": "El código de conexión no es válido.",
+ "joinFailed": "No se pudo unir a la sesión.",
+ "peerUnreachable": "No se pudo conectar con el remitente. Revisa el código e inténtalo de nuevo.",
+ "transferFailed": "La transferencia ha fallado. Inténtalo de nuevo.",
+ "downloadFailed": "La descarga ha fallado. Inténtalo de nuevo."
+ }
+}
diff --git a/packages/locales/src/locales/es-ES/feedback.json b/packages/locales/src/locales/es-ES/feedback.json
new file mode 100644
index 0000000..1ebd093
--- /dev/null
+++ b/packages/locales/src/locales/es-ES/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "Comentarios",
+ "types": {
+ "bug": "Informe de error",
+ "feature": "Solicitud de función",
+ "general": "generales"
+ },
+ "placeholders": {
+ "bug": "Describe lo que pasó y cómo reproducirlo...",
+ "desktopBug": "Describe lo que salió mal...",
+ "feature": "¿Qué te gustaría ver en AlterSend?",
+ "desktopFeature": "¿Qué te gustaría ver?",
+ "general": "Comparte tus pensamientos..."
+ },
+ "actions": {
+ "send": "Enviar comentarios",
+ "sending": "Enviando…"
+ },
+ "states": {
+ "sent": "¡Gracias por tus comentarios!",
+ "failed": "No se pudo enviar. Comprueba tu conexión.",
+ "received": "Hemos recibido tus comentarios."
+ }
+}
diff --git a/packages/locales/src/locales/es-ES/index.ts b/packages/locales/src/locales/es-ES/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/es-ES/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/es-ES/native.json b/packages/locales/src/locales/es-ES/native.json
new file mode 100644
index 0000000..0381b25
--- /dev/null
+++ b/packages/locales/src/locales/es-ES/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend usa tu cámara para escanear códigos de conexión QR.",
+ "localNetwork": "AlterSend usa la red local para encontrar dispositivos cercanos y transferir archivos directamente.",
+ "photoRead": "AlterSend lee tu biblioteca de fotos para que puedas elegir fotos y videos para enviarlos a otro dispositivo.",
+ "photoSave": "AlterSend guarda las imágenes y los videos recibidos en su biblioteca de fotos."
+ }
+}
diff --git a/packages/locales/src/locales/es-ES/onboarding.json b/packages/locales/src/locales/es-ES/onboarding.json
new file mode 100644
index 0000000..1a9c8a0
--- /dev/null
+++ b/packages/locales/src/locales/es-ES/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "Archivos, directamente entre dispositivos.",
+ "description": "Un dispositivo envía, el otro recibe. Un código corto los conecta para que los archivos puedan transmitirse directamente."
+ },
+ "keepOpen": {
+ "title": "Mantenga ambas aplicaciones abiertas.",
+ "description": "Los archivos se transmiten directamente entre dispositivos: no hay nube. Cerrar o poner en segundo plano la aplicación cancelará la transferencia."
+ },
+ "encrypted": {
+ "title": "Cifrado de extremo a extremo.",
+ "description": "Sin servidores, sin copias, sin intermediarios. Tus archivos viajan directamente entre tú y el destinatario.",
+ "link": "Lea nuestra política de privacidad"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/es-ES/receive.json b/packages/locales/src/locales/es-ES/receive.json
new file mode 100644
index 0000000..2faeee9
--- /dev/null
+++ b/packages/locales/src/locales/es-ES/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "Recibir",
+ "join": {
+ "title": "Recibir archivos",
+ "description": "Ingrese un código de conexión de 64 caracteres del remitente para transmitir sus archivos.",
+ "mobileDescription": "Escanea o importa el QR del remitente, o pega su código de 64 caracteres para iniciar la transferencia."
+ },
+ "connecting": {
+ "title": "Conectando",
+ "description": "Establecer una sesión segura con el remitente."
+ },
+ "incomingTransfer": {
+ "title": "Archivos disponibles",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} archivo · {{size}}",
+ "description_other": "{{count}} archivos · {{size}}"
+ },
+ "completed": {
+ "title_one": "Archivo recibido",
+ "title_other": "Archivos recibidos",
+ "downloadsComplete": "Descargas completas"
+ },
+ "reconnecting": {
+ "title": "Reconectando",
+ "description": "Reconectándose a la sesión. Los archivos volverán a estar disponibles tan pronto como se restablezca el enlace.",
+ "panelDescription": "La conexión se interrumpió. Reingresando a la sesión…"
+ },
+ "interrupted": {
+ "title": "Transferencia incompleta",
+ "description": "El remitente se fue antes de que llegaran todos los archivos."
+ },
+ "handshake": {
+ "title": "Conexión en progreso",
+ "description": "Completar el apretón de manos seguro con el remitente."
+ },
+ "sessionEnded": {
+ "title": "Sesión finalizada",
+ "description": "Regrese para iniciar una nueva transferencia."
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "Archivos listos",
+ "filesReadyDescription": "El remitente ha compartido archivos. Revíselos e inicie cada descarga cuando esté listo.",
+ "receivedFiles": "Archivos recibidos"
+ },
+ "form": {
+ "codeLabel": "Código de conexión",
+ "codePlaceholder": "Pegue el código de 64 caracteres...",
+ "orPasteCode": "o pega el código"
+ },
+ "actions": {
+ "scanQr": "Escanear código QR",
+ "allowCamera": "Permitir cámara",
+ "downloadAll": "Descargar todo",
+ "view": "Ver",
+ "play": "Reproducir",
+ "open": "Abierto",
+ "scanQrHint": "Usa la cámara web para leer el QR del remitente",
+ "downloadingPercent": "Descargando {{percent}}%",
+ "downloadAllWithSize": "Descargar todo ({{size}})",
+ "showInFinder": "Mostrar en Finder",
+ "backToHome": "Volver al inicio",
+ "viewPhotos": "Ver fotos",
+ "scanOrImportQr": "Escanear o importar QR",
+ "scanOrImportQrHintDesktop": "Usa la cámara web o importa una imagen QR guardada",
+ "scanOrImportQrHintMobile": "Usa la cámara o importa una imagen guardada",
+ "importImage": "Importar imagen",
+ "importFromImage": "Importar desde imagen"
+ },
+ "errors": {
+ "invalidCode": "Ingrese un código hexadecimal válido de 64 caracteres.",
+ "invalidKey": "Ingrese una clave hexadecimal válida de 64 caracteres.",
+ "joinFailed": "No se pudo unir a la sesión.",
+ "unreachable": "No se pudo comunicar con el remitente. Verifique el código e inténtelo nuevamente.",
+ "unsupportedQrTitle": "Código QR no admitido",
+ "unsupportedQrHint": "Escanea un código de conexión AlterSend.",
+ "mobileJoinFailedTitle": "No se pudo unir a la sesión",
+ "mobileJoinFailedHint": "Intente escanear nuevamente o pegue el código manualmente.",
+ "cameraUnavailable": "Cámara no disponible.",
+ "cameraCouldNotStart": "No se pudo iniciar la cámara. Pegue el código de conexión en su lugar.",
+ "downloadFailed": "Fallido",
+ "didntArrive": "no llego",
+ "transferIssue": "Problema de transferencia",
+ "imageNoQrTitle": "No se encontró ningún código QR",
+ "imageNoQrHint": "Elige una imagen que muestre un código QR de AlterSend.",
+ "imageUnsupportedQrHint": "Esa imagen no es un código de conexión de AlterSend.",
+ "imageReadFailedTitle": "No se pudo leer esa imagen"
+ },
+ "camera": {
+ "preparingTitle": "Preparando la cámara",
+ "preparingDescription": "Comprobando el acceso a la cámara para poder escanear el código QR del remitente.",
+ "accessNeededTitle": "Se necesita acceso a la cámara",
+ "accessNeededDescription": "Permitir el acceso a la cámara para escanear el código QR de conexión de un remitente.",
+ "scanTitle": "Escanear código QR",
+ "scanDescription": "Centra el código QR del remitente dentro del marco. AlterSend se conectará automáticamente.",
+ "desktopHint": "Apunta el código QR del remitente a la cámara web: AlterSend se conecta automáticamente.",
+ "blockedTitle": "Acceso a la cámara bloqueado",
+ "blockedHint": "Permite el acceso a la cámara para AlterSend en la configuración de tu sistema y vuelve a intentarlo. También puedes pegar el código.",
+ "noneTitle": "No se encontró ninguna cámara",
+ "noneHint": "Conecte una cámara web para escanear o pegue el código de conexión.",
+ "unavailableTitle": "Cámara no disponible",
+ "starting": "Iniciando cámara…",
+ "enableTitle": "Activar acceso a la cámara",
+ "enableDescription": "Solo se necesita para escanear el QR del remitente. También puedes volver y pegar el código manualmente.",
+ "usePastedCode": "Usar el código pegado",
+ "joiningDescription": "Uniéndose a la sesión del remitente.",
+ "scanImportTitle": "Escanear o importar QR",
+ "scanImportDescription": "Centra el QR del remitente en el marco o importa una imagen guardada. AlterSend se conecta automáticamente.",
+ "desktopImportHint": "Centra el QR del remitente en el marco o importa una imagen guardada. AlterSend se conecta automáticamente.",
+ "enableImportDescription": "La cámara solo se necesita para escanear un QR. También puedes importar una imagen guardada o pegar el código manualmente."
+ },
+ "status": {
+ "ready": "Listo",
+ "saved": "Guardado",
+ "failed": "Fallido",
+ "downloadingPercent": "Descargando {{percent}}%",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "Esperando archivos del remitente…"
+ },
+ "summary": {
+ "receivedCount_one": "Se recibió {{completed}} de {{count}} archivo",
+ "receivedCount_other": "Se recibió {{completed}} de {{count}} archivos",
+ "savedToPhotos_one": "Guardado en fotos",
+ "savedToPhotos_other": "{{count}} guardados en Fotos",
+ "savedInFiles_one": "Guardado en archivos",
+ "savedInFiles_other": "{{count}} guardados en Archivos",
+ "tapToView": "Toca para ver",
+ "saved": "guardado",
+ "savedToLocation": "guardado en {{location}}",
+ "receivedProgress": "{{completed}} de {{count}} recibidos",
+ "senderLeftBeforeFinishing": "El remitente salió antes de terminar.",
+ "filesSaved_one": "{{count}} archivo guardado",
+ "filesSaved_other": "{{count}} archivos guardados"
+ }
+}
diff --git a/packages/locales/src/locales/es-ES/send.json b/packages/locales/src/locales/es-ES/send.json
new file mode 100644
index 0000000..322bef5
--- /dev/null
+++ b/packages/locales/src/locales/es-ES/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "Enviar archivos",
+ "description": "Elija uno o más archivos y genere un código único para una transferencia cifrada directa."
+ },
+ "preparing": {
+ "title": "Preparando la transferencia",
+ "description": "Preparar los archivos seleccionados antes de que se revele el código compartido."
+ },
+ "waitingForReceiver": {
+ "title": "Comparte el código",
+ "description": "Envía el código o QR a tu destinatario para iniciar la transferencia."
+ },
+ "receiverConnected": {
+ "title": "Comparte el código",
+ "description": "Envía el código o QR a tu destinatario para iniciar la transferencia."
+ }
+ },
+ "actions": {
+ "sendFiles_one": "Enviar {{count}} archivo",
+ "sendFiles_other": "Enviar {{count}} archivos",
+ "addFiles": "Agregar archivos",
+ "addMoreFiles": "Agregar más archivos",
+ "dragAndDrop": "Arrastrar y soltar",
+ "clear": "Borrar",
+ "endSession": "Finalizar sesión",
+ "pickFilesTitle": "Agregar archivos",
+ "pickPhotos": "Fotos",
+ "pickFiles": "Archivos"
+ },
+ "status": {
+ "waitingForPeer": "Esperando al destinatario",
+ "peerConnected": "Destinatario conectado",
+ "uploadComplete": "Subida completa",
+ "uploadingFiles": "Subiendo archivos",
+ "uploaded": "subido",
+ "uploading": "Subiendo…",
+ "waiting": "esperando",
+ "failed": "Fallido",
+ "downloaded": "Descargado",
+ "disconnected": "desconectado",
+ "online": "En línea",
+ "downloading": "Descargando",
+ "downloadingPercent": "Descargando {{percent}}%"
+ },
+ "connection": {
+ "placeholder": "Generando clave segura…",
+ "copyLabel": "Copiar código de conexión",
+ "showQrLabel": "Mostrar código QR",
+ "qrCodeLabel": "Código QR para la clave de conexión",
+ "qrModalDescription": "Abre AlterSend en otro dispositivo y escanea este código",
+ "copiedToast": "Copiado al portapapeles",
+ "scanToConnect": "Escanea para conectar",
+ "orScan": "o escanea",
+ "generating": "Generando…",
+ "waitingForConnection": "Esperando una conexión…"
+ },
+ "errors": {
+ "folderUnsupported": "Las carpetas aún no son compatibles. Seleccione solo archivos.",
+ "failedPickFiles": "No se pudieron seleccionar archivos",
+ "failedPickPhotos": "No se pudieron seleccionar las fotos"
+ },
+ "hints": {
+ "keepOpen": "Cerrar la aplicación cancela la transferencia."
+ },
+ "preparing": {
+ "uploadedCount_one": "{{completed}} de {{count}} archivo subido",
+ "uploadedCount_other": "{{completed}} de {{count}} archivos subidos"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} completado",
+ "completedDone_other": "{{count}} completados",
+ "devices": "Dispositivos",
+ "connectedCount_one": "{{count}} conectado",
+ "connectedCount_other": "{{count}} conectados"
+ },
+ "dropzone": {
+ "addMoreDescription": "o haz clic para <link>añadir más</link>",
+ "browseDescription": "o haz clic para <link>buscar</link>",
+ "tapAddMoreDescription": "Toca para <link>añadir más</link>",
+ "tapBrowseDescription": "Toca para <link>buscar</link>",
+ "orClickTo": "o haz clic para",
+ "tapTo": "Toca para",
+ "addMoreLink": "añadir más",
+ "browseLink": "buscar"
+ },
+ "files": {
+ "removeLabel": "Eliminar {{name}}"
+ }
+}
diff --git a/packages/locales/src/locales/es-ES/settings.json b/packages/locales/src/locales/es-ES/settings.json
new file mode 100644
index 0000000..1fe9354
--- /dev/null
+++ b/packages/locales/src/locales/es-ES/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "Ajustes",
+ "languageTitle": "Idioma",
+ "languageHint": "Elige el idioma utilizado por AlterSend.",
+ "sections": {
+ "privacy": "Privacidad",
+ "support": "Soporte",
+ "about": "Acerca de"
+ },
+ "crashReports": {
+ "label": "Informes de fallos",
+ "description": "Comparte datos anónimos sobre fallos para ayudar a mejorar AlterSend"
+ },
+ "rows": {
+ "feedback": "Comentarios",
+ "feedbackHint": "Informar un problema o sugerir una característica",
+ "discord": "Discord",
+ "discordHint": "Únete a la comunidad",
+ "contact": "Contáctenos",
+ "privacyPolicy": "Política de privacidad",
+ "privacyPolicyHint": "Cómo AlterSend maneja tus datos",
+ "terms": "Términos de servicio",
+ "termsHint": "Reglas para usar AlterSend",
+ "website": "Sitio web"
+ },
+ "legal": {
+ "terms": "Términos de uso",
+ "privacy": "Declaración de privacidad",
+ "sentence": "<terms>Términos de uso</terms> y <privacy>Declaración de privacidad</privacy>."
+ }
+}
diff --git a/packages/locales/src/locales/fr-FR/common.json b/packages/locales/src/locales/fr-FR/common.json
new file mode 100644
index 0000000..9dc1535
--- /dev/null
+++ b/packages/locales/src/locales/fr-FR/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "Transfert direct de fichiers",
+ "welcome": "Bienvenue dans AlterSend",
+ "loadingTagline": "Les fichiers passent directement entre vos appareils.\nAucun serveur, aucune copie, aucun intermédiaire."
+ },
+ "actions": {
+ "back": "Retour",
+ "continue": "Continuer",
+ "getStarted": "Commencer",
+ "cancel": "Annuler",
+ "clear": "Effacer",
+ "close": "Fermer",
+ "copy": "Copier",
+ "copied": "Copié",
+ "connect": "Connecter",
+ "connecting": "Connexion…",
+ "done": "Terminé",
+ "endSession": "Terminer la session",
+ "restart": "Redémarrer",
+ "tryAgain": "Réessayer",
+ "dismiss": "Fermer",
+ "openSettings": "Ouvrir les paramètres",
+ "update": "Mettre à jour",
+ "downloadAll": "Téléchargez tout",
+ "skip": "Ignorer"
+ },
+ "labels": {
+ "settings": "Paramètres",
+ "language": "Langue",
+ "systemDefault": "Valeur système",
+ "camera": "Caméra",
+ "statusBar": "Barre d'état",
+ "transferMode": "Mode de transfert",
+ "version": "Version de l’app",
+ "platform": "Plateforme",
+ "desktop": "Ordinateur",
+ "mobile": "Appareil mobile",
+ "send": "Envoyer",
+ "receive": "Recevoir",
+ "connectionCode": "Code de connexion"
+ },
+ "files": {
+ "count_one": "{{count}} fichier",
+ "count_other": "{{count}} fichiers",
+ "photos": "Photothèque",
+ "files": "Fichiers",
+ "downloads": "Fichiers › Téléchargements",
+ "photosAndAlterSend": "Photos + dossier AlterSend",
+ "alterSendFolder": "Dossier AlterSend"
+ },
+ "update": {
+ "ready": "Mise à jour prête",
+ "available": "Mise à jour disponible",
+ "restart": "Redémarrer",
+ "update": "Mettre à jour",
+ "restartFailed": "Échec du redémarrage: veuillez quitter et rouvrir"
+ },
+ "status": {
+ "connected": "Connecté"
+ },
+ "confirm": {
+ "leaveShareSession": "Quitter mettra fin à votre session de partage active. Continuer?",
+ "leaveReceiveSession": "Quitter mettra fin à votre session de réception active. Continuer?"
+ }
+}
diff --git a/packages/locales/src/locales/fr-FR/errors.json b/packages/locales/src/locales/fr-FR/errors.json
new file mode 100644
index 0000000..ef11b66
--- /dev/null
+++ b/packages/locales/src/locales/fr-FR/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "Quelque chose s'est mal passé",
+ "desktopDescription": "AlterSend a rencontré une erreur inattendue et doit redémarrer. Le service de transfert peut être instable, un redémarrage est donc l'option la plus sûre.",
+ "mobileDescription": "AlterSend a rencontré une erreur inattendue. Réessayez ou fermez et rouvrez l'application si le problème persiste.",
+ "restartAlterSend": "Redémarrez AlterSend",
+ "tryAgain": "Réessayez"
+ },
+ "bridgeUnavailable": {
+ "title": "Connexion de bureau indisponible",
+ "description": "Cette fenêtre n'est pas connectée à l'application de bureau. Redémarrez AlterSend depuis l'application de bureau.",
+ "status": "Connexion de bureau indisponible"
+ },
+ "transfer": {
+ "invalidTopic": "Le code de connexion est invalide.",
+ "joinFailed": "Impossible de rejoindre la session.",
+ "peerUnreachable": "Impossible de joindre l’expéditeur. Vérifiez le code et réessayez.",
+ "transferFailed": "Le transfert a échoué. Réessayez.",
+ "downloadFailed": "Le téléchargement a échoué. Réessayez."
+ }
+}
diff --git a/packages/locales/src/locales/fr-FR/feedback.json b/packages/locales/src/locales/fr-FR/feedback.json
new file mode 100644
index 0000000..03d3bdf
--- /dev/null
+++ b/packages/locales/src/locales/fr-FR/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "Commentaires",
+ "types": {
+ "bug": "Rapport de bug",
+ "feature": "Demande de fonctionnalité",
+ "general": "Général"
+ },
+ "placeholders": {
+ "bug": "Décrivez ce qui s’est passé et comment le reproduire…",
+ "desktopBug": "Décrivez ce qui n’a pas fonctionné…",
+ "feature": "Que souhaiteriez-vous voir dans AlterSend?",
+ "desktopFeature": "Qu’aimeriez-vous voir?",
+ "general": "Partagez vos réflexions…"
+ },
+ "actions": {
+ "send": "Envoyer des commentaires",
+ "sending": "Envoi…"
+ },
+ "states": {
+ "sent": "Merci pour vos commentaires!",
+ "failed": "Échec de l'envoi. Vérifiez votre connexion.",
+ "received": "Votre retour a bien été reçu."
+ }
+}
diff --git a/packages/locales/src/locales/fr-FR/index.ts b/packages/locales/src/locales/fr-FR/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/fr-FR/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/fr-FR/native.json b/packages/locales/src/locales/fr-FR/native.json
new file mode 100644
index 0000000..8ed88dc
--- /dev/null
+++ b/packages/locales/src/locales/fr-FR/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend utilise votre caméra pour scanner les codes de connexion QR.",
+ "localNetwork": "AlterSend utilise votre réseau local pour trouver les appareils à proximité et transférer des fichiers directement.",
+ "photoRead": "AlterSend lit votre photothèque afin que vous puissiez sélectionner des photos et des vidéos à envoyer vers un autre appareil.",
+ "photoSave": "AlterSend enregistre les images et vidéos reçues dans votre photothèque."
+ }
+}
diff --git a/packages/locales/src/locales/fr-FR/onboarding.json b/packages/locales/src/locales/fr-FR/onboarding.json
new file mode 100644
index 0000000..3799c8c
--- /dev/null
+++ b/packages/locales/src/locales/fr-FR/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "Fichiers, directement entre appareils.",
+ "description": "Un appareil envoie, l'autre reçoit. Un code court les connecte afin que les fichiers puissent être diffusés directement."
+ },
+ "keepOpen": {
+ "title": "Gardez les deux applications ouvertes.",
+ "description": "Les fichiers sont diffusés directement entre les appareils – il n’y a pas de cloud. La fermeture ou la mise en arrière-plan de l'application annulera le transfert."
+ },
+ "encrypted": {
+ "title": "Chiffré de bout en bout.",
+ "description": "Pas de serveurs, pas de copies, pas d'intermédiaires. Vos fichiers sont transférés directement entre vous et le destinataire.",
+ "link": "Lire notre politique de confidentialité"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/fr-FR/receive.json b/packages/locales/src/locales/fr-FR/receive.json
new file mode 100644
index 0000000..61be0b9
--- /dev/null
+++ b/packages/locales/src/locales/fr-FR/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "Recevoir",
+ "join": {
+ "title": "Recevoir des fichiers",
+ "description": "Saisissez un code de connexion à 64 caractères de l'expéditeur pour diffuser ses fichiers.",
+ "mobileDescription": "Scannez ou importez le QR de l’expéditeur, ou collez son code de 64 caractères pour démarrer le transfert."
+ },
+ "connecting": {
+ "title": "Connexion",
+ "description": "Établir une session sécurisée avec l'expéditeur."
+ },
+ "incomingTransfer": {
+ "title": "Fichiers disponibles",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} fichier · {{size}}",
+ "description_other": "{{count}} fichiers · {{size}}"
+ },
+ "completed": {
+ "title_one": "Fichier reçu",
+ "title_other": "Fichiers reçus",
+ "downloadsComplete": "Téléchargements terminés"
+ },
+ "reconnecting": {
+ "title": "Reconnexion",
+ "description": "Reconnexion à la session. Les fichiers seront à nouveau disponibles dès que le lien sera rétabli.",
+ "panelDescription": "Connexion interrompue. Reconnexion à la session…"
+ },
+ "interrupted": {
+ "title": "Transfert incomplet",
+ "description": "L'expéditeur est parti avant l'arrivée de tous les fichiers."
+ },
+ "handshake": {
+ "title": "Connexion en cours",
+ "description": "Terminer la poignée de main sécurisée avec l’expéditeur."
+ },
+ "sessionEnded": {
+ "title": "Séance terminée",
+ "description": "Revenez pour démarrer un nouveau transfert."
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "Fichiers prêts",
+ "filesReadyDescription": "L'expéditeur a partagé des fichiers. Passez-les en revue et démarrez chaque téléchargement lorsque vous êtes prêt.",
+ "receivedFiles": "Fichiers reçus"
+ },
+ "form": {
+ "codeLabel": "Code de connexion",
+ "codePlaceholder": "Collez le code de 64 caractères…",
+ "orPasteCode": "ou collez le code"
+ },
+ "actions": {
+ "scanQr": "Scanner le code QR",
+ "allowCamera": "Autoriser la caméra",
+ "downloadAll": "Téléchargez tout",
+ "view": "Voir",
+ "play": "Lire",
+ "open": "Ouvert",
+ "scanQrHint": "Utilisez la webcam pour lire le QR de l'expéditeur",
+ "downloadingPercent": "Téléchargement {{percent}} %",
+ "downloadAllWithSize": "Tout télécharger ({{size}})",
+ "showInFinder": "Afficher dans le Finder",
+ "backToHome": "Retour à l'accueil",
+ "viewPhotos": "Voir les photos",
+ "scanOrImportQr": "Scanner ou importer le QR",
+ "scanOrImportQrHintDesktop": "Utilisez la webcam ou importez une image QR enregistrée",
+ "scanOrImportQrHintMobile": "Utilisez l’appareil photo ou importez une image enregistrée",
+ "importImage": "Importer une image",
+ "importFromImage": "Importer depuis une image"
+ },
+ "errors": {
+ "invalidCode": "Entrez un code hexadécimal valide de 64 caractères.",
+ "invalidKey": "Entrez une clé hexadécimale valide de 64 caractères.",
+ "joinFailed": "Impossible de rejoindre la session.",
+ "unreachable": "Impossible de joindre l'expéditeur. Vérifiez le code et réessayez.",
+ "unsupportedQrTitle": "Code QR non pris en charge",
+ "unsupportedQrHint": "Scannez un code de connexion AlterSend.",
+ "mobileJoinFailedTitle": "Impossible de rejoindre la session",
+ "mobileJoinFailedHint": "Essayez de scanner à nouveau ou collez le code manuellement.",
+ "cameraUnavailable": "Caméra indisponible.",
+ "cameraCouldNotStart": "La caméra n'a pas pu démarrer. Collez plutôt le code de connexion.",
+ "downloadFailed": "Échec",
+ "didntArrive": "Je ne suis pas arrivé",
+ "transferIssue": "Problème de transfert",
+ "imageNoQrTitle": "Aucun code QR trouvé",
+ "imageNoQrHint": "Choisissez une image contenant un code QR AlterSend.",
+ "imageUnsupportedQrHint": "Cette image n’est pas un code de connexion AlterSend.",
+ "imageReadFailedTitle": "Impossible de lire cette image"
+ },
+ "camera": {
+ "preparingTitle": "Préparation de la caméra",
+ "preparingDescription": "Vérifier l'accès à la caméra afin de pouvoir scanner le code QR de l'expéditeur.",
+ "accessNeededTitle": "Accès à la caméra nécessaire",
+ "accessNeededDescription": "Autoriser l'accès à la caméra pour scanner le code de connexion QR d'un expéditeur.",
+ "scanTitle": "Scanner le code QR",
+ "scanDescription": "Centrez le code QR de l’expéditeur à l’intérieur du cadre. AlterSend se connectera automatiquement.",
+ "desktopHint": "Pointez le code QR de l’expéditeur vers la webcam: AlterSend se connecte automatiquement.",
+ "blockedTitle": "Accès à la caméra bloqué",
+ "blockedHint": "Autorisez l'accès à la caméra pour AlterSend dans les paramètres de votre système, puis réessayez. Vous pouvez également coller le code à la place.",
+ "noneTitle": "Aucune caméra trouvée",
+ "noneHint": "Connectez une webcam pour numériser ou collez plutôt le code de connexion.",
+ "unavailableTitle": "Caméra indisponible",
+ "starting": "Démarrage de la caméra…",
+ "enableTitle": "Activer l'accès à la caméra",
+ "enableDescription": "Cela sert uniquement à scanner le QR code de l'expéditeur. Vous pouvez aussi revenir en arrière et coller le code manuellement.",
+ "usePastedCode": "Utiliser plutôt le code collé",
+ "joiningDescription": "Connexion à la session de l'expéditeur.",
+ "scanImportTitle": "Scanner ou importer le QR",
+ "scanImportDescription": "Centrez le QR de l’expéditeur dans le cadre, ou importez une image enregistrée. AlterSend se connecte automatiquement.",
+ "desktopImportHint": "Centrez le QR de l’expéditeur dans le cadre, ou importez une image enregistrée. AlterSend se connecte automatiquement.",
+ "enableImportDescription": "L’appareil photo sert uniquement à scanner un QR. Vous pouvez aussi importer une image enregistrée ou coller le code manuellement."
+ },
+ "status": {
+ "ready": "Prêt",
+ "saved": "Enregistré",
+ "failed": "Échec",
+ "downloadingPercent": "Téléchargement de {{percent}} %",
+ "percent": "{{percent}} %",
+ "waitingForFiles": "En attente des fichiers de l'expéditeur…"
+ },
+ "summary": {
+ "receivedCount_one": "{{completed}} fichier sur {{count}} reçu",
+ "receivedCount_other": "{{completed}} fichiers sur {{count}} reçus",
+ "savedToPhotos_one": "Enregistré dans les photos",
+ "savedToPhotos_other": "{{count}} enregistrés dans Photos",
+ "savedInFiles_one": "Enregistré dans Fichiers",
+ "savedInFiles_other": "{{count}} enregistrés dans Fichiers",
+ "tapToView": "Appuyez pour voir",
+ "saved": "enregistré",
+ "savedToLocation": "enregistré dans {{location}}",
+ "receivedProgress": "{{completed}} sur {{count}} reçus",
+ "senderLeftBeforeFinishing": "L'expéditeur est parti avant la fin.",
+ "filesSaved_one": "{{count}} fichier enregistré",
+ "filesSaved_other": "{{count}} fichiers enregistrés"
+ }
+}
diff --git a/packages/locales/src/locales/fr-FR/send.json b/packages/locales/src/locales/fr-FR/send.json
new file mode 100644
index 0000000..5f9b00b
--- /dev/null
+++ b/packages/locales/src/locales/fr-FR/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "Envoyer des fichiers",
+ "description": "Choisissez un ou plusieurs fichiers et générez un code à usage unique pour un transfert crypté direct."
+ },
+ "preparing": {
+ "title": "Préparation du transfert",
+ "description": "Préparation des fichiers sélectionnés avant la révélation du code de partage."
+ },
+ "waitingForReceiver": {
+ "title": "Partagez le code",
+ "description": "Envoyez le code ou QR à votre destinataire pour démarrer le transfert."
+ },
+ "receiverConnected": {
+ "title": "Partagez le code",
+ "description": "Envoyez le code ou QR à votre destinataire pour démarrer le transfert."
+ }
+ },
+ "actions": {
+ "sendFiles_one": "Envoyer {{count}} fichier",
+ "sendFiles_other": "Envoyer {{count}} fichiers",
+ "addFiles": "Ajouter des fichiers",
+ "addMoreFiles": "Ajouter plus de fichiers",
+ "dragAndDrop": "Glisser et déposer",
+ "clear": "Effacer",
+ "endSession": "Fin de séance",
+ "pickFilesTitle": "Ajouter des fichiers",
+ "pickPhotos": "Photothèque",
+ "pickFiles": "Fichiers"
+ },
+ "status": {
+ "waitingForPeer": "En attente du destinataire",
+ "peerConnected": "Destinataire connecté",
+ "uploadComplete": "Téléchargement terminé",
+ "uploadingFiles": "Téléchargement de fichiers",
+ "uploaded": "Téléchargé",
+ "uploading": "Téléchargement…",
+ "waiting": "En attente",
+ "failed": "Échec",
+ "downloaded": "Téléchargé",
+ "disconnected": "Déconnecté",
+ "online": "En ligne",
+ "downloading": "Téléchargement",
+ "downloadingPercent": "Téléchargement de {{percent}} %"
+ },
+ "connection": {
+ "placeholder": "Génération de clé sécurisée…",
+ "copyLabel": "Copier le code de connexion",
+ "showQrLabel": "Afficher le code QR",
+ "qrCodeLabel": "Code QR pour la clé de connexion",
+ "qrModalDescription": "Ouvrez AlterSend sur un autre appareil et scannez ce code",
+ "copiedToast": "Copié dans le presse-papiers",
+ "scanToConnect": "Scannez pour vous connecter",
+ "orScan": "ou scannez",
+ "generating": "Génération…",
+ "waitingForConnection": "En attente de connexion…"
+ },
+ "errors": {
+ "folderUnsupported": "Les dossiers ne sont pas encore pris en charge. Veuillez sélectionner uniquement les fichiers.",
+ "failedPickFiles": "Échec de la sélection des fichiers",
+ "failedPickPhotos": "Échec de la sélection des photos"
+ },
+ "hints": {
+ "keepOpen": "La fermeture de l'application annule le transfert."
+ },
+ "preparing": {
+ "uploadedCount_one": "{{completed}} fichier sur {{count}} téléversé",
+ "uploadedCount_other": "{{completed}} fichiers sur {{count}} téléversés"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} terminé",
+ "completedDone_other": "{{count}} terminés",
+ "devices": "Appareils",
+ "connectedCount_one": "{{count}} connecté",
+ "connectedCount_other": "{{count}} connectés"
+ },
+ "dropzone": {
+ "addMoreDescription": "ou cliquez pour <link>en ajouter</link>",
+ "browseDescription": "ou cliquez pour <link>parcourir</link>",
+ "tapAddMoreDescription": "Touchez pour <link>en ajouter</link>",
+ "tapBrowseDescription": "Touchez pour <link>parcourir</link>",
+ "orClickTo": "ou cliquez pour",
+ "tapTo": "Touchez pour",
+ "addMoreLink": "en ajouter",
+ "browseLink": "parcourir"
+ },
+ "files": {
+ "removeLabel": "Supprimer {{name}}"
+ }
+}
diff --git a/packages/locales/src/locales/fr-FR/settings.json b/packages/locales/src/locales/fr-FR/settings.json
new file mode 100644
index 0000000..307a79f
--- /dev/null
+++ b/packages/locales/src/locales/fr-FR/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "Paramètres",
+ "languageTitle": "Langue",
+ "languageHint": "Choisissez la langue utilisée par AlterSend.",
+ "sections": {
+ "privacy": "Confidentialité",
+ "support": "Assistance",
+ "about": "À propos"
+ },
+ "crashReports": {
+ "label": "Rapports d'erreur",
+ "description": "Partagez des données anonymes sur les accidents pour contribuer à améliorer AlterSend"
+ },
+ "rows": {
+ "feedback": "Commentaires",
+ "feedbackHint": "Signaler un problème ou suggérer une fonctionnalité",
+ "discord": "Discord",
+ "discordHint": "Rejoignez la communauté",
+ "contact": "Contactez-nous",
+ "privacyPolicy": "Politique de confidentialité",
+ "privacyPolicyHint": "Comment AlterSend gère vos données",
+ "terms": "Conditions d'utilisation",
+ "termsHint": "Règles d'utilisation de AlterSend",
+ "website": "Site Web"
+ },
+ "legal": {
+ "terms": "Conditions d'utilisation",
+ "privacy": "Déclaration de confidentialité",
+ "sentence": "<terms>Conditions d’utilisation</terms> et <privacy>Déclaration de confidentialité</privacy>."
+ }
+}
diff --git a/packages/locales/src/locales/it-IT/common.json b/packages/locales/src/locales/it-IT/common.json
new file mode 100644
index 0000000..54c59b3
--- /dev/null
+++ b/packages/locales/src/locales/it-IT/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "Trasferimento diretto di file",
+ "welcome": "Benvenuto in AlterSend",
+ "loadingTagline": "I file viaggiano direttamente tra i tuoi dispositivi.\nNessun server, nessuna copia, nessun intermediario."
+ },
+ "actions": {
+ "back": "Indietro",
+ "continue": "Continua",
+ "getStarted": "Inizia",
+ "cancel": "Annulla",
+ "clear": "Cancella",
+ "close": "Chiudi",
+ "copy": "Copia",
+ "copied": "Copiato",
+ "connect": "Connetti",
+ "connecting": "Connessione…",
+ "done": "Fine",
+ "endSession": "Termina sessione",
+ "restart": "Riavvia",
+ "tryAgain": "Riprova",
+ "dismiss": "Ignora",
+ "openSettings": "Apri le impostazioni",
+ "update": "Aggiorna",
+ "downloadAll": "Scarica tutto",
+ "skip": "Salta"
+ },
+ "labels": {
+ "settings": "Impostazioni",
+ "language": "Lingua",
+ "systemDefault": "Predefinito di sistema",
+ "camera": "Fotocamera",
+ "statusBar": "Barra di stato",
+ "transferMode": "Modalità di trasferimento",
+ "version": "Versione",
+ "platform": "Piattaforma",
+ "desktop": "App desktop",
+ "mobile": "Dispositivo mobile",
+ "send": "Invia",
+ "receive": "Ricevi",
+ "connectionCode": "Codice di connessione"
+ },
+ "files": {
+ "count_one": "{{count}} file",
+ "count_other": "{{count}} file",
+ "photos": "Foto",
+ "files": "File",
+ "downloads": "File › Download",
+ "photosAndAlterSend": "Foto + cartella AlterSend",
+ "alterSendFolder": "Cartella AlterSend"
+ },
+ "update": {
+ "ready": "Aggiornamento pronto",
+ "available": "Aggiornamento disponibile",
+ "restart": "Riavvia",
+ "update": "Aggiorna",
+ "restartFailed": "Riavvio non riuscito: esci e riapri"
+ },
+ "status": {
+ "connected": "Connesso"
+ },
+ "confirm": {
+ "leaveShareSession": "L'abbandono terminerà la sessione di condivisione attiva. Continuare?",
+ "leaveReceiveSession": "L'abbandono terminerà la sessione di ricezione attiva. Continuare?"
+ }
+}
diff --git a/packages/locales/src/locales/it-IT/errors.json b/packages/locales/src/locales/it-IT/errors.json
new file mode 100644
index 0000000..66d3800
--- /dev/null
+++ b/packages/locales/src/locales/it-IT/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "Qualcosa è andato storto",
+ "desktopDescription": "AlterSend ha riscontrato un errore imprevisto ed è necessario riavviarlo. Il servizio di trasferimento potrebbe essere instabile, quindi un riavvio è l'opzione più sicura.",
+ "mobileDescription": "AlterSend ha riscontrato un errore imprevisto. Riprova oppure chiudi e riapri l'app se il problema persiste.",
+ "restartAlterSend": "Riavvia AlterSend",
+ "tryAgain": "Riprova"
+ },
+ "bridgeUnavailable": {
+ "title": "Connessione desktop non disponibile",
+ "description": "Questa finestra non è collegata all'app desktop. Riavvia AlterSend dall'app desktop.",
+ "status": "Connessione desktop non disponibile"
+ },
+ "transfer": {
+ "invalidTopic": "Il codice di connessione non è valido.",
+ "joinFailed": "Impossibile partecipare alla sessione.",
+ "peerUnreachable": "Impossibile raggiungere il mittente. Controlla il codice e riprova.",
+ "transferFailed": "Trasferimento non riuscito. Riprova.",
+ "downloadFailed": "Download non riuscito. Riprova."
+ }
+}
diff --git a/packages/locales/src/locales/it-IT/feedback.json b/packages/locales/src/locales/it-IT/feedback.json
new file mode 100644
index 0000000..066e530
--- /dev/null
+++ b/packages/locales/src/locales/it-IT/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "Invia una segnalazione",
+ "types": {
+ "bug": "Segnalazione di bug",
+ "feature": "Richiesta di funzionalità",
+ "general": "Generale"
+ },
+ "placeholders": {
+ "bug": "Descrivi cosa è successo e come riprodurlo...",
+ "desktopBug": "Descrivi cosa è andato storto...",
+ "feature": "Cosa ti piacerebbe vedere in AlterSend?",
+ "desktopFeature": "Cosa ti piacerebbe vedere?",
+ "general": "Condividi i tuoi pensieri..."
+ },
+ "actions": {
+ "send": "Invia feedback",
+ "sending": "Invio…"
+ },
+ "states": {
+ "sent": "Grazie per il tuo feedback!",
+ "failed": "Impossibile inviare. Controlla la tua connessione.",
+ "received": "Il tuo feedback è stato ricevuto."
+ }
+}
diff --git a/packages/locales/src/locales/it-IT/index.ts b/packages/locales/src/locales/it-IT/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/it-IT/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/it-IT/native.json b/packages/locales/src/locales/it-IT/native.json
new file mode 100644
index 0000000..4cbd06d
--- /dev/null
+++ b/packages/locales/src/locales/it-IT/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend utilizza la fotocamera per scansionare i codici di connessione QR.",
+ "localNetwork": "AlterSend utilizza la tua rete locale per trovare dispositivi nelle vicinanze e trasferire file direttamente.",
+ "photoRead": "AlterSend legge la tua libreria fotografica così puoi scegliere foto e video da inviare a un altro dispositivo.",
+ "photoSave": "AlterSend salva le immagini e i video ricevuti nella tua libreria di foto."
+ }
+}
diff --git a/packages/locales/src/locales/it-IT/onboarding.json b/packages/locales/src/locales/it-IT/onboarding.json
new file mode 100644
index 0000000..2c47cac
--- /dev/null
+++ b/packages/locales/src/locales/it-IT/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "File, direttamente tra i dispositivi.",
+ "description": "Un dispositivo invia, l'altro riceve. Un codice breve li collega in modo che i file possano essere trasmessi direttamente in streaming."
+ },
+ "keepOpen": {
+ "title": "Mantieni aperte entrambe le app.",
+ "description": "I file vengono trasmessi direttamente tra i dispositivi: non esiste il cloud. La chiusura o l'inserimento in background dell'app annullerà il trasferimento."
+ },
+ "encrypted": {
+ "title": "Crittografato end-to-end.",
+ "description": "Nessun server, nessuna copia, nessun intermediario. I tuoi file vengono trasferiti direttamente tra te e il destinatario.",
+ "link": "Leggi la nostra politica sulla privacy"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/it-IT/receive.json b/packages/locales/src/locales/it-IT/receive.json
new file mode 100644
index 0000000..105db90
--- /dev/null
+++ b/packages/locales/src/locales/it-IT/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "Ricevi",
+ "join": {
+ "title": "Ricevi file",
+ "description": "Inserisci un codice di connessione di 64 caratteri dal mittente per eseguire lo streaming dei suoi file.",
+ "mobileDescription": "Scansiona o importa il QR del mittente, oppure incolla il codice di 64 caratteri per avviare il trasferimento."
+ },
+ "connecting": {
+ "title": "Connessione",
+ "description": "Stabilire una sessione sicura con il mittente."
+ },
+ "incomingTransfer": {
+ "title": "File disponibili",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} file disponibile · {{size}}",
+ "description_other": "{{count}} file · {{size}}"
+ },
+ "completed": {
+ "title_one": "File ricevuto",
+ "title_other": "File ricevuti",
+ "downloadsComplete": "Download completati"
+ },
+ "reconnecting": {
+ "title": "Riconnessione",
+ "description": "Riconnessione alla sessione. I file saranno nuovamente disponibili non appena il collegamento verrà ripristinato.",
+ "panelDescription": "Connessione interrotta. Rientro nella sessione…"
+ },
+ "interrupted": {
+ "title": "Trasferimento incompleto",
+ "description": "Il mittente se n'è andato prima che arrivassero tutti i file."
+ },
+ "handshake": {
+ "title": "Connessione in corso",
+ "description": "Completamento dell'handshake sicuro con il mittente."
+ },
+ "sessionEnded": {
+ "title": "La sessione è terminata",
+ "description": "Ritorna per iniziare un nuovo trasferimento."
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "File pronti",
+ "filesReadyDescription": "Il mittente ha file condivisi. Rivedili e avvia ciascun download quando è pronto.",
+ "receivedFiles": "File ricevuti"
+ },
+ "form": {
+ "codeLabel": "Codice di connessione",
+ "codePlaceholder": "Incolla il codice di 64 caratteri…",
+ "orPasteCode": "oppure incolla il codice"
+ },
+ "actions": {
+ "scanQr": "Scansiona il codice QR",
+ "allowCamera": "Consenti fotocamera",
+ "downloadAll": "Scarica tutto",
+ "view": "Visualizza",
+ "play": "Riproduci",
+ "open": "Aperto",
+ "scanQrHint": "Usa la webcam per leggere il QR del mittente",
+ "downloadingPercent": "Download {{percent}}%",
+ "downloadAllWithSize": "Scarica tutto ({{size}})",
+ "showInFinder": "Mostra nel Finder",
+ "backToHome": "Torna alla home",
+ "viewPhotos": "Visualizza foto",
+ "scanOrImportQr": "Scansiona o importa QR",
+ "scanOrImportQrHintDesktop": "Usa la webcam o importa un’immagine QR salvata",
+ "scanOrImportQrHintMobile": "Usa la fotocamera o importa un’immagine salvata",
+ "importImage": "Importa immagine",
+ "importFromImage": "Importa da immagine"
+ },
+ "errors": {
+ "invalidCode": "Inserisci un codice esadecimale valido di 64 caratteri.",
+ "invalidKey": "Immettere una chiave esadecimale valida di 64 caratteri.",
+ "joinFailed": "Impossibile partecipare alla sessione.",
+ "unreachable": "Impossibile raggiungere il mittente. Controlla il codice e riprova.",
+ "unsupportedQrTitle": "Codice QR non supportato",
+ "unsupportedQrHint": "Scansiona un codice di connessione AlterSend.",
+ "mobileJoinFailedTitle": "Impossibile partecipare alla sessione",
+ "mobileJoinFailedHint": "Prova a eseguire nuovamente la scansione o incolla il codice manualmente.",
+ "cameraUnavailable": "Fotocamera non disponibile.",
+ "cameraCouldNotStart": "Non è stato possibile avviare la fotocamera. Incolla invece il codice di connessione.",
+ "downloadFailed": "Fallito",
+ "didntArrive": "Non è arrivato",
+ "transferIssue": "Problema di trasferimento",
+ "imageNoQrTitle": "Nessun codice QR trovato",
+ "imageNoQrHint": "Scegli un’immagine che mostri un codice QR AlterSend.",
+ "imageUnsupportedQrHint": "Questa immagine non è un codice di connessione AlterSend.",
+ "imageReadFailedTitle": "Impossibile leggere questa immagine"
+ },
+ "camera": {
+ "preparingTitle": "Preparazione della fotocamera",
+ "preparingDescription": "Controllo dell'accesso alla fotocamera in modo da poter scansionare il codice QR del mittente.",
+ "accessNeededTitle": "È necessario l'accesso alla fotocamera",
+ "accessNeededDescription": "Consenti l'accesso alla fotocamera per scansionare il codice QR di connessione di un mittente.",
+ "scanTitle": "Scansiona il codice QR",
+ "scanDescription": "Centrare il codice QR del mittente all'interno del frame. AlterSend si connetterà automaticamente.",
+ "desktopHint": "Punta il codice QR del mittente verso la webcam: AlterSend si connette automaticamente.",
+ "blockedTitle": "Accesso alla telecamera bloccato",
+ "blockedHint": "Consenti l'accesso alla fotocamera per AlterSend nelle impostazioni di sistema, quindi riprova. Puoi anche incollare il codice.",
+ "noneTitle": "Nessuna fotocamera trovata",
+ "noneHint": "Collega una webcam per eseguire la scansione oppure incolla il codice di connessione.",
+ "unavailableTitle": "Fotocamera non disponibile",
+ "starting": "Avvio della fotocamera…",
+ "enableTitle": "Abilita l'accesso alla fotocamera",
+ "enableDescription": "Serve solo per scansionare il QR del mittente. Puoi anche tornare indietro e incollare il codice manualmente.",
+ "usePastedCode": "Usa invece il codice incollato",
+ "joiningDescription": "Accesso alla sessione del mittente.",
+ "scanImportTitle": "Scansiona o importa QR",
+ "scanImportDescription": "Centra il QR del mittente nel riquadro oppure importa un’immagine salvata. AlterSend si connette automaticamente.",
+ "desktopImportHint": "Centra il QR del mittente nel riquadro oppure importa un’immagine salvata. AlterSend si connette automaticamente.",
+ "enableImportDescription": "La fotocamera serve solo per scansionare un QR. Puoi anche importare un’immagine salvata o incollare il codice manualmente."
+ },
+ "status": {
+ "ready": "Pronto",
+ "saved": "Salvato",
+ "failed": "Fallito",
+ "downloadingPercent": "Download di {{percent}}%",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "In attesa dei file dal mittente…"
+ },
+ "summary": {
+ "receivedCount_one": "Ricevuto {{completed}} di {{count}} file",
+ "receivedCount_other": "Ricevuto {{completed}} di {{count}} file",
+ "savedToPhotos_one": "Salvato in Foto",
+ "savedToPhotos_other": "{{count}} salvati in Foto",
+ "savedInFiles_one": "Salvato in File",
+ "savedInFiles_other": "{{count}} salvati in File",
+ "tapToView": "Tocca per visualizzare",
+ "saved": "salvato",
+ "savedToLocation": "salvato in {{location}}",
+ "receivedProgress": "{{completed}} di {{count}} ricevuti",
+ "senderLeftBeforeFinishing": "Il mittente è uscito prima del completamento.",
+ "filesSaved_one": "{{count}} file salvato",
+ "filesSaved_other": "{{count}} file salvati"
+ }
+}
diff --git a/packages/locales/src/locales/it-IT/send.json b/packages/locales/src/locales/it-IT/send.json
new file mode 100644
index 0000000..46f5c2d
--- /dev/null
+++ b/packages/locales/src/locales/it-IT/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "Invia file",
+ "description": "Scegli uno o più file e genera un codice monouso per un trasferimento crittografato diretto."
+ },
+ "preparing": {
+ "title": "Preparazione del trasferimento",
+ "description": "Preparazione dei file selezionati prima che venga rivelato il codice di condivisione."
+ },
+ "waitingForReceiver": {
+ "title": "Condividi il codice",
+ "description": "Invia il codice o QR al destinatario per avviare il trasferimento."
+ },
+ "receiverConnected": {
+ "title": "Condividi il codice",
+ "description": "Invia il codice o QR al destinatario per avviare il trasferimento."
+ }
+ },
+ "actions": {
+ "sendFiles_one": "Invia {{count}} file",
+ "sendFiles_other": "Invia {{count}} file",
+ "addFiles": "Aggiungi file",
+ "addMoreFiles": "Aggiungi più file",
+ "dragAndDrop": "Trascina e rilascia",
+ "clear": "Chiaro",
+ "endSession": "Fine sessione",
+ "pickFilesTitle": "Aggiungi file",
+ "pickPhotos": "Foto",
+ "pickFiles": "File"
+ },
+ "status": {
+ "waitingForPeer": "In attesa del destinatario",
+ "peerConnected": "Destinatario connesso",
+ "uploadComplete": "Caricamento completato",
+ "uploadingFiles": "Caricamento file",
+ "uploaded": "Caricato",
+ "uploading": "Caricamento…",
+ "waiting": "In attesa",
+ "failed": "Fallito",
+ "downloaded": "Scaricato",
+ "disconnected": "Disconnesso",
+ "online": "In linea",
+ "downloading": "Download in corso",
+ "downloadingPercent": "Download di {{percent}}%"
+ },
+ "connection": {
+ "placeholder": "Generazione della chiave sicura…",
+ "copyLabel": "Copia il codice di connessione",
+ "showQrLabel": "Mostra il codice QR",
+ "qrCodeLabel": "Codice QR per la chiave di connessione",
+ "qrModalDescription": "Apri AlterSend su un altro dispositivo e scansiona questo codice",
+ "copiedToast": "Copiato negli appunti",
+ "scanToConnect": "Scansiona per connetterti",
+ "orScan": "oppure scansiona",
+ "generating": "Generazione…",
+ "waitingForConnection": "In attesa di connessione…"
+ },
+ "errors": {
+ "folderUnsupported": "Le cartelle non sono ancora supportate. Seleziona solo i file.",
+ "failedPickFiles": "Impossibile selezionare i file",
+ "failedPickPhotos": "Impossibile selezionare le foto"
+ },
+ "hints": {
+ "keepOpen": "La chiusura dell'app annulla il trasferimento."
+ },
+ "preparing": {
+ "uploadedCount_one": "{{completed}} file su {{count}} caricato",
+ "uploadedCount_other": "{{completed}} file su {{count}} caricati"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} completato",
+ "completedDone_other": "{{count}} completati",
+ "devices": "Dispositivi",
+ "connectedCount_one": "{{count}} connesso",
+ "connectedCount_other": "{{count}} connessi"
+ },
+ "dropzone": {
+ "addMoreDescription": "oppure fai clic per <link>aggiungerne altri</link>",
+ "browseDescription": "oppure fai clic per <link>sfogliare</link>",
+ "tapAddMoreDescription": "Tocca per <link>aggiungerne altri</link>",
+ "tapBrowseDescription": "Tocca per <link>sfogliare</link>",
+ "orClickTo": "oppure fai clic per",
+ "tapTo": "Tocca per",
+ "addMoreLink": "aggiungerne altri",
+ "browseLink": "sfogliare"
+ },
+ "files": {
+ "removeLabel": "Rimuovi {{name}}"
+ }
+}
diff --git a/packages/locales/src/locales/it-IT/settings.json b/packages/locales/src/locales/it-IT/settings.json
new file mode 100644
index 0000000..b191252
--- /dev/null
+++ b/packages/locales/src/locales/it-IT/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "Impostazioni",
+ "languageTitle": "Lingua",
+ "languageHint": "Scegli la lingua utilizzata da AlterSend.",
+ "sections": {
+ "privacy": "Riservatezza",
+ "support": "Supporto",
+ "about": "Informazioni"
+ },
+ "crashReports": {
+ "label": "Rapporti sugli incidenti",
+ "description": "Condividi dati anonimi sugli arresti anomali per contribuire a migliorare AlterSend"
+ },
+ "rows": {
+ "feedback": "Segnalazioni",
+ "feedbackHint": "Segnala un problema o suggerisci una funzionalità",
+ "discord": "Discord",
+ "discordHint": "Unisciti alla comunità",
+ "contact": "Contattaci",
+ "privacyPolicy": "Informativa sulla privacy",
+ "privacyPolicyHint": "Come AlterSend gestisce i tuoi dati",
+ "terms": "Termini di servizio",
+ "termsHint": "Regole per l'utilizzo di AlterSend",
+ "website": "Sito web"
+ },
+ "legal": {
+ "terms": "Condizioni d'uso",
+ "privacy": "Informativa sulla privacy",
+ "sentence": "<terms>Termini di utilizzo</terms> e <privacy>Informativa sulla privacy</privacy>."
+ }
+}
diff --git a/packages/locales/src/locales/ja-JP/common.json b/packages/locales/src/locales/ja-JP/common.json
new file mode 100644
index 0000000..2c542b6
--- /dev/null
+++ b/packages/locales/src/locales/ja-JP/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "端末間の直接ファイル転送",
+ "welcome": "AlterSend へようこそ",
+ "loadingTagline": "ファイルは端末間で直接転送されます。\nサーバーもコピーも仲介もありません。"
+ },
+ "actions": {
+ "back": "戻る",
+ "continue": "続ける",
+ "getStarted": "始める",
+ "cancel": "キャンセル",
+ "clear": "クリア",
+ "close": "閉じる",
+ "copy": "コピー",
+ "copied": "コピー済み",
+ "connect": "接続",
+ "connecting": "接続中…",
+ "done": "完了",
+ "endSession": "セッション終了",
+ "restart": "再起動",
+ "tryAgain": "再試行",
+ "dismiss": "閉じる",
+ "openSettings": "設定を開く",
+ "update": "更新",
+ "downloadAll": "すべてダウンロード",
+ "skip": "スキップ"
+ },
+ "labels": {
+ "settings": "設定",
+ "language": "言語",
+ "systemDefault": "システム設定",
+ "camera": "カメラ",
+ "statusBar": "ステータスバー",
+ "transferMode": "転送モード",
+ "version": "バージョン",
+ "platform": "プラットフォーム",
+ "desktop": "デスクトップ",
+ "mobile": "モバイル端末",
+ "send": "送信",
+ "receive": "受信",
+ "connectionCode": "接続コード"
+ },
+ "files": {
+ "count_one": "{{count}} 個のファイル",
+ "count_other": "{{count}} 個のファイル",
+ "photos": "写真",
+ "files": "ファイル",
+ "downloads": "ファイル › ダウンロード",
+ "photosAndAlterSend": "写真 + AlterSend フォルダ",
+ "alterSendFolder": "AlterSend フォルダ"
+ },
+ "update": {
+ "ready": "更新の準備ができました",
+ "available": "更新があります",
+ "restart": "再起動",
+ "update": "更新",
+ "restartFailed": "再起動に失敗しました — 終了して開き直してください"
+ },
+ "status": {
+ "connected": "接続済み"
+ },
+ "confirm": {
+ "leaveShareSession": "退出すると、アクティブな共有セッションが終了します。続く?",
+ "leaveReceiveSession": "終了すると、アクティブな受信セッションが終了します。続く?"
+ }
+}
diff --git a/packages/locales/src/locales/ja-JP/errors.json b/packages/locales/src/locales/ja-JP/errors.json
new file mode 100644
index 0000000..6159c75
--- /dev/null
+++ b/packages/locales/src/locales/ja-JP/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "問題が発生しました",
+ "desktopDescription": "AlterSend で予期しないエラーが発生したため再起動が必要です。転送サービスが不安定な状態の可能性があるため、再起動が最も安全です。",
+ "mobileDescription": "AlterSend で予期しないエラーが発生しました。再試行するか、問題が続く場合はアプリを閉じて開き直してください。",
+ "restartAlterSend": "AlterSend を再起動",
+ "tryAgain": "再試行"
+ },
+ "bridgeUnavailable": {
+ "title": "デスクトップ接続を利用できません",
+ "description": "この画面はデスクトップアプリに接続されていません。デスクトップアプリから AlterSend を再起動してください。",
+ "status": "デスクトップ接続を利用できません"
+ },
+ "transfer": {
+ "invalidTopic": "接続コードが無効です。",
+ "joinFailed": "セッションに参加できませんでした。",
+ "peerUnreachable": "送信者に接続できませんでした。コードを確認してもう一度お試しください。",
+ "transferFailed": "転送に失敗しました。もう一度お試しください。",
+ "downloadFailed": "ダウンロードに失敗しました。もう一度お試しください。"
+ }
+}
diff --git a/packages/locales/src/locales/ja-JP/feedback.json b/packages/locales/src/locales/ja-JP/feedback.json
new file mode 100644
index 0000000..7f2efdc
--- /dev/null
+++ b/packages/locales/src/locales/ja-JP/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "フィードバック",
+ "types": {
+ "bug": "バグ報告",
+ "feature": "機能リクエスト",
+ "general": "一般"
+ },
+ "placeholders": {
+ "bug": "発生内容と再現手順を入力してください…",
+ "desktopBug": "問題の内容を入力してください…",
+ "feature": "AlterSend に欲しい機能は何ですか?",
+ "desktopFeature": "欲しい機能を教えてください",
+ "general": "ご意見を入力してください…"
+ },
+ "actions": {
+ "send": "フィードバックを送信",
+ "sending": "送信中…"
+ },
+ "states": {
+ "sent": "フィードバックありがとうございます!",
+ "failed": "送信に失敗しました。接続を確認してください。",
+ "received": "フィードバックを受け付けました。"
+ }
+}
diff --git a/packages/locales/src/locales/ja-JP/index.ts b/packages/locales/src/locales/ja-JP/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/ja-JP/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/ja-JP/native.json b/packages/locales/src/locales/ja-JP/native.json
new file mode 100644
index 0000000..cd7e204
--- /dev/null
+++ b/packages/locales/src/locales/ja-JP/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend は接続QRコードをスキャンするためにカメラを使用します。",
+ "localNetwork": "AlterSend は近くの端末を検出し、ファイルを直接転送するためにローカルネットワークを使用します。",
+ "photoRead": "AlterSend は別の端末へ送信する写真や動画を選ぶためフォトライブラリを読み取ります。",
+ "photoSave": "AlterSend は受信した画像や動画をフォトライブラリに保存します。"
+ }
+}
diff --git a/packages/locales/src/locales/ja-JP/onboarding.json b/packages/locales/src/locales/ja-JP/onboarding.json
new file mode 100644
index 0000000..ebde8e7
--- /dev/null
+++ b/packages/locales/src/locales/ja-JP/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "ファイルを端末間で直接転送。",
+ "description": "片方の端末が送信し、もう片方が受信します。短いコードで接続し、ファイルを直接転送します。"
+ },
+ "keepOpen": {
+ "title": "両方のアプリを開いたままに。",
+ "description": "ファイルはクラウドを使わず端末間で直接転送されます。アプリを閉じたりバックグラウンドにすると転送はキャンセルされます。"
+ },
+ "encrypted": {
+ "title": "エンドツーエンド暗号化。",
+ "description": "サーバーもコピーも仲介もありません。ファイルはあなたと受信者の間で直接転送されます。",
+ "link": "プライバシーポリシーを読む"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/ja-JP/receive.json b/packages/locales/src/locales/ja-JP/receive.json
new file mode 100644
index 0000000..75dad4a
--- /dev/null
+++ b/packages/locales/src/locales/ja-JP/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "受信",
+ "join": {
+ "title": "ファイルを受信",
+ "description": "送信側の64文字の接続コードを入力してファイルを受信します。",
+ "mobileDescription": "送信側のQRをスキャンまたは画像から読み込むか、64文字のコードを貼り付けて受信を開始します。"
+ },
+ "connecting": {
+ "title": "接続中",
+ "description": "送信側との安全なセッションを確立しています。"
+ },
+ "incomingTransfer": {
+ "title": "ファイルがあります",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} 個のファイル · {{size}}",
+ "description_other": "{{count}} 個のファイル · {{size}}"
+ },
+ "completed": {
+ "title_one": "ファイルを受信しました",
+ "title_other": "ファイルを受信しました",
+ "downloadsComplete": "ダウンロード完了"
+ },
+ "reconnecting": {
+ "title": "再接続中",
+ "description": "セッションに再接続しています。リンクが復旧するとファイルを再び利用できます。",
+ "panelDescription": "接続が切れました。セッションに再参加しています…"
+ },
+ "interrupted": {
+ "title": "転送未完了",
+ "description": "すべてのファイルが届く前に送信側が退出しました。"
+ },
+ "handshake": {
+ "title": "接続処理中",
+ "description": "送信側との安全なハンドシェイクを完了しています。"
+ },
+ "sessionEnded": {
+ "title": "セッション終了",
+ "description": "戻って新しい転送を開始してください。"
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "ファイル準備完了",
+ "filesReadyDescription": "送信側がファイルを共有しました。確認して必要なものをダウンロードしてください。",
+ "receivedFiles": "受信したファイル"
+ },
+ "form": {
+ "codeLabel": "接続コード",
+ "codePlaceholder": "64文字のコードを貼り付け…",
+ "orPasteCode": "またはコードを貼り付け"
+ },
+ "actions": {
+ "scanQr": "QRコードをスキャン",
+ "allowCamera": "カメラを許可",
+ "downloadAll": "すべてダウンロード",
+ "view": "表示",
+ "play": "再生",
+ "open": "開く",
+ "scanQrHint": "Web カメラで送信者の QR を読み取ります",
+ "downloadingPercent": "ダウンロード中 {{percent}}%",
+ "downloadAllWithSize": "すべてダウンロード({{size}})",
+ "showInFinder": "Finder で表示",
+ "backToHome": "ホームに戻る",
+ "viewPhotos": "写真を表示",
+ "scanOrImportQr": "QRをスキャンまたは読み込み",
+ "scanOrImportQrHintDesktop": "Webカメラを使うか、保存済みのQR画像を読み込みます",
+ "scanOrImportQrHintMobile": "カメラを使うか、保存済み画像を読み込みます",
+ "importImage": "画像を読み込む",
+ "importFromImage": "画像から読み込む"
+ },
+ "errors": {
+ "invalidCode": "有効な64文字の16進コードを入力してください。",
+ "invalidKey": "有効な64文字の16進キーを入力してください。",
+ "joinFailed": "セッションに参加できませんでした。",
+ "unreachable": "送信側に接続できませんでした。コードを確認して再試行してください。",
+ "unsupportedQrTitle": "対応していないQRコード",
+ "unsupportedQrHint": "AlterSend の接続コードをスキャンしてください。",
+ "mobileJoinFailedTitle": "セッションに参加できませんでした",
+ "mobileJoinFailedHint": "もう一度スキャンするかコードを貼り付けてください。",
+ "cameraUnavailable": "カメラを利用できません。",
+ "cameraCouldNotStart": "カメラを開始できませんでした。コードを貼り付けてください。",
+ "downloadFailed": "失敗",
+ "didntArrive": "未着",
+ "transferIssue": "転送の問題",
+ "imageNoQrTitle": "QRコードが見つかりません",
+ "imageNoQrHint": "AlterSend のQRコードが写っている画像を選択してください。",
+ "imageUnsupportedQrHint": "この画像は AlterSend の接続コードではありません。",
+ "imageReadFailedTitle": "画像を読み取れませんでした"
+ },
+ "camera": {
+ "preparingTitle": "カメラを準備中",
+ "preparingDescription": "送信側のQRコードをスキャンできるようカメラ権限を確認しています。",
+ "accessNeededTitle": "カメラアクセスが必要です",
+ "accessNeededDescription": "送信側の接続QRコードをスキャンするにはカメラを許可してください。",
+ "scanTitle": "QRコードをスキャン",
+ "scanDescription": "送信側のQRコードを枠内に合わせてください。AlterSend が自動で接続します。",
+ "desktopHint": "送信側のQRコードをWebカメラに向けてください — AlterSend が自動で接続します。",
+ "blockedTitle": "カメラアクセスがブロックされています",
+ "blockedHint": "システム設定で AlterSend のカメラアクセスを許可してから再試行してください。コード貼り付けも使えます。",
+ "noneTitle": "カメラが見つかりません",
+ "noneHint": "Webカメラを接続するか、接続コードを貼り付けてください。",
+ "unavailableTitle": "カメラを利用できません",
+ "starting": "カメラを起動中…",
+ "enableTitle": "カメラアクセスを有効にする",
+ "enableDescription": "送信者の QR コードを読み取るためだけに使用します。戻ってコードを手動で貼り付けることもできます。",
+ "usePastedCode": "代わりに貼り付けたコードを使う",
+ "joiningDescription": "送信者のセッションに参加しています。",
+ "scanImportTitle": "QRをスキャンまたは読み込み",
+ "scanImportDescription": "送信側のQRを枠内に合わせるか、保存済み画像を読み込んでください。AlterSend が自動で接続します。",
+ "desktopImportHint": "送信側のQRを枠内に合わせるか、保存済み画像を読み込んでください。AlterSend が自動で接続します。",
+ "enableImportDescription": "カメラはQRをスキャンするためだけに使用します。保存済み画像の読み込みやコードの貼り付けもできます。"
+ },
+ "status": {
+ "ready": "準備完了",
+ "saved": "保存済み",
+ "failed": "失敗",
+ "downloadingPercent": "{{percent}}% ダウンロード中",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "送信者からのファイルを待機中…"
+ },
+ "summary": {
+ "receivedCount_one": "{{count}} 個中 {{completed}} 個を受信",
+ "receivedCount_other": "{{count}} 個中 {{completed}} 個を受信",
+ "savedToPhotos_one": "写真に保存しました",
+ "savedToPhotos_other": "{{count}} 個を写真に保存しました",
+ "savedInFiles_one": "ファイルに保存しました",
+ "savedInFiles_other": "{{count}} 個をファイルに保存しました",
+ "tapToView": "タップして表示",
+ "saved": "保存済み",
+ "savedToLocation": "{{location}} に保存済み",
+ "receivedProgress": "{{count}} 個中 {{completed}} 個受信済み",
+ "senderLeftBeforeFinishing": "完了前に送信者が退出しました。",
+ "filesSaved_one": "{{count}} 個のファイルを保存済み",
+ "filesSaved_other": "{{count}} 個のファイルを保存済み"
+ }
+}
diff --git a/packages/locales/src/locales/ja-JP/send.json b/packages/locales/src/locales/ja-JP/send.json
new file mode 100644
index 0000000..a6555f7
--- /dev/null
+++ b/packages/locales/src/locales/ja-JP/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "ファイルを送信",
+ "description": "1つ以上のファイルを選び、直接暗号化転送用のワンタイムコードを生成します。"
+ },
+ "preparing": {
+ "title": "転送を準備中",
+ "description": "共有コードを表示する前に、選択したファイルを準備しています。"
+ },
+ "waitingForReceiver": {
+ "title": "コードを共有",
+ "description": "コードまたはQRを相手に送ると転送を開始できます。"
+ },
+ "receiverConnected": {
+ "title": "コードを共有",
+ "description": "コードまたはQRを相手に送ると転送を開始できます。"
+ }
+ },
+ "actions": {
+ "sendFiles_one": "{{count}} 個のファイルを送信",
+ "sendFiles_other": "{{count}} 個のファイルを送信",
+ "addFiles": "ファイルを追加",
+ "addMoreFiles": "さらに追加",
+ "dragAndDrop": "ドラッグ&ドロップ",
+ "clear": "クリア",
+ "endSession": "セッション終了",
+ "pickFilesTitle": "ファイルを追加",
+ "pickPhotos": "写真",
+ "pickFiles": "ファイル"
+ },
+ "status": {
+ "waitingForPeer": "受信者を待機中",
+ "peerConnected": "受信者が接続済み",
+ "uploadComplete": "アップロード完了",
+ "uploadingFiles": "ファイルをアップロード中",
+ "uploaded": "アップロード済み",
+ "uploading": "アップロード中…",
+ "waiting": "待機中",
+ "failed": "失敗",
+ "downloaded": "ダウンロード済み",
+ "disconnected": "切断",
+ "online": "オンライン",
+ "downloading": "ダウンロード中",
+ "downloadingPercent": "{{percent}}% ダウンロード中"
+ },
+ "connection": {
+ "placeholder": "安全なキーを生成中…",
+ "copyLabel": "接続コードをコピー",
+ "showQrLabel": "QRコードを表示",
+ "qrCodeLabel": "接続キーのQRコード",
+ "qrModalDescription": "別の端末で AlterSend を開き、このコードをスキャンしてください",
+ "copiedToast": "クリップボードにコピーしました",
+ "scanToConnect": "スキャンして接続",
+ "orScan": "またはスキャン",
+ "generating": "生成中…",
+ "waitingForConnection": "接続を待機中…"
+ },
+ "errors": {
+ "folderUnsupported": "フォルダはまだ対応していません。ファイルのみ選択してください。",
+ "failedPickFiles": "ファイルの選択に失敗しました",
+ "failedPickPhotos": "写真の選択に失敗しました"
+ },
+ "hints": {
+ "keepOpen": "アプリを閉じると転送はキャンセルされます。"
+ },
+ "preparing": {
+ "uploadedCount_one": "{{count}} 個中 {{completed}} 個のファイルをアップロード済み",
+ "uploadedCount_other": "{{count}} 個中 {{completed}} 個のファイルをアップロード済み"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} 個完了",
+ "completedDone_other": "{{count}} 個完了",
+ "devices": "デバイス",
+ "connectedCount_one": "{{count}} 台接続済み",
+ "connectedCount_other": "{{count}} 台接続済み"
+ },
+ "dropzone": {
+ "addMoreDescription": "またはクリックして<link>さらに追加</link>",
+ "browseDescription": "またはクリックして<link>参照</link>",
+ "tapAddMoreDescription": "タップして<link>さらに追加</link>",
+ "tapBrowseDescription": "タップして<link>参照</link>",
+ "orClickTo": "またはクリックして",
+ "tapTo": "タップして",
+ "addMoreLink": "さらに追加",
+ "browseLink": "参照"
+ },
+ "files": {
+ "removeLabel": "{{name}} を削除"
+ }
+}
diff --git a/packages/locales/src/locales/ja-JP/settings.json b/packages/locales/src/locales/ja-JP/settings.json
new file mode 100644
index 0000000..3bf843c
--- /dev/null
+++ b/packages/locales/src/locales/ja-JP/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "設定",
+ "languageTitle": "言語",
+ "languageHint": "AlterSend で使用する言語を選択します。",
+ "sections": {
+ "privacy": "プライバシー",
+ "support": "サポート",
+ "about": "情報"
+ },
+ "crashReports": {
+ "label": "クラッシュレポート",
+ "description": "AlterSend 改善のため匿名のクラッシュデータを共有する"
+ },
+ "rows": {
+ "feedback": "フィードバック",
+ "feedbackHint": "問題を報告または機能を提案",
+ "discord": "Discord",
+ "discordHint": "コミュニティに参加",
+ "contact": "お問い合わせ",
+ "privacyPolicy": "プライバシーポリシー",
+ "privacyPolicyHint": "AlterSend のデータの扱い",
+ "terms": "利用規約",
+ "termsHint": "AlterSend の利用ルール",
+ "website": "Webサイト"
+ },
+ "legal": {
+ "terms": "利用規約",
+ "privacy": "プライバシー声明",
+ "sentence": "<terms>利用規約</terms> と <privacy>プライバシーステートメント</privacy>。"
+ }
+}
diff --git a/packages/locales/src/locales/ko-KR/common.json b/packages/locales/src/locales/ko-KR/common.json
new file mode 100644
index 0000000..2b5fc3b
--- /dev/null
+++ b/packages/locales/src/locales/ko-KR/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "기기 간 직접 파일 전송",
+ "welcome": "AlterSend에 오신 것을 환영합니다",
+ "loadingTagline": "파일은 기기 간에 직접 이동합니다.\n서버도 복사본도 중간자도 없습니다."
+ },
+ "actions": {
+ "back": "뒤로",
+ "continue": "계속",
+ "getStarted": "시작하기",
+ "cancel": "취소",
+ "clear": "지우기",
+ "close": "닫기",
+ "copy": "복사",
+ "copied": "복사됨",
+ "connect": "연결",
+ "connecting": "연결 중…",
+ "done": "완료",
+ "endSession": "세션 종료",
+ "restart": "다시 시작",
+ "tryAgain": "다시 시도",
+ "dismiss": "닫기",
+ "openSettings": "설정 열기",
+ "update": "업데이트",
+ "downloadAll": "모두 다운로드",
+ "skip": "건너뛰기"
+ },
+ "labels": {
+ "settings": "설정",
+ "language": "언어",
+ "systemDefault": "시스템 기본값",
+ "camera": "카메라",
+ "statusBar": "상태 표시줄",
+ "transferMode": "전송 모드",
+ "version": "버전",
+ "platform": "플랫폼",
+ "desktop": "데스크톱",
+ "mobile": "모바일",
+ "send": "보내기",
+ "receive": "받기",
+ "connectionCode": "연결 코드"
+ },
+ "files": {
+ "count_one": "{{count}}개 파일",
+ "count_other": "{{count}}개 파일",
+ "photos": "사진",
+ "files": "파일",
+ "downloads": "파일 › 다운로드",
+ "photosAndAlterSend": "사진 + AlterSend 폴더",
+ "alterSendFolder": "AlterSend 폴더"
+ },
+ "update": {
+ "ready": "업데이트 준비됨",
+ "available": "업데이트 가능",
+ "restart": "다시 시작",
+ "update": "업데이트",
+ "restartFailed": "다시 시작하지 못했습니다. 종료하고 다시 시작해 주세요."
+ },
+ "status": {
+ "connected": "연결됨"
+ },
+ "confirm": {
+ "leaveShareSession": "나가면 활성 공유 세션이 종료됩니다. 계속하다?",
+ "leaveReceiveSession": "나가면 활성 수신 세션이 종료됩니다. 계속하다?"
+ }
+}
diff --git a/packages/locales/src/locales/ko-KR/errors.json b/packages/locales/src/locales/ko-KR/errors.json
new file mode 100644
index 0000000..dee7427
--- /dev/null
+++ b/packages/locales/src/locales/ko-KR/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "문제가 발생했습니다.",
+ "desktopDescription": "AlterSend에 예상치 못한 오류가 발생하여 다시 시작해야 합니다. 전송 서비스가 불안정할 수 있으므로 다시 시작하는 것이 가장 안전합니다.",
+ "mobileDescription": "AlterSend에 예상치 못한 오류가 발생했습니다. 다시 시도하거나 문제가 지속되면 앱을 닫았다가 다시 열어보세요.",
+ "restartAlterSend": "AlterSend 다시 시작",
+ "tryAgain": "다시 시도하세요"
+ },
+ "bridgeUnavailable": {
+ "title": "데스크톱 연결을 사용할 수 없음",
+ "description": "이 화면이 데스크톱 앱에 연결되어 있지 않습니다. 데스크톱 앱에서 AlterSend를 다시 시작하세요.",
+ "status": "데스크톱 연결을 사용할 수 없음"
+ },
+ "transfer": {
+ "invalidTopic": "연결 코드가 올바르지 않습니다.",
+ "joinFailed": "세션에 참가할 수 없습니다.",
+ "peerUnreachable": "보낸 사람에게 연결할 수 없습니다. 코드를 확인한 뒤 다시 시도하세요.",
+ "transferFailed": "전송에 실패했습니다. 다시 시도하세요.",
+ "downloadFailed": "다운로드에 실패했습니다. 다시 시도하세요."
+ }
+}
diff --git a/packages/locales/src/locales/ko-KR/feedback.json b/packages/locales/src/locales/ko-KR/feedback.json
new file mode 100644
index 0000000..2b87202
--- /dev/null
+++ b/packages/locales/src/locales/ko-KR/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "피드백",
+ "types": {
+ "bug": "버그 신고",
+ "feature": "기능 요청",
+ "general": "일반"
+ },
+ "placeholders": {
+ "bug": "무슨 일이 일어났는지, 그리고 그것을 재현하는 방법을 설명하세요…",
+ "desktopBug": "무엇이 잘못되었는지 설명하세요…",
+ "feature": "AlterSend에서 무엇을 보고 싶나요?",
+ "desktopFeature": "무엇을 보고 싶나요?",
+ "general": "당신의 생각을 공유하세요…"
+ },
+ "actions": {
+ "send": "피드백 보내기",
+ "sending": "보내는 중…"
+ },
+ "states": {
+ "sent": "피드백을 보내주셔서 감사합니다!",
+ "failed": "전송하지 못했습니다. 연결을 확인하세요.",
+ "received": "피드백을 받았습니다."
+ }
+}
diff --git a/packages/locales/src/locales/ko-KR/index.ts b/packages/locales/src/locales/ko-KR/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/ko-KR/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/ko-KR/native.json b/packages/locales/src/locales/ko-KR/native.json
new file mode 100644
index 0000000..d5aa4c6
--- /dev/null
+++ b/packages/locales/src/locales/ko-KR/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend가 카메라를 사용하여 연결 QR 코드를 스캔합니다.",
+ "localNetwork": "AlterSend가 로컬 네트워크를 사용하여 주변 기기를 찾고 파일을 직접 전송합니다.",
+ "photoRead": "AlterSend가 사진 보관함에 접근하여 다른 기기로 보낼 사진과 동영상을 선택할 수 있습니다.",
+ "photoSave": "AlterSend가 받은 이미지와 동영상을 사진 보관함에 저장합니다."
+ }
+}
diff --git a/packages/locales/src/locales/ko-KR/onboarding.json b/packages/locales/src/locales/ko-KR/onboarding.json
new file mode 100644
index 0000000..19a0e3b
--- /dev/null
+++ b/packages/locales/src/locales/ko-KR/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "장치 간에 직접 파일을 전송합니다.",
+ "description": "한 장치는 전송하고 다른 장치는 수신합니다. 짧은 코드로 연결하여 파일을 직접 스트리밍할 수 있습니다."
+ },
+ "keepOpen": {
+ "title": "두 앱을 모두 열어두세요.",
+ "description": "파일은 장치 간에 직접 스트리밍되므로 클라우드가 없습니다. 앱을 닫거나 백그라운드에서 실행하면 전송이 취소됩니다."
+ },
+ "encrypted": {
+ "title": "엔드투엔드 암호화.",
+ "description": "서버도, 복사본도, 중개자도 없습니다. 파일은 사용자와 수신자 사이에서 직접 전송됩니다.",
+ "link": "개인 정보 보호 정책을 읽어보세요"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/ko-KR/receive.json b/packages/locales/src/locales/ko-KR/receive.json
new file mode 100644
index 0000000..5085aa5
--- /dev/null
+++ b/packages/locales/src/locales/ko-KR/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "받기",
+ "join": {
+ "title": "파일 받기",
+ "description": "파일을 스트리밍하려면 보낸 사람으로부터 64자 연결 코드를 입력하세요.",
+ "mobileDescription": "발신자의 QR을 스캔하거나 가져오거나 64자 코드를 붙여넣어 전송을 시작하세요."
+ },
+ "connecting": {
+ "title": "연결 중",
+ "description": "발신자와 보안 세션을 설정합니다."
+ },
+ "incomingTransfer": {
+ "title": "사용 가능한 파일",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "파일 {{count}}개 · {{size}}",
+ "description_other": "파일 {{count}}개 · {{size}}"
+ },
+ "completed": {
+ "title_one": "파일 수신됨",
+ "title_other": "받은 파일",
+ "downloadsComplete": "다운로드 완료"
+ },
+ "reconnecting": {
+ "title": "다시 연결하는 중",
+ "description": "세션에 다시 연결하는 중입니다. 링크가 복원되는 즉시 파일을 다시 사용할 수 있습니다.",
+ "panelDescription": "연결이 끊겼습니다. 세션에 다시 참여하는 중…"
+ },
+ "interrupted": {
+ "title": "전송이 완료되지 않았습니다.",
+ "description": "모든 파일이 도착하기 전에 보낸 사람이 떠났습니다."
+ },
+ "handshake": {
+ "title": "연결 진행 중",
+ "description": "발신자와 보안 핸드셰이크를 완료합니다."
+ },
+ "sessionEnded": {
+ "title": "세션이 종료되었습니다.",
+ "description": "새로운 전송을 시작하려면 돌아오세요."
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "파일 준비됨",
+ "filesReadyDescription": "보낸 사람이 파일을 공유했습니다. 검토하고 준비가 되면 각 다운로드를 시작하세요.",
+ "receivedFiles": "받은 파일"
+ },
+ "form": {
+ "codeLabel": "연결 코드",
+ "codePlaceholder": "64자 코드 붙여넣기…",
+ "orPasteCode": "또는 코드 붙여넣기"
+ },
+ "actions": {
+ "scanQr": "QR 코드 스캔",
+ "allowCamera": "카메라 허용",
+ "downloadAll": "모두 다운로드",
+ "view": "보기",
+ "play": "재생",
+ "open": "열기",
+ "scanQrHint": "웹캠으로 보내는 사람의 QR을 읽습니다",
+ "downloadingPercent": "다운로드 중 {{percent}}%",
+ "downloadAllWithSize": "모두 다운로드({{size}})",
+ "showInFinder": "Finder에서 보기",
+ "backToHome": "홈으로 돌아가기",
+ "viewPhotos": "사진 보기",
+ "scanOrImportQr": "QR 스캔 또는 가져오기",
+ "scanOrImportQrHintDesktop": "웹캠을 사용하거나 저장된 QR 이미지를 가져옵니다",
+ "scanOrImportQrHintMobile": "카메라를 사용하거나 저장된 이미지를 가져옵니다",
+ "importImage": "이미지 가져오기",
+ "importFromImage": "이미지에서 가져오기"
+ },
+ "errors": {
+ "invalidCode": "유효한 64자의 16진수 코드를 입력하세요.",
+ "invalidKey": "유효한 64자의 16진수 키를 입력하세요.",
+ "joinFailed": "세션에 참여할 수 없습니다.",
+ "unreachable": "발신자에게 연락할 수 없습니다. 코드를 확인하고 다시 시도하세요.",
+ "unsupportedQrTitle": "지원되지 않는 QR 코드",
+ "unsupportedQrHint": "AlterSend 연결 코드를 스캔하세요.",
+ "mobileJoinFailedTitle": "세션에 참여할 수 없습니다.",
+ "mobileJoinFailedHint": "다시 스캔해 보거나 코드를 수동으로 붙여넣으세요.",
+ "cameraUnavailable": "카메라를 사용할 수 없습니다.",
+ "cameraCouldNotStart": "카메라를 시작할 수 없습니다. 대신 연결 코드를 붙여넣으세요.",
+ "downloadFailed": "실패",
+ "didntArrive": "도착하지 않았습니다",
+ "transferIssue": "전송 문제",
+ "imageNoQrTitle": "QR 코드를 찾을 수 없습니다",
+ "imageNoQrHint": "AlterSend QR 코드가 보이는 이미지를 선택하세요.",
+ "imageUnsupportedQrHint": "이 이미지는 AlterSend 연결 코드가 아닙니다.",
+ "imageReadFailedTitle": "이미지를 읽을 수 없습니다"
+ },
+ "camera": {
+ "preparingTitle": "카메라 준비 중",
+ "preparingDescription": "발신자의 QR 코드를 스캔할 수 있도록 카메라 액세스를 확인하는 중입니다.",
+ "accessNeededTitle": "카메라 액세스가 필요합니다",
+ "accessNeededDescription": "발신자의 연결 QR 코드를 스캔하려면 카메라 액세스를 허용하세요.",
+ "scanTitle": "QR 코드 스캔",
+ "scanDescription": "보낸 사람의 QR 코드를 프레임 중앙에 맞추세요. AlterSend가 자동으로 연결됩니다.",
+ "desktopHint": "보낸 사람의 QR 코드를 웹캠에 비추면 AlterSend가 자동으로 연결됩니다.",
+ "blockedTitle": "카메라 액세스가 차단되었습니다.",
+ "blockedHint": "시스템 설정에서 AlterSend에 대한 카메라 액세스를 허용한 후 다시 시도하세요. 대신 코드를 붙여넣을 수도 있습니다.",
+ "noneTitle": "카메라를 찾을 수 없습니다.",
+ "noneHint": "웹캠을 연결하여 스캔하거나 대신 연결 코드를 붙여넣으세요.",
+ "unavailableTitle": "카메라를 사용할 수 없음",
+ "starting": "카메라 시작 중…",
+ "enableTitle": "카메라 접근 허용",
+ "enableDescription": "보내는 사람의 QR 코드를 스캔할 때만 필요합니다. 돌아가서 코드를 직접 붙여넣을 수도 있습니다.",
+ "usePastedCode": "대신 붙여넣은 코드 사용",
+ "joiningDescription": "보내는 사람의 세션에 참여하는 중입니다.",
+ "scanImportTitle": "QR 스캔 또는 가져오기",
+ "scanImportDescription": "발신자의 QR을 프레임 안에 맞추거나 저장된 이미지를 가져오세요. AlterSend가 자동으로 연결합니다.",
+ "desktopImportHint": "발신자의 QR을 프레임 안에 맞추거나 저장된 이미지를 가져오세요. AlterSend가 자동으로 연결합니다.",
+ "enableImportDescription": "카메라는 QR을 스캔할 때만 필요합니다. 저장된 이미지를 가져오거나 코드를 직접 붙여넣을 수도 있습니다."
+ },
+ "status": {
+ "ready": "준비",
+ "saved": "저장됨",
+ "failed": "실패",
+ "downloadingPercent": "{{percent}}% 다운로드 중",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "보내는 사람의 파일을 기다리는 중…"
+ },
+ "summary": {
+ "receivedCount_one": "{{count}}개 파일 중 {{completed}}개를 받았습니다.",
+ "receivedCount_other": "{{count}}개 파일 중 {{completed}}개를 받았습니다.",
+ "savedToPhotos_one": "사진 앱에 저장됨",
+ "savedToPhotos_other": "{{count}}개를 사진 앱에 저장했습니다.",
+ "savedInFiles_one": "파일에 저장됨",
+ "savedInFiles_other": "{{count}}개를 파일에 저장했습니다.",
+ "tapToView": "보려면 탭하세요.",
+ "saved": "저장됨",
+ "savedToLocation": "{{location}}에 저장됨",
+ "receivedProgress": "{{count}}개 중 {{completed}}개 수신됨",
+ "senderLeftBeforeFinishing": "완료되기 전에 보내는 사람이 나갔습니다.",
+ "filesSaved_one": "{{count}}개 파일 저장됨",
+ "filesSaved_other": "{{count}}개 파일 저장됨"
+ }
+}
diff --git a/packages/locales/src/locales/ko-KR/send.json b/packages/locales/src/locales/ko-KR/send.json
new file mode 100644
index 0000000..04f2b43
--- /dev/null
+++ b/packages/locales/src/locales/ko-KR/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "파일 보내기",
+ "description": "하나 이상의 파일을 선택하고 직접 암호화된 전송을 위한 일회성 코드를 생성하세요."
+ },
+ "preparing": {
+ "title": "전송 준비 중",
+ "description": "공유 코드가 공개되기 전에 선택한 파일을 준비 중입니다."
+ },
+ "waitingForReceiver": {
+ "title": "코드 공유",
+ "description": "전송을 시작하려면 수신자에게 코드 또는 QR을 보내세요."
+ },
+ "receiverConnected": {
+ "title": "코드 공유",
+ "description": "전송을 시작하려면 수신자에게 코드 또는 QR을 보내세요."
+ }
+ },
+ "actions": {
+ "sendFiles_one": "{{count}}개 파일 보내기",
+ "sendFiles_other": "{{count}}개 파일 보내기",
+ "addFiles": "파일 추가",
+ "addMoreFiles": "더 많은 파일 추가",
+ "dragAndDrop": "드래그 앤 드롭",
+ "clear": "지우기",
+ "endSession": "세션 종료",
+ "pickFilesTitle": "파일 추가",
+ "pickPhotos": "사진",
+ "pickFiles": "파일"
+ },
+ "status": {
+ "waitingForPeer": "수신자를 기다리는 중",
+ "peerConnected": "수신자 연결됨",
+ "uploadComplete": "업로드 완료",
+ "uploadingFiles": "파일 업로드",
+ "uploaded": "업로드됨",
+ "uploading": "업로드 중…",
+ "waiting": "대기 중",
+ "failed": "실패",
+ "downloaded": "다운로드됨",
+ "disconnected": "연결이 끊김",
+ "online": "온라인",
+ "downloading": "다운로드 중",
+ "downloadingPercent": "{{percent}}% 다운로드 중"
+ },
+ "connection": {
+ "placeholder": "보안 키 생성 중…",
+ "copyLabel": "연결 코드 복사",
+ "showQrLabel": "QR 코드 표시",
+ "qrCodeLabel": "연결 키에 대한 QR 코드",
+ "qrModalDescription": "다른 기기에서 AlterSend를 열고 이 코드를 스캔하세요.",
+ "copiedToast": "클립보드에 복사됨",
+ "scanToConnect": "스캔하여 연결",
+ "orScan": "또는 스캔",
+ "generating": "생성 중…",
+ "waitingForConnection": "연결을 기다리는 중…"
+ },
+ "errors": {
+ "folderUnsupported": "폴더는 아직 지원되지 않습니다. 파일만 선택하세요.",
+ "failedPickFiles": "파일을 선택하지 못했습니다.",
+ "failedPickPhotos": "사진을 선택하지 못했습니다."
+ },
+ "hints": {
+ "keepOpen": "앱을 닫으면 전송이 취소됩니다."
+ },
+ "preparing": {
+ "uploadedCount_one": "{{count}}개 중 {{completed}}개 파일 업로드됨",
+ "uploadedCount_other": "{{count}}개 중 {{completed}}개 파일 업로드됨"
+ },
+ "peer": {
+ "completedDone_one": "{{count}}개 완료",
+ "completedDone_other": "{{count}}개 완료",
+ "devices": "장치",
+ "connectedCount_one": "{{count}}대 연결됨",
+ "connectedCount_other": "{{count}}대 연결됨"
+ },
+ "dropzone": {
+ "addMoreDescription": "또는 클릭하여 <link>더 추가</link>",
+ "browseDescription": "또는 클릭하여 <link>찾아보기</link>",
+ "tapAddMoreDescription": "탭하여 <link>더 추가</link>",
+ "tapBrowseDescription": "탭하여 <link>찾아보기</link>",
+ "orClickTo": "또는 클릭하여",
+ "tapTo": "탭하여",
+ "addMoreLink": "더 추가",
+ "browseLink": "찾아보기"
+ },
+ "files": {
+ "removeLabel": "{{name}} 삭제"
+ }
+}
diff --git a/packages/locales/src/locales/ko-KR/settings.json b/packages/locales/src/locales/ko-KR/settings.json
new file mode 100644
index 0000000..1358b9e
--- /dev/null
+++ b/packages/locales/src/locales/ko-KR/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "설정",
+ "languageTitle": "언어",
+ "languageHint": "AlterSend에서 사용하는 언어를 선택하세요.",
+ "sections": {
+ "privacy": "개인정보",
+ "support": "지원",
+ "about": "정보"
+ },
+ "crashReports": {
+ "label": "충돌 보고서",
+ "description": "AlterSend 개선을 위해 익명 충돌 데이터 공유"
+ },
+ "rows": {
+ "feedback": "피드백",
+ "feedbackHint": "문제 신고 또는 기능 제안",
+ "discord": "Discord",
+ "discordHint": "커뮤니티에 가입하세요",
+ "contact": "문의하기",
+ "privacyPolicy": "개인 정보 보호 정책",
+ "privacyPolicyHint": "AlterSend가 데이터를 처리하는 방법",
+ "terms": "서비스 약관",
+ "termsHint": "AlterSend 사용 규칙",
+ "website": "웹사이트"
+ },
+ "legal": {
+ "terms": "이용약관",
+ "privacy": "개인 정보 보호 정책",
+ "sentence": "<terms>이용 약관</terms> 및 <privacy>개인정보 처리방침</privacy>."
+ }
+}
diff --git a/packages/locales/src/locales/pt-BR/common.json b/packages/locales/src/locales/pt-BR/common.json
new file mode 100644
index 0000000..69ff95a
--- /dev/null
+++ b/packages/locales/src/locales/pt-BR/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "Transferência de arquivos ponto a ponto",
+ "welcome": "Bem-vindo ao AlterSend",
+ "loadingTagline": "Seus arquivos vão direto de um dispositivo para o outro.\nSem servidores. Sem cópias. Sem intermediários."
+ },
+ "actions": {
+ "back": "Voltar",
+ "continue": "Continuar",
+ "getStarted": "Começar",
+ "cancel": "Cancelar",
+ "clear": "Limpar",
+ "close": "Fechar",
+ "copy": "Copiar",
+ "copied": "Copiado",
+ "connect": "Conectar",
+ "connecting": "Conectando…",
+ "done": "Concluído",
+ "endSession": "Encerrar sessão",
+ "restart": "Reiniciar",
+ "tryAgain": "Tentar novamente",
+ "dismiss": "Descartar",
+ "openSettings": "Abrir configurações",
+ "update": "Atualizar",
+ "downloadAll": "Baixar tudo",
+ "skip": "Pular"
+ },
+ "labels": {
+ "settings": "Configurações",
+ "language": "Idioma",
+ "systemDefault": "Padrão do sistema",
+ "camera": "Câmera",
+ "statusBar": "Barra de status",
+ "transferMode": "Modo de transferência",
+ "version": "Versão",
+ "platform": "Plataforma",
+ "desktop": "Desktop",
+ "mobile": "Celular",
+ "send": "Enviar",
+ "receive": "Receber",
+ "connectionCode": "Código de conexão"
+ },
+ "files": {
+ "count_one": "{{count}} arquivo",
+ "count_other": "{{count}} arquivos",
+ "photos": "Fotos",
+ "files": "Arquivos",
+ "downloads": "Arquivos › Downloads",
+ "photosAndAlterSend": "Fotos + pasta AlterSend",
+ "alterSendFolder": "Pasta AlterSend"
+ },
+ "update": {
+ "ready": "Atualização pronta",
+ "available": "Atualização disponível",
+ "restart": "Reiniciar",
+ "update": "Atualizar",
+ "restartFailed": "Falha na reinicialização – saia e reabra"
+ },
+ "status": {
+ "connected": "Conectado"
+ },
+ "confirm": {
+ "leaveShareSession": "Sair encerrará sua sessão de compartilhamento ativa. Continuar?",
+ "leaveReceiveSession": "Sair encerrará sua sessão de recebimento ativa. Continuar?"
+ }
+}
diff --git a/packages/locales/src/locales/pt-BR/errors.json b/packages/locales/src/locales/pt-BR/errors.json
new file mode 100644
index 0000000..47790ad
--- /dev/null
+++ b/packages/locales/src/locales/pt-BR/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "Algo deu errado",
+ "desktopDescription": "O AlterSend encontrou um erro inesperado e precisa ser reiniciado. O serviço de transferência pode estar instável — reiniciar é a opção mais segura.",
+ "mobileDescription": "O AlterSend encontrou um erro inesperado. Tente novamente ou feche e reabra o aplicativo se o problema persistir.",
+ "restartAlterSend": "Reiniciar o AlterSend",
+ "tryAgain": "Tente novamente"
+ },
+ "bridgeUnavailable": {
+ "title": "Conexão com o desktop indisponível",
+ "description": "Esta janela não está conectada ao aplicativo desktop. Reinicie o AlterSend pelo aplicativo desktop.",
+ "status": "Conexão com o desktop indisponível"
+ },
+ "transfer": {
+ "invalidTopic": "O código de conexão é inválido.",
+ "joinFailed": "Não foi possível entrar na sessão.",
+ "peerUnreachable": "Não foi possível alcançar o remetente. Verifique o código e tente novamente.",
+ "transferFailed": "A transferência falhou. Tente novamente.",
+ "downloadFailed": "O download falhou. Tente novamente."
+ }
+}
diff --git a/packages/locales/src/locales/pt-BR/feedback.json b/packages/locales/src/locales/pt-BR/feedback.json
new file mode 100644
index 0000000..ae54aaa
--- /dev/null
+++ b/packages/locales/src/locales/pt-BR/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "Feedback",
+ "types": {
+ "bug": "Relatório de bug",
+ "feature": "Sugestão de funcionalidade",
+ "general": "Geral"
+ },
+ "placeholders": {
+ "bug": "Descreva o que aconteceu e como reproduzi-lo…",
+ "desktopBug": "Descreva o que deu errado…",
+ "feature": "O que você gostaria de ver no AlterSend?",
+ "desktopFeature": "O que você gostaria de ver?",
+ "general": "Conte o que você acha…"
+ },
+ "actions": {
+ "send": "Enviar feedback",
+ "sending": "Enviando…"
+ },
+ "states": {
+ "sent": "Obrigado pelo seu feedback!",
+ "failed": "Falha ao enviar. Verifique sua conexão.",
+ "received": "Seu feedback foi recebido."
+ }
+}
diff --git a/packages/locales/src/locales/pt-BR/index.ts b/packages/locales/src/locales/pt-BR/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/pt-BR/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/pt-BR/meta.json b/packages/locales/src/locales/pt-BR/meta.json
deleted file mode 100644
index 6261019..0000000
--- a/packages/locales/src/locales/pt-BR/meta.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "label": "Português (BR)",
- "productionReady": false,
- "dir": "ltr"
-}
diff --git a/packages/locales/src/locales/pt-BR/native.json b/packages/locales/src/locales/pt-BR/native.json
new file mode 100644
index 0000000..fc985bb
--- /dev/null
+++ b/packages/locales/src/locales/pt-BR/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "O AlterSend usa sua câmera para escanear códigos QR de conexão.",
+ "localNetwork": "O AlterSend usa a rede local para encontrar dispositivos próximos e transferir arquivos diretamente.",
+ "photoRead": "O AlterSend acessa sua biblioteca de fotos para que você possa escolher fotos e vídeos para enviar para outro dispositivo.",
+ "photoSave": "O AlterSend salva as imagens e vídeos recebidos na sua biblioteca de fotos."
+ }
+}
diff --git a/packages/locales/src/locales/pt-BR/onboarding.json b/packages/locales/src/locales/pt-BR/onboarding.json
new file mode 100644
index 0000000..c98d9c0
--- /dev/null
+++ b/packages/locales/src/locales/pt-BR/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "Arquivos, diretamente entre dispositivos.",
+ "description": "Um dispositivo envia, o outro recebe. Um código simples os conecta para que os arquivos possam ser transferidos diretamente."
+ },
+ "keepOpen": {
+ "title": "Mantenha os dois aplicativos abertos.",
+ "description": "Os arquivos são transferidos diretamente entre os dispositivos — sem uso de nuvem. Fechar ou colocar o aplicativo em segundo plano cancelará a transferência."
+ },
+ "encrypted": {
+ "title": "Criptografado de ponta a ponta.",
+ "description": "Sem servidores, sem cópias, sem intermediários. Seus arquivos vão diretamente de você para o destinatário.",
+ "link": "Leia nossa política de privacidade"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/pt-BR/receive.json b/packages/locales/src/locales/pt-BR/receive.json
new file mode 100644
index 0000000..1599ff6
--- /dev/null
+++ b/packages/locales/src/locales/pt-BR/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "Receber",
+ "join": {
+ "title": "Receber arquivos",
+ "description": "Insira um código de conexão de 64 caracteres do remetente para receber seus arquivos.",
+ "mobileDescription": "Escaneie ou importe o QR do remetente, ou cole o código de 64 caracteres para iniciar a transferência."
+ },
+ "connecting": {
+ "title": "Conectando",
+ "description": "Estabelecendo uma sessão segura com o remetente."
+ },
+ "incomingTransfer": {
+ "title": "Arquivos disponíveis",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} arquivo · {{size}}",
+ "description_other": "{{count}} arquivos · {{size}}"
+ },
+ "completed": {
+ "title_one": "Arquivo recebido",
+ "title_other": "Arquivos recebidos",
+ "downloadsComplete": "Downloads concluídos"
+ },
+ "reconnecting": {
+ "title": "Reconectando",
+ "description": "Reconectando-se à sessão. Os arquivos estarão disponíveis novamente assim que o link for restaurado.",
+ "panelDescription": "Conexão interrompida. Reentrando na sessão…"
+ },
+ "interrupted": {
+ "title": "Transferência incompleta",
+ "description": "O remetente saiu antes que todos os arquivos chegassem."
+ },
+ "handshake": {
+ "title": "Conexão em andamento",
+ "description": "Concluindo a conexão segura com o remetente."
+ },
+ "sessionEnded": {
+ "title": "Sessão encerrada",
+ "description": "Retorne para iniciar uma nova transferência."
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "Arquivos prontos",
+ "filesReadyDescription": "O remetente compartilhou arquivos. Revise-os e inicie cada download quando estiver pronto.",
+ "receivedFiles": "Arquivos recebidos"
+ },
+ "form": {
+ "codeLabel": "Código de conexão",
+ "codePlaceholder": "Cole o código de 64 caracteres…",
+ "orPasteCode": "ou cole o código"
+ },
+ "actions": {
+ "scanQr": "Escanear código QR",
+ "allowCamera": "Permitir câmera",
+ "downloadAll": "Baixar tudo",
+ "view": "Ver",
+ "play": "Reproduzir",
+ "open": "Abrir",
+ "scanQrHint": "Use a webcam para ler o QR do remetente",
+ "downloadingPercent": "Baixando {{percent}}%",
+ "downloadAllWithSize": "Baixar tudo ({{size}})",
+ "showInFinder": "Mostrar no Finder",
+ "backToHome": "Voltar ao início",
+ "viewPhotos": "Ver fotos",
+ "scanOrImportQr": "Escanear ou importar QR",
+ "scanOrImportQrHintDesktop": "Use a webcam ou importe uma imagem QR salva",
+ "scanOrImportQrHintMobile": "Use a câmera ou importe uma imagem salva",
+ "importImage": "Importar imagem",
+ "importFromImage": "Importar de imagem"
+ },
+ "errors": {
+ "invalidCode": "Insira um código hexadecimal válido de 64 caracteres.",
+ "invalidKey": "Insira uma chave hexadecimal válida de 64 caracteres.",
+ "joinFailed": "Não foi possível ingressar na sessão.",
+ "unreachable": "Não foi possível entrar em contato com o remetente. Verifique o código e tente novamente.",
+ "unsupportedQrTitle": "Código QR incompatível",
+ "unsupportedQrHint": "Escaneie um código de conexão do AlterSend.",
+ "mobileJoinFailedTitle": "Não foi possível entrar na sessão",
+ "mobileJoinFailedHint": "Tente escanear novamente ou cole o código manualmente.",
+ "cameraUnavailable": "Câmera indisponível.",
+ "cameraCouldNotStart": "A câmera não pôde ser iniciada. Cole o código de conexão.",
+ "downloadFailed": "Falha",
+ "didntArrive": "Não chegou",
+ "transferIssue": "Problema de transferência",
+ "imageNoQrTitle": "Nenhum QR code encontrado",
+ "imageNoQrHint": "Escolha uma imagem que mostre um QR code do AlterSend.",
+ "imageUnsupportedQrHint": "Essa imagem não é um código de conexão do AlterSend.",
+ "imageReadFailedTitle": "Não foi possível ler essa imagem"
+ },
+ "camera": {
+ "preparingTitle": "Preparando câmera",
+ "preparingDescription": "Verificando o acesso à câmera para que você possa escanear o código QR do remetente.",
+ "accessNeededTitle": "Acesso à câmera necessário",
+ "accessNeededDescription": "Permita o acesso à câmera para escanear o código QR de conexão de um remetente.",
+ "scanTitle": "Escanear código QR",
+ "scanDescription": "Centralize o código QR do remetente dentro do quadro. O AlterSend se conectará automaticamente.",
+ "desktopHint": "Aponte o código QR do remetente para a webcam – o AlterSend se conecta automaticamente.",
+ "blockedTitle": "Acesso à câmera bloqueado",
+ "blockedHint": "Permita o acesso à câmera para o AlterSend nas configurações do sistema e tente novamente. Você também pode colar o código.",
+ "noneTitle": "Nenhuma câmera encontrada",
+ "noneHint": "Conecte uma webcam para escanear ou cole o código de conexão.",
+ "unavailableTitle": "Câmera indisponível",
+ "starting": "Iniciando a câmera…",
+ "enableTitle": "Ativar acesso à câmera",
+ "enableDescription": "Isso só é necessário para escanear o QR do remetente. Você também pode voltar e colar o código manualmente.",
+ "usePastedCode": "Usar o código colado",
+ "joiningDescription": "Entrando na sessão do remetente.",
+ "scanImportTitle": "Escanear ou importar QR",
+ "scanImportDescription": "Centralize o QR do remetente no quadro ou importe uma imagem salva. O AlterSend conecta automaticamente.",
+ "desktopImportHint": "Centralize o QR do remetente no quadro ou importe uma imagem salva. O AlterSend conecta automaticamente.",
+ "enableImportDescription": "A câmera só é necessária para escanear um QR. Você também pode importar uma imagem salva ou colar o código manualmente."
+ },
+ "status": {
+ "ready": "Pronto",
+ "saved": "Salvo",
+ "failed": "Falha",
+ "downloadingPercent": "Baixando {{percent}}%",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "Aguardando arquivos do remetente…"
+ },
+ "summary": {
+ "receivedCount_one": "{{completed}} de {{count}} arquivo recebido",
+ "receivedCount_other": "{{completed}} de {{count}} arquivos recebidos",
+ "savedToPhotos_one": "Salvo em Fotos",
+ "savedToPhotos_other": "{{count}} salvos em Fotos",
+ "savedInFiles_one": "Salvo em Arquivos",
+ "savedInFiles_other": "{{count}} salvos em Arquivos",
+ "tapToView": "Toque para visualizar",
+ "saved": "salvo",
+ "savedToLocation": "salvo em {{location}}",
+ "receivedProgress": "{{completed}} de {{count}} recebidos",
+ "senderLeftBeforeFinishing": "O remetente saiu antes de terminar.",
+ "filesSaved_one": "{{count}} arquivo salvo",
+ "filesSaved_other": "{{count}} arquivos salvos"
+ }
+}
diff --git a/packages/locales/src/locales/pt-BR/send.json b/packages/locales/src/locales/pt-BR/send.json
new file mode 100644
index 0000000..834a6b7
--- /dev/null
+++ b/packages/locales/src/locales/pt-BR/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "Enviar arquivos",
+ "description": "Escolha um ou mais arquivos e gere um código único para uma transferência criptografada direta."
+ },
+ "preparing": {
+ "title": "Preparando transferência",
+ "description": "Preparando os arquivos selecionados antes que o código de compartilhamento seja revelado."
+ },
+ "waitingForReceiver": {
+ "title": "Compartilhe o código",
+ "description": "Envie o código ou QR ao seu destinatário para iniciar a transferência."
+ },
+ "receiverConnected": {
+ "title": "Compartilhe o código",
+ "description": "Envie o código ou QR ao seu destinatário para iniciar a transferência."
+ }
+ },
+ "actions": {
+ "sendFiles_one": "Enviar {{count}} arquivo",
+ "sendFiles_other": "Enviar {{count}} arquivos",
+ "addFiles": "Adicionar arquivos",
+ "addMoreFiles": "Adicionar mais arquivos",
+ "dragAndDrop": "Arraste e solte",
+ "clear": "Limpar",
+ "endSession": "Encerrar sessão",
+ "pickFilesTitle": "Adicionar arquivos",
+ "pickPhotos": "Fotos",
+ "pickFiles": "Arquivos"
+ },
+ "status": {
+ "waitingForPeer": "Aguardando destinatário",
+ "peerConnected": "Destinatário conectado",
+ "uploadComplete": "Envio concluído",
+ "uploadingFiles": "Enviando arquivos",
+ "uploaded": "Enviado",
+ "uploading": "Enviando…",
+ "waiting": "Aguardando",
+ "failed": "Falha",
+ "downloaded": "Baixado",
+ "disconnected": "Desconectado",
+ "online": "On-line",
+ "downloading": "Baixando",
+ "downloadingPercent": "Baixando {{percent}}%"
+ },
+ "connection": {
+ "placeholder": "Gerando chave segura…",
+ "copyLabel": "Copiar código de conexão",
+ "showQrLabel": "Mostrar código QR",
+ "qrCodeLabel": "Código QR para chave de conexão",
+ "qrModalDescription": "Abra o AlterSend em outro dispositivo e escaneie este código",
+ "copiedToast": "Copiado para a área de transferência",
+ "scanToConnect": "Escaneie para conectar",
+ "orScan": "ou escaneie",
+ "generating": "Gerando…",
+ "waitingForConnection": "Aguardando conexão…"
+ },
+ "errors": {
+ "folderUnsupported": "As pastas ainda não são suportadas. Selecione apenas arquivos.",
+ "failedPickFiles": "Falha ao selecionar arquivos",
+ "failedPickPhotos": "Falha ao escolher fotos"
+ },
+ "hints": {
+ "keepOpen": "Fechar o aplicativo cancela a transferência."
+ },
+ "preparing": {
+ "uploadedCount_one": "{{completed}} de {{count}} arquivo enviado",
+ "uploadedCount_other": "{{completed}} de {{count}} arquivos enviados"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} concluído",
+ "completedDone_other": "{{count}} concluídos",
+ "devices": "Dispositivos",
+ "connectedCount_one": "{{count}} conectado",
+ "connectedCount_other": "{{count}} conectados"
+ },
+ "dropzone": {
+ "addMoreDescription": "ou clique para <link>adicionar mais</link>",
+ "browseDescription": "ou clique para <link>procurar</link>",
+ "tapAddMoreDescription": "Toque para <link>adicionar mais</link>",
+ "tapBrowseDescription": "Toque para <link>procurar</link>",
+ "orClickTo": "ou clique para",
+ "tapTo": "Toque para",
+ "addMoreLink": "adicionar mais",
+ "browseLink": "procurar"
+ },
+ "files": {
+ "removeLabel": "Remover {{name}}"
+ }
+}
diff --git a/packages/locales/src/locales/pt-BR/settings.json b/packages/locales/src/locales/pt-BR/settings.json
new file mode 100644
index 0000000..27a2326
--- /dev/null
+++ b/packages/locales/src/locales/pt-BR/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "Configurações",
+ "languageTitle": "Idioma",
+ "languageHint": "Escolha o idioma usado pelo AlterSend.",
+ "sections": {
+ "privacy": "Privacidade",
+ "support": "Suporte",
+ "about": "Sobre"
+ },
+ "crashReports": {
+ "label": "Relatórios de falhas",
+ "description": "Compartilhe dados anônimos de falhas para ajudar a melhorar o AlterSend"
+ },
+ "rows": {
+ "feedback": "Feedback",
+ "feedbackHint": "Relate um problema ou sugira uma funcionalidade",
+ "discord": "Discord",
+ "discordHint": "Junte-se à comunidade",
+ "contact": "Contate-nos",
+ "privacyPolicy": "Política de privacidade",
+ "privacyPolicyHint": "Como o AlterSend trata seus dados",
+ "terms": "Termos de serviço",
+ "termsHint": "Regras para usar o AlterSend",
+ "website": "Site"
+ },
+ "legal": {
+ "terms": "Termos de Uso",
+ "privacy": "Declaração de privacidade",
+ "sentence": "<terms>Termos de Uso</terms> e <privacy>Declaração de Privacidade</privacy>."
+ }
+}
diff --git a/packages/locales/src/locales/zh-CN/common.json b/packages/locales/src/locales/zh-CN/common.json
new file mode 100644
index 0000000..d2d4fd4
--- /dev/null
+++ b/packages/locales/src/locales/zh-CN/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "直接文件传输",
+ "welcome": "欢迎使用 AlterSend",
+ "loadingTagline": "文件会在你的设备之间直接传输。\n没有服务器、没有副本、没有中间人。"
+ },
+ "actions": {
+ "back": "返回",
+ "continue": "继续",
+ "getStarted": "开始使用",
+ "cancel": "取消",
+ "clear": "清除",
+ "close": "关闭",
+ "copy": "复制",
+ "copied": "已复制",
+ "connect": "连接",
+ "connecting": "正在连接…",
+ "done": "完成",
+ "endSession": "结束会话",
+ "restart": "重启",
+ "tryAgain": "重试",
+ "dismiss": "关闭",
+ "openSettings": "打开设置",
+ "update": "更新",
+ "downloadAll": "下载全部",
+ "skip": "跳过"
+ },
+ "labels": {
+ "settings": "设置",
+ "language": "语言",
+ "systemDefault": "系统默认",
+ "camera": "摄像头",
+ "statusBar": "状态栏",
+ "transferMode": "传输方式",
+ "version": "版本",
+ "platform": "平台",
+ "desktop": "桌面端",
+ "mobile": "移动端",
+ "send": "发送",
+ "receive": "接收",
+ "connectionCode": "连接代码"
+ },
+ "files": {
+ "count_one": "{{count}} 个文件",
+ "count_other": "{{count}} 个文件",
+ "photos": "照片",
+ "files": "文件",
+ "downloads": "文件 › 下载",
+ "photosAndAlterSend": "照片 + AlterSend 文件夹",
+ "alterSendFolder": "AlterSend 文件夹"
+ },
+ "update": {
+ "ready": "更新准备就绪",
+ "available": "可用更新",
+ "restart": "重启",
+ "update": "更新",
+ "restartFailed": "重新启动失败 - 请退出并重新启动"
+ },
+ "status": {
+ "connected": "已连接"
+ },
+ "confirm": {
+ "leaveShareSession": "离开将结束您的活跃共享会话。继续?",
+ "leaveReceiveSession": "离开将结束您的活动接收会话。继续?"
+ }
+}
diff --git a/packages/locales/src/locales/zh-CN/errors.json b/packages/locales/src/locales/zh-CN/errors.json
new file mode 100644
index 0000000..026b96d
--- /dev/null
+++ b/packages/locales/src/locales/zh-CN/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "出了点问题",
+ "desktopDescription": "AlterSend 遇到意外错误,需要重新启动。传输服务可能不稳定,因此重新启动是最安全的选择。",
+ "mobileDescription": "AlterSend 遇到意外错误。请重试,或者如果问题仍然存在,请关闭并重新打开应用程序。",
+ "restartAlterSend": "重新启动 AlterSend",
+ "tryAgain": "再试一次"
+ },
+ "bridgeUnavailable": {
+ "title": "桌面连接不可用",
+ "description": "此窗口未连接到桌面应用。请从桌面应用重新启动 AlterSend。",
+ "status": "桌面连接不可用"
+ },
+ "transfer": {
+ "invalidTopic": "连接代码无效。",
+ "joinFailed": "无法加入会话。",
+ "peerUnreachable": "无法连接到发送方。请检查代码后重试。",
+ "transferFailed": "传输失败。请重试。",
+ "downloadFailed": "下载失败。请重试。"
+ }
+}
diff --git a/packages/locales/src/locales/zh-CN/feedback.json b/packages/locales/src/locales/zh-CN/feedback.json
new file mode 100644
index 0000000..3b4bc85
--- /dev/null
+++ b/packages/locales/src/locales/zh-CN/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "反馈",
+ "types": {
+ "bug": "错误报告",
+ "feature": "功能请求",
+ "general": "一般"
+ },
+ "placeholders": {
+ "bug": "描述发生了什么以及如何重现它......",
+ "desktopBug": "描述一下出了什么问题...",
+ "feature": "您希望在 AlterSend 中看到什么?",
+ "desktopFeature": "你想看什么?",
+ "general": "分享您的想法..."
+ },
+ "actions": {
+ "send": "发送反馈",
+ "sending": "正在发送..."
+ },
+ "states": {
+ "sent": "感谢您的反馈!",
+ "failed": "发送失败。检查您的连接。",
+ "received": "已收到你的反馈。"
+ }
+}
diff --git a/packages/locales/src/locales/zh-CN/index.ts b/packages/locales/src/locales/zh-CN/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/zh-CN/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/zh-CN/native.json b/packages/locales/src/locales/zh-CN/native.json
new file mode 100644
index 0000000..db5f5e2
--- /dev/null
+++ b/packages/locales/src/locales/zh-CN/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend 使用相机扫描连接 QR 码。",
+ "localNetwork": "AlterSend 使用本地网络寻找附近设备并直接传输文件。",
+ "photoRead": "AlterSend 会读取您的照片库,以便您可以选择照片和视频发送到其他设备。",
+ "photoSave": "AlterSend 将收到的图片和视频保存到您的照片库。"
+ }
+}
diff --git a/packages/locales/src/locales/zh-CN/onboarding.json b/packages/locales/src/locales/zh-CN/onboarding.json
new file mode 100644
index 0000000..ed758aa
--- /dev/null
+++ b/packages/locales/src/locales/zh-CN/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "直接在设备之间传输文件。",
+ "description": "一台设备发送,另一台设备接收。一个简短的代码将它们连接起来,以便文件可以直接流式传输。"
+ },
+ "keepOpen": {
+ "title": "保持两个应用程序打开。",
+ "description": "文件直接在设备之间传输——没有云。关闭或后台应用程序将取消传输。"
+ },
+ "encrypted": {
+ "title": "端到端加密。",
+ "description": "没有服务器,没有副本,没有中间方。您的文件会在您和接收方之间直接传输。",
+ "link": "阅读我们的隐私政策"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/zh-CN/receive.json b/packages/locales/src/locales/zh-CN/receive.json
new file mode 100644
index 0000000..ba412a1
--- /dev/null
+++ b/packages/locales/src/locales/zh-CN/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "接收",
+ "join": {
+ "title": "接收文件",
+ "description": "输入发件人提供的 64 个字符的连接代码以传输其文件。",
+ "mobileDescription": "扫描或导入发送方的二维码,或粘贴 64 字符代码以开始接收。"
+ },
+ "connecting": {
+ "title": "正在连接",
+ "description": "与发件人建立安全会话。"
+ },
+ "incomingTransfer": {
+ "title": "可用文件",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} 个文件 · {{size}}",
+ "description_other": "{{count}} 个文件 · {{size}}"
+ },
+ "completed": {
+ "title_one": "文件已收到",
+ "title_other": "收到文件",
+ "downloadsComplete": "下载完成"
+ },
+ "reconnecting": {
+ "title": "重新连接",
+ "description": "重新连接到会话。链接恢复后,文件将再次可用。",
+ "panelDescription": "连接已断开。正在重新加入会话…"
+ },
+ "interrupted": {
+ "title": "传输不完整",
+ "description": "发件人在所有文件到达之前离开。"
+ },
+ "handshake": {
+ "title": "连接正在进行中",
+ "description": "完成与发送方的安全握手。"
+ },
+ "sessionEnded": {
+ "title": "会议结束",
+ "description": "返回开始新的传输。"
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "文件准备好",
+ "filesReadyDescription": "发件人已共享文件。查看它们并在准备好后开始每次下载。",
+ "receivedFiles": "收到的文件"
+ },
+ "form": {
+ "codeLabel": "连接代码",
+ "codePlaceholder": "粘贴 64 字符代码...",
+ "orPasteCode": "或粘贴代码"
+ },
+ "actions": {
+ "scanQr": "扫描QR代码",
+ "allowCamera": "允许拍照",
+ "downloadAll": "下载全部",
+ "view": "查看",
+ "play": "播放",
+ "open": "打开",
+ "scanQrHint": "使用摄像头读取发送者的二维码",
+ "downloadingPercent": "正在下载 {{percent}}%",
+ "downloadAllWithSize": "全部下载({{size}})",
+ "showInFinder": "在 Finder 中显示",
+ "backToHome": "返回首页",
+ "viewPhotos": "查看照片",
+ "scanOrImportQr": "扫描或导入二维码",
+ "scanOrImportQrHintDesktop": "使用摄像头,或导入已保存的二维码图片",
+ "scanOrImportQrHintMobile": "使用相机,或导入已保存的图片",
+ "importImage": "导入图片",
+ "importFromImage": "从图片导入"
+ },
+ "errors": {
+ "invalidCode": "输入有效的 64 字符十六进制代码。",
+ "invalidKey": "输入有效的 64 字符十六进制密钥。",
+ "joinFailed": "无法加入会话。",
+ "unreachable": "无法联系发件人。检查代码并重试。",
+ "unsupportedQrTitle": "QR 代码不受支持",
+ "unsupportedQrHint": "扫描 AlterSend 连接代码。",
+ "mobileJoinFailedTitle": "无法加入会话",
+ "mobileJoinFailedHint": "尝试再次扫描或手动粘贴代码。",
+ "cameraUnavailable": "相机不可用。",
+ "cameraCouldNotStart": "相机无法启动。请改为粘贴连接代码。",
+ "downloadFailed": "失败",
+ "didntArrive": "没有到达",
+ "transferIssue": "转账问题",
+ "imageNoQrTitle": "未找到二维码",
+ "imageNoQrHint": "请选择包含 AlterSend 二维码的图片。",
+ "imageUnsupportedQrHint": "这张图片不是 AlterSend 连接码。",
+ "imageReadFailedTitle": "无法读取该图片"
+ },
+ "camera": {
+ "preparingTitle": "准备相机",
+ "preparingDescription": "检查摄像头访问权限,以便您可以扫描发件人的 QR 代码。",
+ "accessNeededTitle": "需要相机访问权限",
+ "accessNeededDescription": "允许摄像头访问以扫描发送者的连接 QR 代码。",
+ "scanTitle": "扫描QR代码",
+ "scanDescription": "将发送方的 QR 码置于取景框中央。AlterSend 会自动连接。",
+ "desktopHint": "将发送方的 QR 码对准网络摄像头,AlterSend 会自动连接。",
+ "blockedTitle": "摄像头访问被阻止",
+ "blockedHint": "在系统设置中允许 AlterSend 访问摄像头,然后重试。您也可以粘贴代码。",
+ "noneTitle": "没有找到相机",
+ "noneHint": "连接网络摄像头进行扫描,或粘贴连接代码。",
+ "unavailableTitle": "相机不可用",
+ "starting": "启动相机...",
+ "enableTitle": "启用摄像头访问",
+ "enableDescription": "仅用于扫描发送者的二维码。你也可以返回并手动粘贴代码。",
+ "usePastedCode": "改用粘贴的代码",
+ "joiningDescription": "正在加入发送者的会话。",
+ "scanImportTitle": "扫描或导入二维码",
+ "scanImportDescription": "将发送方二维码置于框内,或导入已保存的图片。AlterSend 会自动连接。",
+ "desktopImportHint": "将发送方二维码置于框内,或导入已保存的图片。AlterSend 会自动连接。",
+ "enableImportDescription": "相机仅用于扫描二维码。你也可以导入已保存的图片或手动粘贴代码。"
+ },
+ "status": {
+ "ready": "准备好了",
+ "saved": "已保存",
+ "failed": "失败",
+ "downloadingPercent": "正在下载 {{percent}}%",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "正在等待发送者的文件…"
+ },
+ "summary": {
+ "receivedCount_one": "已收到 {{completed}} 个文件(共 {{count}} 个)",
+ "receivedCount_other": "已收到 {{completed}} 个文件(共 {{count}} 个)",
+ "savedToPhotos_one": "保存到照片",
+ "savedToPhotos_other": "{{count}} 已保存到照片",
+ "savedInFiles_one": "已保存到文件",
+ "savedInFiles_other": "{{count}} 个已保存到文件",
+ "tapToView": "点击查看",
+ "saved": "已保存",
+ "savedToLocation": "已保存到 {{location}}",
+ "receivedProgress": "已接收 {{count}} 个中的 {{completed}} 个",
+ "senderLeftBeforeFinishing": "发送者在完成前离开了。",
+ "filesSaved_one": "已保存 {{count}} 个文件",
+ "filesSaved_other": "已保存 {{count}} 个文件"
+ }
+}
diff --git a/packages/locales/src/locales/zh-CN/send.json b/packages/locales/src/locales/zh-CN/send.json
new file mode 100644
index 0000000..fbb3019
--- /dev/null
+++ b/packages/locales/src/locales/zh-CN/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "发送文件",
+ "description": "选择一个或多个文件并生成一次性代码以进行直接加密传输。"
+ },
+ "preparing": {
+ "title": "准备转移",
+ "description": "在共享代码公开之前准备好选定的文件。"
+ },
+ "waitingForReceiver": {
+ "title": "分享代码",
+ "description": "将代码或 QR 发送给您的收件人以开始转移。"
+ },
+ "receiverConnected": {
+ "title": "分享代码",
+ "description": "将代码或 QR 发送给您的收件人以开始转移。"
+ }
+ },
+ "actions": {
+ "sendFiles_one": "发送 {{count}} 个文件",
+ "sendFiles_other": "发送 {{count}} 个文件",
+ "addFiles": "添加文件",
+ "addMoreFiles": "添加更多文件",
+ "dragAndDrop": "拖放",
+ "clear": "清除",
+ "endSession": "结束会话",
+ "pickFilesTitle": "添加文件",
+ "pickPhotos": "照片",
+ "pickFiles": "文件"
+ },
+ "status": {
+ "waitingForPeer": "等待接收方",
+ "peerConnected": "接收方已连接",
+ "uploadComplete": "上传完成",
+ "uploadingFiles": "上传文件",
+ "uploaded": "已上传",
+ "uploading": "正在上传...",
+ "waiting": "等待",
+ "failed": "失败",
+ "downloaded": "已下载",
+ "disconnected": "已断开连接",
+ "online": "在线",
+ "downloading": "正在下载",
+ "downloadingPercent": "正在下载 {{percent}}%"
+ },
+ "connection": {
+ "placeholder": "正在生成安全密钥...",
+ "copyLabel": "复制连接代码",
+ "showQrLabel": "显示QR代码",
+ "qrCodeLabel": "连接密钥的 QR 代码",
+ "qrModalDescription": "在另一台设备上打开 AlterSend 并扫描此代码",
+ "copiedToast": "已复制到剪贴板",
+ "scanToConnect": "扫描以连接",
+ "orScan": "或扫描",
+ "generating": "正在生成…",
+ "waitingForConnection": "正在等待连接…"
+ },
+ "errors": {
+ "folderUnsupported": "尚不支持文件夹。请仅选择文件。",
+ "failedPickFiles": "选取文件失败",
+ "failedPickPhotos": "无法选择照片"
+ },
+ "hints": {
+ "keepOpen": "关闭应用程序会取消传输。"
+ },
+ "preparing": {
+ "uploadedCount_one": "已上传 {{count}} 个文件中的 {{completed}} 个",
+ "uploadedCount_other": "已上传 {{count}} 个文件中的 {{completed}} 个"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} 个已完成",
+ "completedDone_other": "{{count}} 个已完成",
+ "devices": "设备",
+ "connectedCount_one": "{{count}} 台设备已连接",
+ "connectedCount_other": "{{count}} 台设备已连接"
+ },
+ "dropzone": {
+ "addMoreDescription": "或点击<link>继续添加</link>",
+ "browseDescription": "或点击<link>浏览</link>",
+ "tapAddMoreDescription": "点按<link>继续添加</link>",
+ "tapBrowseDescription": "点按<link>浏览</link>",
+ "orClickTo": "或点击",
+ "tapTo": "点按",
+ "addMoreLink": "继续添加",
+ "browseLink": "浏览"
+ },
+ "files": {
+ "removeLabel": "删除{{name}}"
+ }
+}
diff --git a/packages/locales/src/locales/zh-CN/settings.json b/packages/locales/src/locales/zh-CN/settings.json
new file mode 100644
index 0000000..e002631
--- /dev/null
+++ b/packages/locales/src/locales/zh-CN/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "设置",
+ "languageTitle": "语言",
+ "languageHint": "选择 AlterSend 使用的语言。",
+ "sections": {
+ "privacy": "隐私",
+ "support": "支持",
+ "about": "关于"
+ },
+ "crashReports": {
+ "label": "崩溃报告",
+ "description": "共享匿名崩溃数据以帮助改进AlterSend"
+ },
+ "rows": {
+ "feedback": "反馈",
+ "feedbackHint": "报告问题或建议功能",
+ "discord": "Discord",
+ "discordHint": "加入社区",
+ "contact": "联系我们",
+ "privacyPolicy": "隐私政策",
+ "privacyPolicyHint": "AlterSend 如何处理您的数据",
+ "terms": "服务条款",
+ "termsHint": "AlterSend 使用规则",
+ "website": "网站"
+ },
+ "legal": {
+ "terms": "使用条款",
+ "privacy": "隐私声明",
+ "sentence": "<terms>使用条款</terms>和<privacy>隐私声明</privacy>。"
+ }
+}
diff --git a/packages/locales/src/locales/zh-TW/common.json b/packages/locales/src/locales/zh-TW/common.json
new file mode 100644
index 0000000..c32ae3a
--- /dev/null
+++ b/packages/locales/src/locales/zh-TW/common.json
@@ -0,0 +1,67 @@
+{
+ "app": {
+ "name": "AlterSend",
+ "tagline": "直接檔案傳輸",
+ "welcome": "歡迎使用 AlterSend",
+ "loadingTagline": "文件会在你的设备之间直接传输。\n没有服务器、没有副本、没有中间人。"
+ },
+ "actions": {
+ "back": "返回",
+ "continue": "繼續",
+ "getStarted": "開始使用",
+ "cancel": "取消",
+ "clear": "清除",
+ "close": "關閉",
+ "copy": "複製",
+ "copied": "已複製",
+ "connect": "連線",
+ "connecting": "正在連線…",
+ "done": "完成",
+ "endSession": "結束工作階段",
+ "restart": "重新啟動",
+ "tryAgain": "再試一次",
+ "dismiss": "關閉",
+ "openSettings": "開啟設定",
+ "update": "更新",
+ "downloadAll": "下載全部",
+ "skip": "略過"
+ },
+ "labels": {
+ "settings": "設定",
+ "language": "語言",
+ "systemDefault": "系統預設",
+ "camera": "相機",
+ "statusBar": "狀態列",
+ "transferMode": "傳輸方式",
+ "version": "版本",
+ "platform": "平台",
+ "desktop": "桌面版",
+ "mobile": "行動裝置",
+ "send": "傳送",
+ "receive": "接收",
+ "connectionCode": "連線代碼"
+ },
+ "files": {
+ "count_one": "{{count}} 个文件",
+ "count_other": "{{count}} 个文件",
+ "photos": "照片",
+ "files": "檔案",
+ "downloads": "檔案 › 下載",
+ "photosAndAlterSend": "照片 + AlterSend 資料夾",
+ "alterSendFolder": "AlterSend 資料夾"
+ },
+ "update": {
+ "ready": "更新準備就緒",
+ "available": "可用更新",
+ "restart": "重新啟動",
+ "update": "更新",
+ "restartFailed": "重新啟動失敗 - 請退出並重新啟動"
+ },
+ "status": {
+ "connected": "已連線"
+ },
+ "confirm": {
+ "leaveShareSession": "離開將結束您的活躍共享會話。繼續?",
+ "leaveReceiveSession": "離開將結束您的活動接收會話。繼續?"
+ }
+}
diff --git a/packages/locales/src/locales/zh-TW/errors.json b/packages/locales/src/locales/zh-TW/errors.json
new file mode 100644
index 0000000..4a1b28b
--- /dev/null
+++ b/packages/locales/src/locales/zh-TW/errors.json
@@ -0,0 +1,21 @@
+{
+ "crash": {
+ "title": "出了點問題",
+ "desktopDescription": "AlterSend 遇到意外錯誤,需要重新啟動。傳輸服務可能不穩定,因此重新啟動是最安全的選擇。",
+ "mobileDescription": "AlterSend 遇到意外錯誤。請重試,或者如果問題仍然存在,請關閉並重新開啟應用程式。",
+ "restartAlterSend": "重新啟動 AlterSend",
+ "tryAgain": "再試一次"
+ },
+ "bridgeUnavailable": {
+ "title": "桌面連線無法使用",
+ "description": "此視窗未連接到桌面應用程式。請從桌面應用程式重新啟動 AlterSend。",
+ "status": "桌面連線無法使用"
+ },
+ "transfer": {
+ "invalidTopic": "連線代碼無效。",
+ "joinFailed": "無法加入工作階段。",
+ "peerUnreachable": "無法連線到傳送者。請確認代碼後再試一次。",
+ "transferFailed": "傳輸失敗。請再試一次。",
+ "downloadFailed": "下載失敗。請再試一次。"
+ }
+}
diff --git a/packages/locales/src/locales/zh-TW/feedback.json b/packages/locales/src/locales/zh-TW/feedback.json
new file mode 100644
index 0000000..639755a
--- /dev/null
+++ b/packages/locales/src/locales/zh-TW/feedback.json
@@ -0,0 +1,24 @@
+{
+ "title": "意見回饋",
+ "types": {
+ "bug": "錯誤報告",
+ "feature": "功能請求",
+ "general": "一般"
+ },
+ "placeholders": {
+ "bug": "描述發生了什麼以及如何重現它...",
+ "desktopBug": "描述一下出了什麼問題...",
+ "feature": "您希望在 AlterSend 中看到什麼?",
+ "desktopFeature": "你想看什麼?",
+ "general": "分享您的想法..."
+ },
+ "actions": {
+ "send": "傳送回饋",
+ "sending": "正在發送..."
+ },
+ "states": {
+ "sent": "感謝您的回饋!",
+ "failed": "發送失敗。檢查您的連線。",
+ "received": "已收到你的回饋。"
+ }
+}
diff --git a/packages/locales/src/locales/zh-TW/index.ts b/packages/locales/src/locales/zh-TW/index.ts
new file mode 100644
index 0000000..621e63c
--- /dev/null
+++ b/packages/locales/src/locales/zh-TW/index.ts
@@ -0,0 +1,12 @@
+import common from './common.json'
+import send from './send.json'
+import receive from './receive.json'
+import settings from './settings.json'
+import onboarding from './onboarding.json'
+import feedback from './feedback.json'
+import errors from './errors.json'
+import native from './native.json'
+
+const resources = { common, send, receive, settings, onboarding, feedback, errors, native }
+
+export default resources
diff --git a/packages/locales/src/locales/zh-TW/native.json b/packages/locales/src/locales/zh-TW/native.json
new file mode 100644
index 0000000..6052abd
--- /dev/null
+++ b/packages/locales/src/locales/zh-TW/native.json
@@ -0,0 +1,8 @@
+{
+ "permissions": {
+ "camera": "AlterSend 使用相機掃描連線 QR 碼。",
+ "localNetwork": "AlterSend 使用本機網路尋找附近裝置並直接傳輸檔案。",
+ "photoRead": "AlterSend 會讀取您的照片圖庫,以便您選擇要傳送到其他裝置的照片和影片。",
+ "photoSave": "AlterSend 將收到的圖片和影片儲存到您的照片圖庫。"
+ }
+}
diff --git a/packages/locales/src/locales/zh-TW/onboarding.json b/packages/locales/src/locales/zh-TW/onboarding.json
new file mode 100644
index 0000000..306e23c
--- /dev/null
+++ b/packages/locales/src/locales/zh-TW/onboarding.json
@@ -0,0 +1,17 @@
+{
+ "slides": {
+ "direct": {
+ "title": "直接在裝置之間傳輸檔案。",
+ "description": "一台裝置傳送,另一台裝置接收。短代碼會連接兩台裝置,讓檔案可以直接串流傳輸。"
+ },
+ "keepOpen": {
+ "title": "保持兩個應用程式打開。",
+ "description": "檔案直接在裝置之間傳輸-沒有雲端。關閉或背景應用程式將取消傳輸。"
+ },
+ "encrypted": {
+ "title": "端對端加密。",
+ "description": "沒有伺服器、沒有副本、沒有中介。您的檔案會在您和接收方之間直接傳輸。",
+ "link": "閱讀我們的隱私權政策"
+ }
+ }
+}
diff --git a/packages/locales/src/locales/zh-TW/receive.json b/packages/locales/src/locales/zh-TW/receive.json
new file mode 100644
index 0000000..d191504
--- /dev/null
+++ b/packages/locales/src/locales/zh-TW/receive.json
@@ -0,0 +1,136 @@
+{
+ "page": {
+ "tabTitle": "接收",
+ "join": {
+ "title": "接收文件",
+ "description": "輸入寄件者提供的 64 個字元的連接代碼以傳輸其檔案。",
+ "mobileDescription": "掃描或匯入傳送方的 QR,或貼上 64 字元代碼開始接收。"
+ },
+ "connecting": {
+ "title": "正在連接",
+ "description": "與寄件者建立安全會話。"
+ },
+ "incomingTransfer": {
+ "title": "可用文件",
+ "description": "{{count}} {{fileLabel}} · {{size}}",
+ "description_one": "{{count}} 個檔案 · {{size}}",
+ "description_other": "{{count}} 個檔案 · {{size}}"
+ },
+ "completed": {
+ "title_one": "文件已收到",
+ "title_other": "收到文件",
+ "downloadsComplete": "下載完成"
+ },
+ "reconnecting": {
+ "title": "重新連接",
+ "description": "重新連接到會話。連結恢復後,文件將再次可用。",
+ "panelDescription": "連線中斷。正在重新加入工作階段…"
+ },
+ "interrupted": {
+ "title": "傳輸不完整",
+ "description": "寄件者在所有文件到達之前離開。"
+ },
+ "handshake": {
+ "title": "連接正在進行中",
+ "description": "完成與發送方的安全握手。"
+ },
+ "sessionEnded": {
+ "title": "會議結束",
+ "description": "返回開始新的傳輸。"
+ }
+ },
+ "panel": {
+ "filesReadyTitle": "文件準備好",
+ "filesReadyDescription": "寄件者已共用文件。查看它們並在準備好後開始每次下載。",
+ "receivedFiles": "收到的文件"
+ },
+ "form": {
+ "codeLabel": "連線代碼",
+ "codePlaceholder": "貼上 64 字元代碼...",
+ "orPasteCode": "或貼上代碼"
+ },
+ "actions": {
+ "scanQr": "掃描QR代碼",
+ "allowCamera": "允許拍照",
+ "downloadAll": "下載全部",
+ "view": "查看",
+ "play": "播放",
+ "open": "打開",
+ "scanQrHint": "使用網路攝影機讀取傳送者的 QR",
+ "downloadingPercent": "下載中 {{percent}}%",
+ "downloadAllWithSize": "全部下載({{size}})",
+ "showInFinder": "在 Finder 中顯示",
+ "backToHome": "返回首頁",
+ "viewPhotos": "查看照片",
+ "scanOrImportQr": "掃描或匯入 QR",
+ "scanOrImportQrHintDesktop": "使用網路攝影機,或匯入已儲存的 QR 圖片",
+ "scanOrImportQrHintMobile": "使用相機,或匯入已儲存的圖片",
+ "importImage": "匯入圖片",
+ "importFromImage": "從圖片匯入"
+ },
+ "errors": {
+ "invalidCode": "輸入有效的 64 字元十六進位代碼。",
+ "invalidKey": "輸入有效的 64 字元十六進位金鑰。",
+ "joinFailed": "無法加入會話。",
+ "unreachable": "無法聯繫寄件者。檢查代碼並重試。",
+ "unsupportedQrTitle": "QR 程式碼不受支援",
+ "unsupportedQrHint": "掃描 AlterSend 連線代碼。",
+ "mobileJoinFailedTitle": "無法加入會話",
+ "mobileJoinFailedHint": "嘗試再次掃描或手動貼上代碼。",
+ "cameraUnavailable": "相機不可用。",
+ "cameraCouldNotStart": "相機無法啟動。請改為貼上連接代碼。",
+ "downloadFailed": "失敗",
+ "didntArrive": "沒有到達",
+ "transferIssue": "轉帳問題",
+ "imageNoQrTitle": "找不到 QR 碼",
+ "imageNoQrHint": "請選擇包含 AlterSend QR 碼的圖片。",
+ "imageUnsupportedQrHint": "這張圖片不是 AlterSend 連線代碼。",
+ "imageReadFailedTitle": "無法讀取該圖片"
+ },
+ "camera": {
+ "preparingTitle": "準備相機",
+ "preparingDescription": "檢查攝影機存取權限,以便您可以掃描寄件者的 QR 代碼。",
+ "accessNeededTitle": "需要相機存取權限",
+ "accessNeededDescription": "允許攝影機存取以掃描發送者的連接 QR 代碼。",
+ "scanTitle": "掃描QR代碼",
+ "scanDescription": "將傳送者的 QR 碼置於取景框中央。AlterSend 會自動連線。",
+ "desktopHint": "將傳送者的 QR 碼對準網路攝影機,AlterSend 會自動連線。",
+ "blockedTitle": "攝影機存取被阻止",
+ "blockedHint": "在系統設定中允許 AlterSend 存取攝像頭,然後重試。您也可以貼上代碼。",
+ "noneTitle": "沒有找到相機",
+ "noneHint": "連接網路攝影機進行掃描,或貼上連接代碼。",
+ "unavailableTitle": "相機不可用",
+ "starting": "啟動相機...",
+ "enableTitle": "啟用相機存取",
+ "enableDescription": "僅用於掃描傳送者的 QR 代碼。你也可以返回並手動貼上代碼。",
+ "usePastedCode": "改用貼上的代碼",
+ "joiningDescription": "正在加入傳送者的工作階段。",
+ "scanImportTitle": "掃描或匯入 QR",
+ "scanImportDescription": "將傳送方的 QR 對準框內,或匯入已儲存的圖片。AlterSend 會自動連線。",
+ "desktopImportHint": "將傳送方的 QR 對準框內,或匯入已儲存的圖片。AlterSend 會自動連線。",
+ "enableImportDescription": "相機僅用於掃描 QR。你也可以匯入已儲存的圖片或手動貼上代碼。"
+ },
+ "status": {
+ "ready": "準備好了",
+ "saved": "已儲存",
+ "failed": "失敗",
+ "downloadingPercent": "正在下載 {{percent}}%",
+ "percent": "{{percent}}%",
+ "waitingForFiles": "正在等待傳送者的檔案…"
+ },
+ "summary": {
+ "receivedCount_one": "已收到 {{completed}} 個檔案(共 {{count}} 個)",
+ "receivedCount_other": "已收到 {{completed}} 個檔案(共 {{count}} 個)",
+ "savedToPhotos_one": "儲存到照片",
+ "savedToPhotos_other": "{{count}} 已儲存到照片",
+ "savedInFiles_one": "已儲存到檔案",
+ "savedInFiles_other": "{{count}} 儲存在檔案中",
+ "tapToView": "點擊查看",
+ "saved": "已儲存",
+ "savedToLocation": "已儲存至 {{location}}",
+ "receivedProgress": "已接收 {{count}} 個中的 {{completed}} 個",
+ "senderLeftBeforeFinishing": "傳送者在完成前離開了。",
+ "filesSaved_one": "已儲存 {{count}} 個檔案",
+ "filesSaved_other": "已儲存 {{count}} 個檔案"
+ }
+}
diff --git a/packages/locales/src/locales/zh-TW/send.json b/packages/locales/src/locales/zh-TW/send.json
new file mode 100644
index 0000000..a874dcb
--- /dev/null
+++ b/packages/locales/src/locales/zh-TW/send.json
@@ -0,0 +1,91 @@
+{
+ "page": {
+ "selecting": {
+ "title": "发送文件",
+ "description": "選擇一個或多個檔案並產生一次性代碼以進行直接加密傳輸。"
+ },
+ "preparing": {
+ "title": "準備轉移",
+ "description": "在共享代碼公開之前準備好選定的文件。"
+ },
+ "waitingForReceiver": {
+ "title": "分享程式碼",
+ "description": "將代碼或 QR 傳送給您的收件者以開始轉移。"
+ },
+ "receiverConnected": {
+ "title": "分享程式碼",
+ "description": "將代碼或 QR 傳送給您的收件者以開始轉移。"
+ }
+ },
+ "actions": {
+ "sendFiles_one": "傳送 {{count}} 個檔案",
+ "sendFiles_other": "傳送 {{count}} 個檔案",
+ "addFiles": "新增文件",
+ "addMoreFiles": "新增更多文件",
+ "dragAndDrop": "拖放",
+ "clear": "清除",
+ "endSession": "結束會話",
+ "pickFilesTitle": "新增文件",
+ "pickPhotos": "照片",
+ "pickFiles": "文件"
+ },
+ "status": {
+ "waitingForPeer": "等待接收方",
+ "peerConnected": "接收方已連線",
+ "uploadComplete": "上傳完成",
+ "uploadingFiles": "上傳文件",
+ "uploaded": "已上傳",
+ "uploading": "正在上傳...",
+ "waiting": "等待",
+ "failed": "失敗",
+ "downloaded": "已下載",
+ "disconnected": "已斷開連接",
+ "online": "網路",
+ "downloading": "正在下載",
+ "downloadingPercent": "正在下載 {{percent}}%"
+ },
+ "connection": {
+ "placeholder": "正在生成安全密钥...",
+ "copyLabel": "复制连接代码",
+ "showQrLabel": "显示QR代码",
+ "qrCodeLabel": "連接金鑰的 QR 代碼",
+ "qrModalDescription": "在另一個裝置上開啟 AlterSend 並掃描此程式碼",
+ "copiedToast": "已複製到剪貼簿",
+ "scanToConnect": "掃描以連線",
+ "orScan": "或掃描",
+ "generating": "產生中…",
+ "waitingForConnection": "正在等待連線…"
+ },
+ "errors": {
+ "folderUnsupported": "尚不支持文件夹。请仅选择文件。",
+ "failedPickFiles": "选取文件失败",
+ "failedPickPhotos": "无法选择照片"
+ },
+ "hints": {
+ "keepOpen": "關閉應用程式會取消傳輸。"
+ },
+ "preparing": {
+ "uploadedCount_one": "已上傳 {{count}} 個檔案中的 {{completed}} 個",
+ "uploadedCount_other": "已上傳 {{count}} 個檔案中的 {{completed}} 個"
+ },
+ "peer": {
+ "completedDone_one": "{{count}} 個已完成",
+ "completedDone_other": "{{count}} 個已完成",
+ "devices": "裝置",
+ "connectedCount_one": "{{count}} 台裝置已連線",
+ "connectedCount_other": "{{count}} 台裝置已連線"
+ },
+ "dropzone": {
+ "addMoreDescription": "或點擊<link>繼續新增</link>",
+ "browseDescription": "或點擊<link>瀏覽</link>",
+ "tapAddMoreDescription": "點一下<link>繼續新增</link>",
+ "tapBrowseDescription": "點一下<link>瀏覽</link>",
+ "orClickTo": "或點擊",
+ "tapTo": "點一下",
+ "addMoreLink": "繼續新增",
+ "browseLink": "瀏覽"
+ },
+ "files": {
+ "removeLabel": "删除{{name}}"
+ }
+}
diff --git a/packages/locales/src/locales/zh-TW/settings.json b/packages/locales/src/locales/zh-TW/settings.json
new file mode 100644
index 0000000..0dbba6f
--- /dev/null
+++ b/packages/locales/src/locales/zh-TW/settings.json
@@ -0,0 +1,31 @@
+{
+ "title": "設定",
+ "languageTitle": "語言",
+ "languageHint": "選擇 AlterSend 使用的語言。",
+ "sections": {
+ "privacy": "隱私",
+ "support": "支援",
+ "about": "關於"
+ },
+ "crashReports": {
+ "label": "崩潰報告",
+ "description": "共享匿名崩潰資料以幫助改進AlterSend"
+ },
+ "rows": {
+ "feedback": "意見回饋",
+ "feedbackHint": "報告問題或建議功能",
+ "discord": "Discord",
+ "discordHint": "加入社區",
+ "contact": "聯絡我們",
+ "privacyPolicy": "隱私權政策",
+ "privacyPolicyHint": "AlterSend 如何處理您的數據",
+ "terms": "服務條款",
+ "termsHint": "AlterSend 使用規則",
+ "website": "網站"
+ },
+ "legal": {
+ "terms": "使用條款",
+ "privacy": "隱私權聲明",
+ "sentence": "<terms>使用條款</terms>與<privacy>隱私權聲明</privacy>。"
+ }
+}
diff --git a/packages/locales/src/mobile-font-coverage.test.ts b/packages/locales/src/mobile-font-coverage.test.ts
new file mode 100644
index 0000000..f428ab8
--- /dev/null
+++ b/packages/locales/src/mobile-font-coverage.test.ts
@@ -0,0 +1,139 @@
+import { readdirSync, readFileSync, statSync } from 'node:fs'
+import { join, relative } from 'node:path'
+import { describe, expect, it } from 'vitest'
+
+const repoRoot = new URL('../../..', import.meta.url)
+const mobileRoot = new URL('apps/mobile', repoRoot)
+const allowedRawTextFiles = new Set(['src/components/ThemedText.tsx'])
+
+function walk(dir: string): string[] {
+ return readdirSync(dir).flatMap((entry) => {
+ const path = join(dir, entry)
+ const stat = statSync(path)
+ if (stat.isDirectory()) return walk(path)
+ return /\.(ts|tsx)$/.test(entry) ? [path] : []
+ })
+}
+
+describe('mobile font coverage', () => {
+ it('routes React Native text through the locale font wrapper', () => {
+ const bypasses = walk(mobileRoot.pathname).flatMap((file) => {
+ const relativePath = relative(mobileRoot.pathname, file)
+ if (allowedRawTextFiles.has(relativePath)) return []
+
+ const source = readFileSync(file, 'utf8')
+ const match = source.match(/import\s+\{([^}]+)\}\s+from\s+['"]react-native['"]/)
+ if (!match) return []
+
+ const importedNames = match[1].split(',').map((name) => name.trim().split(/\s+as\s+/)[0])
+ const rawTextImports = importedNames.filter((name) => name === 'Text' || name === 'TextInput')
+ return rawTextImports.length > 0 ? [`${relativePath}: ${rawTextImports.join(', ')}`] : []
+ })
+
+ expect(bypasses).toEqual([])
+ })
+
+ it('refreshes the Settings language row from saved preference on focus', () => {
+ const settingsSource = readFileSync(join(mobileRoot.pathname, 'app/settings.tsx'), 'utf8')
+ const storageSource = readFileSync(
+ join(mobileRoot.pathname, 'src/lifecycle/localePreferenceStorage.ts'),
+ 'utf8'
+ )
+
+ expect(settingsSource).toContain('useFocusEffect')
+ expect(settingsSource).toContain('getSavedLocalePreference')
+ expect(settingsSource).toContain('getLocalePreferenceSnapshot')
+ expect(settingsSource).toContain('subscribeLocalePreference')
+ expect(settingsSource).toMatch(
+ /useState<LocalePreference>\(\s*getLocalePreferenceSnapshot\s*\)/
+ )
+ expect(settingsSource).toMatch(/subscribeLocalePreference\(setLocalePreference\)/)
+ expect(settingsSource).toMatch(/useFocusEffect\(\s*useCallback\(\(\) => \{/s)
+ expect(storageSource).toContain('export function getLocalePreferenceSnapshot')
+ expect(storageSource).toContain('export function subscribeLocalePreference')
+ expect(storageSource).toMatch(/listeners\.forEach\(\(listener\) => listener\(preference\)\)/)
+ })
+
+ it('keeps Settings paired row text metrics explicit for CJK fonts', () => {
+ const settingsSource = readFileSync(join(mobileRoot.pathname, 'app/settings.tsx'), 'utf8')
+
+ expect(settingsSource).toMatch(/rowLabel:\s*\{[^}]*fontSize:\s*14,[^}]*lineHeight:\s*18/s)
+ expect(settingsSource).toMatch(/rowHint:\s*\{[^}]*fontSize:\s*12,[^}]*lineHeight:\s*16/s)
+ expect(settingsSource).toMatch(/brandName:\s*\{[^}]*fontSize:\s*13,[^}]*lineHeight:\s*18/s)
+ expect(settingsSource).toMatch(/brandTagline:\s*\{[^}]*fontSize:\s*12,[^}]*lineHeight:\s*16/s)
+ })
+
+ it('returns from the language screen before changing the active i18n language', () => {
+ const languageSource = readFileSync(join(mobileRoot.pathname, 'app/language.tsx'), 'utf8')
+
+ expect(languageSource).toMatch(/const handleSelect = async \(value: string\) => \{/)
+ expect(languageSource).toContain('function scheduleLanguageChange')
+ expect(languageSource).toContain('requestIdleCallback')
+ expect(languageSource).not.toContain('InteractionManager')
+ expect(languageSource.indexOf('router.back()')).toBeLessThan(
+ languageSource.indexOf('changeI18nLanguage(resolvedLocale)')
+ )
+ })
+
+ it('renders language picker options with per-locale fonts', () => {
+ const languageSource = readFileSync(join(mobileRoot.pathname, 'app/language.tsx'), 'utf8')
+
+ expect(languageSource).toContain('getNativeFontFamilyName')
+ expect(languageSource).toContain('getLocaleFontFamily')
+ expect(languageSource).toContain('getOptionNativeNameFontFamily')
+ expect(languageSource).toContain('fontFamily: getOptionNativeNameFontFamily(option)')
+ expect(languageSource).not.toContain('BUNDLED_FONT_FAMILIES.latin.cssFamily')
+ })
+
+ it('keeps language picker row text metrics explicit for CJK option fonts', () => {
+ const languageSource = readFileSync(join(mobileRoot.pathname, 'app/language.tsx'), 'utf8')
+
+ expect(languageSource).toMatch(/label:\s*\{[^}]*fontSize:\s*15,[^}]*lineHeight:\s*20/s)
+ expect(languageSource).toMatch(/hint:\s*\{[^}]*fontSize:\s*12,[^}]*lineHeight:\s*16/s)
+ expect(languageSource).toMatch(/label:\s*\{[^}]*includeFontPadding:\s*false/s)
+ expect(languageSource).toMatch(/hint:\s*\{[^}]*includeFontPadding:\s*false/s)
+ expect(languageSource).not.toMatch(/label:\s*\{[^}]*fontWeight:\s*'500'/s)
+ })
+
+ it('does not send translated back titles to Android native stack headers', () => {
+ const layoutSource = readFileSync(join(mobileRoot.pathname, 'app/_layout.tsx'), 'utf8')
+ const flowOptionsMatch = layoutSource.match(/function getFlowScreenOptions\([\s\S]*?\n\}/)?.[0]
+
+ expect(layoutSource).toContain('import { Platform')
+ expect(flowOptionsMatch).toBeDefined()
+ expect(flowOptionsMatch).toContain("Platform.OS === 'ios'")
+ expect(flowOptionsMatch).toContain('headerBackTitle: backTitle')
+ })
+
+ it('registers CJK font weights through Expo and the runtime font loader', () => {
+ const appJson = JSON.parse(readFileSync(join(mobileRoot.pathname, 'app.json'), 'utf8')) as {
+ expo: { plugins: unknown[] }
+ }
+ const fontLoaderSource = readFileSync(
+ join(mobileRoot.pathname, 'src/theme/useAlterSendFonts.ts'),
+ 'utf8'
+ )
+
+ const expoFontPlugin = appJson.expo.plugins.find(
+ (plugin) => Array.isArray(plugin) && plugin[0] === 'expo-font'
+ )
+
+ expect(expoFontPlugin).toBeDefined()
+ expect(JSON.stringify(expoFontPlugin)).toContain('NotoSans-JP-Regular.ttf')
+ expect(JSON.stringify(expoFontPlugin)).toContain('NotoSans-JP-Bold.ttf')
+ expect(JSON.stringify(expoFontPlugin)).toContain('NotoSans-KR-Regular.ttf')
+ expect(JSON.stringify(expoFontPlugin)).toContain('NotoSans-KR-Bold.ttf')
+ expect(JSON.stringify(expoFontPlugin)).toContain('NotoSans-SC-Regular.ttf')
+ expect(JSON.stringify(expoFontPlugin)).toContain('NotoSans-SC-Bold.ttf')
+ expect(JSON.stringify(expoFontPlugin)).toContain('NotoSans-TC-Regular.ttf')
+ expect(JSON.stringify(expoFontPlugin)).toContain('NotoSans-TC-Bold.ttf')
+ expect(fontLoaderSource).toContain('NotoSans-JP-Regular.ttf')
+ expect(fontLoaderSource).toContain('NotoSans-JP-Bold.ttf')
+ expect(fontLoaderSource).toContain('NotoSans-KR-Regular.ttf')
+ expect(fontLoaderSource).toContain('NotoSans-KR-Bold.ttf')
+ expect(fontLoaderSource).toContain('NotoSans-SC-Regular.ttf')
+ expect(fontLoaderSource).toContain('NotoSans-SC-Bold.ttf')
+ expect(fontLoaderSource).toContain('NotoSans-TC-Regular.ttf')
+ expect(fontLoaderSource).toContain('NotoSans-TC-Bold.ttf')
+ })
+})
diff --git a/packages/locales/src/native-metadata.test.ts b/packages/locales/src/native-metadata.test.ts
new file mode 100644
index 0000000..6379d3e
--- /dev/null
+++ b/packages/locales/src/native-metadata.test.ts
@@ -0,0 +1,138 @@
+import { createRequire } from 'node:module'
+import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { describe, expect, it } from 'vitest'
+import { DEFAULT_LOCALE, isMultiLangEnabled, RESOURCES, SUPPORTED_LOCALES } from './index'
+
+const repoRoot = new URL('../../..', import.meta.url)
+const require = createRequire(import.meta.url)
+
+const desktopLocaleDirs = {
+ 'en-US': 'en.lproj',
+ 'en-GB': 'en_GB.lproj',
+ 'ja-JP': 'ja.lproj',
+ 'ko-KR': 'ko.lproj',
+ 'zh-CN': 'zh-Hans.lproj',
+ 'zh-TW': 'zh-Hant.lproj',
+ 'fr-FR': 'fr.lproj',
+ 'de-DE': 'de.lproj',
+ 'it-IT': 'it.lproj',
+ 'pt-BR': 'pt-BR.lproj',
+ 'es-419': 'es-419.lproj',
+ 'es-ES': 'es.lproj'
+} as const
+
+function readJson(path: URL) {
+ return JSON.parse(readFileSync(path, 'utf8')) as Record<string, unknown>
+}
+
+describe('native metadata localization', () => {
+ it('declares Expo locale metadata for every supported locale', () => {
+ const appJson = readJson(new URL('apps/mobile/app.json', repoRoot))
+ const expo = appJson.expo as {
+ ios: { infoPlist: Record<string, unknown> }
+ locales: Record<string, string>
+ }
+
+ expect(expo.ios.infoPlist.CFBundleAllowMixedLocalizations).toBe(true)
+
+ for (const locale of SUPPORTED_LOCALES) {
+ const localePath = expo.locales[locale.code]
+ expect(localePath, locale.code).toBe(`./locales/${locale.code}.json`)
+
+ const metadata = readJson(new URL(`apps/mobile/locales/${locale.code}.json`, repoRoot)) as {
+ ios: Record<string, string>
+ android: Record<string, string>
+ }
+ const permissions = RESOURCES[locale.code].native.permissions
+
+ expect(metadata.ios.CFBundleDisplayName, locale.code).toBe('AlterSend')
+ expect(metadata.ios.NSCameraUsageDescription, locale.code).toBe(permissions.camera)
+ expect(metadata.ios.NSLocalNetworkUsageDescription, locale.code).toBe(
+ permissions.localNetwork
+ )
+ expect(metadata.ios.NSPhotoLibraryUsageDescription, locale.code).toBe(permissions.photoRead)
+ expect(metadata.ios.NSPhotoLibraryAddUsageDescription, locale.code).toBe(
+ permissions.photoSave
+ )
+ expect(metadata.android.app_name, locale.code).toBe('AlterSend')
+ }
+ })
+
+ it('ships macOS InfoPlist localizations for every supported locale', () => {
+ for (const locale of SUPPORTED_LOCALES) {
+ const dir = desktopLocaleDirs[locale.code]
+ const file = new URL(`apps/desktop/build/locales/${dir}/InfoPlist.strings`, repoRoot)
+ expect(existsSync(file), locale.code).toBe(true)
+
+ const content = readFileSync(file, 'utf8')
+ expect(content, locale.code).toContain('"CFBundleDisplayName" = "AlterSend";')
+ expect(content, locale.code).toContain(
+ `"NSCameraUsageDescription" = "${RESOURCES[locale.code].native.permissions.camera}";`
+ )
+ }
+ })
+
+ it('keeps generated Expo native locale metadata English-only while release-gated', () => {
+ const createExpoConfig = require('../../../apps/mobile/app.config.cjs') as (args: {
+ config: Record<string, unknown>
+ }) => Record<string, unknown> | { expo: Record<string, unknown> }
+
+ const generatedConfig = createExpoConfig({ config: {} })
+ const generated =
+ 'expo' in generatedConfig
+ ? (generatedConfig.expo as Record<string, unknown>)
+ : (generatedConfig as Record<string, unknown>)
+
+ if (isMultiLangEnabled) {
+ expect(Object.keys((generated.locales as Record<string, string>) ?? {}).sort()).toEqual(
+ SUPPORTED_LOCALES.map((locale) => locale.code).sort()
+ )
+ return
+ }
+
+ expect(Object.keys((generated.locales as Record<string, string>) ?? {})).toEqual([
+ DEFAULT_LOCALE
+ ])
+
+ const plugins = generated.plugins as unknown[]
+ const localizationPlugin = plugins.find(
+ (plugin): plugin is [string, { supportedLocales: { ios: string[]; android: string[] } }] =>
+ Array.isArray(plugin) && plugin[0] === 'expo-localization'
+ )
+
+ expect(localizationPlugin?.[1].supportedLocales.ios).toEqual([DEFAULT_LOCALE])
+ expect(localizationPlugin?.[1].supportedLocales.android).toEqual([DEFAULT_LOCALE])
+ })
+
+ it('does not copy non-English macOS native localizations while release-gated', async () => {
+ const afterPack = require('../../../apps/desktop/scripts/afterPack.cjs') as {
+ default: (context: unknown) => Promise<void>
+ }
+ const tmp = mkdtempSync(join(tmpdir(), 'altersend-afterpack-'))
+
+ try {
+ await afterPack.default({
+ electronPlatformName: 'darwin',
+ arch: 3,
+ appOutDir: tmp,
+ packager: {
+ appInfo: {
+ productFilename: 'AlterSend'
+ }
+ }
+ })
+
+ const resourcesDir = join(tmp, 'AlterSend.app', 'Contents', 'Resources')
+ expect(existsSync(join(resourcesDir, 'en.lproj', 'InfoPlist.strings'))).toBe(true)
+
+ if (!isMultiLangEnabled) {
+ expect(existsSync(join(resourcesDir, 'ja.lproj', 'InfoPlist.strings'))).toBe(false)
+ expect(existsSync(join(resourcesDir, 'ko.lproj', 'InfoPlist.strings'))).toBe(false)
+ }
+ } finally {
+ rmSync(tmp, { recursive: true, force: true })
+ }
+ })
+})
diff --git a/packages/locales/src/release-gate-source.test.ts b/packages/locales/src/release-gate-source.test.ts
new file mode 100644
index 0000000..708e142
--- /dev/null
+++ b/packages/locales/src/release-gate-source.test.ts
@@ -0,0 +1,75 @@
+import { readFileSync } from 'node:fs'
+import { join } from 'node:path'
+import { describe, expect, it } from 'vitest'
+
+const repoRoot = new URL('../../..', import.meta.url)
+const desktopRoot = new URL('apps/desktop', repoRoot)
+const mobileRoot = new URL('apps/mobile', repoRoot)
+
+function readDesktop(path: string): string {
+ return readFileSync(join(desktopRoot.pathname, path), 'utf8')
+}
+
+function readMobile(path: string): string {
+ return readFileSync(join(mobileRoot.pathname, path), 'utf8')
+}
+
+function readMobilePackageJson() {
+ return JSON.parse(readMobile('package.json')) as {
+ scripts: Record<string, string>
+ }
+}
+
+describe('release-gated language UI wiring', () => {
+ it('forces desktop locale initialization through the active locale resolver', () => {
+ const source = readDesktop('src/renderer/main.tsx')
+
+ expect(source).toContain('resolveActiveLocalePreference')
+ expect(source).not.toContain('initI18n(resolveLocalePreference(')
+ })
+
+ it('hides the desktop language selector behind the multi-language flag', () => {
+ const source = readDesktop('src/renderer/pages/TransferPage/FooterBar.tsx')
+
+ expect(source).toContain('isMultiLangEnabled')
+ expect(source).toMatch(/\{isMultiLangEnabled && \(/)
+ })
+
+ it('forces mobile locale initialization through the active locale resolver', () => {
+ const source = readMobile('app/_layout.tsx')
+
+ expect(source).toContain('resolveActiveLocalePreference')
+ expect(source).not.toContain('initI18n(resolveLocalePreference(')
+ })
+
+ it('hides and guards the mobile language picker behind the multi-language flag', () => {
+ const settingsSource = readMobile('app/settings.tsx')
+ const languageSource = readMobile('app/language.tsx')
+
+ expect(settingsSource).toContain('isMultiLangEnabled')
+ expect(settingsSource).toMatch(/\{isMultiLangEnabled && \(/)
+ expect(languageSource).toContain('isMultiLangEnabled')
+ expect(languageSource).toMatch(/if \(!isMultiLangEnabled\)/)
+ })
+
+ it('builds shared packages before direct mobile dev commands can start Metro', () => {
+ const { scripts } = readMobilePackageJson()
+
+ expect(scripts['build:packages']).toBeDefined()
+ expect(scripts['build:packages']).toContain('npm run build -w packages/locales')
+ expect(scripts.prestart).toMatch(/build:packages.*bundle-bare/)
+ expect(scripts.preandroid).toMatch(/build:packages.*bundle:android/)
+ expect(scripts.preios).toMatch(/build:packages.*bundle:ios/)
+ })
+
+ it('routes mobile Metro workspace packages to source files', () => {
+ const metroSource = readMobile('metro.config.js')
+
+ expect(metroSource).toContain('workspaceSourceAliases')
+ expect(metroSource).toContain("'@altersend/locales'")
+ expect(metroSource).toContain('packages/locales/src/index.ts')
+ expect(metroSource).toContain("'@altersend/components'")
+ expect(metroSource).toContain('packages/components/src/index.ts')
+ expect(metroSource).toContain('resolveRequest')
+ })
+})
diff --git a/packages/locales/src/release.json b/packages/locales/src/release.json
new file mode 100644
index 0000000..2ec27b5
--- /dev/null
+++ b/packages/locales/src/release.json
@@ -0,0 +1,3 @@
+{
+ "isMultiLangEnabled": false
+}
diff --git a/packages/locales/src/resources.test.ts b/packages/locales/src/resources.test.ts
new file mode 100644
index 0000000..9aaa9f0
--- /dev/null
+++ b/packages/locales/src/resources.test.ts
@@ -0,0 +1,152 @@
+import { describe, expect, it } from 'vitest'
+import { RESOURCES, SUPPORTED_LOCALES } from './index'
+
+type JsonRecord = Record<string, unknown>
+type StringEntry = { path: string; value: string }
+
+function flattenKeys(value: unknown, prefix = ''): string[] {
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
+ return prefix ? [prefix] : []
+ }
+ return Object.entries(value as JsonRecord).flatMap(([key, child]) =>
+ flattenKeys(child, prefix ? `${prefix}.${key}` : key)
+ )
+}
+
+function collectStrings(value: unknown): string[] {
+ if (typeof value === 'string') return [value]
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return []
+ return Object.values(value as JsonRecord).flatMap((child) => collectStrings(child))
+}
+
+function flattenStringEntries(value: unknown, prefix = ''): StringEntry[] {
+ if (typeof value === 'string') return prefix ? [{ path: prefix, value }] : []
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return []
+
+ return Object.entries(value as JsonRecord).flatMap(([key, child]) =>
+ flattenStringEntries(child, prefix ? `${prefix}.${key}` : key)
+ )
+}
+
+function isPlaceholderOnly(value: string): boolean {
+ const withoutPlaceholders = value.replace(/\{\{[^}]+\}\}/g, '')
+ const withoutPunctuation = withoutPlaceholders.replace(/[\s%.,:;!?()[\]{}'"“”‘’…·\-+/#|]+/g, '')
+ return withoutPunctuation.length === 0
+}
+
+const identicalValueAllowList = new Set([
+ 'AlterSend',
+ 'Discord',
+ 'GitHub',
+ 'GitHub Issues',
+ 'QR',
+ 'OK'
+])
+
+const identicalKeyAllowList = new Set([
+ 'common.files.count_one',
+ 'common.labels.desktop',
+ 'settings.rows.feedback',
+ 'feedback.title'
+])
+
+function canMatchEnglishSource(key: string, value: string): boolean {
+ return (
+ identicalValueAllowList.has(value.trim()) ||
+ identicalKeyAllowList.has(key) ||
+ isPlaceholderOnly(value)
+ )
+}
+
+describe('translation resources', () => {
+ it('has resources for every supported locale', () => {
+ expect(Object.keys(RESOURCES).sort()).toEqual(
+ SUPPORTED_LOCALES.map((locale) => locale.code).sort()
+ )
+ })
+
+ it('keeps every locale namespace and key aligned with en-US', () => {
+ const source = RESOURCES['en-US']
+ const expectedNamespaces = Object.keys(source).sort() as Array<keyof typeof source>
+
+ for (const locale of SUPPORTED_LOCALES) {
+ const localeResources = RESOURCES[locale.code]
+ expect(Object.keys(localeResources).sort(), locale.code).toEqual(expectedNamespaces)
+
+ for (const namespace of expectedNamespaces) {
+ expect(
+ flattenKeys(localeResources[namespace]).sort(),
+ `${locale.code}/${namespace}`
+ ).toEqual(flattenKeys(source[namespace]).sort())
+ }
+ }
+ })
+
+ it('does not ship empty translated strings', () => {
+ for (const locale of SUPPORTED_LOCALES) {
+ const localeResources = RESOURCES[locale.code]
+ const namespaces = Object.keys(localeResources) as Array<keyof typeof localeResources>
+ for (const namespace of namespaces) {
+ const emptyStrings = collectStrings(localeResources[namespace]).filter(
+ (value) => value.trim().length === 0
+ )
+ expect(emptyStrings, `${locale.code}/${namespace}`).toEqual([])
+ }
+ }
+ })
+
+ it('does not leave en-US strings in non-English locales', () => {
+ const source = RESOURCES['en-US']
+ const namespaces = Object.keys(source) as Array<keyof typeof source>
+ const checkedLocales = SUPPORTED_LOCALES.filter(
+ (locale) => locale.code !== 'en-US' && locale.code !== 'en-GB'
+ )
+
+ for (const locale of checkedLocales) {
+ const identicalEntries: string[] = []
+
+ for (const namespace of namespaces) {
+ const sourceByPath = new Map(
+ flattenStringEntries(source[namespace]).map((entry) => [entry.path, entry.value])
+ )
+
+ for (const entry of flattenStringEntries(RESOURCES[locale.code][namespace])) {
+ const sourceValue = sourceByPath.get(entry.path)
+ const key = `${String(namespace)}.${entry.path}`
+ if (
+ sourceValue &&
+ entry.value === sourceValue &&
+ !canMatchEnglishSource(key, sourceValue)
+ ) {
+ identicalEntries.push(`${key}: ${entry.value}`)
+ }
+ }
+ }
+
+ expect(identicalEntries, locale.code).toEqual([])
+ }
+ })
+
+ it('includes plural keys for file counts in every locale', () => {
+ for (const locale of SUPPORTED_LOCALES) {
+ expect(RESOURCES[locale.code].common.files.count_one, locale.code).toBeTruthy()
+ expect(RESOURCES[locale.code].common.files.count_other, locale.code).toBeTruthy()
+ expect(
+ RESOURCES[locale.code].receive.page.incomingTransfer.description_one,
+ locale.code
+ ).toBeTruthy()
+ expect(
+ RESOURCES[locale.code].receive.page.incomingTransfer.description_other,
+ locale.code
+ ).toBeTruthy()
+ expect(RESOURCES[locale.code].receive.summary.receivedCount_one, locale.code).toBeTruthy()
+ expect(RESOURCES[locale.code].receive.summary.receivedCount_other, locale.code).toBeTruthy()
+ expect(RESOURCES[locale.code].receive.summary.filesSaved_one, locale.code).toBeTruthy()
+ expect(RESOURCES[locale.code].receive.summary.filesSaved_other, locale.code).toBeTruthy()
+ expect(RESOURCES[locale.code].send.actions.sendFiles_one, locale.code).toBeTruthy()
+ expect(RESOURCES[locale.code].send.actions.sendFiles_other, locale.code).toBeTruthy()
+ expect(RESOURCES[locale.code].send.preparing.uploadedCount_one, locale.code).toBeTruthy()
+ expect(RESOURCES[locale.code].send.preparing.uploadedCount_other, locale.code).toBeTruthy()
+ }
+ })
+})
diff --git a/packages/locales/src/resources.ts b/packages/locales/src/resources.ts
new file mode 100644
index 0000000..0123b82
--- /dev/null
+++ b/packages/locales/src/resources.ts
@@ -0,0 +1,29 @@
+import type { Resources } from './i18n-augmentation'
+import type { SupportedLocaleCode } from './locale'
+import en_US from './locales/en-US'
+import ko_KR from './locales/ko-KR'
+import zh_CN from './locales/zh-CN'
+import zh_TW from './locales/zh-TW'
+import fr_FR from './locales/fr-FR'
+import de_DE from './locales/de-DE'
+import it_IT from './locales/it-IT'
+import pt_BR from './locales/pt-BR'
+import es_419 from './locales/es-419'
+import es_ES from './locales/es-ES'
+import en_GB from './locales/en-GB'
+import ja_JP from './locales/ja-JP'
+
+export const RESOURCES: Record<SupportedLocaleCode, Resources> = {
+ 'en-US': en_US,
+ 'ko-KR': ko_KR,
+ 'zh-CN': zh_CN,
+ 'zh-TW': zh_TW,
+ 'fr-FR': fr_FR,
+ 'de-DE': de_DE,
+ 'it-IT': it_IT,
+ 'pt-BR': pt_BR,
+ 'es-419': es_419,
+ 'es-ES': es_ES,
+ 'en-GB': en_GB,
+ 'ja-JP': ja_JP
+}
diff --git a/packages/locales/src/source-copy.test.ts b/packages/locales/src/source-copy.test.ts
new file mode 100644
index 0000000..82f0c23
--- /dev/null
+++ b/packages/locales/src/source-copy.test.ts
@@ -0,0 +1,64 @@
+import { readFileSync } from 'node:fs'
+import { describe, expect, it } from 'vitest'
+
+const repoRoot = new URL('../../..', import.meta.url)
+
+const hardcodedCopyChecks = [
+ {
+ file: 'apps/desktop/src/renderer/pages/TransferPage/index.tsx',
+ snippets: [
+ 'Leaving will end your active share session. Continue?',
+ 'Leaving will end your active receive session. Continue?',
+ 'Transfer mode'
+ ]
+ },
+ {
+ file: 'apps/desktop/src/renderer/components/QRCode.tsx',
+ snippets: ['Generating…', 'QR code for connection key']
+ },
+ {
+ file: 'packages/components/src/components/SendFileListRow/SendFileListRow.tsx',
+ snippets: ['Remove ${name}']
+ },
+ {
+ file: 'packages/components/src/components/PeerListCard/PeerListCard.tsx',
+ snippets: ['Devices', '1 connected', '${activeCount} connected']
+ },
+ {
+ file: 'apps/mobile/src/transfer/receive/views/ErrorPanel.tsx',
+ snippets: ['Transfer issue']
+ },
+ {
+ file: 'apps/desktop/src/renderer/pages/TransferPage/FooterBar.tsx',
+ snippets: ["{' and '}", "{'.'}"]
+ },
+ {
+ file: 'apps/desktop/src/renderer/pages/ReceivePage/ReceiveJoinView.tsx',
+ snippets: ['error.message', 's.errorMessage', 'PEER_UNREACHABLE_ERROR_CODE']
+ },
+ {
+ file: 'apps/desktop/src/renderer/pages/ReceivePage/WebcamScanView.tsx',
+ snippets: ['error.message']
+ },
+ {
+ file: 'apps/mobile/app/(tabs)/receive/index.tsx',
+ snippets: ['s.errorMessage', 'PEER_UNREACHABLE_ERROR_CODE']
+ },
+ {
+ file: 'apps/mobile/app/receive/incoming.tsx',
+ snippets: ['s.errorMessage', 'PEER_UNREACHABLE_ERROR_CODE']
+ }
+]
+
+describe('user-facing source copy', () => {
+ it('keeps audited UI copy in translation catalogs instead of source literals', () => {
+ const remaining = hardcodedCopyChecks.flatMap(({ file, snippets }) => {
+ const source = readFileSync(new URL(file, repoRoot), 'utf8')
+ return snippets
+ .filter((snippet) => source.includes(snippet))
+ .map((snippet) => `${file}: ${snippet}`)
+ })
+
+ expect(remaining).toEqual([])
+ })
+})
diff --git a/packages/locales/src/utils.test.ts b/packages/locales/src/utils.test.ts
deleted file mode 100644
index 6730da6..0000000
--- a/packages/locales/src/utils.test.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { describe, expect, it } from 'vitest'
-import { PICKABLE_LANGUAGES } from './languages'
-import { getInitialLocale, resolveSupportedLocale } from './utils'
-
-describe('resolveSupportedLocale', () => {
- it('returns an exact production-ready match', () => {
- expect(resolveSupportedLocale('en-US')).toBe('en-US')
- })
-
- it('matches case-insensitively', () => {
- expect(resolveSupportedLocale('EN-US')).toBe('en-US')
- })
-
- it('matches a regional tag by its primary subtag', () => {
- expect(resolveSupportedLocale('en')).toBe('en-US')
- expect(resolveSupportedLocale('en-GB')).toBe('en-US')
- })
-
- it('falls back to English for not-yet-ready languages', () => {
- // pt-BR is registered but not production-ready, so it must not be selected.
- expect(resolveSupportedLocale('pt-BR')).toBe('en-US')
- expect(resolveSupportedLocale('pt-PT')).toBe('en-US')
- })
-
- it('falls back to English for unsupported or empty input', () => {
- expect(resolveSupportedLocale('de-DE')).toBe('en-US')
- expect(resolveSupportedLocale('')).toBe('en-US')
- expect(resolveSupportedLocale(null)).toBe('en-US')
- expect(resolveSupportedLocale(undefined)).toBe('en-US')
- })
-})
-
-describe('getInitialLocale', () => {
- it('always resolves to a production-ready locale', () => {
- const codes = PICKABLE_LANGUAGES.map((l) => l.code)
- expect(codes).toContain(getInitialLocale())
- })
-})
diff --git a/packages/locales/src/utils.ts b/packages/locales/src/utils.ts
deleted file mode 100644
index 87f3746..0000000
--- a/packages/locales/src/utils.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-import { DEFAULT_LANGUAGE, PICKABLE_LANGUAGES, type LocalePreference } from './languages'
-
-/**
- * Best-effort detection of the user's preferred UI language as a raw BCP-47
- * tag. Prefers `navigator.languages` (the ordered UI-language preference on
- * web/Electron) and falls back to the `Intl` resolved locale (a regional
- * formatting locale, and unreliable on Hermes — mobile passes the device tag
- * from `expo-localization` to {@link resolveSupportedLocale} instead).
- */
-function getSystemPreferredLocale(): string {
- if (typeof navigator !== 'undefined') {
- const fromNavigator = navigator.languages?.[0] ?? navigator.language
- if (fromNavigator) return fromNavigator
- }
- if (typeof Intl !== 'undefined' && typeof Intl.DateTimeFormat === 'function') {
- const resolved = Intl.DateTimeFormat().resolvedOptions().locale
- if (resolved) return resolved
- }
- return DEFAULT_LANGUAGE
-}
-
-/**
- * Maps any BCP-47 tag to the nearest production-ready language code, falling
- * back to {@link DEFAULT_LANGUAGE}. This is the single guard that keeps the
- * store/i18next from ever holding an unsupported or not-yet-ready locale
- * (e.g. `en-US` → `en`, `pt-PT` → `en` while pt-BR is not ready).
- */
-export function resolveSupportedLocale(tag: string | null | undefined): string {
- const normalized = tag?.trim().toLowerCase()
- if (!normalized) return DEFAULT_LANGUAGE
-
- const exact = PICKABLE_LANGUAGES.find((l) => l.code.toLowerCase() === normalized)
- if (exact) return exact.code
-
- const base = normalized.split('-')[0]
- if (base) {
- const byBase = PICKABLE_LANGUAGES.find((l) => l.code.toLowerCase().split('-')[0] === base)
- if (byBase) return byBase.code
- }
-
- return DEFAULT_LANGUAGE
-}
-
-import i18nextInstance from './config'
-
-/** Production-ready locale to boot with, derived from system preference or user choice. */
-export function getInitialLocale(preference: LocalePreference | 'system' = 'system'): string {
- if (preference === 'system') return resolveSupportedLocale(getSystemPreferredLocale())
- return resolveSupportedLocale(preference)
-}
-
-/**
- * Switches the active language. The requested tag is normalized to a
- * production-ready code (so a stale/persisted/unsupported value can never put
- * the app in an undefined locale state) and i18next is told to change language.
- */
-export const changeLocale = async (locale: string): Promise<void> => {
- const resolved = resolveSupportedLocale(locale)
- try {
- await i18nextInstance.changeLanguage(resolved)
- } catch (error) {
- console.error('Failed to change language:', error)
- throw error
- }
-}
diff --git a/scripts/check-tokens.sh b/scripts/check-tokens.sh
index 2f646cf..7da2e34 100755
--- a/scripts/check-tokens.sh
+++ b/scripts/check-tokens.sh
@@ -14,7 +14,7 @@ matches=$(grep -rEn "$PATTERN" apps packages/components \
--include='*.css' \
2>/dev/null \
| grep -vE '(node_modules|/dist/|\.bundle\.js)' \
- | grep -vE '(packages/components/src/theme/tokens\.json|packages/components/src/theme/tokens\.raw\.ts|packages/components/src/theme/tokens\.css\.ts|packages/components/src/theme/themes/|packages/components/src/theme/tailwind-theme\.css|packages/components/scripts/generate-tokens\.mjs|packages/components/src/theme/fileTypeColors\.ts|packages/components/src/theme/withAlpha\.ts)' \
+ | grep -vE '(packages/components/src/theme/tokens\.json|packages/components/src/theme/tokens\.raw\.ts|packages/components/src/theme/tokens\.css(\.native)?\.ts|packages/components/src/theme/themes/|packages/components/src/theme/tailwind-theme\.css|packages/components/scripts/generate-tokens\.mjs|packages/components/src/theme/fileTypeColors\.ts|packages/components/src/theme/withAlpha\.ts)' \
| grep -vE '(transparent|currentColor|inherit|absoluteFillObject)' \
| grep -vE 'packages/components/src/components/SendFileListRow/styles\.ts:[0-9]+:\s+thumb(Image|Video|Pdf|Audio|Archive|App|Code|Generic):' \
|| true)