forked from akai/readest
Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3174e341a3 | |||
| 298d4872a0 | |||
| b679817fce | |||
| b9a2b10fac | |||
| a9e33ca50a | |||
| 09d1e0c040 | |||
| 8b10e7fb17 | |||
| a2d17e6a79 | |||
| 7e62516b5d | |||
| d53f3b42e2 | |||
| d682fcbb44 | |||
| b3fe33221d | |||
| fbfd7fd6c6 | |||
| 531dbe5f16 | |||
| 70b94d8986 | |||
| 21795e5cd3 | |||
| 52242d6886 | |||
| f361698e05 | |||
| 9595aa56e0 | |||
| caa0d719c5 | |||
| 45bd355981 | |||
| 52ac74bbad | |||
| 6a44f609ba | |||
| ca5c860594 | |||
| 80cab8e56d | |||
| 888f4afde9 | |||
| 05afaab5fd | |||
| ff962a1f02 | |||
| 62df631dd1 | |||
| c9647276b1 | |||
| 9ecb9b24d2 | |||
| f0ab05bbde | |||
| f1a08565e3 | |||
| b8ddb5475e | |||
| 74401fc1bb | |||
| 29df8522fa | |||
| 9f958a44e2 | |||
| 0e516f6e56 | |||
| b71b246601 | |||
| 94843902ac | |||
| f67930feb1 | |||
| 5e048ddab1 | |||
| e68dedd10d | |||
| d22b8bec1e | |||
| e9c5ebb696 | |||
| 956c71cd7b | |||
| b4207bd742 | |||
| ec26ef4f29 | |||
| b872868136 | |||
| 797fe9c604 | |||
| 8ed9290659 | |||
| 8e6451863f | |||
| c688612888 | |||
| b3333c384c | |||
| 84349ab12d | |||
| c4e3315642 | |||
| bbfc82e50d | |||
| 966f5e2acd | |||
| 45e5f0fa61 | |||
| 3d4d1482aa | |||
| 5f897f648f | |||
| 26fec924fc | |||
| af9cf33936 | |||
| 52df478f21 | |||
| 97555a7e88 | |||
| c7e82825f5 | |||
| bb82ab6c8a | |||
| e2faa9ad75 | |||
| f310305834 | |||
| 5a072e7d1f | |||
| 64675820f1 | |||
| 1e942a23b4 | |||
| a92c357982 | |||
| 1ebf5e7b52 |
@@ -124,11 +124,6 @@ jobs:
|
||||
release: linux
|
||||
arch: aarch64
|
||||
rust_target: aarch64-unknown-linux-gnu
|
||||
- os: ubuntu-22.04-arm
|
||||
release: linux
|
||||
arch: armhf
|
||||
rust_target: arm-unknown-linux-gnueabihf
|
||||
args: '--target arm-unknown-linux-gnueabihf --bundles deb'
|
||||
- os: macos-latest
|
||||
release: macos
|
||||
arch: aarch64
|
||||
@@ -171,7 +166,7 @@ jobs:
|
||||
|
||||
- name: setup Android SDK (for Android build only)
|
||||
if: matrix.config.release == 'android'
|
||||
uses: android-actions/setup-android@v3
|
||||
uses: android-actions/setup-android@v4
|
||||
|
||||
- name: install NDK (for Android build only)
|
||||
if: matrix.config.release == 'android'
|
||||
@@ -208,6 +203,7 @@ jobs:
|
||||
echo 'PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig' >> $GITHUB_ENV
|
||||
echo 'PKG_CONFIG_SYSROOT_DIR=/usr/arm-linux-gnueabihf' >> $GITHUB_ENV
|
||||
echo 'CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc' >> $GITHUB_ENV
|
||||
echo 'CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS=--cfg=io_uring_skip_arch_check' >> $GITHUB_ENV
|
||||
|
||||
- name: create .env.local file for Next.js
|
||||
run: |
|
||||
|
||||
@@ -41,6 +41,7 @@ next-env.d.ts
|
||||
target
|
||||
|
||||
fastlane/report.xml
|
||||
fastlane/metadata/android/en-US/changelogs
|
||||
|
||||
*.koplugin.zip
|
||||
|
||||
|
||||
@@ -16,3 +16,6 @@
|
||||
[submodule "apps/readest-app/.claude/skills/gstack"]
|
||||
path = apps/readest-app/.claude/skills/gstack
|
||||
url = https://github.com/garrytan/gstack.git
|
||||
[submodule "packages/qcms"]
|
||||
path = packages/qcms
|
||||
url = https://github.com/mozilla/pdf.js.qcms.git
|
||||
|
||||
Regular → Executable
Generated
+427
-167
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,9 @@ members = [
|
||||
"packages/tauri/crates/tauri",
|
||||
"packages/tauri-plugins/plugins/fs"
|
||||
]
|
||||
exclude = [
|
||||
"packages/qcms"
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
[workspace.dependencies]
|
||||
@@ -21,6 +24,9 @@ glob = "0.3"
|
||||
zbus = "5.9"
|
||||
dunce = "1"
|
||||
url = "2"
|
||||
tar = "0.4.45"
|
||||
nix = "0.20.2"
|
||||
glib = "0.20.0"
|
||||
|
||||
[workspace.package]
|
||||
authors = ["Bilingify LLC"]
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Readest does not currently maintain separate release channels. Security updates are provided only for the latest release series.
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| 0.10.x | :white_check_mark: |
|
||||
| < 0.10 | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please report suspected vulnerabilities privately. Do not open a public GitHub
|
||||
issue or discussion for security-sensitive reports.
|
||||
|
||||
Use GitHub's private vulnerability reporting for this repository:
|
||||
|
||||
<https://github.com/readest/readest/security/advisories/new>
|
||||
|
||||
When submitting a report, include:
|
||||
|
||||
- A clear description of the issue and the affected component
|
||||
- Steps to reproduce, proof of concept, or a minimal test case
|
||||
- The versions, platforms, or environments you tested
|
||||
- Any suggested remediation or mitigating details, if available
|
||||
|
||||
What to expect after you report:
|
||||
|
||||
- We will aim to acknowledge receipt within 3 business days.
|
||||
- We may contact you for additional details, reproduction steps, or validation.
|
||||
- If the report is accepted, we will work on a fix and coordinate disclosure.
|
||||
- If the report is declined, we will explain why, for example if the behavior is
|
||||
expected, unsupported, or not reproducible.
|
||||
|
||||
Please keep vulnerability details private until a fix is available and the
|
||||
maintainers have approved disclosure.
|
||||
@@ -16,6 +16,9 @@
|
||||
- `src/app/reader/components/FoliateViewer.tsx` - Reader view orchestration
|
||||
- `src/app/reader/components/annotator/Annotator.tsx` - Annotation lifecycle
|
||||
|
||||
## Feature Notes
|
||||
- [D-pad Navigation](dpad-navigation.md) — Android TV remote / keyboard arrow navigation design, key files, and pitfalls
|
||||
|
||||
## Architecture Notes
|
||||
- foliate-js is a git submodule at `packages/foliate-js/`
|
||||
- Multiview paginator: loads adjacent sections in background, multiple View/Overlayer instances per book
|
||||
@@ -24,3 +27,8 @@
|
||||
- TTS uses independent section tracking (`#ttsSectionIndex`) decoupled from view
|
||||
- Safe area insets flow: Native plugin -> useSafeAreaInsets hook -> component styles
|
||||
- Dropdown menus use `DropdownContext` (not blur-based) for screen reader compat
|
||||
|
||||
## Workflow
|
||||
- [Always rebase before PR](feedback_pr_rebase.md) — rebase onto origin/main before creating PRs
|
||||
- [New branch per PR](feedback_pr_new_branch.md) — always create a fresh branch from main for each new PR/issue
|
||||
- [Upgrade gstack locally](feedback_gstack_upgrade.md) — always upgrade from the project's .claude/skills/gstack, not global
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
name: D-pad Navigation Design
|
||||
description: Android TV / Bluetooth remote D-pad navigation architecture, key files, and pitfalls encountered during implementation
|
||||
type: project
|
||||
---
|
||||
|
||||
## D-pad Navigation Architecture
|
||||
|
||||
D-pad support enables Bluetooth remote controller navigation on Android TV (and keyboard arrow navigation on desktop).
|
||||
|
||||
### Key Files
|
||||
|
||||
- `src/app/reader/hooks/useSpatialNavigation.ts` — Reader toolbar D-pad navigation. Left/Right navigates between buttons, Up/Down moves between header↔footer. Auto-focuses first button on show. Uses focus-probe technique for visibility detection.
|
||||
- `src/app/library/hooks/useSpatialNavigation.ts` — Library grid D-pad navigation. Arrow keys move between BookshelfItem elements. ArrowDown from outside bookshelf (e.g. header) enters the grid via window-level listener.
|
||||
- `src/helpers/shortcuts.ts` — `onToggleToolbar` (Enter key) toggles reader toolbar visibility.
|
||||
- `src/app/reader/hooks/useBookShortcuts.ts` — `toggleToolbar` handler shows/hides header+footer bars. Skips when a `<button>` is focused (lets native click fire).
|
||||
- `src/__tests__/hooks/useSpatialNavigation.test.tsx` — Unit tests for reader toolbar navigation.
|
||||
|
||||
### Design Decisions
|
||||
|
||||
- **No third-party library**: Tried `@noriginmedia/norigin-spatial-navigation` but it failed due to init timing issues (React child effects run before parent effects) and conflicts with the existing `useShortcuts` system. Custom solution is simpler and more reliable.
|
||||
- **Two `useSpatialNavigation` hooks**: Same name in different directories — library version handles grid navigation, reader version handles toolbar button navigation. Different navigation patterns but same concept.
|
||||
- **Platform-agnostic hooks**: Both `useSpatialNavigation` hooks work on all platforms, not just Android.
|
||||
- **Focus-probe for visibility**: `offsetParent` is unreliable for detecting visible buttons (returns null inside `position: fixed` containers on mobile). Instead, try `btn.focus()` and check if `document.activeElement === btn` — this correctly handles all hiding methods (display:none, visibility:hidden, fixed positioning).
|
||||
|
||||
### Pitfalls
|
||||
|
||||
1. **WebView spatial navigation conflict**: Android WebView has built-in spatial navigation that intercepts D-pad arrow keys and moves DOM focus between `tabIndex>=0` elements. Added `tabIndex={-1}` to non-interactive overlay elements (HeaderBar trigger, ProgressBar, FooterBar trigger, SectionInfo) to prevent focus theft.
|
||||
|
||||
2. **`eventDispatcher.dispatchSync` short-circuits**: When multiple handlers are registered for `native-key-down`, the first handler returning `true` stops propagation. The FooterBar's Back handler fires before the Reader's. Both must independently call `blur()` — can't rely on the Reader's handler running.
|
||||
|
||||
3. **Must blur on toolbar dismiss**: When Back/Escape dismisses the toolbar, the focused button must be blurred. Otherwise `document.activeElement` remains a hidden button, and `toggleToolbar` skips Enter when `activeElement.tagName === 'BUTTON'`. Blur is called in FooterBar's handleKeyDown (for Back and Escape) and in Reader's handleKeyDown.
|
||||
|
||||
4. **Arrow key trapping must use `stopPropagation`**: Without it, arrow keys bubble to `window` where `useShortcuts` handles them as page turns. The toolbar keydown handler on the container div calls `e.stopPropagation()` + `e.preventDefault()` to prevent this.
|
||||
|
||||
5. **Library grid needs window-level listener**: The bookshelf container keydown handler only fires when focus is inside it. A separate `window` keydown listener handles ArrowDown from the header into the grid (when focus is outside the container).
|
||||
|
||||
6. **Auto-focus race on toolbar show**: Both header and footer bars auto-focus their first button when `isVisible` becomes true simultaneously. The last effect to run wins. This is acceptable — user can navigate between them with Up/Down.
|
||||
|
||||
7. **`offsetParent` null in fixed containers**: On mobile, `.footer-bar` uses `position: fixed`. All child buttons have `offsetParent === null`, making `offsetParent`-based visibility checks useless. The focus-probe approach (try focus, check activeElement) is the reliable alternative.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
name: gstack upgrade location
|
||||
description: Always upgrade gstack from the project directory (.claude/skills/gstack), not from a global install
|
||||
type: feedback
|
||||
---
|
||||
|
||||
When upgrading gstack, always run the upgrade from the current project's `.claude/skills/gstack` directory (local-git install), not from a global install path.
|
||||
|
||||
**Why:** The project uses a local-git gstack install at `apps/readest-app/.claude/skills/gstack`. Previous mistakes upgraded a global copy while the project's local copy stayed outdated.
|
||||
|
||||
**How to apply:** When `/gstack-upgrade` is invoked, ensure the `cd` and `git reset --hard origin/main && ./setup` happen inside the project's `.claude/skills/gstack` directory.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
name: Always use a new branch for new PRs
|
||||
description: Each new PR/issue should get its own fresh branch from main, never reuse an existing feature branch
|
||||
type: feedback
|
||||
---
|
||||
|
||||
Always create a new branch from main for each new PR or issue. Never reuse an existing feature branch for unrelated work.
|
||||
|
||||
**Why:** The user corrected this when a storage fix was committed on the `feat/full-sync-annotations` branch instead of a dedicated branch. Mixing unrelated changes on the same branch makes PRs harder to review and manage.
|
||||
|
||||
**How to apply:** Before committing fixes, create a new branch like `fix/<topic>` from `origin/main`. Only reuse a branch if the work is directly related to that branch's existing purpose.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
name: Always rebase before PR
|
||||
description: Rebase to origin/main before creating pull requests
|
||||
type: feedback
|
||||
---
|
||||
|
||||
Always rebase the branch onto origin/main before creating a pull request.
|
||||
|
||||
**Why:** The user wants PRs to be up-to-date with main to avoid merge conflicts and keep a clean history.
|
||||
|
||||
**How to apply:** Before running `gh pr create`, always run `git fetch origin && git rebase origin/main` first. If there are conflicts, resolve them before proceeding.
|
||||
Submodule apps/readest-app/.claude/skills/gstack updated: 1f4b6fd7a2...6169273d16
@@ -8,6 +8,7 @@
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
.test-sandbox-node/
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
|
||||
@@ -22,7 +22,7 @@ pnpm tauri:dev:test # Start Tauri app with webdriver
|
||||
pnpm test:tauri # Run Tauri integration tests
|
||||
|
||||
# Linting & Formatting
|
||||
pnpm lint # ESLint
|
||||
pnpm lint # Biome (linter) + tsgo (type check)
|
||||
pnpm format # Prettier (runs from monorepo root)
|
||||
pnpm format:check # Check formatting without writing
|
||||
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.4.9/schema.json",
|
||||
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
|
||||
"files": { "ignoreUnknown": true },
|
||||
"formatter": { "enabled": false },
|
||||
"assist": { "enabled": false },
|
||||
"css": { "linter": { "enabled": false } },
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"includes": [
|
||||
"**",
|
||||
"!.next/**",
|
||||
"!.open-next/**",
|
||||
"!.wrangler/**",
|
||||
"!.claude/**",
|
||||
"!dist/**",
|
||||
"!out/**",
|
||||
"!build/**",
|
||||
"!public/**",
|
||||
"!src-tauri/**",
|
||||
"!next-env.d.ts",
|
||||
"!i18next-scanner.config.cjs"
|
||||
],
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"a11y": {
|
||||
"recommended": true,
|
||||
"useKeyWithClickEvents": "off",
|
||||
"useKeyWithMouseEvents": "off",
|
||||
"noSvgWithoutTitle": "off",
|
||||
"noLabelWithoutControl": "off",
|
||||
"useSemanticElements": "off",
|
||||
"noAriaHiddenOnFocusable": "off",
|
||||
"noInteractiveElementToNoninteractiveRole": "off",
|
||||
"noNoninteractiveElementToInteractiveRole": "off",
|
||||
"noNoninteractiveElementInteractions": "off",
|
||||
"noStaticElementInteractions": "off",
|
||||
"noNoninteractiveTabindex": "off",
|
||||
"useButtonType": "off",
|
||||
"useAriaPropsSupportedByRole": "off",
|
||||
"useFocusableInteractive": "off",
|
||||
"noAutofocus": "off"
|
||||
},
|
||||
"complexity": {
|
||||
"noForEach": "off",
|
||||
"noStaticOnlyClass": "off",
|
||||
"noUselessSwitchCase": "off",
|
||||
"noUselessFragments": "off",
|
||||
"noUselessCatch": "off",
|
||||
"useLiteralKeys": "off",
|
||||
"useOptionalChain": "off",
|
||||
"noThisInStatic": "off",
|
||||
"useArrowFunction": "off",
|
||||
"noUselessEscapeInRegex": "off"
|
||||
},
|
||||
"correctness": {
|
||||
"noUnusedVariables": "warn",
|
||||
"noUnusedImports": "error",
|
||||
"useExhaustiveDependencies": "off",
|
||||
"useHookAtTopLevel": "error",
|
||||
"useJsxKeyInIterable": "error",
|
||||
"noChildrenProp": "error",
|
||||
"noNextAsyncClientComponent": "warn",
|
||||
"noSwitchDeclarations": "off",
|
||||
"noUndeclaredVariables": "off",
|
||||
"noEmptyCharacterClassInRegex": "off",
|
||||
"useParseIntRadix": "off",
|
||||
"noEmptyPattern": "off"
|
||||
},
|
||||
"nursery": {
|
||||
"noBeforeInteractiveScriptOutsideDocument": "warn",
|
||||
"noDuplicateEnumValues": "error",
|
||||
"noSyncScripts": "warn",
|
||||
"useInlineScriptId": "error"
|
||||
},
|
||||
"performance": {
|
||||
"noImgElement": "off",
|
||||
"noUnwantedPolyfillio": "warn",
|
||||
"useGoogleFontPreconnect": "warn"
|
||||
},
|
||||
"security": {
|
||||
"noBlankTarget": "off",
|
||||
"noDangerouslySetInnerHtmlWithChildren": "off",
|
||||
"noDangerouslySetInnerHtml": "off"
|
||||
},
|
||||
"style": {
|
||||
"noNonNullAssertion": "off",
|
||||
"useImportType": "off",
|
||||
"noParameterAssign": "off",
|
||||
"useDefaultParameterLast": "off",
|
||||
"noUselessElse": "off",
|
||||
"noHeadElement": "warn",
|
||||
"noCommonJs": "off",
|
||||
"useFilenamingConvention": "off",
|
||||
"useNamingConvention": "off",
|
||||
"noUnusedTemplateLiteral": "off",
|
||||
"useTemplate": "off",
|
||||
"useExponentiationOperator": "off",
|
||||
"useNodejsImportProtocol": "off"
|
||||
},
|
||||
"suspicious": {
|
||||
"noExplicitAny": "error",
|
||||
"noArrayIndexKey": "off",
|
||||
"noAssignInExpressions": "off",
|
||||
"noDoubleEquals": "off",
|
||||
"noDocumentImportInPage": "error",
|
||||
"noHeadImportInDocument": "error",
|
||||
"useGoogleFontDisplay": "warn",
|
||||
"noCommentText": "error",
|
||||
"noDuplicateJsxProps": "error",
|
||||
"noAsyncPromiseExecutor": "off",
|
||||
"noImplicitAnyLet": "off",
|
||||
"noControlCharactersInRegex": "off",
|
||||
"noEmptyBlockStatements": "off",
|
||||
"useIterableCallbackReturn": "off",
|
||||
"noGlobalIsNan": "off",
|
||||
"noConfusingVoidType": "off",
|
||||
"noConstEnum": "off"
|
||||
}
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"globals": ["React"]
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
import { defineConfig, globalIgnores } from 'eslint/config';
|
||||
import next from 'eslint-config-next';
|
||||
import nextVitals from 'eslint-config-next/core-web-vitals';
|
||||
import tseslint from 'eslint-config-next/typescript';
|
||||
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
||||
|
||||
const eslintConfig = defineConfig([
|
||||
...tseslint,
|
||||
...next,
|
||||
...nextVitals,
|
||||
{
|
||||
rules: {
|
||||
...jsxA11y.configs.recommended.rules,
|
||||
'@next/next/no-img-element': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
caughtErrorsIgnorePattern: '^_',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
globalIgnores([
|
||||
'node_modules/**',
|
||||
'.next/**',
|
||||
'.open-next/**',
|
||||
'.wrangler/**',
|
||||
'.claude/**',
|
||||
'dist/**',
|
||||
'out/**',
|
||||
'build/**',
|
||||
'public/**',
|
||||
'src-tauri/**',
|
||||
'next-env.d.ts',
|
||||
'i18next-scanner.config.cjs',
|
||||
]),
|
||||
]);
|
||||
|
||||
export default eslintConfig;
|
||||
@@ -35,6 +35,8 @@ const options = {
|
||||
'si',
|
||||
'zh-CN',
|
||||
'zh-TW',
|
||||
'ro',
|
||||
'hu',
|
||||
],
|
||||
ns: ['translation'],
|
||||
defaultNs: 'translation',
|
||||
|
||||
@@ -31,12 +31,14 @@ const nextConfig = {
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
nunjucks: 'nunjucks/browser/nunjucks.js',
|
||||
...(appPlatform !== 'web' ? { '@tursodatabase/database-wasm': false } : {}),
|
||||
};
|
||||
return config;
|
||||
},
|
||||
turbopack: {
|
||||
resolveAlias: {
|
||||
nunjucks: 'nunjucks/browser/nunjucks.js',
|
||||
...(appPlatform !== 'web' ? { '@tursodatabase/database-wasm': './src/utils/stub.ts' } : {}),
|
||||
},
|
||||
},
|
||||
transpilePackages: [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@readest/readest-app",
|
||||
"version": "0.10.1",
|
||||
"version": "0.10.4",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -15,8 +15,9 @@
|
||||
"start-web:vinext": "dotenv -e .env.web -- vinext start",
|
||||
"build-tauri": "dotenv -e .env.tauri -- next build",
|
||||
"i18n:extract": "i18next-scanner --config i18next-scanner.config.cjs",
|
||||
"lint": "tsgo --noEmit && eslint --cache .",
|
||||
"lint": "tsgo --noEmit && biome check .",
|
||||
"test": "dotenv -e .env -e .env.test.local vitest",
|
||||
"test:coverage": "dotenv -e .env -e .env.test.local -- vitest run --coverage",
|
||||
"test:browser": "vitest --config vitest.browser.config.mts --watch=false",
|
||||
"test:tauri": "bash scripts/test-tauri.sh",
|
||||
"test:pr:web": "pnpm test -- --watch=false && pnpm test:browser",
|
||||
@@ -79,7 +80,7 @@
|
||||
"@emnapi/runtime": "^1.7.1",
|
||||
"@fabianlars/tauri-plugin-oauth": "2",
|
||||
"@napi-rs/wasm-runtime": "^1.1.1",
|
||||
"@opennextjs/cloudflare": "^1.17.1",
|
||||
"@opennextjs/cloudflare": "^1.17.3",
|
||||
"@radix-ui/react-collapsible": "^1.1.12",
|
||||
"@radix-ui/react-dialog": "^1.1.15",
|
||||
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
||||
@@ -145,7 +146,7 @@
|
||||
"lunr": "^2.3.9",
|
||||
"marked": "^15.0.12",
|
||||
"nanoid": "^5.1.6",
|
||||
"next": "16.1.7",
|
||||
"next": "16.2.2",
|
||||
"next-view-transitions": "^0.3.5",
|
||||
"nunjucks": "^3.2.4",
|
||||
"overlayscrollbars": "^2.11.4",
|
||||
@@ -193,13 +194,12 @@
|
||||
"@types/tinycolor2": "^1.4.6",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@types/ws": "^8.18.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
||||
"@typescript-eslint/parser": "^8.48.0",
|
||||
"@typescript/native-preview": "7.0.0-dev.20260312.1",
|
||||
"@vitejs/plugin-react": "^5.1.1",
|
||||
"@vitejs/plugin-rsc": "^0.5.21",
|
||||
"@vitest/browser-playwright": "^4.0.18",
|
||||
"@vitest/browser-webdriverio": "^4.0.18",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
"@wdio/cli": "^9.25.0",
|
||||
"@wdio/globals": "^9.23.0",
|
||||
"@wdio/local-runner": "^9.24.0",
|
||||
@@ -211,9 +211,6 @@
|
||||
"cpx2": "^8.0.0",
|
||||
"daisyui": "^4.12.24",
|
||||
"dotenv-cli": "^7.4.4",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-next": "16.1.6",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"i18next-scanner": "^4.6.0",
|
||||
"jsdom": "^28.1.0",
|
||||
"mkdirp": "^3.0.1",
|
||||
@@ -231,6 +228,12 @@
|
||||
"vite": "^7.3.1",
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"vitest": "^4.0.18",
|
||||
"wrangler": "^4.73.0"
|
||||
}
|
||||
"wrangler": "^4.77.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"chrome 92",
|
||||
"edge 92",
|
||||
"firefox 92",
|
||||
"safari 15.2"
|
||||
]
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -183,7 +183,6 @@
|
||||
"RTL Direction": "الاتجاه من اليمين إلى اليسار",
|
||||
"Maximum Column Height": "الارتفاع الأقصى للعمود",
|
||||
"Maximum Column Width": "العرض الأقصى للعمود",
|
||||
"Continuous Scroll": "التمرير المستمر",
|
||||
"Fullscreen": "ملء الشاشة",
|
||||
"No supported files found. Supported formats: {{formats}}": "لم يتم العثور على ملفات مدعومة. الصيغ المدعومة: {{formats}}",
|
||||
"Drop to Import Books": "قم بالسحب والإسقاط لاستيراد الكتب",
|
||||
@@ -1031,7 +1030,6 @@
|
||||
"words": "كلمات",
|
||||
"{{time}} left": "متبقي {{time}}",
|
||||
"Reading progress": "تقدم القراءة",
|
||||
"Click to seek": "انقر للتمرير",
|
||||
"Skip back 15 words": "تخطي للخلف 15 كلمة",
|
||||
"Back 15 words (Shift+Left)": "للخلف 15 كلمة (Shift+اليسار)",
|
||||
"Pause (Space)": "إيقاف مؤقت (المسافة)",
|
||||
@@ -1154,5 +1152,88 @@
|
||||
"{{count}} books refreshed_many": "تم تحديث {{count}} كتابًا",
|
||||
"{{count}} books refreshed_other": "تم تحديث {{count}} كتاب",
|
||||
"Failed to refresh metadata": "فشل تحديث البيانات الوصفية",
|
||||
"Refresh Metadata": "تحديث البيانات الوصفية"
|
||||
"Refresh Metadata": "تحديث البيانات الوصفية",
|
||||
"Keyboard Shortcuts": "اختصارات لوحة المفاتيح",
|
||||
"View all keyboard shortcuts": "عرض جميع اختصارات لوحة المفاتيح",
|
||||
"Switch Sidebar Tab": "تبديل علامة تبويب الشريط الجانبي",
|
||||
"Toggle Notebook": "إظهار/إخفاء دفتر الملاحظات",
|
||||
"Search in Book": "البحث في الكتاب",
|
||||
"Toggle Scroll Mode": "تبديل وضع التمرير",
|
||||
"Toggle Select Mode": "تبديل وضع التحديد",
|
||||
"Toggle Bookmark": "تبديل الإشارة المرجعية",
|
||||
"Toggle Text to Speech": "تبديل تحويل النص إلى كلام",
|
||||
"Play / Pause TTS": "تشغيل / إيقاف القراءة الصوتية",
|
||||
"Toggle Paragraph Mode": "تبديل وضع الفقرة",
|
||||
"Highlight Selection": "تمييز التحديد",
|
||||
"Underline Selection": "وضع خط تحت التحديد",
|
||||
"Annotate Selection": "إضافة تعليق على التحديد",
|
||||
"Search Selection": "البحث عن التحديد",
|
||||
"Copy Selection": "نسخ التحديد",
|
||||
"Translate Selection": "ترجمة التحديد",
|
||||
"Dictionary Lookup": "البحث في القاموس",
|
||||
"Wikipedia Lookup": "البحث في ويكيبيديا",
|
||||
"Read Aloud Selection": "قراءة التحديد بصوت عالٍ",
|
||||
"Proofread Selection": "تدقيق التحديد",
|
||||
"Open Settings": "فتح الإعدادات",
|
||||
"Open Command Palette": "فتح لوحة الأوامر",
|
||||
"Show Keyboard Shortcuts": "عرض اختصارات لوحة المفاتيح",
|
||||
"Open Books": "فتح الكتب",
|
||||
"Toggle Fullscreen": "تبديل ملء الشاشة",
|
||||
"Close Window": "إغلاق النافذة",
|
||||
"Quit App": "إنهاء التطبيق",
|
||||
"Go Left / Previous Page": "الانتقال لليسار / الصفحة السابقة",
|
||||
"Go Right / Next Page": "الانتقال لليمين / الصفحة التالية",
|
||||
"Go Up": "الانتقال لأعلى",
|
||||
"Go Down": "الانتقال لأسفل",
|
||||
"Previous Chapter": "الفصل السابق",
|
||||
"Next Chapter": "الفصل التالي",
|
||||
"Scroll Half Page Down": "تمرير نصف صفحة لأسفل",
|
||||
"Scroll Half Page Up": "تمرير نصف صفحة لأعلى",
|
||||
"Save Note": "حفظ الملاحظة",
|
||||
"Single Section Scroll": "التمرير بقسم واحد",
|
||||
"General": "عام",
|
||||
"Text to Speech": "تحويل النص إلى كلام",
|
||||
"Zoom": "تكبير",
|
||||
"Window": "نافذة",
|
||||
"Your Bookshelf": "رف الكتب الخاص بك",
|
||||
"TTS": "تحويل النص إلى كلام",
|
||||
"Media Info": "معلومات الوسائط",
|
||||
"Update Frequency": "تردد التحديث",
|
||||
"Every Sentence": "كل جملة",
|
||||
"Every Paragraph": "كل فقرة",
|
||||
"Every Chapter": "كل فصل",
|
||||
"TTS Media Info Update Frequency": "تردد تحديث معلومات وسائط TTS",
|
||||
"Select reading speed": "اختر سرعة القراءة",
|
||||
"Drag to seek": "اسحب للتقديم",
|
||||
"Punctuation Delay": "تأخير علامات الترقيم",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "يرجى التأكيد على أن اتصال OPDS هذا سيتم توجيهه عبر خوادم Readest على تطبيق الويب قبل المتابعة.",
|
||||
"Custom Headers": "رؤوس مخصصة",
|
||||
"Custom Headers (optional)": "رؤوس مخصصة (اختياري)",
|
||||
"Add one header per line using \"Header-Name: value\".": "أضف رأسًا واحدًا لكل سطر باستخدام \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "أفهم أن اتصال OPDS هذا سيتم توجيهه عبر خوادم Readest على تطبيق الويب. إذا لم أثق بـ Readest فيما يتعلق ببيانات الاعتماد أو الرؤوس هذه، يجب أن أستخدم التطبيق الأصلي بدلاً من ذلك.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "تعذر الاتصال بـ Hardcover. يرجى التحقق من اتصال الشبكة.",
|
||||
"Invalid Hardcover API token": "رمز API الخاص بـ Hardcover غير صالح",
|
||||
"Disconnected from Hardcover": "تم قطع الاتصال بـ Hardcover",
|
||||
"Hardcover Settings": "إعدادات Hardcover",
|
||||
"Connected to Hardcover": "متصل بـ Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "اربط حسابك على Hardcover لمزامنة تقدم القراءة والملاحظات.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "احصل على رمز API من hardcover.app ← الإعدادات ← API.",
|
||||
"API Token": "رمز API",
|
||||
"Paste your Hardcover API token": "الصق رمز API الخاص بك في Hardcover",
|
||||
"Hardcover sync enabled for this book": "تم تفعيل مزامنة Hardcover لهذا الكتاب",
|
||||
"Hardcover sync disabled for this book": "تم تعطيل مزامنة Hardcover لهذا الكتاب",
|
||||
"Hardcover Sync": "مزامنة Hardcover",
|
||||
"Enable for This Book": "تفعيل لهذا الكتاب",
|
||||
"Push Notes": "دفع الملاحظات",
|
||||
"Enable Hardcover sync for this book first.": "قم بتفعيل مزامنة Hardcover لهذا الكتاب أولاً.",
|
||||
"No annotations or excerpts to sync for this book.": "لا توجد تعليقات توضيحية أو مقتطفات لمزامنتها لهذا الكتاب.",
|
||||
"Configure Hardcover in Settings first.": "قم بإعداد Hardcover في الإعدادات أولاً.",
|
||||
"No new Hardcover note changes to sync.": "لا توجد تغييرات جديدة في ملاحظات Hardcover للمزامنة.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "تمت مزامنة Hardcover: {{inserted}} جديد، {{updated}} محدث، {{skipped}} بدون تغيير",
|
||||
"Hardcover notes sync failed: {{error}}": "فشلت مزامنة ملاحظات Hardcover: {{error}}",
|
||||
"Reading progress synced to Hardcover": "تمت مزامنة تقدم القراءة إلى Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "فشلت مزامنة تقدم Hardcover: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "الإبقاء على معرف المصدر الحالي",
|
||||
"Toggle Toolbar": "تبديل شريط الأدوات"
|
||||
}
|
||||
|
||||
@@ -199,7 +199,6 @@
|
||||
"Auto": "অটো",
|
||||
"Scroll": "স্ক্রল",
|
||||
"Scrolled Mode": "স্ক্রল মোড",
|
||||
"Continuous Scroll": "ক্রমাগত স্ক্রল",
|
||||
"Overlap Pixels": "ওভারল্যাপ পিক্সেল",
|
||||
"Disable Double Click": "ডাবল ক্লিক নিষ্ক্রিয়",
|
||||
"Volume Keys for Page Flip": "পৃষ্ঠা উল্টানোর জন্য ভলিউম কী",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "শব্দ",
|
||||
"{{time}} left": "{{time}} বাকি",
|
||||
"Reading progress": "পড়ার অগ্রগতি",
|
||||
"Click to seek": "খুঁজতে ক্লিক করুন",
|
||||
"Skip back 15 words": "১৫ শব্দ পিছিয়ে যান",
|
||||
"Back 15 words (Shift+Left)": "১৫ শব্দ পিছিয়ে যান (Shift+Left)",
|
||||
"Pause (Space)": "বিরতি (Space)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "{{count}}টি বইয়ের মেটাডেটা রিফ্রেশ হয়েছে",
|
||||
"{{count}} books refreshed_other": "{{count}}টি বইয়ের মেটাডেটা রিফ্রেশ হয়েছে",
|
||||
"Failed to refresh metadata": "মেটাডেটা রিফ্রেশ ব্যর্থ",
|
||||
"Refresh Metadata": "মেটাডেটা রিফ্রেশ"
|
||||
"Refresh Metadata": "মেটাডেটা রিফ্রেশ",
|
||||
"Keyboard Shortcuts": "কীবোর্ড শর্টকাট",
|
||||
"View all keyboard shortcuts": "সমস্ত কীবোর্ড শর্টকাট দেখুন",
|
||||
"Switch Sidebar Tab": "সাইডবার ট্যাব পরিবর্তন করুন",
|
||||
"Toggle Notebook": "নোটবুক দেখান/লুকান",
|
||||
"Search in Book": "বইয়ে অনুসন্ধান করুন",
|
||||
"Toggle Scroll Mode": "স্ক্রল মোড টগল করুন",
|
||||
"Toggle Select Mode": "নির্বাচন মোড টগল করুন",
|
||||
"Toggle Bookmark": "বুকমার্ক টগল করুন",
|
||||
"Toggle Text to Speech": "টেক্সট টু স্পিচ টগল করুন",
|
||||
"Play / Pause TTS": "TTS চালান / বিরতি দিন",
|
||||
"Toggle Paragraph Mode": "অনুচ্ছেদ মোড টগল করুন",
|
||||
"Highlight Selection": "নির্বাচিত অংশ হাইলাইট করুন",
|
||||
"Underline Selection": "নির্বাচিত অংশে আন্ডারলাইন করুন",
|
||||
"Annotate Selection": "নির্বাচিত অংশে টীকা যোগ করুন",
|
||||
"Search Selection": "নির্বাচিত অংশ অনুসন্ধান করুন",
|
||||
"Copy Selection": "নির্বাচিত অংশ কপি করুন",
|
||||
"Translate Selection": "নির্বাচিত অংশ অনুবাদ করুন",
|
||||
"Dictionary Lookup": "অভিধানে খুঁজুন",
|
||||
"Wikipedia Lookup": "উইকিপিডিয়ায় খুঁজুন",
|
||||
"Read Aloud Selection": "নির্বাচিত অংশ জোরে পড়ুন",
|
||||
"Proofread Selection": "নির্বাচিত অংশ প্রুফরিড করুন",
|
||||
"Open Settings": "সেটিংস খুলুন",
|
||||
"Open Command Palette": "কমান্ড প্যালেট খুলুন",
|
||||
"Show Keyboard Shortcuts": "কীবোর্ড শর্টকাট দেখান",
|
||||
"Open Books": "বই খুলুন",
|
||||
"Toggle Fullscreen": "পূর্ণ পর্দা টগল করুন",
|
||||
"Close Window": "উইন্ডো বন্ধ করুন",
|
||||
"Quit App": "অ্যাপ থেকে প্রস্থান করুন",
|
||||
"Go Left / Previous Page": "বামে যান / আগের পৃষ্ঠা",
|
||||
"Go Right / Next Page": "ডানে যান / পরের পৃষ্ঠা",
|
||||
"Go Up": "উপরে যান",
|
||||
"Go Down": "নিচে যান",
|
||||
"Previous Chapter": "আগের অধ্যায়",
|
||||
"Next Chapter": "পরের অধ্যায়",
|
||||
"Scroll Half Page Down": "অর্ধেক পৃষ্ঠা নিচে স্ক্রল করুন",
|
||||
"Scroll Half Page Up": "অর্ধেক পৃষ্ঠা উপরে স্ক্রল করুন",
|
||||
"Save Note": "নোট সংরক্ষণ করুন",
|
||||
"Single Section Scroll": "একক অধ্যায় স্ক্রল",
|
||||
"General": "সাধারণ",
|
||||
"Text to Speech": "পাঠ থেকে বাক্য",
|
||||
"Zoom": "জুম",
|
||||
"Window": "উইন্ডো",
|
||||
"Your Bookshelf": "আপনার বইয়ের তাক",
|
||||
"TTS": "টেক্সট টু স্পিচ",
|
||||
"Media Info": "মিডিয়া তথ্য",
|
||||
"Update Frequency": "আপডেটের ফ্রিকোয়েন্সি",
|
||||
"Every Sentence": "প্রতিটি বাক্য",
|
||||
"Every Paragraph": "প্রতিটি অনুচ্ছেদ",
|
||||
"Every Chapter": "প্রতিটি অধ্যায়",
|
||||
"TTS Media Info Update Frequency": "TTS মিডিয়া তথ্য আপডেট ফ্রিকোয়েন্সি",
|
||||
"Select reading speed": "পড়ার গতি নির্বাচন করুন",
|
||||
"Drag to seek": "খুঁজতে টানুন",
|
||||
"Punctuation Delay": "বিরাম চিহ্ন বিলম্ব",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "অনুগ্রহ করে নিশ্চিত করুন যে এই OPDS সংযোগটি ওয়েব অ্যাপে Readest সার্ভারের মাধ্যমে প্রক্সি করা হবে।",
|
||||
"Custom Headers": "কাস্টম হেডার",
|
||||
"Custom Headers (optional)": "কাস্টম হেডার (ঐচ্ছিক)",
|
||||
"Add one header per line using \"Header-Name: value\".": "প্রতি লাইনে একটি হেডার যোগ করুন \"Header-Name: value\" ব্যবহার করে।",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "আমি বুঝতে পারছি যে এই OPDS সংযোগটি ওয়েব অ্যাপে Readest সার্ভারের মাধ্যমে প্রক্সি করা হবে। আমি যদি এই শংসাপত্র বা হেডারগুলির সাথে Readest-কে বিশ্বাস না করি, তবে আমার পরিবর্তে নেটিভ অ্যাপটি ব্যবহার করা উচিত।",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Hardcover-এ সংযোগ করা যাচ্ছে না। অনুগ্রহ করে আপনার নেটওয়ার্ক সংযোগ পরীক্ষা করুন।",
|
||||
"Invalid Hardcover API token": "অবৈধ Hardcover API টোকেন",
|
||||
"Disconnected from Hardcover": "Hardcover থেকে সংযোগ বিচ্ছিন্ন",
|
||||
"Hardcover Settings": "Hardcover সেটিংস",
|
||||
"Connected to Hardcover": "Hardcover-এ সংযুক্ত",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "পড়ার অগ্রগতি এবং নোট সিঙ্ক করতে আপনার Hardcover অ্যাকাউন্ট সংযুক্ত করুন।",
|
||||
"Get your API token from hardcover.app → Settings → API.": "hardcover.app → সেটিংস → API থেকে আপনার API টোকেন পান।",
|
||||
"API Token": "API টোকেন",
|
||||
"Paste your Hardcover API token": "আপনার Hardcover API টোকেন পেস্ট করুন",
|
||||
"Hardcover sync enabled for this book": "এই বইয়ের জন্য Hardcover সিঙ্ক সক্রিয়",
|
||||
"Hardcover sync disabled for this book": "এই বইয়ের জন্য Hardcover সিঙ্ক নিষ্ক্রিয়",
|
||||
"Hardcover Sync": "Hardcover সিঙ্ক",
|
||||
"Enable for This Book": "এই বইয়ের জন্য সক্রিয় করুন",
|
||||
"Push Notes": "নোট পুশ করুন",
|
||||
"Enable Hardcover sync for this book first.": "প্রথমে এই বইয়ের জন্য Hardcover সিঙ্ক সক্রিয় করুন।",
|
||||
"No annotations or excerpts to sync for this book.": "এই বইয়ের জন্য সিঙ্ক করার মতো কোনো টীকা বা উদ্ধৃতি নেই।",
|
||||
"Configure Hardcover in Settings first.": "প্রথমে সেটিংসে Hardcover কনফিগার করুন।",
|
||||
"No new Hardcover note changes to sync.": "সিঙ্ক করার জন্য নতুন কোনো Hardcover নোট পরিবর্তন নেই।",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover সিঙ্ক সম্পন্ন: {{inserted}} নতুন, {{updated}} আপডেট, {{skipped}} অপরিবর্তিত",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover নোট সিঙ্ক ব্যর্থ: {{error}}",
|
||||
"Reading progress synced to Hardcover": "পড়ার অগ্রগতি Hardcover-এ সিঙ্ক হয়েছে",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover অগ্রগতি সিঙ্ক ব্যর্থ: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "বিদ্যমান উৎস শনাক্তকারী রাখুন",
|
||||
"Toggle Toolbar": "টুলবার টগল করুন"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "གཡས་ནས་གཡོན་དུ།",
|
||||
"Maximum Column Height": "གྲལ་ཐིག་མཐོ་ཤོས།",
|
||||
"Maximum Column Width": "གྲལ་ཐིག་རྒྱ་ཆེ་ཤོས།",
|
||||
"Continuous Scroll": "རྒྱུན་མཐུད་འཁོར་རྒྱུག",
|
||||
"Fullscreen": "བརྡ་ཁྱབ་ངོས་ཆ་ཚང་།",
|
||||
"No supported files found. Supported formats: {{formats}}": "རྒྱབ་སྐྱོར་བྱེད་པའི་ཡིག་ཆ་མ་རྙེད། རྒྱབ་སྐྱོར་བྱེད་པའི་རྣམ་པ། {{formats}}",
|
||||
"Drop to Import Books": "འདྲུད་འཇོག་བྱས་ནས་དཔེ་དེབ་ནང་འདྲེན།",
|
||||
@@ -971,7 +970,6 @@
|
||||
"words": "ཚིག",
|
||||
"{{time}} left": "དུས་ཚོད་ {{time}} ལྷག་ཡོད།",
|
||||
"Reading progress": "ཀློག་པའི་འཕེལ་རིམ།",
|
||||
"Click to seek": "གནས་ས་འཚོལ་བར་གནོན་པ།",
|
||||
"Skip back 15 words": "ཚིག་ ༡༥ རྒྱབ་ལ་བཤུད་པ།",
|
||||
"Back 15 words (Shift+Left)": "ཚིག་ ༡༥ རྒྱབ་ལ་བཤུད་པ། (Shift+Left)",
|
||||
"Pause (Space)": "མཚམས་འཇོག་པ། (Space)",
|
||||
@@ -1089,5 +1087,88 @@
|
||||
"Loading library...": "དཔེ་མཛོད་འཇུག་བཞིན་པ...",
|
||||
"{{count}} books refreshed_other": "تم تحديث {{count}} كتب",
|
||||
"Failed to refresh metadata": "མེ་ཊ་ཌེ་ཊ་གསར་བསྒྱུར་བྱེད་མ་ཐུབ",
|
||||
"Refresh Metadata": "མེ་ཊ་ཌེ་ཊ་གསར་བསྒྱུར"
|
||||
"Refresh Metadata": "མེ་ཊ་ཌེ་ཊ་གསར་བསྒྱུར",
|
||||
"Keyboard Shortcuts": "མཐེབ་གཞོང་མྱུར་ལམ།",
|
||||
"View all keyboard shortcuts": "མཐེབ་གཞོང་མྱུར་ལམ་ཚང་མ་ལྟ་བ།",
|
||||
"Switch Sidebar Tab": "ཟུར་འབར་གྱི་ཤོག་བྱང་བརྗེ་བ།",
|
||||
"Toggle Notebook": "ཟིན་དེབ་སྟོན་པ།/སྦས་པ།",
|
||||
"Search in Book": "དཔེ་དེབ་ནང་འཚོལ་བ།",
|
||||
"Toggle Scroll Mode": "འཁྱོག་སྒུལ་རྣམ་པ་བརྗེ་བ།",
|
||||
"Toggle Select Mode": "འདེམས་རྣམ་པ་བརྗེ་བ།",
|
||||
"Toggle Bookmark": "ཤོག་རྟགས་བརྗེ་བ།",
|
||||
"Toggle Text to Speech": "ཡི་གེ་སྒྲ་ལ་བརྗེ་བ།",
|
||||
"Play / Pause TTS": "སྒྲ་ཀློག་འགོ་འཛུགས / མཚམས་འཇོག",
|
||||
"Toggle Paragraph Mode": "དུམ་བུ་རྣམ་པ་བརྗེ་བ།",
|
||||
"Highlight Selection": "བདམས་པ་གསལ་བཀོད།",
|
||||
"Underline Selection": "བདམས་པའི་འོག་ཐིག",
|
||||
"Annotate Selection": "བདམས་པར་མཆན་འགོད།",
|
||||
"Search Selection": "བདམས་པ་འཚོལ་བ།",
|
||||
"Copy Selection": "བདམས་པ་བཤུ་བ།",
|
||||
"Translate Selection": "བདམས་པ་ཡིག་སྒྱུར།",
|
||||
"Dictionary Lookup": "ཚིག་མཛོད་ནང་འཚོལ་བ།",
|
||||
"Wikipedia Lookup": "ཝེ་ཁེ་པི་ཌི་ཡར་འཚོལ་བ།",
|
||||
"Read Aloud Selection": "བདམས་པ་སྒྲ་ཆེན་པོས་ཀློག",
|
||||
"Proofread Selection": "བདམས་པ་ཞུ་དག",
|
||||
"Open Settings": "སྒྲིག་འགོད་ཁ་ཕྱེ་བ།",
|
||||
"Open Command Palette": "བཀའ་བརྡའི་པང་ཁ་ཕྱེ་བ།",
|
||||
"Show Keyboard Shortcuts": "མཐེབ་གཞོང་མྱུར་ལམ་སྟོན་པ།",
|
||||
"Open Books": "དཔེ་དེབ་ཁ་ཕྱེ་བ།",
|
||||
"Toggle Fullscreen": "ཡོངས་ཁྱབ་བརྗེ་བ།",
|
||||
"Close Window": "སྒེའུ་ཁུང་ཁ་རྒྱག",
|
||||
"Quit App": "ཉེར་སྤྱོད་ཁ་རྒྱག",
|
||||
"Go Left / Previous Page": "གཡོན་དུ / སྔོན་མའི་ཤོག་ངོས།",
|
||||
"Go Right / Next Page": "གཡས་སུ / རྗེས་མའི་ཤོག་ངོས།",
|
||||
"Go Up": "གོང་དུ།",
|
||||
"Go Down": "འོག་ཏུ།",
|
||||
"Previous Chapter": "སྔོན་མའི་ལེའུ།",
|
||||
"Next Chapter": "རྗེས་མའི་ལེའུ།",
|
||||
"Scroll Half Page Down": "ཤོག་ངོས་ཕྱེད་ཀ་འོག་ཏུ།",
|
||||
"Scroll Half Page Up": "ཤོག་ངོས་ཕྱེད་ཀ་གོང་དུ།",
|
||||
"Save Note": "ཟིན་བྲིས་ཉར་བ།",
|
||||
"Single Section Scroll": "དོན་ཚན་གཅིག་འགུལ་བ།",
|
||||
"General": "སྤྱིར་བཏང་།",
|
||||
"Text to Speech": "ཡི་གེ་ནས་སྒྲ།",
|
||||
"Zoom": "ཆེ་རུ་གཏོང་།",
|
||||
"Window": "སྒེའུ་ཁུང་།",
|
||||
"Your Bookshelf": "ཁྱོད་ཀྱི་དཔེ་མཛོད།",
|
||||
"TTS": "ཡི་གེ་ནས་སྒྲ",
|
||||
"Media Info": "སྨྱན་བྱད་ཆ་འཕྲིན",
|
||||
"Update Frequency": "གསར་སྒྱུར་ཐེངས་གྲངས",
|
||||
"Every Sentence": "ཚིག་གྲུབ་རེ་རེ",
|
||||
"Every Paragraph": "དུམ་མཚམས་རེ་རེ",
|
||||
"Every Chapter": "ལེའུ་རེ་རེ",
|
||||
"TTS Media Info Update Frequency": "TTS སྨྱན་བྱད་ཆ་འཕྲིན་གསར་སྒྱུར་ཐེངས་གྲངས",
|
||||
"Select reading speed": "ཀློག་པའི་མྱུར་ཚད་འདེམས།",
|
||||
"Drag to seek": "འཚོལ་བར་འདྲུད།",
|
||||
"Punctuation Delay": "ཚེག་ཤད་ཕྱིར་འགྱངས།",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "མུ་མཐུད་མ་བྱས་གོང་ OPDS འབྲེལ་མཐུད་འདི་དྲ་རྒྱའི་ཉེར་སྤྱོད་ཐོག་ Readest ཞབས་ཞུ་བ་བརྒྱུད་ནས་བསྐུར་རྒྱུ་ཡིན་པ་གཏན་འཁེལ་བྱོས།",
|
||||
"Custom Headers": "སྲོལ་སྒྲིག་མགོ་བརྗེ",
|
||||
"Custom Headers (optional)": "སྲོལ་སྒྲིག་མགོ་བརྗེ (གདམ་གའི)",
|
||||
"Add one header per line using \"Header-Name: value\".": "\"Header-Name: value\" བེད་སྤྱོད་བྱས་ནས་ཕྲེང་རེ་རེའི་ནང་མགོ་བརྗེ་གཅིག་སྣོན།",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "OPDS འབྲེལ་མཐུད་འདི་དྲ་རྒྱའི་ཉེར་སྤྱོད་ཐོག་ Readest ཞབས་ཞུ་བ་བརྒྱུད་ནས་བསྐུར་རྒྱུ་ཡིན་པ་ངས་ཧ་གོ། ང་ Readest ལ་ངེས་འཛིན་འམ་མགོ་བརྗེ་འདི་དག་ཡིད་ཆེས་མེད་ན། ང་ས་གནས་ཉེར་སྤྱོད་བེད་སྤྱོད་བྱ་དགོས།",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Hardcover ལ་འབྲེལ་མཐུད་བྱེད་ཐུབ་མ་སོང་། ཁྱེད་ཀྱི་དྲ་རྒྱའི་འབྲེལ་མཐུད་ལ་ཞིབ་བཤེར་གནང་།",
|
||||
"Invalid Hardcover API token": "Hardcover API ཐོབ་ཐང་མ་ཆིག་སྒྲིལ་མིན།",
|
||||
"Disconnected from Hardcover": "Hardcover ནས་འབྲེལ་མཐུད་ཆད་སོང་།",
|
||||
"Hardcover Settings": "Hardcover སྒྲིག་འགོད",
|
||||
"Connected to Hardcover": "Hardcover ལ་འབྲེལ་མཐུད་བྱས་ཟིན།",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "ཀློག་འགྲོས་དང་མཆན་ཟླ་སྒྲིག་བྱེད་པར་ཁྱེད་ཀྱི Hardcover ཐོ་ཁུངས་འབྲེལ་མཐུད་བྱོས།",
|
||||
"Get your API token from hardcover.app → Settings → API.": "hardcover.app → སྒྲིག་འགོད → API ནས་ཁྱེད་ཀྱི API ཐོབ་ཐང་ལེན།",
|
||||
"API Token": "API ཐོབ་ཐང་།",
|
||||
"Paste your Hardcover API token": "ཁྱེད་ཀྱི Hardcover API ཐོབ་ཐང་སྦྱར།",
|
||||
"Hardcover sync enabled for this book": "དེབ་འདིའི་ཆེད་ Hardcover ཟླ་སྒྲིག་སྤྱོད་འགོ་ཚུགས།",
|
||||
"Hardcover sync disabled for this book": "དེབ་འདིའི་ཆེད་ Hardcover ཟླ་སྒྲིག་མཚམས་བཞག",
|
||||
"Hardcover Sync": "Hardcover ཟླ་སྒྲིག",
|
||||
"Enable for This Book": "དེབ་འདིའི་ཆེད་སྤྱོད་འགོ་ཚུགས།",
|
||||
"Push Notes": "མཆན་གཏོང་བ",
|
||||
"Enable Hardcover sync for this book first.": "སྔོན་ལ་དེབ་འདིའི་ཆེད་ Hardcover ཟླ་སྒྲིག་སྤྱོད་འགོ་ཚུགས།",
|
||||
"No annotations or excerpts to sync for this book.": "དེབ་འདིའི་ཆེད་ཟླ་སྒྲིག་བྱེད་པའི་མཆན་ཡང་ན་དྲངས་ཡིག་མེད།",
|
||||
"Configure Hardcover in Settings first.": "སྔོན་ལ་སྒྲིག་འགོད་ནང་ Hardcover རིགས་སྒྲིག་བྱོས།",
|
||||
"No new Hardcover note changes to sync.": "ཟླ་སྒྲིག་བྱེད་པའི་ Hardcover མཆན་གསར་པ་མེད།",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover ཟླ་སྒྲིག་བྱས་ཟིན: {{inserted}} གསར་པ, {{updated}} གསར་བཅོས, {{skipped}} མི་འགྱུར",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover མཆན་ཟླ་སྒྲིག་མི་ཚོགས: {{error}}",
|
||||
"Reading progress synced to Hardcover": "ཀློག་འགྲོས་ Hardcover ལ་ཟླ་སྒྲིག་བྱས་ཟིན།",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover ཀློག་འགྲོས་ཟླ་སྒྲིག་མི་ཚོགས: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "ཡོད་བཞིན་པའི་འབྱུང་ཁུངས་ཐོབ་ཐང་གཞག",
|
||||
"Toggle Toolbar": "ལག་ཆའི་ཚན་བར་བརྗེ་བ།"
|
||||
}
|
||||
|
||||
@@ -183,7 +183,6 @@
|
||||
"RTL Direction": "RTL-Richtung",
|
||||
"Maximum Column Height": "Maximale Spaltenhöhe",
|
||||
"Maximum Column Width": "Maximale Spaltenbreite",
|
||||
"Continuous Scroll": "Kontinuierliches Scrollen",
|
||||
"Fullscreen": "Vollbild",
|
||||
"No supported files found. Supported formats: {{formats}}": "Keine unterstützten Dateien gefunden. Unterstützte Formate: {{formats}}",
|
||||
"Drop to Import Books": "Zum Importieren von Büchern ablegen",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "Wörter",
|
||||
"{{time}} left": "{{time}} übrig",
|
||||
"Reading progress": "Lesefortschritt",
|
||||
"Click to seek": "Klicken zum Suchen",
|
||||
"Skip back 15 words": "15 Wörter zurück",
|
||||
"Back 15 words (Shift+Left)": "15 Wörter zurück (Shift+Links)",
|
||||
"Pause (Space)": "Pause (Leertaste)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "{{count}} Buch aktualisiert",
|
||||
"{{count}} books refreshed_other": "{{count}} Bücher aktualisiert",
|
||||
"Failed to refresh metadata": "Metadaten-Aktualisierung fehlgeschlagen",
|
||||
"Refresh Metadata": "Metadaten aktualisieren"
|
||||
"Refresh Metadata": "Metadaten aktualisieren",
|
||||
"Keyboard Shortcuts": "Tastaturkürzel",
|
||||
"View all keyboard shortcuts": "Alle Tastaturkürzel anzeigen",
|
||||
"Switch Sidebar Tab": "Seitenleisten-Tab wechseln",
|
||||
"Toggle Notebook": "Notizbuch ein-/ausblenden",
|
||||
"Search in Book": "Im Buch suchen",
|
||||
"Toggle Scroll Mode": "Scrollmodus umschalten",
|
||||
"Toggle Select Mode": "Auswahlmodus umschalten",
|
||||
"Toggle Bookmark": "Lesezeichen umschalten",
|
||||
"Toggle Text to Speech": "Sprachausgabe umschalten",
|
||||
"Play / Pause TTS": "Sprachausgabe abspielen / pausieren",
|
||||
"Toggle Paragraph Mode": "Absatzmodus umschalten",
|
||||
"Highlight Selection": "Auswahl hervorheben",
|
||||
"Underline Selection": "Auswahl unterstreichen",
|
||||
"Annotate Selection": "Auswahl kommentieren",
|
||||
"Search Selection": "Auswahl suchen",
|
||||
"Copy Selection": "Auswahl kopieren",
|
||||
"Translate Selection": "Auswahl übersetzen",
|
||||
"Dictionary Lookup": "Im Wörterbuch nachschlagen",
|
||||
"Wikipedia Lookup": "In Wikipedia nachschlagen",
|
||||
"Read Aloud Selection": "Auswahl vorlesen",
|
||||
"Proofread Selection": "Auswahl korrekturlesen",
|
||||
"Open Settings": "Einstellungen öffnen",
|
||||
"Open Command Palette": "Befehlspalette öffnen",
|
||||
"Show Keyboard Shortcuts": "Tastaturkürzel anzeigen",
|
||||
"Open Books": "Bücher öffnen",
|
||||
"Toggle Fullscreen": "Vollbild umschalten",
|
||||
"Close Window": "Fenster schließen",
|
||||
"Quit App": "App beenden",
|
||||
"Go Left / Previous Page": "Nach links / Vorherige Seite",
|
||||
"Go Right / Next Page": "Nach rechts / Nächste Seite",
|
||||
"Go Up": "Nach oben",
|
||||
"Go Down": "Nach unten",
|
||||
"Previous Chapter": "Vorheriges Kapitel",
|
||||
"Next Chapter": "Nächstes Kapitel",
|
||||
"Scroll Half Page Down": "Halbe Seite nach unten scrollen",
|
||||
"Scroll Half Page Up": "Halbe Seite nach oben scrollen",
|
||||
"Save Note": "Notiz speichern",
|
||||
"Single Section Scroll": "Einzelabschnitt-Scrollen",
|
||||
"General": "Allgemein",
|
||||
"Text to Speech": "Sprachausgabe",
|
||||
"Zoom": "Zoom",
|
||||
"Window": "Fenster",
|
||||
"Your Bookshelf": "Dein Bücherregal",
|
||||
"TTS": "Sprachausgabe",
|
||||
"Media Info": "Medieninfo",
|
||||
"Update Frequency": "Aktualisierungshäufigkeit",
|
||||
"Every Sentence": "Jeden Satz",
|
||||
"Every Paragraph": "Jeden Absatz",
|
||||
"Every Chapter": "Jedes Kapitel",
|
||||
"TTS Media Info Update Frequency": "TTS-Medieninfo-Aktualisierungshäufigkeit",
|
||||
"Select reading speed": "Lesegeschwindigkeit wählen",
|
||||
"Drag to seek": "Ziehen zum Suchen",
|
||||
"Punctuation Delay": "Satzzeichen-Verzögerung",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Bitte bestätigen Sie, dass diese OPDS-Verbindung über Readest-Server in der Web-App weitergeleitet wird, bevor Sie fortfahren.",
|
||||
"Custom Headers": "Benutzerdefinierte Header",
|
||||
"Custom Headers (optional)": "Benutzerdefinierte Header (optional)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Fügen Sie pro Zeile einen Header im Format \"Header-Name: value\" hinzu.",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Ich verstehe, dass diese OPDS-Verbindung über Readest-Server in der Web-App weitergeleitet wird. Wenn ich Readest meine Anmeldedaten oder Header nicht anvertraue, sollte ich stattdessen die native App verwenden.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Verbindung zu Hardcover nicht möglich. Bitte überprüfen Sie Ihre Netzwerkverbindung.",
|
||||
"Invalid Hardcover API token": "Ungültiges Hardcover-API-Token",
|
||||
"Disconnected from Hardcover": "Von Hardcover getrennt",
|
||||
"Hardcover Settings": "Hardcover-Einstellungen",
|
||||
"Connected to Hardcover": "Mit Hardcover verbunden",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Verbinden Sie Ihr Hardcover-Konto, um Lesefortschritt und Notizen zu synchronisieren.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Holen Sie Ihr API-Token von hardcover.app → Einstellungen → API.",
|
||||
"API Token": "API-Token",
|
||||
"Paste your Hardcover API token": "Fügen Sie Ihr Hardcover-API-Token ein",
|
||||
"Hardcover sync enabled for this book": "Hardcover-Synchronisierung für dieses Buch aktiviert",
|
||||
"Hardcover sync disabled for this book": "Hardcover-Synchronisierung für dieses Buch deaktiviert",
|
||||
"Hardcover Sync": "Hardcover-Synchronisierung",
|
||||
"Enable for This Book": "Für dieses Buch aktivieren",
|
||||
"Push Notes": "Notizen übertragen",
|
||||
"Enable Hardcover sync for this book first.": "Aktivieren Sie zuerst die Hardcover-Synchronisierung für dieses Buch.",
|
||||
"No annotations or excerpts to sync for this book.": "Keine Anmerkungen oder Auszüge zum Synchronisieren für dieses Buch.",
|
||||
"Configure Hardcover in Settings first.": "Konfigurieren Sie zuerst Hardcover in den Einstellungen.",
|
||||
"No new Hardcover note changes to sync.": "Keine neuen Hardcover-Notizänderungen zum Synchronisieren.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover synchronisiert: {{inserted}} neu, {{updated}} aktualisiert, {{skipped}} unverändert",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover-Notizsynchronisierung fehlgeschlagen: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Lesefortschritt mit Hardcover synchronisiert",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover-Fortschrittssynchronisierung fehlgeschlagen: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Vorhandene Quellkennung beibehalten",
|
||||
"Toggle Toolbar": "Symbolleiste umschalten"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "Κατεύθυνση RTL",
|
||||
"Maximum Column Height": "Μέγιστο ύψος στήλης",
|
||||
"Maximum Column Width": "Μέγιστο πλάτος στήλης",
|
||||
"Continuous Scroll": "Συνεχής κύλιση",
|
||||
"Fullscreen": "Πλήρης οθόνη",
|
||||
"No supported files found. Supported formats: {{formats}}": "Δεν βρέθηκαν υποστηριζόμενα αρχεία. Υποστηριζόμενες μορφές: {{formats}}",
|
||||
"Drop to Import Books": "Ρίξτε για εισαγωγή βιβλίων",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "λέξεις",
|
||||
"{{time}} left": "{{time}} απομένουν",
|
||||
"Reading progress": "Πρόοδος ανάγνωσης",
|
||||
"Click to seek": "Κάντε κλικ για αναζήτηση",
|
||||
"Skip back 15 words": "Επιστροφή 15 λέξεων",
|
||||
"Back 15 words (Shift+Left)": "Πίσω 15 λέξεις (Shift+Αριστερά)",
|
||||
"Pause (Space)": "Παύση (Διάστημα)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "{{count}} βιβλίο ανανεώθηκε",
|
||||
"{{count}} books refreshed_other": "{{count}} βιβλία ανανεώθηκαν",
|
||||
"Failed to refresh metadata": "Αποτυχία ανανέωσης μεταδεδομένων",
|
||||
"Refresh Metadata": "Ανανέωση μεταδεδομένων"
|
||||
"Refresh Metadata": "Ανανέωση μεταδεδομένων",
|
||||
"Keyboard Shortcuts": "Συντομεύσεις πληκτρολογίου",
|
||||
"View all keyboard shortcuts": "Προβολή όλων των συντομεύσεων",
|
||||
"Switch Sidebar Tab": "Εναλλαγή καρτέλας πλαϊνής γραμμής",
|
||||
"Toggle Notebook": "Εμφάνιση/Απόκρυψη σημειωματάριου",
|
||||
"Search in Book": "Αναζήτηση στο βιβλίο",
|
||||
"Toggle Scroll Mode": "Εναλλαγή λειτουργίας κύλισης",
|
||||
"Toggle Select Mode": "Εναλλαγή λειτουργίας επιλογής",
|
||||
"Toggle Bookmark": "Εναλλαγή σελιδοδείκτη",
|
||||
"Toggle Text to Speech": "Εναλλαγή κειμένου σε ομιλία",
|
||||
"Play / Pause TTS": "Αναπαραγωγή / Παύση TTS",
|
||||
"Toggle Paragraph Mode": "Εναλλαγή λειτουργίας παραγράφου",
|
||||
"Highlight Selection": "Επισήμανση επιλογής",
|
||||
"Underline Selection": "Υπογράμμιση επιλογής",
|
||||
"Annotate Selection": "Σχολιασμός επιλογής",
|
||||
"Search Selection": "Αναζήτηση επιλογής",
|
||||
"Copy Selection": "Αντιγραφή επιλογής",
|
||||
"Translate Selection": "Μετάφραση επιλογής",
|
||||
"Dictionary Lookup": "Αναζήτηση στο λεξικό",
|
||||
"Wikipedia Lookup": "Αναζήτηση στη Wikipedia",
|
||||
"Read Aloud Selection": "Ανάγνωση επιλογής",
|
||||
"Proofread Selection": "Διόρθωση επιλογής",
|
||||
"Open Settings": "Άνοιγμα ρυθμίσεων",
|
||||
"Open Command Palette": "Άνοιγμα παλέτας εντολών",
|
||||
"Show Keyboard Shortcuts": "Εμφάνιση συντομεύσεων",
|
||||
"Open Books": "Άνοιγμα βιβλίων",
|
||||
"Toggle Fullscreen": "Εναλλαγή πλήρους οθόνης",
|
||||
"Close Window": "Κλείσιμο παραθύρου",
|
||||
"Quit App": "Έξοδος εφαρμογής",
|
||||
"Go Left / Previous Page": "Αριστερά / Προηγούμενη σελίδα",
|
||||
"Go Right / Next Page": "Δεξιά / Επόμενη σελίδα",
|
||||
"Go Up": "Πάνω",
|
||||
"Go Down": "Κάτω",
|
||||
"Previous Chapter": "Προηγούμενο κεφάλαιο",
|
||||
"Next Chapter": "Επόμενο κεφάλαιο",
|
||||
"Scroll Half Page Down": "Κύλιση μισής σελίδας κάτω",
|
||||
"Scroll Half Page Up": "Κύλιση μισής σελίδας πάνω",
|
||||
"Save Note": "Αποθήκευση σημείωσης",
|
||||
"Single Section Scroll": "Κύλιση μεμονωμένης ενότητας",
|
||||
"General": "Γενικά",
|
||||
"Text to Speech": "Κείμενο σε ομιλία",
|
||||
"Zoom": "Ζουμ",
|
||||
"Window": "Παράθυρο",
|
||||
"Your Bookshelf": "Η βιβλιοθήκη σου",
|
||||
"TTS": "Εκφώνηση",
|
||||
"Media Info": "Πληροφορίες μέσων",
|
||||
"Update Frequency": "Συχνότητα ενημέρωσης",
|
||||
"Every Sentence": "Κάθε πρόταση",
|
||||
"Every Paragraph": "Κάθε παράγραφο",
|
||||
"Every Chapter": "Κάθε κεφάλαιο",
|
||||
"TTS Media Info Update Frequency": "Συχνότητα ενημέρωσης πληροφοριών μέσων TTS",
|
||||
"Select reading speed": "Επιλέξτε ταχύτητα ανάγνωσης",
|
||||
"Drag to seek": "Σύρετε για αναζήτηση",
|
||||
"Punctuation Delay": "Καθυστέρηση στίξης",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Επιβεβαιώστε ότι αυτή η σύνδεση OPDS θα δρομολογηθεί μέσω των διακομιστών Readest στην εφαρμογή ιστού πριν συνεχίσετε.",
|
||||
"Custom Headers": "Προσαρμοσμένες κεφαλίδες",
|
||||
"Custom Headers (optional)": "Προσαρμοσμένες κεφαλίδες (προαιρετικό)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Προσθέστε μία κεφαλίδα ανά γραμμή χρησιμοποιώντας \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Κατανοώ ότι αυτή η σύνδεση OPDS θα δρομολογηθεί μέσω των διακομιστών Readest στην εφαρμογή ιστού. Αν δεν εμπιστεύομαι τo Readest με αυτά τα διαπιστευτήρια ή τις κεφαλίδες, θα πρέπει να χρησιμοποιήσω την εγγενή εφαρμογή.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Αδυναμία σύνδεσης στο Hardcover. Ελέγξτε τη σύνδεση δικτύου σας.",
|
||||
"Invalid Hardcover API token": "Μη έγκυρο Hardcover API token",
|
||||
"Disconnected from Hardcover": "Αποσυνδέθηκε από το Hardcover",
|
||||
"Hardcover Settings": "Ρυθμίσεις Hardcover",
|
||||
"Connected to Hardcover": "Συνδεδεμένο στο Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Συνδέστε τον λογαριασμό σας Hardcover για συγχρονισμό προόδου ανάγνωσης και σημειώσεων.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Λάβετε το API token σας από hardcover.app → Ρυθμίσεις → API.",
|
||||
"API Token": "API Token",
|
||||
"Paste your Hardcover API token": "Επικολλήστε το Hardcover API token σας",
|
||||
"Hardcover sync enabled for this book": "Ο συγχρονισμός Hardcover ενεργοποιήθηκε για αυτό το βιβλίο",
|
||||
"Hardcover sync disabled for this book": "Ο συγχρονισμός Hardcover απενεργοποιήθηκε για αυτό το βιβλίο",
|
||||
"Hardcover Sync": "Συγχρονισμός Hardcover",
|
||||
"Enable for This Book": "Ενεργοποίηση για αυτό το βιβλίο",
|
||||
"Push Notes": "Αποστολή σημειώσεων",
|
||||
"Enable Hardcover sync for this book first.": "Ενεργοποιήστε πρώτα τον συγχρονισμό Hardcover για αυτό το βιβλίο.",
|
||||
"No annotations or excerpts to sync for this book.": "Δεν υπάρχουν σχολιασμοί ή αποσπάσματα για συγχρονισμό σε αυτό το βιβλίο.",
|
||||
"Configure Hardcover in Settings first.": "Ρυθμίστε πρώτα το Hardcover στις Ρυθμίσεις.",
|
||||
"No new Hardcover note changes to sync.": "Δεν υπάρχουν νέες αλλαγές σημειώσεων Hardcover για συγχρονισμό.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover συγχρονίστηκε: {{inserted}} νέα, {{updated}} ενημερωμένα, {{skipped}} αμετάβλητα",
|
||||
"Hardcover notes sync failed: {{error}}": "Αποτυχία συγχρονισμού σημειώσεων Hardcover: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Η πρόοδος ανάγνωσης συγχρονίστηκε στο Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Αποτυχία συγχρονισμού προόδου Hardcover: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Διατήρηση υπάρχοντος αναγνωριστικού πηγής",
|
||||
"Toggle Toolbar": "Εναλλαγή γραμμής εργαλείων"
|
||||
}
|
||||
|
||||
@@ -211,7 +211,6 @@
|
||||
"RTL Direction": "Dirección RTL",
|
||||
"Maximum Column Height": "Altura máxima de columna",
|
||||
"Maximum Column Width": "Ancho máximo de columna",
|
||||
"Continuous Scroll": "Desplazamiento continuo",
|
||||
"Fullscreen": "Pantalla completa",
|
||||
"No supported files found. Supported formats: {{formats}}": "No se encontraron archivos compatibles. Formatos compatibles: {{formats}}",
|
||||
"Drop to Import Books": "Soltar para importar libros",
|
||||
@@ -995,7 +994,6 @@
|
||||
"words": "palabras",
|
||||
"{{time}} left": "faltan {{time}}",
|
||||
"Reading progress": "Progreso de lectura",
|
||||
"Click to seek": "Hacer clic para buscar",
|
||||
"Skip back 15 words": "Retroceder 15 palabras",
|
||||
"Back 15 words (Shift+Left)": "Retroceder 15 palabras (Shift+Izquierda)",
|
||||
"Pause (Space)": "Pausa (Espacio)",
|
||||
@@ -1115,5 +1113,88 @@
|
||||
"{{count}} books refreshed_many": "{{count}} libros actualizados",
|
||||
"{{count}} books refreshed_other": "{{count}} libros actualizados",
|
||||
"Failed to refresh metadata": "Error al actualizar metadatos",
|
||||
"Refresh Metadata": "Actualizar metadatos"
|
||||
"Refresh Metadata": "Actualizar metadatos",
|
||||
"Keyboard Shortcuts": "Atajos de teclado",
|
||||
"View all keyboard shortcuts": "Ver todos los atajos de teclado",
|
||||
"Switch Sidebar Tab": "Cambiar pestaña de la barra lateral",
|
||||
"Toggle Notebook": "Mostrar/ocultar cuaderno",
|
||||
"Search in Book": "Buscar en el libro",
|
||||
"Toggle Scroll Mode": "Alternar modo desplazamiento",
|
||||
"Toggle Select Mode": "Alternar modo selección",
|
||||
"Toggle Bookmark": "Alternar marcador",
|
||||
"Toggle Text to Speech": "Alternar texto a voz",
|
||||
"Play / Pause TTS": "Reproducir / Pausar TTS",
|
||||
"Toggle Paragraph Mode": "Alternar modo párrafo",
|
||||
"Highlight Selection": "Resaltar selección",
|
||||
"Underline Selection": "Subrayar selección",
|
||||
"Annotate Selection": "Anotar selección",
|
||||
"Search Selection": "Buscar selección",
|
||||
"Copy Selection": "Copiar selección",
|
||||
"Translate Selection": "Traducir selección",
|
||||
"Dictionary Lookup": "Buscar en diccionario",
|
||||
"Wikipedia Lookup": "Buscar en Wikipedia",
|
||||
"Read Aloud Selection": "Leer selección en voz alta",
|
||||
"Proofread Selection": "Corregir selección",
|
||||
"Open Settings": "Abrir ajustes",
|
||||
"Open Command Palette": "Abrir paleta de comandos",
|
||||
"Show Keyboard Shortcuts": "Mostrar atajos de teclado",
|
||||
"Open Books": "Abrir libros",
|
||||
"Toggle Fullscreen": "Alternar pantalla completa",
|
||||
"Close Window": "Cerrar ventana",
|
||||
"Quit App": "Salir de la aplicación",
|
||||
"Go Left / Previous Page": "Ir a la izquierda / Página anterior",
|
||||
"Go Right / Next Page": "Ir a la derecha / Página siguiente",
|
||||
"Go Up": "Ir arriba",
|
||||
"Go Down": "Ir abajo",
|
||||
"Previous Chapter": "Capítulo anterior",
|
||||
"Next Chapter": "Capítulo siguiente",
|
||||
"Scroll Half Page Down": "Desplazar media página abajo",
|
||||
"Scroll Half Page Up": "Desplazar media página arriba",
|
||||
"Save Note": "Guardar nota",
|
||||
"Single Section Scroll": "Desplazamiento por sección",
|
||||
"General": "General",
|
||||
"Text to Speech": "Texto a voz",
|
||||
"Zoom": "Zoom",
|
||||
"Window": "Ventana",
|
||||
"Your Bookshelf": "Tu estantería",
|
||||
"TTS": "Lectura en voz alta",
|
||||
"Media Info": "Info multimedia",
|
||||
"Update Frequency": "Frecuencia de actualización",
|
||||
"Every Sentence": "Cada oración",
|
||||
"Every Paragraph": "Cada párrafo",
|
||||
"Every Chapter": "Cada capítulo",
|
||||
"TTS Media Info Update Frequency": "Frecuencia de actualización de info multimedia TTS",
|
||||
"Select reading speed": "Seleccionar velocidad de lectura",
|
||||
"Drag to seek": "Arrastra para buscar",
|
||||
"Punctuation Delay": "Retraso de puntuación",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Confirme que esta conexión OPDS se enrutará a través de los servidores de Readest en la aplicación web antes de continuar.",
|
||||
"Custom Headers": "Encabezados personalizados",
|
||||
"Custom Headers (optional)": "Encabezados personalizados (opcional)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Añada un encabezado por línea usando \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Entiendo que esta conexión OPDS se enrutará a través de los servidores de Readest en la aplicación web. Si no confío en Readest con estas credenciales o encabezados, debería usar la aplicación nativa.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "No se puede conectar a Hardcover. Compruebe su conexión de red.",
|
||||
"Invalid Hardcover API token": "Token de API de Hardcover no válido",
|
||||
"Disconnected from Hardcover": "Desconectado de Hardcover",
|
||||
"Hardcover Settings": "Ajustes de Hardcover",
|
||||
"Connected to Hardcover": "Conectado a Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Conecte su cuenta de Hardcover para sincronizar el progreso de lectura y las notas.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Obtenga su token de API en hardcover.app → Ajustes → API.",
|
||||
"API Token": "Token de API",
|
||||
"Paste your Hardcover API token": "Pegue su token de API de Hardcover",
|
||||
"Hardcover sync enabled for this book": "Sincronización de Hardcover activada para este libro",
|
||||
"Hardcover sync disabled for this book": "Sincronización de Hardcover desactivada para este libro",
|
||||
"Hardcover Sync": "Sincronización de Hardcover",
|
||||
"Enable for This Book": "Activar para este libro",
|
||||
"Push Notes": "Enviar notas",
|
||||
"Enable Hardcover sync for this book first.": "Active primero la sincronización de Hardcover para este libro.",
|
||||
"No annotations or excerpts to sync for this book.": "No hay anotaciones ni extractos para sincronizar en este libro.",
|
||||
"Configure Hardcover in Settings first.": "Configure Hardcover en los ajustes primero.",
|
||||
"No new Hardcover note changes to sync.": "No hay nuevos cambios en notas de Hardcover para sincronizar.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover sincronizado: {{inserted}} nuevos, {{updated}} actualizados, {{skipped}} sin cambios",
|
||||
"Hardcover notes sync failed: {{error}}": "Error al sincronizar notas de Hardcover: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Progreso de lectura sincronizado con Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Error al sincronizar progreso de Hardcover: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Mantener el identificador de origen existente",
|
||||
"Toggle Toolbar": "Alternar barra de herramientas"
|
||||
}
|
||||
|
||||
@@ -183,7 +183,6 @@
|
||||
"RTL Direction": "جهت راستبهچپ",
|
||||
"Maximum Column Height": "حداکثر ارتفاع ستون",
|
||||
"Maximum Column Width": "حداکثر عرض ستون",
|
||||
"Continuous Scroll": "پیمایش مداوم",
|
||||
"Fullscreen": "تمامصفحه",
|
||||
"No supported files found. Supported formats: {{formats}}": "فایل پشتیبانیشدهای یافت نشد. فرمتهای قابل پشتیبانی: {{formats}}",
|
||||
"Drop to Import Books": "برای وارد کردن کتابها، فایل را رها کنید",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "کلمات",
|
||||
"{{time}} left": "{{time}} باقیمانده",
|
||||
"Reading progress": "پیشرفت مطالعه",
|
||||
"Click to seek": "برای جستجو کلیک کنید",
|
||||
"Skip back 15 words": "۱۵ کلمه به عقب",
|
||||
"Back 15 words (Shift+Left)": "۱۵ کلمه به عقب (Shift+Left)",
|
||||
"Pause (Space)": "توقف (Space)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "{{count}} کتاب بهروزرسانی شد",
|
||||
"{{count}} books refreshed_other": "{{count}} کتاب بهروزرسانی شد",
|
||||
"Failed to refresh metadata": "بهروزرسانی فراداده ناموفق",
|
||||
"Refresh Metadata": "بهروزرسانی فراداده"
|
||||
"Refresh Metadata": "بهروزرسانی فراداده",
|
||||
"Keyboard Shortcuts": "میانبرهای صفحهکلید",
|
||||
"View all keyboard shortcuts": "مشاهده همه میانبرهای صفحهکلید",
|
||||
"Switch Sidebar Tab": "تغییر زبانه نوار کناری",
|
||||
"Toggle Notebook": "نمایش/پنهان کردن دفترچه یادداشت",
|
||||
"Search in Book": "جستجو در کتاب",
|
||||
"Toggle Scroll Mode": "تغییر حالت پیمایش",
|
||||
"Toggle Select Mode": "تغییر حالت انتخاب",
|
||||
"Toggle Bookmark": "تغییر نشانک",
|
||||
"Toggle Text to Speech": "تغییر متن به گفتار",
|
||||
"Play / Pause TTS": "پخش / توقف TTS",
|
||||
"Toggle Paragraph Mode": "تغییر حالت پاراگراف",
|
||||
"Highlight Selection": "برجستهسازی انتخاب",
|
||||
"Underline Selection": "زیرخط انتخاب",
|
||||
"Annotate Selection": "افزودن یادداشت به انتخاب",
|
||||
"Search Selection": "جستجوی انتخاب",
|
||||
"Copy Selection": "کپی انتخاب",
|
||||
"Translate Selection": "ترجمه انتخاب",
|
||||
"Dictionary Lookup": "جستجو در فرهنگ لغت",
|
||||
"Wikipedia Lookup": "جستجو در ویکیپدیا",
|
||||
"Read Aloud Selection": "خواندن بلند انتخاب",
|
||||
"Proofread Selection": "بازبینی انتخاب",
|
||||
"Open Settings": "باز کردن تنظیمات",
|
||||
"Open Command Palette": "باز کردن پالت فرمان",
|
||||
"Show Keyboard Shortcuts": "نمایش میانبرهای صفحهکلید",
|
||||
"Open Books": "باز کردن کتابها",
|
||||
"Toggle Fullscreen": "تغییر تمامصفحه",
|
||||
"Close Window": "بستن پنجره",
|
||||
"Quit App": "خروج از برنامه",
|
||||
"Go Left / Previous Page": "رفتن به چپ / صفحه قبلی",
|
||||
"Go Right / Next Page": "رفتن به راست / صفحه بعدی",
|
||||
"Go Up": "رفتن به بالا",
|
||||
"Go Down": "رفتن به پایین",
|
||||
"Previous Chapter": "فصل قبلی",
|
||||
"Next Chapter": "فصل بعدی",
|
||||
"Scroll Half Page Down": "پیمایش نیم صفحه پایین",
|
||||
"Scroll Half Page Up": "پیمایش نیم صفحه بالا",
|
||||
"Save Note": "ذخیره یادداشت",
|
||||
"Single Section Scroll": "پیمایش تکبخشی",
|
||||
"General": "عمومی",
|
||||
"Text to Speech": "تبدیل متن به گفتار",
|
||||
"Zoom": "بزرگنمایی",
|
||||
"Window": "پنجره",
|
||||
"Your Bookshelf": "قفسه کتاب شما",
|
||||
"TTS": "تبدیل متن به گفتار",
|
||||
"Media Info": "اطلاعات رسانه",
|
||||
"Update Frequency": "تناوب بهروزرسانی",
|
||||
"Every Sentence": "هر جمله",
|
||||
"Every Paragraph": "هر پاراگراف",
|
||||
"Every Chapter": "هر فصل",
|
||||
"TTS Media Info Update Frequency": "تناوب بهروزرسانی اطلاعات رسانه TTS",
|
||||
"Select reading speed": "انتخاب سرعت خواندن",
|
||||
"Drag to seek": "بکشید برای جستجو",
|
||||
"Punctuation Delay": "تأخیر نشانهگذاری",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "لطفاً تأیید کنید که این اتصال OPDS از طریق سرورهای Readest در برنامه وب پروکسی خواهد شد.",
|
||||
"Custom Headers": "سرآیندهای سفارشی",
|
||||
"Custom Headers (optional)": "سرآیندهای سفارشی (اختیاری)",
|
||||
"Add one header per line using \"Header-Name: value\".": "در هر خط یک سرآیند با استفاده از \"Header-Name: value\" اضافه کنید.",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "متوجه هستم که این اتصال OPDS از طریق سرورهای Readest در برنامه وب پروکسی خواهد شد. اگر به Readest برای این اعتبارنامهها یا سرآیندها اعتماد ندارم، باید از برنامه بومی استفاده کنم.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "اتصال به Hardcover ممکن نیست. لطفاً اتصال شبکه خود را بررسی کنید.",
|
||||
"Invalid Hardcover API token": "توکن API نامعتبر Hardcover",
|
||||
"Disconnected from Hardcover": "قطع اتصال از Hardcover",
|
||||
"Hardcover Settings": "تنظیمات Hardcover",
|
||||
"Connected to Hardcover": "متصل به Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "حساب Hardcover خود را برای همگامسازی پیشرفت مطالعه و یادداشتها متصل کنید.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "توکن API خود را از hardcover.app ← تنظیمات ← API دریافت کنید.",
|
||||
"API Token": "توکن API",
|
||||
"Paste your Hardcover API token": "توکن API Hardcover خود را جایگذاری کنید",
|
||||
"Hardcover sync enabled for this book": "همگامسازی Hardcover برای این کتاب فعال شد",
|
||||
"Hardcover sync disabled for this book": "همگامسازی Hardcover برای این کتاب غیرفعال شد",
|
||||
"Hardcover Sync": "همگامسازی Hardcover",
|
||||
"Enable for This Book": "فعالسازی برای این کتاب",
|
||||
"Push Notes": "ارسال یادداشتها",
|
||||
"Enable Hardcover sync for this book first.": "ابتدا همگامسازی Hardcover را برای این کتاب فعال کنید.",
|
||||
"No annotations or excerpts to sync for this book.": "هیچ حاشیهنویسی یا گزیدهای برای همگامسازی این کتاب وجود ندارد.",
|
||||
"Configure Hardcover in Settings first.": "ابتدا Hardcover را در تنظیمات پیکربندی کنید.",
|
||||
"No new Hardcover note changes to sync.": "تغییرات جدیدی در یادداشتهای Hardcover برای همگامسازی وجود ندارد.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover همگامسازی شد: {{inserted}} جدید، {{updated}} بهروزرسانی، {{skipped}} بدون تغییر",
|
||||
"Hardcover notes sync failed: {{error}}": "همگامسازی یادداشتهای Hardcover ناموفق: {{error}}",
|
||||
"Reading progress synced to Hardcover": "پیشرفت مطالعه با Hardcover همگامسازی شد",
|
||||
"Hardcover progress sync failed: {{error}}": "همگامسازی پیشرفت Hardcover ناموفق: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "حفظ شناسه منبع موجود",
|
||||
"Toggle Toolbar": "تغییر نوار ابزار"
|
||||
}
|
||||
|
||||
@@ -183,7 +183,6 @@
|
||||
"RTL Direction": "Direction RTL",
|
||||
"Maximum Column Height": "Hauteur maximale de colonne",
|
||||
"Maximum Column Width": "Largeur maximale de colonne",
|
||||
"Continuous Scroll": "Défilement continu",
|
||||
"Fullscreen": "Plein écran",
|
||||
"No supported files found. Supported formats: {{formats}}": "Aucun fichier pris en charge trouvé. Formats pris en charge : {{formats}}",
|
||||
"Drop to Import Books": "Déposez pour importer des livres",
|
||||
@@ -995,7 +994,6 @@
|
||||
"words": "mots",
|
||||
"{{time}} left": "{{time}} restant",
|
||||
"Reading progress": "Progression de la lecture",
|
||||
"Click to seek": "Cliquer pour chercher",
|
||||
"Skip back 15 words": "Reculer de 15 mots",
|
||||
"Back 15 words (Shift+Left)": "Reculer de 15 mots (Shift+Left)",
|
||||
"Pause (Space)": "Pause (Espace)",
|
||||
@@ -1115,5 +1113,88 @@
|
||||
"{{count}} books refreshed_many": "{{count}} livres rafraîchis",
|
||||
"{{count}} books refreshed_other": "{{count}} livres rafraîchis",
|
||||
"Failed to refresh metadata": "Échec du rafraîchissement des métadonnées",
|
||||
"Refresh Metadata": "Rafraîchir les métadonnées"
|
||||
"Refresh Metadata": "Rafraîchir les métadonnées",
|
||||
"Keyboard Shortcuts": "Raccourcis clavier",
|
||||
"View all keyboard shortcuts": "Voir tous les raccourcis clavier",
|
||||
"Switch Sidebar Tab": "Changer l'onglet de la barre latérale",
|
||||
"Toggle Notebook": "Afficher/masquer le carnet",
|
||||
"Search in Book": "Rechercher dans le livre",
|
||||
"Toggle Scroll Mode": "Basculer le mode défilement",
|
||||
"Toggle Select Mode": "Basculer le mode sélection",
|
||||
"Toggle Bookmark": "Basculer le signet",
|
||||
"Toggle Text to Speech": "Basculer la synthèse vocale",
|
||||
"Play / Pause TTS": "Lecture / Pause TTS",
|
||||
"Toggle Paragraph Mode": "Basculer le mode paragraphe",
|
||||
"Highlight Selection": "Surligner la sélection",
|
||||
"Underline Selection": "Souligner la sélection",
|
||||
"Annotate Selection": "Annoter la sélection",
|
||||
"Search Selection": "Rechercher la sélection",
|
||||
"Copy Selection": "Copier la sélection",
|
||||
"Translate Selection": "Traduire la sélection",
|
||||
"Dictionary Lookup": "Recherche dans le dictionnaire",
|
||||
"Wikipedia Lookup": "Recherche sur Wikipédia",
|
||||
"Read Aloud Selection": "Lire la sélection à voix haute",
|
||||
"Proofread Selection": "Relire la sélection",
|
||||
"Open Settings": "Ouvrir les paramètres",
|
||||
"Open Command Palette": "Ouvrir la palette de commandes",
|
||||
"Show Keyboard Shortcuts": "Afficher les raccourcis clavier",
|
||||
"Open Books": "Ouvrir les livres",
|
||||
"Toggle Fullscreen": "Basculer en plein écran",
|
||||
"Close Window": "Fermer la fenêtre",
|
||||
"Quit App": "Quitter l'application",
|
||||
"Go Left / Previous Page": "Aller à gauche / Page précédente",
|
||||
"Go Right / Next Page": "Aller à droite / Page suivante",
|
||||
"Go Up": "Aller en haut",
|
||||
"Go Down": "Aller en bas",
|
||||
"Previous Chapter": "Chapitre précédent",
|
||||
"Next Chapter": "Chapitre suivant",
|
||||
"Scroll Half Page Down": "Défiler d'une demi-page vers le bas",
|
||||
"Scroll Half Page Up": "Défiler d'une demi-page vers le haut",
|
||||
"Save Note": "Enregistrer la note",
|
||||
"Single Section Scroll": "Défilement par section",
|
||||
"General": "Général",
|
||||
"Text to Speech": "Synthèse vocale",
|
||||
"Zoom": "Zoom",
|
||||
"Window": "Fenêtre",
|
||||
"Your Bookshelf": "Votre bibliothèque",
|
||||
"TTS": "Synthèse vocale",
|
||||
"Media Info": "Infos média",
|
||||
"Update Frequency": "Fréquence de mise à jour",
|
||||
"Every Sentence": "Chaque phrase",
|
||||
"Every Paragraph": "Chaque paragraphe",
|
||||
"Every Chapter": "Chaque chapitre",
|
||||
"TTS Media Info Update Frequency": "Fréquence de mise à jour des infos média TTS",
|
||||
"Select reading speed": "Sélectionner la vitesse de lecture",
|
||||
"Drag to seek": "Glisser pour chercher",
|
||||
"Punctuation Delay": "Délai de ponctuation",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Veuillez confirmer que cette connexion OPDS sera acheminée via les serveurs Readest sur l'application web avant de continuer.",
|
||||
"Custom Headers": "En-têtes personnalisés",
|
||||
"Custom Headers (optional)": "En-têtes personnalisés (facultatif)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Ajoutez un en-tête par ligne en utilisant \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Je comprends que cette connexion OPDS sera acheminée via les serveurs Readest sur l'application web. Si je ne fais pas confiance à Readest pour ces identifiants ou en-têtes, je devrais utiliser l'application native.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Impossible de se connecter à Hardcover. Veuillez vérifier votre connexion réseau.",
|
||||
"Invalid Hardcover API token": "Jeton API Hardcover invalide",
|
||||
"Disconnected from Hardcover": "Déconnecté de Hardcover",
|
||||
"Hardcover Settings": "Paramètres Hardcover",
|
||||
"Connected to Hardcover": "Connecté à Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Connectez votre compte Hardcover pour synchroniser la progression de lecture et les notes.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Obtenez votre jeton API depuis hardcover.app → Paramètres → API.",
|
||||
"API Token": "Jeton API",
|
||||
"Paste your Hardcover API token": "Collez votre jeton API Hardcover",
|
||||
"Hardcover sync enabled for this book": "Synchronisation Hardcover activée pour ce livre",
|
||||
"Hardcover sync disabled for this book": "Synchronisation Hardcover désactivée pour ce livre",
|
||||
"Hardcover Sync": "Synchronisation Hardcover",
|
||||
"Enable for This Book": "Activer pour ce livre",
|
||||
"Push Notes": "Envoyer les notes",
|
||||
"Enable Hardcover sync for this book first.": "Activez d'abord la synchronisation Hardcover pour ce livre.",
|
||||
"No annotations or excerpts to sync for this book.": "Aucune annotation ni extrait à synchroniser pour ce livre.",
|
||||
"Configure Hardcover in Settings first.": "Configurez d'abord Hardcover dans les paramètres.",
|
||||
"No new Hardcover note changes to sync.": "Aucun nouveau changement de notes Hardcover à synchroniser.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover synchronisé : {{inserted}} nouveaux, {{updated}} mis à jour, {{skipped}} inchangés",
|
||||
"Hardcover notes sync failed: {{error}}": "Échec de la synchronisation des notes Hardcover : {{error}}",
|
||||
"Reading progress synced to Hardcover": "Progression de lecture synchronisée avec Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Échec de la synchronisation de la progression Hardcover : {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Conserver l'identifiant source existant",
|
||||
"Toggle Toolbar": "Basculer la barre d'outils"
|
||||
}
|
||||
|
||||
@@ -493,7 +493,6 @@
|
||||
"words": "מילים",
|
||||
"{{time}} left": "נותרו {{time}}",
|
||||
"Reading progress": "התקדמות קריאה",
|
||||
"Click to seek": "לחץ לחיפוש",
|
||||
"Skip back 15 words": "קפוץ 15 מילים אחורה",
|
||||
"Back 15 words (Shift+Left)": "15 מילים אחורה (Shift+Left)",
|
||||
"Pause": "השהה",
|
||||
@@ -853,7 +852,6 @@
|
||||
"Override Book Color": "דרוס צבע ספר",
|
||||
"None": "ללא",
|
||||
"Scroll": "גלילה",
|
||||
"Continuous Scroll": "גלילה רציפה",
|
||||
"Overlap Pixels": "פיקסלים לחפיפה",
|
||||
"Pagination": "עימוד (Pagination)",
|
||||
"Tap to Paginate": "הקש לעימוד",
|
||||
@@ -1115,5 +1113,88 @@
|
||||
"{{count}} books refreshed_two": "{{count}} ספרים רועננו",
|
||||
"{{count}} books refreshed_other": "{{count}} ספרים רועננו",
|
||||
"Failed to refresh metadata": "רענון המטא-נתונים נכשל",
|
||||
"Refresh Metadata": "רענון מטא-נתונים"
|
||||
"Refresh Metadata": "רענון מטא-נתונים",
|
||||
"Keyboard Shortcuts": "קיצורי מקלדת",
|
||||
"View all keyboard shortcuts": "הצג את כל קיצורי המקלדת",
|
||||
"Switch Sidebar Tab": "החלף לשונית סרגל צד",
|
||||
"Toggle Notebook": "הצג/הסתר מחברת",
|
||||
"Search in Book": "חפש בספר",
|
||||
"Toggle Scroll Mode": "החלף מצב גלילה",
|
||||
"Toggle Select Mode": "החלף מצב בחירה",
|
||||
"Toggle Bookmark": "החלף סימנייה",
|
||||
"Toggle Text to Speech": "החלף טקסט לדיבור",
|
||||
"Play / Pause TTS": "נגן / השהה TTS",
|
||||
"Toggle Paragraph Mode": "החלף מצב פסקה",
|
||||
"Highlight Selection": "הדגש בחירה",
|
||||
"Underline Selection": "קו תחתון לבחירה",
|
||||
"Annotate Selection": "הוסף הערה לבחירה",
|
||||
"Search Selection": "חפש בחירה",
|
||||
"Copy Selection": "העתק בחירה",
|
||||
"Translate Selection": "תרגם בחירה",
|
||||
"Dictionary Lookup": "חיפוש במילון",
|
||||
"Wikipedia Lookup": "חיפוש בוויקיפדיה",
|
||||
"Read Aloud Selection": "קרא בקול את הבחירה",
|
||||
"Proofread Selection": "הגה בחירה",
|
||||
"Open Settings": "פתח הגדרות",
|
||||
"Open Command Palette": "פתח לוח פקודות",
|
||||
"Show Keyboard Shortcuts": "הצג קיצורי מקלדת",
|
||||
"Open Books": "פתח ספרים",
|
||||
"Toggle Fullscreen": "החלף מסך מלא",
|
||||
"Close Window": "סגור חלון",
|
||||
"Quit App": "צא מהאפליקציה",
|
||||
"Go Left / Previous Page": "שמאלה / עמוד קודם",
|
||||
"Go Right / Next Page": "ימינה / עמוד הבא",
|
||||
"Go Up": "למעלה",
|
||||
"Go Down": "למטה",
|
||||
"Previous Chapter": "פרק קודם",
|
||||
"Next Chapter": "פרק הבא",
|
||||
"Scroll Half Page Down": "גלול חצי עמוד למטה",
|
||||
"Scroll Half Page Up": "גלול חצי עמוד למעלה",
|
||||
"Save Note": "שמור הערה",
|
||||
"Single Section Scroll": "גלילת קטע בודד",
|
||||
"General": "כללי",
|
||||
"Text to Speech": "טקסט לדיבור",
|
||||
"Zoom": "זום",
|
||||
"Window": "חלון",
|
||||
"Your Bookshelf": "מדף הספרים שלך",
|
||||
"TTS": "הקראה",
|
||||
"Media Info": "פרטי מדיה",
|
||||
"Update Frequency": "תדירות עדכון",
|
||||
"Every Sentence": "כל משפט",
|
||||
"Every Paragraph": "כל פסקה",
|
||||
"Every Chapter": "כל פרק",
|
||||
"TTS Media Info Update Frequency": "תדירות עדכון פרטי מדיה TTS",
|
||||
"Select reading speed": "בחר מהירות קריאה",
|
||||
"Drag to seek": "גרור לחיפוש",
|
||||
"Punctuation Delay": "השהיית פיסוק",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "אנא אשר שחיבור OPDS זה יועבר דרך שרתי Readest באפליקציית האינטרנט לפני שתמשיך.",
|
||||
"Custom Headers": "כותרות מותאמות אישית",
|
||||
"Custom Headers (optional)": "כותרות מותאמות אישית (אופציונלי)",
|
||||
"Add one header per line using \"Header-Name: value\".": "הוסף כותרת אחת לכל שורה בפורמט \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "אני מבין שחיבור OPDS זה יועבר דרך שרתי Readest באפליקציית האינטרנט. אם אינני סומך על Readest עם פרטי ההתחברות או הכותרות האלה, עליי להשתמש באפליקציה המקורית.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "לא ניתן להתחבר ל-Hardcover. אנא בדוק את חיבור הרשת שלך.",
|
||||
"Invalid Hardcover API token": "טוקן API של Hardcover לא חוקי",
|
||||
"Disconnected from Hardcover": "מנותק מ-Hardcover",
|
||||
"Hardcover Settings": "הגדרות Hardcover",
|
||||
"Connected to Hardcover": "מחובר ל-Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "חבר את חשבון ה-Hardcover שלך לסנכרון התקדמות קריאה והערות.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "קבל את טוקן ה-API שלך מ-hardcover.app ← הגדרות ← API.",
|
||||
"API Token": "טוקן API",
|
||||
"Paste your Hardcover API token": "הדבק את טוקן ה-API של Hardcover שלך",
|
||||
"Hardcover sync enabled for this book": "סנכרון Hardcover הופעל לספר זה",
|
||||
"Hardcover sync disabled for this book": "סנכרון Hardcover הושבת לספר זה",
|
||||
"Hardcover Sync": "סנכרון Hardcover",
|
||||
"Enable for This Book": "הפעל לספר זה",
|
||||
"Push Notes": "שלח הערות",
|
||||
"Enable Hardcover sync for this book first.": "הפעל תחילה סנכרון Hardcover לספר זה.",
|
||||
"No annotations or excerpts to sync for this book.": "אין הערות או ציטוטים לסנכרון עבור ספר זה.",
|
||||
"Configure Hardcover in Settings first.": "הגדר תחילה את Hardcover בהגדרות.",
|
||||
"No new Hardcover note changes to sync.": "אין שינויים חדשים בהערות Hardcover לסנכרון.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover סונכרן: {{inserted}} חדשים, {{updated}} עודכנו, {{skipped}} ללא שינוי",
|
||||
"Hardcover notes sync failed: {{error}}": "סנכרון הערות Hardcover נכשל: {{error}}",
|
||||
"Reading progress synced to Hardcover": "התקדמות הקריאה סונכרנה ל-Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "סנכרון התקדמות Hardcover נכשל: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "שמור על מזהה המקור הקיים",
|
||||
"Toggle Toolbar": "הצג/הסתר סרגל כלים"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "RTL दिशा",
|
||||
"Maximum Column Height": "कॉलम की अधिकतम ऊँचाई",
|
||||
"Maximum Column Width": "कॉलम की अधिकतम चौड़ाई",
|
||||
"Continuous Scroll": "निरंतर स्क्रॉल",
|
||||
"Fullscreen": "पूर्णस्क्रीन",
|
||||
"No supported files found. Supported formats: {{formats}}": "कोई समर्थित फ़ाइलें नहीं मिलीं। समर्थित प्रारूप: {{formats}}",
|
||||
"Drop to Import Books": "पुस्तकें आयात करने के लिए छोड़ें",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "शब्द",
|
||||
"{{time}} left": "{{time}} शेष",
|
||||
"Reading progress": "पठन प्रगति",
|
||||
"Click to seek": "सीक करने के लिए क्लिक करें",
|
||||
"Skip back 15 words": "15 शब्द पीछे",
|
||||
"Back 15 words (Shift+Left)": "15 शब्द पीछे (Shift+Left)",
|
||||
"Pause (Space)": "विराम (Space)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "{{count}} पुस्तक रिफ्रेश हुई",
|
||||
"{{count}} books refreshed_other": "{{count}} पुस्तकें रिफ्रेश हुईं",
|
||||
"Failed to refresh metadata": "मेटाडेटा रिफ्रेश विफल",
|
||||
"Refresh Metadata": "मेटाडेटा रिफ्रेश करें"
|
||||
"Refresh Metadata": "मेटाडेटा रिफ्रेश करें",
|
||||
"Keyboard Shortcuts": "कीबोर्ड शॉर्टकट",
|
||||
"View all keyboard shortcuts": "सभी कीबोर्ड शॉर्टकट देखें",
|
||||
"Switch Sidebar Tab": "साइडबार टैब बदलें",
|
||||
"Toggle Notebook": "नोटबुक दिखाएँ/छुपाएँ",
|
||||
"Search in Book": "पुस्तक में खोजें",
|
||||
"Toggle Scroll Mode": "स्क्रॉल मोड टॉगल करें",
|
||||
"Toggle Select Mode": "चयन मोड टॉगल करें",
|
||||
"Toggle Bookmark": "बुकमार्क टॉगल करें",
|
||||
"Toggle Text to Speech": "टेक्स्ट टू स्पीच टॉगल करें",
|
||||
"Play / Pause TTS": "TTS चलाएँ / रोकें",
|
||||
"Toggle Paragraph Mode": "अनुच्छेद मोड टॉगल करें",
|
||||
"Highlight Selection": "चयन हाइलाइट करें",
|
||||
"Underline Selection": "चयन अंडरलाइन करें",
|
||||
"Annotate Selection": "चयन पर टिप्पणी करें",
|
||||
"Search Selection": "चयन खोजें",
|
||||
"Copy Selection": "चयन कॉपी करें",
|
||||
"Translate Selection": "चयन का अनुवाद करें",
|
||||
"Dictionary Lookup": "शब्दकोश में खोजें",
|
||||
"Wikipedia Lookup": "विकिपीडिया पर खोजें",
|
||||
"Read Aloud Selection": "चयन को ज़ोर से पढ़ें",
|
||||
"Proofread Selection": "चयन की प्रूफरीडिंग करें",
|
||||
"Open Settings": "सेटिंग्स खोलें",
|
||||
"Open Command Palette": "कमांड पैलेट खोलें",
|
||||
"Show Keyboard Shortcuts": "कीबोर्ड शॉर्टकट दिखाएँ",
|
||||
"Open Books": "पुस्तकें खोलें",
|
||||
"Toggle Fullscreen": "पूर्ण स्क्रीन टॉगल करें",
|
||||
"Close Window": "विंडो बंद करें",
|
||||
"Quit App": "ऐप से बाहर निकलें",
|
||||
"Go Left / Previous Page": "बाएँ जाएँ / पिछला पृष्ठ",
|
||||
"Go Right / Next Page": "दाएँ जाएँ / अगला पृष्ठ",
|
||||
"Go Up": "ऊपर जाएँ",
|
||||
"Go Down": "नीचे जाएँ",
|
||||
"Previous Chapter": "पिछला अध्याय",
|
||||
"Next Chapter": "अगला अध्याय",
|
||||
"Scroll Half Page Down": "आधा पृष्ठ नीचे स्क्रॉल करें",
|
||||
"Scroll Half Page Up": "आधा पृष्ठ ऊपर स्क्रॉल करें",
|
||||
"Save Note": "नोट सहेजें",
|
||||
"Single Section Scroll": "एकल अनुभाग स्क्रॉल",
|
||||
"General": "सामान्य",
|
||||
"Text to Speech": "पाठ से वाक्",
|
||||
"Zoom": "ज़ूम",
|
||||
"Window": "विंडो",
|
||||
"Your Bookshelf": "आपकी किताबों की अलमारी",
|
||||
"TTS": "पाठ से वाक्",
|
||||
"Media Info": "मीडिया जानकारी",
|
||||
"Update Frequency": "अपडेट आवृत्ति",
|
||||
"Every Sentence": "हर वाक्य",
|
||||
"Every Paragraph": "हर पैराग्राफ",
|
||||
"Every Chapter": "हर अध्याय",
|
||||
"TTS Media Info Update Frequency": "TTS मीडिया जानकारी अपडेट आवृत्ति",
|
||||
"Select reading speed": "पढ़ने की गति चुनें",
|
||||
"Drag to seek": "खोजने के लिए खींचें",
|
||||
"Punctuation Delay": "विराम चिह्न विलंब",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "कृपया जारी रखने से पहले पुष्टि करें कि यह OPDS कनेक्शन वेब ऐप पर Readest सर्वर के माध्यम से प्रॉक्सी किया जाएगा।",
|
||||
"Custom Headers": "कस्टम हेडर",
|
||||
"Custom Headers (optional)": "कस्टम हेडर (वैकल्पिक)",
|
||||
"Add one header per line using \"Header-Name: value\".": "\"Header-Name: value\" का उपयोग करके प्रति पंक्ति एक हेडर जोड़ें।",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "मैं समझता/समझती हूँ कि यह OPDS कनेक्शन वेब ऐप पर Readest सर्वर के माध्यम से प्रॉक्सी किया जाएगा। यदि मुझे इन क्रेडेंशियल या हेडर के साथ Readest पर भरोसा नहीं है, तो मुझे नेटिव ऐप का उपयोग करना चाहिए।",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Hardcover से कनेक्ट करने में असमर्थ। कृपया अपना नेटवर्क कनेक्शन जाँचें।",
|
||||
"Invalid Hardcover API token": "अमान्य Hardcover API टोकन",
|
||||
"Disconnected from Hardcover": "Hardcover से डिस्कनेक्ट हो गया",
|
||||
"Hardcover Settings": "Hardcover सेटिंग्स",
|
||||
"Connected to Hardcover": "Hardcover से कनेक्टेड",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "पढ़ने की प्रगति और नोट्स सिंक करने के लिए अपना Hardcover खाता कनेक्ट करें।",
|
||||
"Get your API token from hardcover.app → Settings → API.": "hardcover.app → सेटिंग्स → API से अपना API टोकन प्राप्त करें।",
|
||||
"API Token": "API टोकन",
|
||||
"Paste your Hardcover API token": "अपना Hardcover API टोकन पेस्ट करें",
|
||||
"Hardcover sync enabled for this book": "इस पुस्तक के लिए Hardcover सिंक सक्षम",
|
||||
"Hardcover sync disabled for this book": "इस पुस्तक के लिए Hardcover सिंक अक्षम",
|
||||
"Hardcover Sync": "Hardcover सिंक",
|
||||
"Enable for This Book": "इस पुस्तक के लिए सक्षम करें",
|
||||
"Push Notes": "नोट्स भेजें",
|
||||
"Enable Hardcover sync for this book first.": "पहले इस पुस्तक के लिए Hardcover सिंक सक्षम करें।",
|
||||
"No annotations or excerpts to sync for this book.": "इस पुस्तक के लिए सिंक करने हेतु कोई एनोटेशन या अंश नहीं हैं।",
|
||||
"Configure Hardcover in Settings first.": "पहले सेटिंग्स में Hardcover कॉन्फ़िगर करें।",
|
||||
"No new Hardcover note changes to sync.": "सिंक करने के लिए कोई नया Hardcover नोट परिवर्तन नहीं है।",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover सिंक हुआ: {{inserted}} नए, {{updated}} अपडेटेड, {{skipped}} अपरिवर्तित",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover नोट्स सिंक विफल: {{error}}",
|
||||
"Reading progress synced to Hardcover": "पढ़ने की प्रगति Hardcover से सिंक हो गई",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover प्रगति सिंक विफल: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "मौजूदा स्रोत पहचानकर्ता रखें",
|
||||
"Toggle Toolbar": "टूलबार टॉगल करें"
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "Arah RTL",
|
||||
"Maximum Column Height": "Tinggi Kolom Maksimum",
|
||||
"Maximum Column Width": "Lebar Kolom Maksimum",
|
||||
"Continuous Scroll": "Gulir Terus",
|
||||
"Fullscreen": "Layar Penuh",
|
||||
"No supported files found. Supported formats: {{formats}}": "Tidak ada file yang didukung ditemukan. Format yang didukung: {{formats}}",
|
||||
"Drop to Import Books": "Jatuhkan untuk Mengimpor Buku",
|
||||
@@ -971,7 +970,6 @@
|
||||
"words": "kata",
|
||||
"{{time}} left": "{{time}} tersisa",
|
||||
"Reading progress": "Kemajuan membaca",
|
||||
"Click to seek": "Klik untuk mencari",
|
||||
"Skip back 15 words": "Lompat mundur 15 kata",
|
||||
"Back 15 words (Shift+Left)": "Mundur 15 kata (Shift+Kiri)",
|
||||
"Pause (Space)": "Jeda (Spasi)",
|
||||
@@ -1089,5 +1087,88 @@
|
||||
"Loading library...": "Memuat perpustakaan...",
|
||||
"{{count}} books refreshed_other": "{{count}} buku diperbarui",
|
||||
"Failed to refresh metadata": "Gagal memperbarui metadata",
|
||||
"Refresh Metadata": "Perbarui Metadata"
|
||||
"Refresh Metadata": "Perbarui Metadata",
|
||||
"Keyboard Shortcuts": "Pintasan Keyboard",
|
||||
"View all keyboard shortcuts": "Lihat semua pintasan keyboard",
|
||||
"Switch Sidebar Tab": "Ganti tab bilah sisi",
|
||||
"Toggle Notebook": "Tampilkan/sembunyikan buku catatan",
|
||||
"Search in Book": "Cari di buku",
|
||||
"Toggle Scroll Mode": "Alihkan mode gulir",
|
||||
"Toggle Select Mode": "Alihkan mode pilih",
|
||||
"Toggle Bookmark": "Alihkan penanda",
|
||||
"Toggle Text to Speech": "Alihkan teks ke suara",
|
||||
"Play / Pause TTS": "Putar / Jeda TTS",
|
||||
"Toggle Paragraph Mode": "Alihkan mode paragraf",
|
||||
"Highlight Selection": "Sorot pilihan",
|
||||
"Underline Selection": "Garis bawahi pilihan",
|
||||
"Annotate Selection": "Beri anotasi pilihan",
|
||||
"Search Selection": "Cari pilihan",
|
||||
"Copy Selection": "Salin pilihan",
|
||||
"Translate Selection": "Terjemahkan pilihan",
|
||||
"Dictionary Lookup": "Cari di kamus",
|
||||
"Wikipedia Lookup": "Cari di Wikipedia",
|
||||
"Read Aloud Selection": "Bacakan pilihan",
|
||||
"Proofread Selection": "Periksa ejaan pilihan",
|
||||
"Open Settings": "Buka pengaturan",
|
||||
"Open Command Palette": "Buka palet perintah",
|
||||
"Show Keyboard Shortcuts": "Tampilkan pintasan keyboard",
|
||||
"Open Books": "Buka buku",
|
||||
"Toggle Fullscreen": "Alihkan layar penuh",
|
||||
"Close Window": "Tutup jendela",
|
||||
"Quit App": "Keluar dari aplikasi",
|
||||
"Go Left / Previous Page": "Ke kiri / Halaman sebelumnya",
|
||||
"Go Right / Next Page": "Ke kanan / Halaman berikutnya",
|
||||
"Go Up": "Ke atas",
|
||||
"Go Down": "Ke bawah",
|
||||
"Previous Chapter": "Bab sebelumnya",
|
||||
"Next Chapter": "Bab berikutnya",
|
||||
"Scroll Half Page Down": "Gulir setengah halaman ke bawah",
|
||||
"Scroll Half Page Up": "Gulir setengah halaman ke atas",
|
||||
"Save Note": "Simpan catatan",
|
||||
"Single Section Scroll": "Gulir Satu Bagian",
|
||||
"General": "Umum",
|
||||
"Text to Speech": "Teks ke Suara",
|
||||
"Zoom": "Zoom",
|
||||
"Window": "Jendela",
|
||||
"Your Bookshelf": "Rak Buku Anda",
|
||||
"TTS": "Teks ke Suara",
|
||||
"Media Info": "Info Media",
|
||||
"Update Frequency": "Frekuensi Pembaruan",
|
||||
"Every Sentence": "Setiap Kalimat",
|
||||
"Every Paragraph": "Setiap Paragraf",
|
||||
"Every Chapter": "Setiap Bab",
|
||||
"TTS Media Info Update Frequency": "Frekuensi Pembaruan Info Media TTS",
|
||||
"Select reading speed": "Pilih kecepatan membaca",
|
||||
"Drag to seek": "Seret untuk mencari",
|
||||
"Punctuation Delay": "Jeda tanda baca",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Harap konfirmasi bahwa koneksi OPDS ini akan diteruskan melalui server Readest di aplikasi web sebelum melanjutkan.",
|
||||
"Custom Headers": "Header Kustom",
|
||||
"Custom Headers (optional)": "Header Kustom (opsional)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Tambahkan satu header per baris menggunakan \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Saya memahami bahwa koneksi OPDS ini akan diteruskan melalui server Readest di aplikasi web. Jika saya tidak mempercayai Readest dengan kredensial atau header ini, saya harus menggunakan aplikasi native.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Tidak dapat terhubung ke Hardcover. Periksa koneksi jaringan Anda.",
|
||||
"Invalid Hardcover API token": "Token API Hardcover tidak valid",
|
||||
"Disconnected from Hardcover": "Terputus dari Hardcover",
|
||||
"Hardcover Settings": "Pengaturan Hardcover",
|
||||
"Connected to Hardcover": "Terhubung ke Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Hubungkan akun Hardcover Anda untuk menyinkronkan progres membaca dan catatan.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Dapatkan token API Anda dari hardcover.app → Pengaturan → API.",
|
||||
"API Token": "Token API",
|
||||
"Paste your Hardcover API token": "Tempel token API Hardcover Anda",
|
||||
"Hardcover sync enabled for this book": "Sinkronisasi Hardcover diaktifkan untuk buku ini",
|
||||
"Hardcover sync disabled for this book": "Sinkronisasi Hardcover dinonaktifkan untuk buku ini",
|
||||
"Hardcover Sync": "Sinkronisasi Hardcover",
|
||||
"Enable for This Book": "Aktifkan untuk Buku Ini",
|
||||
"Push Notes": "Kirim Catatan",
|
||||
"Enable Hardcover sync for this book first.": "Aktifkan sinkronisasi Hardcover untuk buku ini terlebih dahulu.",
|
||||
"No annotations or excerpts to sync for this book.": "Tidak ada anotasi atau kutipan untuk disinkronkan pada buku ini.",
|
||||
"Configure Hardcover in Settings first.": "Konfigurasikan Hardcover di Pengaturan terlebih dahulu.",
|
||||
"No new Hardcover note changes to sync.": "Tidak ada perubahan catatan Hardcover baru untuk disinkronkan.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover disinkronkan: {{inserted}} baru, {{updated}} diperbarui, {{skipped}} tidak berubah",
|
||||
"Hardcover notes sync failed: {{error}}": "Sinkronisasi catatan Hardcover gagal: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Progres membaca disinkronkan ke Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Sinkronisasi progres Hardcover gagal: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Pertahankan pengidentifikasi sumber yang ada",
|
||||
"Toggle Toolbar": "Alihkan Bilah Alat"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "Direzione RTL",
|
||||
"Maximum Column Height": "Altezza massima colonna",
|
||||
"Maximum Column Width": "Larghezza massima colonna",
|
||||
"Continuous Scroll": "Scorrimento continuo",
|
||||
"Fullscreen": "Schermo intero",
|
||||
"No supported files found. Supported formats: {{formats}}": "Nessun file supportato trovato. Formati supportati: {{formats}}",
|
||||
"Drop to Import Books": "Rilascia per importare libri",
|
||||
@@ -995,7 +994,6 @@
|
||||
"words": "parole",
|
||||
"{{time}} left": "{{time}} rimanenti",
|
||||
"Reading progress": "Progresso lettura",
|
||||
"Click to seek": "Clicca per cercare",
|
||||
"Skip back 15 words": "Indietro di 15 parole",
|
||||
"Back 15 words (Shift+Left)": "Indietro di 15 parole (Shift+Sinistra)",
|
||||
"Pause (Space)": "Pausa (Spazio)",
|
||||
@@ -1115,5 +1113,88 @@
|
||||
"{{count}} books refreshed_many": "{{count}} libri aggiornati",
|
||||
"{{count}} books refreshed_other": "{{count}} libri aggiornati",
|
||||
"Failed to refresh metadata": "Aggiornamento metadati fallito",
|
||||
"Refresh Metadata": "Aggiorna metadati"
|
||||
"Refresh Metadata": "Aggiorna metadati",
|
||||
"Keyboard Shortcuts": "Scorciatoie da tastiera",
|
||||
"View all keyboard shortcuts": "Visualizza tutte le scorciatoie",
|
||||
"Switch Sidebar Tab": "Cambia scheda barra laterale",
|
||||
"Toggle Notebook": "Mostra/nascondi blocco note",
|
||||
"Search in Book": "Cerca nel libro",
|
||||
"Toggle Scroll Mode": "Attiva/disattiva scorrimento",
|
||||
"Toggle Select Mode": "Attiva/disattiva selezione",
|
||||
"Toggle Bookmark": "Attiva/disattiva segnalibro",
|
||||
"Toggle Text to Speech": "Attiva/disattiva sintesi vocale",
|
||||
"Play / Pause TTS": "Riproduci / Pausa TTS",
|
||||
"Toggle Paragraph Mode": "Attiva/disattiva modo paragrafo",
|
||||
"Highlight Selection": "Evidenzia selezione",
|
||||
"Underline Selection": "Sottolinea selezione",
|
||||
"Annotate Selection": "Annota selezione",
|
||||
"Search Selection": "Cerca selezione",
|
||||
"Copy Selection": "Copia selezione",
|
||||
"Translate Selection": "Traduci selezione",
|
||||
"Dictionary Lookup": "Cerca nel dizionario",
|
||||
"Wikipedia Lookup": "Cerca su Wikipedia",
|
||||
"Read Aloud Selection": "Leggi la selezione ad alta voce",
|
||||
"Proofread Selection": "Correggi selezione",
|
||||
"Open Settings": "Apri impostazioni",
|
||||
"Open Command Palette": "Apri tavolozza comandi",
|
||||
"Show Keyboard Shortcuts": "Mostra scorciatoie da tastiera",
|
||||
"Open Books": "Apri libri",
|
||||
"Toggle Fullscreen": "Attiva/disattiva schermo intero",
|
||||
"Close Window": "Chiudi finestra",
|
||||
"Quit App": "Esci dall'app",
|
||||
"Go Left / Previous Page": "Vai a sinistra / Pagina precedente",
|
||||
"Go Right / Next Page": "Vai a destra / Pagina successiva",
|
||||
"Go Up": "Vai su",
|
||||
"Go Down": "Vai giù",
|
||||
"Previous Chapter": "Capitolo precedente",
|
||||
"Next Chapter": "Capitolo successivo",
|
||||
"Scroll Half Page Down": "Scorri mezza pagina in basso",
|
||||
"Scroll Half Page Up": "Scorri mezza pagina in alto",
|
||||
"Save Note": "Salva nota",
|
||||
"Single Section Scroll": "Scorrimento a sezione singola",
|
||||
"General": "Generale",
|
||||
"Text to Speech": "Sintesi vocale",
|
||||
"Zoom": "Zoom",
|
||||
"Window": "Finestra",
|
||||
"Your Bookshelf": "La tua libreria",
|
||||
"TTS": "Sintesi vocale",
|
||||
"Media Info": "Info multimediali",
|
||||
"Update Frequency": "Frequenza aggiornamento",
|
||||
"Every Sentence": "Ogni frase",
|
||||
"Every Paragraph": "Ogni paragrafo",
|
||||
"Every Chapter": "Ogni capitolo",
|
||||
"TTS Media Info Update Frequency": "Frequenza aggiornamento info multimediali TTS",
|
||||
"Select reading speed": "Seleziona velocità di lettura",
|
||||
"Drag to seek": "Trascina per cercare",
|
||||
"Punctuation Delay": "Ritardo punteggiatura",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Conferma che questa connessione OPDS verrà instradata attraverso i server Readest nell'app web prima di continuare.",
|
||||
"Custom Headers": "Intestazioni personalizzate",
|
||||
"Custom Headers (optional)": "Intestazioni personalizzate (facoltativo)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Aggiungi un'intestazione per riga usando \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Capisco che questa connessione OPDS verrà instradata attraverso i server Readest nell'app web. Se non mi fido di Readest con queste credenziali o intestazioni, dovrei usare l'app nativa.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Impossibile connettersi a Hardcover. Controlla la connessione di rete.",
|
||||
"Invalid Hardcover API token": "Token API Hardcover non valido",
|
||||
"Disconnected from Hardcover": "Disconnesso da Hardcover",
|
||||
"Hardcover Settings": "Impostazioni Hardcover",
|
||||
"Connected to Hardcover": "Connesso a Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Collega il tuo account Hardcover per sincronizzare i progressi di lettura e le note.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Ottieni il tuo token API da hardcover.app → Impostazioni → API.",
|
||||
"API Token": "Token API",
|
||||
"Paste your Hardcover API token": "Incolla il tuo token API Hardcover",
|
||||
"Hardcover sync enabled for this book": "Sincronizzazione Hardcover attivata per questo libro",
|
||||
"Hardcover sync disabled for this book": "Sincronizzazione Hardcover disattivata per questo libro",
|
||||
"Hardcover Sync": "Sincronizzazione Hardcover",
|
||||
"Enable for This Book": "Attiva per questo libro",
|
||||
"Push Notes": "Invia note",
|
||||
"Enable Hardcover sync for this book first.": "Attiva prima la sincronizzazione Hardcover per questo libro.",
|
||||
"No annotations or excerpts to sync for this book.": "Nessuna annotazione o estratto da sincronizzare per questo libro.",
|
||||
"Configure Hardcover in Settings first.": "Configura prima Hardcover nelle impostazioni.",
|
||||
"No new Hardcover note changes to sync.": "Nessuna nuova modifica alle note Hardcover da sincronizzare.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover sincronizzato: {{inserted}} nuovi, {{updated}} aggiornati, {{skipped}} invariati",
|
||||
"Hardcover notes sync failed: {{error}}": "Sincronizzazione note Hardcover non riuscita: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Progressi di lettura sincronizzati con Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Sincronizzazione progressi Hardcover non riuscita: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Mantieni l'identificatore sorgente esistente",
|
||||
"Toggle Toolbar": "Mostra/nascondi barra degli strumenti"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "RTL方向",
|
||||
"Maximum Column Height": "最大列高",
|
||||
"Maximum Column Width": "最大列幅",
|
||||
"Continuous Scroll": "連続スクロール",
|
||||
"Fullscreen": "全画面",
|
||||
"No supported files found. Supported formats: {{formats}}": "サポートされているファイルが見つかりません。サポートされている形式:{{formats}}",
|
||||
"Drop to Import Books": "書籍をインポートするにはドロップ",
|
||||
@@ -971,7 +970,6 @@
|
||||
"words": "単語",
|
||||
"{{time}} left": "残り {{time}}",
|
||||
"Reading progress": "読書の進捗",
|
||||
"Click to seek": "クリックしてシーク",
|
||||
"Skip back 15 words": "15単語戻る",
|
||||
"Back 15 words (Shift+Left)": "15単語戻る (Shift+左)",
|
||||
"Pause (Space)": "一時停止 (Space)",
|
||||
@@ -1089,5 +1087,88 @@
|
||||
"Loading library...": "ライブラリを読み込み中...",
|
||||
"{{count}} books refreshed_other": "{{count}}冊のメタデータを更新しました",
|
||||
"Failed to refresh metadata": "メタデータの更新に失敗しました",
|
||||
"Refresh Metadata": "メタデータを更新"
|
||||
"Refresh Metadata": "メタデータを更新",
|
||||
"Keyboard Shortcuts": "キーボードショートカット",
|
||||
"View all keyboard shortcuts": "すべてのキーボードショートカットを表示",
|
||||
"Switch Sidebar Tab": "サイドバータブを切り替え",
|
||||
"Toggle Notebook": "ノートブックの表示/非表示",
|
||||
"Search in Book": "本の中を検索",
|
||||
"Toggle Scroll Mode": "スクロールモードの切り替え",
|
||||
"Toggle Select Mode": "選択モードの切り替え",
|
||||
"Toggle Bookmark": "ブックマークの切り替え",
|
||||
"Toggle Text to Speech": "音声読み上げの切り替え",
|
||||
"Play / Pause TTS": "読み上げ再生 / 一時停止",
|
||||
"Toggle Paragraph Mode": "段落モードの切り替え",
|
||||
"Highlight Selection": "選択範囲をハイライト",
|
||||
"Underline Selection": "選択範囲に下線",
|
||||
"Annotate Selection": "選択範囲に注釈",
|
||||
"Search Selection": "選択範囲を検索",
|
||||
"Copy Selection": "選択範囲をコピー",
|
||||
"Translate Selection": "選択範囲を翻訳",
|
||||
"Dictionary Lookup": "辞書で調べる",
|
||||
"Wikipedia Lookup": "Wikipediaで調べる",
|
||||
"Read Aloud Selection": "選択範囲を読み上げ",
|
||||
"Proofread Selection": "選択範囲を校正",
|
||||
"Open Settings": "設定を開く",
|
||||
"Open Command Palette": "コマンドパレットを開く",
|
||||
"Show Keyboard Shortcuts": "キーボードショートカットを表示",
|
||||
"Open Books": "本を開く",
|
||||
"Toggle Fullscreen": "フルスクリーンの切り替え",
|
||||
"Close Window": "ウィンドウを閉じる",
|
||||
"Quit App": "アプリを終了",
|
||||
"Go Left / Previous Page": "左へ / 前のページ",
|
||||
"Go Right / Next Page": "右へ / 次のページ",
|
||||
"Go Up": "上へ",
|
||||
"Go Down": "下へ",
|
||||
"Previous Chapter": "前の章",
|
||||
"Next Chapter": "次の章",
|
||||
"Scroll Half Page Down": "半ページ下にスクロール",
|
||||
"Scroll Half Page Up": "半ページ上にスクロール",
|
||||
"Save Note": "メモを保存",
|
||||
"Single Section Scroll": "単一セクションスクロール",
|
||||
"General": "一般",
|
||||
"Text to Speech": "テキスト読み上げ",
|
||||
"Zoom": "ズーム",
|
||||
"Window": "ウィンドウ",
|
||||
"Your Bookshelf": "あなたの本棚",
|
||||
"TTS": "読み上げ",
|
||||
"Media Info": "メディア情報",
|
||||
"Update Frequency": "更新頻度",
|
||||
"Every Sentence": "文ごと",
|
||||
"Every Paragraph": "段落ごと",
|
||||
"Every Chapter": "章ごと",
|
||||
"TTS Media Info Update Frequency": "TTSメディア情報の更新頻度",
|
||||
"Select reading speed": "読み上げ速度を選択",
|
||||
"Drag to seek": "ドラッグしてシーク",
|
||||
"Punctuation Delay": "句読点の遅延",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "続行する前に、このOPDS接続がWebアプリのReadestサーバーを経由してプロキシされることを確認してください。",
|
||||
"Custom Headers": "カスタムヘッダー",
|
||||
"Custom Headers (optional)": "カスタムヘッダー(任意)",
|
||||
"Add one header per line using \"Header-Name: value\".": "「Header-Name: value」の形式で1行に1つのヘッダーを追加してください。",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "このOPDS接続がWebアプリのReadestサーバーを経由してプロキシされることを理解しています。これらの認証情報やヘッダーについてReadestを信頼しない場合は、ネイティブアプリを使用してください。",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Hardcoverに接続できません。ネットワーク接続を確認してください。",
|
||||
"Invalid Hardcover API token": "Hardcover APIトークンが無効です",
|
||||
"Disconnected from Hardcover": "Hardcoverから切断されました",
|
||||
"Hardcover Settings": "Hardcover設定",
|
||||
"Connected to Hardcover": "Hardcoverに接続済み",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Hardcoverアカウントを接続して、読書の進捗やメモを同期しましょう。",
|
||||
"Get your API token from hardcover.app → Settings → API.": "hardcover.app → 設定 → APIからAPIトークンを取得してください。",
|
||||
"API Token": "APIトークン",
|
||||
"Paste your Hardcover API token": "HardcoverのAPIトークンを貼り付け",
|
||||
"Hardcover sync enabled for this book": "この本のHardcover同期が有効になりました",
|
||||
"Hardcover sync disabled for this book": "この本のHardcover同期が無効になりました",
|
||||
"Hardcover Sync": "Hardcover同期",
|
||||
"Enable for This Book": "この本で有効にする",
|
||||
"Push Notes": "メモを送信",
|
||||
"Enable Hardcover sync for this book first.": "まずこの本のHardcover同期を有効にしてください。",
|
||||
"No annotations or excerpts to sync for this book.": "この本に同期する注釈や抜粋がありません。",
|
||||
"Configure Hardcover in Settings first.": "まず設定でHardcoverを構成してください。",
|
||||
"No new Hardcover note changes to sync.": "同期するHardcoverメモの新しい変更はありません。",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover同期完了: {{inserted}}件追加、{{updated}}件更新、{{skipped}}件変更なし",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcoverメモの同期に失敗: {{error}}",
|
||||
"Reading progress synced to Hardcover": "読書の進捗がHardcoverに同期されました",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover進捗の同期に失敗: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "既存のソース識別子を保持",
|
||||
"Toggle Toolbar": "ツールバーの表示切替"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "RTL 방향",
|
||||
"Maximum Column Height": "최대 열 높이",
|
||||
"Maximum Column Width": "최대 열 너비",
|
||||
"Continuous Scroll": "연속 스크롤",
|
||||
"Fullscreen": "전체 화면",
|
||||
"No supported files found. Supported formats: {{formats}}": "지원되는 파일이 없습니다. 지원되는 형식: {{formats}}",
|
||||
"Drop to Import Books": "책 가져오기 위해 드롭",
|
||||
@@ -971,7 +970,6 @@
|
||||
"words": "단어",
|
||||
"{{time}} left": "{{time}} 남음",
|
||||
"Reading progress": "독서 진행 상황",
|
||||
"Click to seek": "클릭하여 탐색",
|
||||
"Skip back 15 words": "15단어 뒤로",
|
||||
"Back 15 words (Shift+Left)": "15단어 뒤로 (Shift+왼쪽 화살표)",
|
||||
"Pause (Space)": "일시정지 (스페이스바)",
|
||||
@@ -1089,5 +1087,88 @@
|
||||
"Loading library...": "라이브러리 로딩 중...",
|
||||
"{{count}} books refreshed_other": "{{count}}권 새로고침됨",
|
||||
"Failed to refresh metadata": "메타데이터 새로고침 실패",
|
||||
"Refresh Metadata": "메타데이터 새로고침"
|
||||
"Refresh Metadata": "메타데이터 새로고침",
|
||||
"Keyboard Shortcuts": "키보드 단축키",
|
||||
"View all keyboard shortcuts": "모든 키보드 단축키 보기",
|
||||
"Switch Sidebar Tab": "사이드바 탭 전환",
|
||||
"Toggle Notebook": "노트북 표시/숨기기",
|
||||
"Search in Book": "책에서 검색",
|
||||
"Toggle Scroll Mode": "스크롤 모드 전환",
|
||||
"Toggle Select Mode": "선택 모드 전환",
|
||||
"Toggle Bookmark": "북마크 전환",
|
||||
"Toggle Text to Speech": "텍스트 음성 변환 전환",
|
||||
"Play / Pause TTS": "TTS 재생 / 일시정지",
|
||||
"Toggle Paragraph Mode": "문단 모드 전환",
|
||||
"Highlight Selection": "선택 영역 강조",
|
||||
"Underline Selection": "선택 영역 밑줄",
|
||||
"Annotate Selection": "선택 영역 주석",
|
||||
"Search Selection": "선택 영역 검색",
|
||||
"Copy Selection": "선택 영역 복사",
|
||||
"Translate Selection": "선택 영역 번역",
|
||||
"Dictionary Lookup": "사전 검색",
|
||||
"Wikipedia Lookup": "위키백과 검색",
|
||||
"Read Aloud Selection": "선택 영역 소리 내어 읽기",
|
||||
"Proofread Selection": "선택 영역 교정",
|
||||
"Open Settings": "설정 열기",
|
||||
"Open Command Palette": "명령 팔레트 열기",
|
||||
"Show Keyboard Shortcuts": "키보드 단축키 표시",
|
||||
"Open Books": "책 열기",
|
||||
"Toggle Fullscreen": "전체 화면 전환",
|
||||
"Close Window": "창 닫기",
|
||||
"Quit App": "앱 종료",
|
||||
"Go Left / Previous Page": "왼쪽으로 / 이전 페이지",
|
||||
"Go Right / Next Page": "오른쪽으로 / 다음 페이지",
|
||||
"Go Up": "위로",
|
||||
"Go Down": "아래로",
|
||||
"Previous Chapter": "이전 장",
|
||||
"Next Chapter": "다음 장",
|
||||
"Scroll Half Page Down": "반 페이지 아래로 스크롤",
|
||||
"Scroll Half Page Up": "반 페이지 위로 스크롤",
|
||||
"Save Note": "메모 저장",
|
||||
"Single Section Scroll": "단일 섹션 스크롤",
|
||||
"General": "일반",
|
||||
"Text to Speech": "텍스트 음성 변환",
|
||||
"Zoom": "확대/축소",
|
||||
"Window": "창",
|
||||
"Your Bookshelf": "내 책장",
|
||||
"TTS": "음성 읽기",
|
||||
"Media Info": "미디어 정보",
|
||||
"Update Frequency": "업데이트 빈도",
|
||||
"Every Sentence": "문장마다",
|
||||
"Every Paragraph": "단락마다",
|
||||
"Every Chapter": "챕터마다",
|
||||
"TTS Media Info Update Frequency": "TTS 미디어 정보 업데이트 빈도",
|
||||
"Select reading speed": "읽기 속도 선택",
|
||||
"Drag to seek": "드래그하여 탐색",
|
||||
"Punctuation Delay": "구두점 지연",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "계속하기 전에 이 OPDS 연결이 웹 앱의 Readest 서버를 통해 프록시될 것임을 확인해 주세요.",
|
||||
"Custom Headers": "사용자 정의 헤더",
|
||||
"Custom Headers (optional)": "사용자 정의 헤더 (선택 사항)",
|
||||
"Add one header per line using \"Header-Name: value\".": "\"Header-Name: value\" 형식으로 한 줄에 하나의 헤더를 추가하세요.",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "이 OPDS 연결이 웹 앱의 Readest 서버를 통해 프록시될 것임을 이해합니다. 이 자격 증명이나 헤더에 대해 Readest를 신뢰하지 않는다면 네이티브 앱을 사용해야 합니다.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Hardcover에 연결할 수 없습니다. 네트워크 연결을 확인해 주세요.",
|
||||
"Invalid Hardcover API token": "유효하지 않은 Hardcover API 토큰",
|
||||
"Disconnected from Hardcover": "Hardcover에서 연결 해제됨",
|
||||
"Hardcover Settings": "Hardcover 설정",
|
||||
"Connected to Hardcover": "Hardcover에 연결됨",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "독서 진행 상황과 메모를 동기화하려면 Hardcover 계정을 연결하세요.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "hardcover.app → 설정 → API에서 API 토큰을 받으세요.",
|
||||
"API Token": "API 토큰",
|
||||
"Paste your Hardcover API token": "Hardcover API 토큰을 붙여넣기",
|
||||
"Hardcover sync enabled for this book": "이 책의 Hardcover 동기화가 활성화됨",
|
||||
"Hardcover sync disabled for this book": "이 책의 Hardcover 동기화가 비활성화됨",
|
||||
"Hardcover Sync": "Hardcover 동기화",
|
||||
"Enable for This Book": "이 책에 대해 활성화",
|
||||
"Push Notes": "메모 보내기",
|
||||
"Enable Hardcover sync for this book first.": "먼저 이 책의 Hardcover 동기화를 활성화하세요.",
|
||||
"No annotations or excerpts to sync for this book.": "이 책에 동기화할 주석이나 발췌가 없습니다.",
|
||||
"Configure Hardcover in Settings first.": "먼저 설정에서 Hardcover를 구성하세요.",
|
||||
"No new Hardcover note changes to sync.": "동기화할 새로운 Hardcover 메모 변경 사항이 없습니다.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover 동기화 완료: {{inserted}}개 추가, {{updated}}개 업데이트, {{skipped}}개 변경 없음",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover 메모 동기화 실패: {{error}}",
|
||||
"Reading progress synced to Hardcover": "독서 진행 상황이 Hardcover에 동기화됨",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover 진행 상황 동기화 실패: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "기존 소스 식별자 유지",
|
||||
"Toggle Toolbar": "도구 모음 전환"
|
||||
}
|
||||
|
||||
@@ -500,7 +500,6 @@
|
||||
"Quick Colors": "Warna Pantas",
|
||||
"Override Book Color": "Ganti Warna Buku",
|
||||
"Scroll": "Tatal",
|
||||
"Continuous Scroll": "Tatal Berterusan",
|
||||
"Overlap Pixels": "Piksel Bertindih",
|
||||
"Pagination": "Penomboran Halaman",
|
||||
"Tap to Paginate": "Ketik untuk Nomborkan Halaman",
|
||||
@@ -971,7 +970,6 @@
|
||||
"words": "perkataan",
|
||||
"{{time}} left": "{{time}} tinggal",
|
||||
"Reading progress": "Kemajuan membaca",
|
||||
"Click to seek": "Klik untuk cari",
|
||||
"Skip back 15 words": "Langkau belakang 15 perkataan",
|
||||
"Back 15 words (Shift+Left)": "Belakang 15 perkataan (Shift+Kiri)",
|
||||
"Pause (Space)": "Jeda (Ruang)",
|
||||
@@ -1089,5 +1087,88 @@
|
||||
"Loading library...": "Memuatkan perpustakaan...",
|
||||
"{{count}} books refreshed_other": "{{count}} buku dimuat semula",
|
||||
"Failed to refresh metadata": "Gagal memuat semula metadata",
|
||||
"Refresh Metadata": "Muat Semula Metadata"
|
||||
"Refresh Metadata": "Muat Semula Metadata",
|
||||
"Keyboard Shortcuts": "Pintasan Papan Kekunci",
|
||||
"View all keyboard shortcuts": "Lihat semua pintasan papan kekunci",
|
||||
"Switch Sidebar Tab": "Tukar tab bar sisi",
|
||||
"Toggle Notebook": "Tunjuk/sembunyikan buku nota",
|
||||
"Search in Book": "Cari dalam buku",
|
||||
"Toggle Scroll Mode": "Togol mod tatal",
|
||||
"Toggle Select Mode": "Togol mod pilih",
|
||||
"Toggle Bookmark": "Togol penanda buku",
|
||||
"Toggle Text to Speech": "Togol teks ke pertuturan",
|
||||
"Play / Pause TTS": "Main / Jeda TTS",
|
||||
"Toggle Paragraph Mode": "Togol mod perenggan",
|
||||
"Highlight Selection": "Serlahkan pilihan",
|
||||
"Underline Selection": "Garis bawah pilihan",
|
||||
"Annotate Selection": "Anotasi pilihan",
|
||||
"Search Selection": "Cari pilihan",
|
||||
"Copy Selection": "Salin pilihan",
|
||||
"Translate Selection": "Terjemah pilihan",
|
||||
"Dictionary Lookup": "Cari dalam kamus",
|
||||
"Wikipedia Lookup": "Cari di Wikipedia",
|
||||
"Read Aloud Selection": "Baca kuat pilihan",
|
||||
"Proofread Selection": "Semak pilihan",
|
||||
"Open Settings": "Buka tetapan",
|
||||
"Open Command Palette": "Buka palet arahan",
|
||||
"Show Keyboard Shortcuts": "Tunjukkan pintasan papan kekunci",
|
||||
"Open Books": "Buka buku",
|
||||
"Toggle Fullscreen": "Togol skrin penuh",
|
||||
"Close Window": "Tutup tetingkap",
|
||||
"Quit App": "Keluar dari aplikasi",
|
||||
"Go Left / Previous Page": "Ke kiri / Halaman sebelumnya",
|
||||
"Go Right / Next Page": "Ke kanan / Halaman seterusnya",
|
||||
"Go Up": "Ke atas",
|
||||
"Go Down": "Ke bawah",
|
||||
"Previous Chapter": "Bab sebelumnya",
|
||||
"Next Chapter": "Bab seterusnya",
|
||||
"Scroll Half Page Down": "Tatal separuh halaman ke bawah",
|
||||
"Scroll Half Page Up": "Tatal separuh halaman ke atas",
|
||||
"Save Note": "Simpan nota",
|
||||
"Single Section Scroll": "Tatal Satu Bahagian",
|
||||
"General": "Umum",
|
||||
"Text to Speech": "Teks ke Pertuturan",
|
||||
"Zoom": "Zum",
|
||||
"Window": "Tetingkap",
|
||||
"Your Bookshelf": "Rak Buku Anda",
|
||||
"TTS": "Teks ke Suara",
|
||||
"Media Info": "Info Media",
|
||||
"Update Frequency": "Kekerapan Kemas Kini",
|
||||
"Every Sentence": "Setiap Ayat",
|
||||
"Every Paragraph": "Setiap Perenggan",
|
||||
"Every Chapter": "Setiap Bab",
|
||||
"TTS Media Info Update Frequency": "Kekerapan Kemas Kini Info Media TTS",
|
||||
"Select reading speed": "Pilih kelajuan membaca",
|
||||
"Drag to seek": "Seret untuk mencari",
|
||||
"Punctuation Delay": "Kelewatan tanda baca",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Sila sahkan bahawa sambungan OPDS ini akan diproksi melalui pelayan Readest pada aplikasi web sebelum meneruskan.",
|
||||
"Custom Headers": "Pengepala Tersuai",
|
||||
"Custom Headers (optional)": "Pengepala Tersuai (pilihan)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Tambah satu pengepala setiap baris menggunakan \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Saya faham bahawa sambungan OPDS ini akan diproksi melalui pelayan Readest pada aplikasi web. Jika saya tidak mempercayai Readest dengan kelayakan atau pengepala ini, saya perlu menggunakan aplikasi natif.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Tidak dapat menyambung ke Hardcover. Sila semak sambungan rangkaian anda.",
|
||||
"Invalid Hardcover API token": "Token API Hardcover tidak sah",
|
||||
"Disconnected from Hardcover": "Diputuskan dari Hardcover",
|
||||
"Hardcover Settings": "Tetapan Hardcover",
|
||||
"Connected to Hardcover": "Disambungkan ke Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Sambungkan akaun Hardcover anda untuk menyegerakkan kemajuan bacaan dan nota.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Dapatkan token API anda dari hardcover.app → Tetapan → API.",
|
||||
"API Token": "Token API",
|
||||
"Paste your Hardcover API token": "Tampal token API Hardcover anda",
|
||||
"Hardcover sync enabled for this book": "Penyegerakan Hardcover diaktifkan untuk buku ini",
|
||||
"Hardcover sync disabled for this book": "Penyegerakan Hardcover dinyahaktifkan untuk buku ini",
|
||||
"Hardcover Sync": "Penyegerakan Hardcover",
|
||||
"Enable for This Book": "Aktifkan untuk Buku Ini",
|
||||
"Push Notes": "Hantar Nota",
|
||||
"Enable Hardcover sync for this book first.": "Aktifkan penyegerakan Hardcover untuk buku ini terlebih dahulu.",
|
||||
"No annotations or excerpts to sync for this book.": "Tiada anotasi atau petikan untuk disegerakkan bagi buku ini.",
|
||||
"Configure Hardcover in Settings first.": "Konfigurasikan Hardcover dalam Tetapan terlebih dahulu.",
|
||||
"No new Hardcover note changes to sync.": "Tiada perubahan nota Hardcover baharu untuk disegerakkan.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover disegerakkan: {{inserted}} baharu, {{updated}} dikemas kini, {{skipped}} tidak berubah",
|
||||
"Hardcover notes sync failed: {{error}}": "Penyegerakan nota Hardcover gagal: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Kemajuan bacaan disegerakkan ke Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Penyegerakan kemajuan Hardcover gagal: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Kekalkan pengecam sumber sedia ada",
|
||||
"Toggle Toolbar": "Togol Bar Alat"
|
||||
}
|
||||
|
||||
@@ -179,7 +179,6 @@
|
||||
"Portrait": "Portret",
|
||||
"Landscape": "Landschap",
|
||||
"Behavior": "Gedrag",
|
||||
"Continuous Scroll": "Doorlopend scrollen",
|
||||
"Volume Keys for Page Flip": "Volumetoetsen voor pagina omslaan",
|
||||
"Apply": "Toepassen",
|
||||
"Font": "Lettertype",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "woorden",
|
||||
"{{time}} left": "{{time}} over",
|
||||
"Reading progress": "Leesvoortgang",
|
||||
"Click to seek": "Klik om te zoeken",
|
||||
"Skip back 15 words": "15 woorden terug",
|
||||
"Back 15 words (Shift+Left)": "15 woorden terug (Shift+Links)",
|
||||
"Pause (Space)": "Pauze (Spatie)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "{{count}} boek vernieuwd",
|
||||
"{{count}} books refreshed_other": "{{count}} boeken vernieuwd",
|
||||
"Failed to refresh metadata": "Metadata vernieuwen mislukt",
|
||||
"Refresh Metadata": "Metadata vernieuwen"
|
||||
"Refresh Metadata": "Metadata vernieuwen",
|
||||
"Keyboard Shortcuts": "Sneltoetsen",
|
||||
"View all keyboard shortcuts": "Alle sneltoetsen bekijken",
|
||||
"Switch Sidebar Tab": "Zijbalktabblad wisselen",
|
||||
"Toggle Notebook": "Notitieboek tonen/verbergen",
|
||||
"Search in Book": "Zoeken in boek",
|
||||
"Toggle Scroll Mode": "Scrollmodus wisselen",
|
||||
"Toggle Select Mode": "Selectiemodus wisselen",
|
||||
"Toggle Bookmark": "Bladwijzer wisselen",
|
||||
"Toggle Text to Speech": "Tekst-naar-spraak wisselen",
|
||||
"Play / Pause TTS": "TTS afspelen / pauzeren",
|
||||
"Toggle Paragraph Mode": "Alineamodus wisselen",
|
||||
"Highlight Selection": "Selectie markeren",
|
||||
"Underline Selection": "Selectie onderstrepen",
|
||||
"Annotate Selection": "Selectie annoteren",
|
||||
"Search Selection": "Selectie zoeken",
|
||||
"Copy Selection": "Selectie kopiëren",
|
||||
"Translate Selection": "Selectie vertalen",
|
||||
"Dictionary Lookup": "Opzoeken in woordenboek",
|
||||
"Wikipedia Lookup": "Opzoeken op Wikipedia",
|
||||
"Read Aloud Selection": "Selectie voorlezen",
|
||||
"Proofread Selection": "Selectie proeflezen",
|
||||
"Open Settings": "Instellingen openen",
|
||||
"Open Command Palette": "Opdrachtenpalet openen",
|
||||
"Show Keyboard Shortcuts": "Sneltoetsen tonen",
|
||||
"Open Books": "Boeken openen",
|
||||
"Toggle Fullscreen": "Volledig scherm wisselen",
|
||||
"Close Window": "Venster sluiten",
|
||||
"Quit App": "App afsluiten",
|
||||
"Go Left / Previous Page": "Naar links / Vorige pagina",
|
||||
"Go Right / Next Page": "Naar rechts / Volgende pagina",
|
||||
"Go Up": "Omhoog",
|
||||
"Go Down": "Omlaag",
|
||||
"Previous Chapter": "Vorig hoofdstuk",
|
||||
"Next Chapter": "Volgend hoofdstuk",
|
||||
"Scroll Half Page Down": "Halve pagina naar beneden scrollen",
|
||||
"Scroll Half Page Up": "Halve pagina naar boven scrollen",
|
||||
"Save Note": "Notitie opslaan",
|
||||
"Single Section Scroll": "Scrollen per sectie",
|
||||
"General": "Algemeen",
|
||||
"Text to Speech": "Tekst naar spraak",
|
||||
"Zoom": "Zoom",
|
||||
"Window": "Venster",
|
||||
"Your Bookshelf": "Jouw boekenkast",
|
||||
"TTS": "Spraak",
|
||||
"Media Info": "Media-info",
|
||||
"Update Frequency": "Updatefrequentie",
|
||||
"Every Sentence": "Elke zin",
|
||||
"Every Paragraph": "Elke alinea",
|
||||
"Every Chapter": "Elk hoofdstuk",
|
||||
"TTS Media Info Update Frequency": "TTS media-info updatefrequentie",
|
||||
"Select reading speed": "Leessnelheid selecteren",
|
||||
"Drag to seek": "Sleep om te zoeken",
|
||||
"Punctuation Delay": "Leesteken-vertraging",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Bevestig dat deze OPDS-verbinding via Readest-servers in de webapp wordt doorgestuurd voordat u doorgaat.",
|
||||
"Custom Headers": "Aangepaste headers",
|
||||
"Custom Headers (optional)": "Aangepaste headers (optioneel)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Voeg één header per regel toe met \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Ik begrijp dat deze OPDS-verbinding via Readest-servers in de webapp wordt doorgestuurd. Als ik Readest niet vertrouw met deze inloggegevens of headers, moet ik de native app gebruiken.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Kan geen verbinding maken met Hardcover. Controleer uw netwerkverbinding.",
|
||||
"Invalid Hardcover API token": "Ongeldig Hardcover API-token",
|
||||
"Disconnected from Hardcover": "Verbinding met Hardcover verbroken",
|
||||
"Hardcover Settings": "Hardcover-instellingen",
|
||||
"Connected to Hardcover": "Verbonden met Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Verbind uw Hardcover-account om leesvoortgang en notities te synchroniseren.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Haal uw API-token op via hardcover.app → Instellingen → API.",
|
||||
"API Token": "API-token",
|
||||
"Paste your Hardcover API token": "Plak uw Hardcover API-token",
|
||||
"Hardcover sync enabled for this book": "Hardcover-synchronisatie ingeschakeld voor dit boek",
|
||||
"Hardcover sync disabled for this book": "Hardcover-synchronisatie uitgeschakeld voor dit boek",
|
||||
"Hardcover Sync": "Hardcover-synchronisatie",
|
||||
"Enable for This Book": "Inschakelen voor dit boek",
|
||||
"Push Notes": "Notities verzenden",
|
||||
"Enable Hardcover sync for this book first.": "Schakel eerst Hardcover-synchronisatie in voor dit boek.",
|
||||
"No annotations or excerpts to sync for this book.": "Geen annotaties of fragmenten om te synchroniseren voor dit boek.",
|
||||
"Configure Hardcover in Settings first.": "Configureer eerst Hardcover in de instellingen.",
|
||||
"No new Hardcover note changes to sync.": "Geen nieuwe Hardcover-notitiewijzigingen om te synchroniseren.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover gesynchroniseerd: {{inserted}} nieuw, {{updated}} bijgewerkt, {{skipped}} ongewijzigd",
|
||||
"Hardcover notes sync failed: {{error}}": "Synchronisatie van Hardcover-notities mislukt: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Leesvoortgang gesynchroniseerd met Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Synchronisatie van Hardcover-voortgang mislukt: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Bestaande bronidentificatie behouden",
|
||||
"Toggle Toolbar": "Werkbalk in-/uitschakelen"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "Kierunek RTL",
|
||||
"Maximum Column Height": "Maksymalna wysokość kolumny",
|
||||
"Maximum Column Width": "Maksymalna szerokość kolumny",
|
||||
"Continuous Scroll": "Przewijanie ciągłe",
|
||||
"Fullscreen": "Pełny ekran",
|
||||
"No supported files found. Supported formats: {{formats}}": "Nie znaleziono obsługiwanych plików. Obsługiwane formaty: {{formats}}",
|
||||
"Drop to Import Books": "Upuść, aby zaimportować książki",
|
||||
@@ -1007,7 +1006,6 @@
|
||||
"words": "słowa",
|
||||
"{{time}} left": "pozostało {{time}}",
|
||||
"Reading progress": "Postęp czytania",
|
||||
"Click to seek": "Kliknij, aby wyszukać",
|
||||
"Skip back 15 words": "Cofnij o 15 słów",
|
||||
"Back 15 words (Shift+Left)": "Cofnij o 15 słów (Shift+Lewo)",
|
||||
"Pause (Space)": "Pauze (Spacja)",
|
||||
@@ -1128,5 +1126,88 @@
|
||||
"{{count}} books refreshed_many": "Odświeżono {{count}} książek",
|
||||
"{{count}} books refreshed_other": "Odświeżono {{count}} książek",
|
||||
"Failed to refresh metadata": "Nie udało się odświeżyć metadanych",
|
||||
"Refresh Metadata": "Odśwież metadane"
|
||||
"Refresh Metadata": "Odśwież metadane",
|
||||
"Keyboard Shortcuts": "Skróty klawiszowe",
|
||||
"View all keyboard shortcuts": "Zobacz wszystkie skróty klawiszowe",
|
||||
"Switch Sidebar Tab": "Przełącz kartę paska bocznego",
|
||||
"Toggle Notebook": "Pokaż/ukryj notatnik",
|
||||
"Search in Book": "Szukaj w książce",
|
||||
"Toggle Scroll Mode": "Przełącz tryb przewijania",
|
||||
"Toggle Select Mode": "Przełącz tryb zaznaczania",
|
||||
"Toggle Bookmark": "Przełącz zakładkę",
|
||||
"Toggle Text to Speech": "Przełącz tekst na mowę",
|
||||
"Play / Pause TTS": "Odtwórz / Wstrzymaj TTS",
|
||||
"Toggle Paragraph Mode": "Przełącz tryb akapitu",
|
||||
"Highlight Selection": "Podświetl zaznaczenie",
|
||||
"Underline Selection": "Podkreśl zaznaczenie",
|
||||
"Annotate Selection": "Dodaj adnotację do zaznaczenia",
|
||||
"Search Selection": "Wyszukaj zaznaczenie",
|
||||
"Copy Selection": "Kopiuj zaznaczenie",
|
||||
"Translate Selection": "Przetłumacz zaznaczenie",
|
||||
"Dictionary Lookup": "Wyszukaj w słowniku",
|
||||
"Wikipedia Lookup": "Wyszukaj w Wikipedii",
|
||||
"Read Aloud Selection": "Odczytaj zaznaczenie na głos",
|
||||
"Proofread Selection": "Sprawdź zaznaczenie",
|
||||
"Open Settings": "Otwórz ustawienia",
|
||||
"Open Command Palette": "Otwórz paletę poleceń",
|
||||
"Show Keyboard Shortcuts": "Pokaż skróty klawiszowe",
|
||||
"Open Books": "Otwórz książki",
|
||||
"Toggle Fullscreen": "Przełącz pełny ekran",
|
||||
"Close Window": "Zamknij okno",
|
||||
"Quit App": "Zamknij aplikację",
|
||||
"Go Left / Previous Page": "W lewo / Poprzednia strona",
|
||||
"Go Right / Next Page": "W prawo / Następna strona",
|
||||
"Go Up": "W górę",
|
||||
"Go Down": "W dół",
|
||||
"Previous Chapter": "Poprzedni rozdział",
|
||||
"Next Chapter": "Następny rozdział",
|
||||
"Scroll Half Page Down": "Przewiń o pół strony w dół",
|
||||
"Scroll Half Page Up": "Przewiń o pół strony w górę",
|
||||
"Save Note": "Zapisz notatkę",
|
||||
"Single Section Scroll": "Przewijanie pojedynczej sekcji",
|
||||
"General": "Ogólne",
|
||||
"Text to Speech": "Tekst na mowę",
|
||||
"Zoom": "Powiększenie",
|
||||
"Window": "Okno",
|
||||
"Your Bookshelf": "Twoja półka z książkami",
|
||||
"TTS": "Czytanie na głos",
|
||||
"Media Info": "Informacje o mediach",
|
||||
"Update Frequency": "Częstotliwość aktualizacji",
|
||||
"Every Sentence": "Co zdanie",
|
||||
"Every Paragraph": "Co akapit",
|
||||
"Every Chapter": "Co rozdział",
|
||||
"TTS Media Info Update Frequency": "Częstotliwość aktualizacji informacji o mediach TTS",
|
||||
"Select reading speed": "Wybierz prędkość czytania",
|
||||
"Drag to seek": "Przeciągnij, aby przewinąć",
|
||||
"Punctuation Delay": "Opóźnienie interpunkcji",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Potwierdź, że to połączenie OPDS będzie przekierowywane przez serwery Readest w aplikacji webowej, zanim przejdziesz dalej.",
|
||||
"Custom Headers": "Niestandardowe nagłówki",
|
||||
"Custom Headers (optional)": "Niestandardowe nagłówki (opcjonalnie)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Dodaj jeden nagłówek w każdym wierszu, używając formatu \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Rozumiem, że to połączenie OPDS będzie przekierowywane przez serwery Readest w aplikacji webowej. Jeśli nie ufam Readest w kwestii tych danych uwierzytelniających lub nagłówków, powinienem użyć aplikacji natywnej.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Nie można połączyć się z Hardcover. Sprawdź połączenie sieciowe.",
|
||||
"Invalid Hardcover API token": "Nieprawidłowy token API Hardcover",
|
||||
"Disconnected from Hardcover": "Rozłączono z Hardcover",
|
||||
"Hardcover Settings": "Ustawienia Hardcover",
|
||||
"Connected to Hardcover": "Połączono z Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Połącz swoje konto Hardcover, aby synchronizować postęp czytania i notatki.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Pobierz token API z hardcover.app → Ustawienia → API.",
|
||||
"API Token": "Token API",
|
||||
"Paste your Hardcover API token": "Wklej swój token API Hardcover",
|
||||
"Hardcover sync enabled for this book": "Synchronizacja Hardcover włączona dla tej książki",
|
||||
"Hardcover sync disabled for this book": "Synchronizacja Hardcover wyłączona dla tej książki",
|
||||
"Hardcover Sync": "Synchronizacja Hardcover",
|
||||
"Enable for This Book": "Włącz dla tej książki",
|
||||
"Push Notes": "Wyślij notatki",
|
||||
"Enable Hardcover sync for this book first.": "Najpierw włącz synchronizację Hardcover dla tej książki.",
|
||||
"No annotations or excerpts to sync for this book.": "Brak adnotacji lub fragmentów do zsynchronizowania dla tej książki.",
|
||||
"Configure Hardcover in Settings first.": "Najpierw skonfiguruj Hardcover w ustawieniach.",
|
||||
"No new Hardcover note changes to sync.": "Brak nowych zmian notatek Hardcover do zsynchronizowania.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover zsynchronizowano: {{inserted}} nowych, {{updated}} zaktualizowanych, {{skipped}} bez zmian",
|
||||
"Hardcover notes sync failed: {{error}}": "Synchronizacja notatek Hardcover nie powiodła się: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Postęp czytania zsynchronizowany z Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Synchronizacja postępu Hardcover nie powiodła się: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Zachowaj istniejący identyfikator źródła",
|
||||
"Toggle Toolbar": "Przełącz pasek narzędzi"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "Direção RTL",
|
||||
"Maximum Column Height": "Altura Máxima da Coluna",
|
||||
"Maximum Column Width": "Largura Máxima da Coluna",
|
||||
"Continuous Scroll": "Rolagem Contínua",
|
||||
"Fullscreen": "Tela Cheia",
|
||||
"No supported files found. Supported formats: {{formats}}": "Nenhum arquivo suportado encontrado. Formatos suportados: {{formats}}",
|
||||
"Drop to Import Books": "Arraste para Importar Livros",
|
||||
@@ -995,7 +994,6 @@
|
||||
"words": "palavras",
|
||||
"{{time}} left": "{{time}} restante",
|
||||
"Reading progress": "Progresso de leitura",
|
||||
"Click to seek": "Clique para navegar",
|
||||
"Skip back 15 words": "Voltar 15 palavras",
|
||||
"Back 15 words (Shift+Left)": "Voltar 15 palavras (Shift+Esquerda)",
|
||||
"Pause (Space)": "Pausar (Espaço)",
|
||||
@@ -1115,5 +1113,88 @@
|
||||
"{{count}} books refreshed_many": "{{count}} livros atualizados",
|
||||
"{{count}} books refreshed_other": "{{count}} livros atualizados",
|
||||
"Failed to refresh metadata": "Falha ao atualizar metadados",
|
||||
"Refresh Metadata": "Atualizar metadados"
|
||||
"Refresh Metadata": "Atualizar metadados",
|
||||
"Keyboard Shortcuts": "Atalhos de teclado",
|
||||
"View all keyboard shortcuts": "Ver todos os atalhos de teclado",
|
||||
"Switch Sidebar Tab": "Alternar aba da barra lateral",
|
||||
"Toggle Notebook": "Mostrar/ocultar caderno",
|
||||
"Search in Book": "Pesquisar no livro",
|
||||
"Toggle Scroll Mode": "Alternar modo rolagem",
|
||||
"Toggle Select Mode": "Alternar modo seleção",
|
||||
"Toggle Bookmark": "Alternar marcador",
|
||||
"Toggle Text to Speech": "Alternar texto para fala",
|
||||
"Play / Pause TTS": "Reproduzir / Pausar TTS",
|
||||
"Toggle Paragraph Mode": "Alternar modo parágrafo",
|
||||
"Highlight Selection": "Destacar seleção",
|
||||
"Underline Selection": "Sublinhar seleção",
|
||||
"Annotate Selection": "Anotar seleção",
|
||||
"Search Selection": "Pesquisar seleção",
|
||||
"Copy Selection": "Copiar seleção",
|
||||
"Translate Selection": "Traduzir seleção",
|
||||
"Dictionary Lookup": "Pesquisar no dicionário",
|
||||
"Wikipedia Lookup": "Pesquisar na Wikipédia",
|
||||
"Read Aloud Selection": "Ler seleção em voz alta",
|
||||
"Proofread Selection": "Revisar seleção",
|
||||
"Open Settings": "Abrir configurações",
|
||||
"Open Command Palette": "Abrir paleta de comandos",
|
||||
"Show Keyboard Shortcuts": "Mostrar atalhos de teclado",
|
||||
"Open Books": "Abrir livros",
|
||||
"Toggle Fullscreen": "Alternar tela cheia",
|
||||
"Close Window": "Fechar janela",
|
||||
"Quit App": "Sair do aplicativo",
|
||||
"Go Left / Previous Page": "Ir para a esquerda / Página anterior",
|
||||
"Go Right / Next Page": "Ir para a direita / Próxima página",
|
||||
"Go Up": "Ir para cima",
|
||||
"Go Down": "Ir para baixo",
|
||||
"Previous Chapter": "Capítulo anterior",
|
||||
"Next Chapter": "Próximo capítulo",
|
||||
"Scroll Half Page Down": "Rolar meia página para baixo",
|
||||
"Scroll Half Page Up": "Rolar meia página para cima",
|
||||
"Save Note": "Salvar nota",
|
||||
"Single Section Scroll": "Rolagem por seção",
|
||||
"General": "Geral",
|
||||
"Text to Speech": "Texto para fala",
|
||||
"Zoom": "Zoom",
|
||||
"Window": "Janela",
|
||||
"Your Bookshelf": "Sua estante",
|
||||
"TTS": "Leitura em voz alta",
|
||||
"Media Info": "Info de mídia",
|
||||
"Update Frequency": "Frequência de atualização",
|
||||
"Every Sentence": "A cada frase",
|
||||
"Every Paragraph": "A cada parágrafo",
|
||||
"Every Chapter": "A cada capítulo",
|
||||
"TTS Media Info Update Frequency": "Frequência de atualização de info de mídia TTS",
|
||||
"Select reading speed": "Selecionar velocidade de leitura",
|
||||
"Drag to seek": "Arraste para procurar",
|
||||
"Punctuation Delay": "Atraso de pontuação",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Confirme que esta conexão OPDS será encaminhada através dos servidores Readest no aplicativo web antes de continuar.",
|
||||
"Custom Headers": "Cabeçalhos personalizados",
|
||||
"Custom Headers (optional)": "Cabeçalhos personalizados (opcional)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Adicione um cabeçalho por linha usando \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Entendo que esta conexão OPDS será encaminhada através dos servidores Readest no aplicativo web. Se não confio no Readest com essas credenciais ou cabeçalhos, devo usar o aplicativo nativo.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Não foi possível conectar ao Hardcover. Verifique sua conexão de rede.",
|
||||
"Invalid Hardcover API token": "Token de API do Hardcover inválido",
|
||||
"Disconnected from Hardcover": "Desconectado do Hardcover",
|
||||
"Hardcover Settings": "Configurações do Hardcover",
|
||||
"Connected to Hardcover": "Conectado ao Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Conecte sua conta Hardcover para sincronizar o progresso de leitura e notas.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Obtenha seu token de API em hardcover.app → Configurações → API.",
|
||||
"API Token": "Token de API",
|
||||
"Paste your Hardcover API token": "Cole seu token de API do Hardcover",
|
||||
"Hardcover sync enabled for this book": "Sincronização do Hardcover ativada para este livro",
|
||||
"Hardcover sync disabled for this book": "Sincronização do Hardcover desativada para este livro",
|
||||
"Hardcover Sync": "Sincronização do Hardcover",
|
||||
"Enable for This Book": "Ativar para este livro",
|
||||
"Push Notes": "Enviar notas",
|
||||
"Enable Hardcover sync for this book first.": "Ative primeiro a sincronização do Hardcover para este livro.",
|
||||
"No annotations or excerpts to sync for this book.": "Não há anotações ou trechos para sincronizar neste livro.",
|
||||
"Configure Hardcover in Settings first.": "Configure o Hardcover nas configurações primeiro.",
|
||||
"No new Hardcover note changes to sync.": "Não há novas alterações de notas do Hardcover para sincronizar.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover sincronizado: {{inserted}} novos, {{updated}} atualizados, {{skipped}} inalterados",
|
||||
"Hardcover notes sync failed: {{error}}": "Falha na sincronização de notas do Hardcover: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Progresso de leitura sincronizado com o Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Falha na sincronização de progresso do Hardcover: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Manter o identificador de origem existente",
|
||||
"Toggle Toolbar": "Alternar barra de ferramentas"
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "Направление RTL",
|
||||
"Maximum Column Height": "Максимальная высота колонки",
|
||||
"Maximum Column Width": "Максимальная ширина колонки",
|
||||
"Continuous Scroll": "Непрерывная прокрутка",
|
||||
"Fullscreen": "Полноэкранный режим",
|
||||
"No supported files found. Supported formats: {{formats}}": "Поддерживаемые файлы не найдены. Поддерживаемые форматы: {{formats}}",
|
||||
"Drop to Import Books": "Перетащите сюда книги для импорта",
|
||||
@@ -1007,7 +1006,6 @@
|
||||
"words": "слов",
|
||||
"{{time}} left": "осталось {{time}}",
|
||||
"Reading progress": "Прогресс чтения",
|
||||
"Click to seek": "Нажмите для поиска",
|
||||
"Skip back 15 words": "Назад на 15 слов",
|
||||
"Back 15 words (Shift+Left)": "Назад на 15 слов (Shift+Влево)",
|
||||
"Pause (Space)": "Пауза (Пробел)",
|
||||
@@ -1128,5 +1126,88 @@
|
||||
"{{count}} books refreshed_many": "Обновлено {{count}} книг",
|
||||
"{{count}} books refreshed_other": "Обновлено {{count}} книг",
|
||||
"Failed to refresh metadata": "Не удалось обновить метаданные",
|
||||
"Refresh Metadata": "Обновить метаданные"
|
||||
"Refresh Metadata": "Обновить метаданные",
|
||||
"Keyboard Shortcuts": "Сочетания клавиш",
|
||||
"View all keyboard shortcuts": "Показать все сочетания клавиш",
|
||||
"Switch Sidebar Tab": "Переключить вкладку боковой панели",
|
||||
"Toggle Notebook": "Показать/скрыть записную книжку",
|
||||
"Search in Book": "Поиск в книге",
|
||||
"Toggle Scroll Mode": "Переключить режим прокрутки",
|
||||
"Toggle Select Mode": "Переключить режим выделения",
|
||||
"Toggle Bookmark": "Переключить закладку",
|
||||
"Toggle Text to Speech": "Переключить озвучивание текста",
|
||||
"Play / Pause TTS": "Воспроизвести / Пауза TTS",
|
||||
"Toggle Paragraph Mode": "Переключить режим абзаца",
|
||||
"Highlight Selection": "Выделить выбранное",
|
||||
"Underline Selection": "Подчеркнуть выбранное",
|
||||
"Annotate Selection": "Добавить примечание к выбранному",
|
||||
"Search Selection": "Искать выбранное",
|
||||
"Copy Selection": "Копировать выбранное",
|
||||
"Translate Selection": "Перевести выбранное",
|
||||
"Dictionary Lookup": "Поиск в словаре",
|
||||
"Wikipedia Lookup": "Поиск в Википедии",
|
||||
"Read Aloud Selection": "Прочитать выбранное вслух",
|
||||
"Proofread Selection": "Проверить выбранное",
|
||||
"Open Settings": "Открыть настройки",
|
||||
"Open Command Palette": "Открыть палитру команд",
|
||||
"Show Keyboard Shortcuts": "Показать сочетания клавиш",
|
||||
"Open Books": "Открыть книги",
|
||||
"Toggle Fullscreen": "Переключить полноэкранный режим",
|
||||
"Close Window": "Закрыть окно",
|
||||
"Quit App": "Выйти из приложения",
|
||||
"Go Left / Previous Page": "Влево / Предыдущая страница",
|
||||
"Go Right / Next Page": "Вправо / Следующая страница",
|
||||
"Go Up": "Вверх",
|
||||
"Go Down": "Вниз",
|
||||
"Previous Chapter": "Предыдущая глава",
|
||||
"Next Chapter": "Следующая глава",
|
||||
"Scroll Half Page Down": "Прокрутить на полстраницы вниз",
|
||||
"Scroll Half Page Up": "Прокрутить на полстраницы вверх",
|
||||
"Save Note": "Сохранить заметку",
|
||||
"Single Section Scroll": "Прокрутка одного раздела",
|
||||
"General": "Общие",
|
||||
"Text to Speech": "Озвучивание",
|
||||
"Zoom": "Масштаб",
|
||||
"Window": "Окно",
|
||||
"Your Bookshelf": "Ваша книжная полка",
|
||||
"TTS": "Озвучивание",
|
||||
"Media Info": "Медиа-информация",
|
||||
"Update Frequency": "Частота обновления",
|
||||
"Every Sentence": "Каждое предложение",
|
||||
"Every Paragraph": "Каждый абзац",
|
||||
"Every Chapter": "Каждая глава",
|
||||
"TTS Media Info Update Frequency": "Частота обновления медиа-информации TTS",
|
||||
"Select reading speed": "Выберите скорость чтения",
|
||||
"Drag to seek": "Перетащите для перемотки",
|
||||
"Punctuation Delay": "Задержка на знаках препинания",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Подтвердите, что это OPDS-соединение будет проксироваться через серверы Readest в веб-приложении, прежде чем продолжить.",
|
||||
"Custom Headers": "Пользовательские заголовки",
|
||||
"Custom Headers (optional)": "Пользовательские заголовки (необязательно)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Добавляйте по одному заголовку на строку в формате \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Я понимаю, что это OPDS-соединение будет проксироваться через серверы Readest в веб-приложении. Если я не доверяю Readest свои учётные данные или заголовки, мне следует использовать нативное приложение.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Не удалось подключиться к Hardcover. Проверьте сетевое подключение.",
|
||||
"Invalid Hardcover API token": "Недействительный API-токен Hardcover",
|
||||
"Disconnected from Hardcover": "Отключено от Hardcover",
|
||||
"Hardcover Settings": "Настройки Hardcover",
|
||||
"Connected to Hardcover": "Подключено к Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Подключите свой аккаунт Hardcover для синхронизации прогресса чтения и заметок.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Получите API-токен на hardcover.app → Настройки → API.",
|
||||
"API Token": "API-токен",
|
||||
"Paste your Hardcover API token": "Вставьте ваш API-токен Hardcover",
|
||||
"Hardcover sync enabled for this book": "Синхронизация Hardcover включена для этой книги",
|
||||
"Hardcover sync disabled for this book": "Синхронизация Hardcover отключена для этой книги",
|
||||
"Hardcover Sync": "Синхронизация Hardcover",
|
||||
"Enable for This Book": "Включить для этой книги",
|
||||
"Push Notes": "Отправить заметки",
|
||||
"Enable Hardcover sync for this book first.": "Сначала включите синхронизацию Hardcover для этой книги.",
|
||||
"No annotations or excerpts to sync for this book.": "Нет аннотаций или выдержек для синхронизации для этой книги.",
|
||||
"Configure Hardcover in Settings first.": "Сначала настройте Hardcover в параметрах.",
|
||||
"No new Hardcover note changes to sync.": "Нет новых изменений заметок Hardcover для синхронизации.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover синхронизирован: {{inserted}} новых, {{updated}} обновлённых, {{skipped}} без изменений",
|
||||
"Hardcover notes sync failed: {{error}}": "Ошибка синхронизации заметок Hardcover: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Прогресс чтения синхронизирован с Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Ошибка синхронизации прогресса Hardcover: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Сохранить существующий идентификатор источника",
|
||||
"Toggle Toolbar": "Переключить панель инструментов"
|
||||
}
|
||||
|
||||
@@ -199,7 +199,6 @@
|
||||
"Auto": "ස්වයංක්රීය",
|
||||
"Scroll": "අනුචලනය",
|
||||
"Scrolled Mode": "අනුචලන ආකාරය",
|
||||
"Continuous Scroll": "අඛණ්ඩ අනුචලනය",
|
||||
"Overlap Pixels": "අතිච්ඡාදන පික්සල්",
|
||||
"Disable Double Click": "ද්විත්ව ක්ලික් අබල කරන්න",
|
||||
"Volume Keys for Page Flip": "පිටු පෙරැළීම සඳහා ශබ්ද යතුර",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "වචන",
|
||||
"{{time}} left": "{{time}} ඉතිරිව ඇත",
|
||||
"Reading progress": "කියවීමේ ප්රගතිය",
|
||||
"Click to seek": "සොයා බැලීමට ක්ලික් කරන්න",
|
||||
"Skip back 15 words": "වචන 15ක් පසුපසට",
|
||||
"Back 15 words (Shift+Left)": "වචන 15ක් පසුපසට (Shift+Left)",
|
||||
"Pause (Space)": "විරාමය (Space)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "පොත් {{count}}ක් යාවත්කාලීන විය",
|
||||
"{{count}} books refreshed_other": "පොත් {{count}}ක් යාවත්කාලීන විය",
|
||||
"Failed to refresh metadata": "පාරදත්ත යාවත්කාලීන කිරීම අසාර්ථකයි",
|
||||
"Refresh Metadata": "පාරදත්ත යාවත්කාලීන කරන්න"
|
||||
"Refresh Metadata": "පාරදත්ත යාවත්කාලීන කරන්න",
|
||||
"Keyboard Shortcuts": "යතුරුපුවරු කෙටිමං",
|
||||
"View all keyboard shortcuts": "සියලුම යතුරුපුවරු කෙටිමං බලන්න",
|
||||
"Switch Sidebar Tab": "පැති තීරු ටැබය මාරු කරන්න",
|
||||
"Toggle Notebook": "සටහන් පොත පෙන්වන්න/සඟවන්න",
|
||||
"Search in Book": "පොතේ සොයන්න",
|
||||
"Toggle Scroll Mode": "අනුචලන ප්රකාරය මාරු කරන්න",
|
||||
"Toggle Select Mode": "තේරීම් ප්රකාරය මාරු කරන්න",
|
||||
"Toggle Bookmark": "පිටු සලකුණ මාරු කරන්න",
|
||||
"Toggle Text to Speech": "පෙළ-කථනය මාරු කරන්න",
|
||||
"Play / Pause TTS": "TTS ධාවනය / විරාමය",
|
||||
"Toggle Paragraph Mode": "ඡේද ප්රකාරය මාරු කරන්න",
|
||||
"Highlight Selection": "තේරීම උද්දීපනය කරන්න",
|
||||
"Underline Selection": "තේරීමට යටින් ඉරක් අදින්න",
|
||||
"Annotate Selection": "තේරීමට සටහනක් එක් කරන්න",
|
||||
"Search Selection": "තේරීම සොයන්න",
|
||||
"Copy Selection": "තේරීම පිටපත් කරන්න",
|
||||
"Translate Selection": "තේරීම පරිවර්තනය කරන්න",
|
||||
"Dictionary Lookup": "ශබ්දකෝෂයේ සොයන්න",
|
||||
"Wikipedia Lookup": "විකිපීඩියාවේ සොයන්න",
|
||||
"Read Aloud Selection": "තේරීම ශබ්ද නගා කියවන්න",
|
||||
"Proofread Selection": "තේරීම සෝදුපත් කරන්න",
|
||||
"Open Settings": "සැකසුම් විවෘත කරන්න",
|
||||
"Open Command Palette": "විධාන පැලට් එක විවෘත කරන්න",
|
||||
"Show Keyboard Shortcuts": "යතුරුපුවරු කෙටිමං පෙන්වන්න",
|
||||
"Open Books": "පොත් විවෘත කරන්න",
|
||||
"Toggle Fullscreen": "පූර්ණ තිරය මාරු කරන්න",
|
||||
"Close Window": "කවුළුව වසන්න",
|
||||
"Quit App": "යෙදුමෙන් පිටවන්න",
|
||||
"Go Left / Previous Page": "වමට / පෙර පිටුව",
|
||||
"Go Right / Next Page": "දකුණට / ඊළඟ පිටුව",
|
||||
"Go Up": "ඉහළට",
|
||||
"Go Down": "පහළට",
|
||||
"Previous Chapter": "පෙර පරිච්ඡේදය",
|
||||
"Next Chapter": "ඊළඟ පරිච්ඡේදය",
|
||||
"Scroll Half Page Down": "අඩ පිටුවක් පහළට අනුචලනය",
|
||||
"Scroll Half Page Up": "අඩ පිටුවක් ඉහළට අනුචලනය",
|
||||
"Save Note": "සටහන සුරකින්න",
|
||||
"Single Section Scroll": "තනි කොටස අනුචලනය",
|
||||
"General": "සාමාන්ය",
|
||||
"Text to Speech": "පෙළ කථනය",
|
||||
"Zoom": "විශාලනය",
|
||||
"Window": "කවුළුව",
|
||||
"Your Bookshelf": "ඔබේ පොත් රාක්කය",
|
||||
"TTS": "කියවීම",
|
||||
"Media Info": "මාධ්ය තොරතුරු",
|
||||
"Update Frequency": "යාවත්කාලීන සංඛ්යාතය",
|
||||
"Every Sentence": "සෑම වාක්යයක්ම",
|
||||
"Every Paragraph": "සෑම ඡේදයක්ම",
|
||||
"Every Chapter": "සෑම පරිච්ඡේදයක්ම",
|
||||
"TTS Media Info Update Frequency": "TTS මාධ්ය තොරතුරු යාවත්කාලීන සංඛ්යාතය",
|
||||
"Select reading speed": "කියවීමේ වේගය තෝරන්න",
|
||||
"Drag to seek": "සෙවීමට ඇදගන්න",
|
||||
"Punctuation Delay": "විරාම ලකුණු ප්රමාදය",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "ඉදිරියට යාමට පෙර මෙම OPDS සම්බන්ධතාවය වෙබ් යෙදුමේ Readest සේවාදායක හරහා ප්රොක්සි කරන බව තහවුරු කරන්න.",
|
||||
"Custom Headers": "අභිරුචි ශීර්ෂ",
|
||||
"Custom Headers (optional)": "අභිරුචි ශීර්ෂ (විකල්ප)",
|
||||
"Add one header per line using \"Header-Name: value\".": "\"Header-Name: value\" භාවිතයෙන් පේළියකට එක ශීර්ෂයක් එක් කරන්න.",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "මෙම OPDS සම්බන්ධතාවය වෙබ් යෙදුමේ Readest සේවාදායක හරහා ප්රොක්සි කරන බව මට තේරෙනවා. මෙම අක්තපත්ර හෝ ශීර්ෂ සමඟ Readest විශ්වාස නොකරන්නේ නම්, මම ස්වදේශීය යෙදුම භාවිතා කළ යුතුය.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Hardcover වෙත සම්බන්ධ විය නොහැක. ඔබේ ජාල සම්බන්ධතාවය පරීක්ෂා කරන්න.",
|
||||
"Invalid Hardcover API token": "අවලංගු Hardcover API ටෝකනය",
|
||||
"Disconnected from Hardcover": "Hardcover වෙතින් විසන්ධි විය",
|
||||
"Hardcover Settings": "Hardcover සැකසීම්",
|
||||
"Connected to Hardcover": "Hardcover වෙත සම්බන්ධයි",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "කියවීමේ ප්රගතිය සහ සටහන් සමමුහුර්ත කිරීමට ඔබේ Hardcover ගිණුම සම්බන්ධ කරන්න.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "hardcover.app → සැකසීම් → API වෙතින් ඔබේ API ටෝකනය ලබාගන්න.",
|
||||
"API Token": "API ටෝකනය",
|
||||
"Paste your Hardcover API token": "ඔබේ Hardcover API ටෝකනය අලවන්න",
|
||||
"Hardcover sync enabled for this book": "මෙම පොත සඳහා Hardcover සමමුහුර්තකරණය සක්රීයයි",
|
||||
"Hardcover sync disabled for this book": "මෙම පොත සඳහා Hardcover සමමුහුර්තකරණය අක්රීයයි",
|
||||
"Hardcover Sync": "Hardcover සමමුහුර්තකරණය",
|
||||
"Enable for This Book": "මෙම පොත සඳහා සක්රීය කරන්න",
|
||||
"Push Notes": "සටහන් යවන්න",
|
||||
"Enable Hardcover sync for this book first.": "පළමුව මෙම පොත සඳහා Hardcover සමමුහුර්තකරණය සක්රීය කරන්න.",
|
||||
"No annotations or excerpts to sync for this book.": "මෙම පොත සඳහා සමමුහුර්ත කිරීමට සටහන් හෝ උපුටා ගැනීම් නැත.",
|
||||
"Configure Hardcover in Settings first.": "පළමුව සැකසීම් තුළ Hardcover වින්යාස කරන්න.",
|
||||
"No new Hardcover note changes to sync.": "සමමුහුර්ත කිරීමට නව Hardcover සටහන් වෙනස්කම් නැත.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover සමමුහුර්ත විය: {{inserted}} නව, {{updated}} යාවත්කාලීන, {{skipped}} වෙනස් නොවූ",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover සටහන් සමමුහුර්තකරණය අසාර්ථකයි: {{error}}",
|
||||
"Reading progress synced to Hardcover": "කියවීමේ ප්රගතිය Hardcover වෙත සමමුහුර්ත විය",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover ප්රගති සමමුහුර්තකරණය අසාර්ථකයි: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "පවතින මූලාශ්ර හඳුනාගැනීම තබාගන්න",
|
||||
"Toggle Toolbar": "මෙවලම් තීරුව ටොගල් කරන්න"
|
||||
}
|
||||
|
||||
@@ -523,7 +523,6 @@
|
||||
"words": "besed",
|
||||
"{{time}} left": "{{time}} do konca",
|
||||
"Reading progress": "Napredek branja",
|
||||
"Click to seek": "Kliknite za iskanje",
|
||||
"Skip back 15 words": "Skoči nazaj za 15 besed",
|
||||
"Back 15 words (Shift+Left)": "Nazaj za 15 besed (Shift+Levo)",
|
||||
"Pause": "Premor",
|
||||
@@ -896,7 +895,6 @@
|
||||
"Override Book Color": "Prezri barvo knjige",
|
||||
"None": "Brez",
|
||||
"Scroll": "Pomikanje",
|
||||
"Continuous Scroll": "Neprekinjeno pomikanje",
|
||||
"Overlap Pixels": "Prekrivanje pikslov",
|
||||
"Pagination": "Paginacija",
|
||||
"Tap to Paginate": "Tapnite za paginacijo",
|
||||
@@ -1128,5 +1126,88 @@
|
||||
"{{count}} books refreshed_few": "Osvežene {{count}} knjige",
|
||||
"{{count}} books refreshed_other": "Osveženih {{count}} knjig",
|
||||
"Failed to refresh metadata": "Osveževanje metapodatkov ni uspelo",
|
||||
"Refresh Metadata": "Osveži metapodatke"
|
||||
"Refresh Metadata": "Osveži metapodatke",
|
||||
"Keyboard Shortcuts": "Bližnjice na tipkovnici",
|
||||
"View all keyboard shortcuts": "Prikaži vse bližnjice na tipkovnici",
|
||||
"Switch Sidebar Tab": "Preklopi zavihek stranske vrstice",
|
||||
"Toggle Notebook": "Prikaži/skrij beležnico",
|
||||
"Search in Book": "Išči v knjigi",
|
||||
"Toggle Scroll Mode": "Preklopi način drsenja",
|
||||
"Toggle Select Mode": "Preklopi način izbire",
|
||||
"Toggle Bookmark": "Preklopi zaznamek",
|
||||
"Toggle Text to Speech": "Preklopi besedilo v govor",
|
||||
"Play / Pause TTS": "Predvajaj / Zaustavi TTS",
|
||||
"Toggle Paragraph Mode": "Preklopi način odstavka",
|
||||
"Highlight Selection": "Označi izbiro",
|
||||
"Underline Selection": "Podčrtaj izbiro",
|
||||
"Annotate Selection": "Dodaj opombo k izbiri",
|
||||
"Search Selection": "Išči izbiro",
|
||||
"Copy Selection": "Kopiraj izbiro",
|
||||
"Translate Selection": "Prevedi izbiro",
|
||||
"Dictionary Lookup": "Iskanje v slovarju",
|
||||
"Wikipedia Lookup": "Iskanje na Wikipediji",
|
||||
"Read Aloud Selection": "Preberi izbiro na glas",
|
||||
"Proofread Selection": "Lektoriraj izbiro",
|
||||
"Open Settings": "Odpri nastavitve",
|
||||
"Open Command Palette": "Odpri ukazno paleto",
|
||||
"Show Keyboard Shortcuts": "Prikaži bližnjice na tipkovnici",
|
||||
"Open Books": "Odpri knjige",
|
||||
"Toggle Fullscreen": "Preklopi celoten zaslon",
|
||||
"Close Window": "Zapri okno",
|
||||
"Quit App": "Zapri aplikacijo",
|
||||
"Go Left / Previous Page": "Levo / Prejšnja stran",
|
||||
"Go Right / Next Page": "Desno / Naslednja stran",
|
||||
"Go Up": "Navzgor",
|
||||
"Go Down": "Navzdol",
|
||||
"Previous Chapter": "Prejšnje poglavje",
|
||||
"Next Chapter": "Naslednje poglavje",
|
||||
"Scroll Half Page Down": "Drsi pol strani navzdol",
|
||||
"Scroll Half Page Up": "Drsi pol strani navzgor",
|
||||
"Save Note": "Shrani opombo",
|
||||
"Single Section Scroll": "Drsenje posameznega razdelka",
|
||||
"General": "Splošno",
|
||||
"Text to Speech": "Besedilo v govor",
|
||||
"Zoom": "Povečava",
|
||||
"Window": "Okno",
|
||||
"Your Bookshelf": "Vaša knjižna polica",
|
||||
"TTS": "Branje na glas",
|
||||
"Media Info": "Podatki o medijih",
|
||||
"Update Frequency": "Pogostost posodabljanja",
|
||||
"Every Sentence": "Vsak stavek",
|
||||
"Every Paragraph": "Vsak odstavek",
|
||||
"Every Chapter": "Vsako poglavje",
|
||||
"TTS Media Info Update Frequency": "Pogostost posodabljanja podatkov o medijih TTS",
|
||||
"Select reading speed": "Izberite hitrost branja",
|
||||
"Drag to seek": "Povlecite za iskanje",
|
||||
"Punctuation Delay": "Zamik ločil",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Pred nadaljevanjem potrdite, da bo ta povezava OPDS preusmerjena prek strežnikov Readest v spletni aplikaciji.",
|
||||
"Custom Headers": "Glave po meri",
|
||||
"Custom Headers (optional)": "Glave po meri (neobvezno)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Dodajte eno glavo na vrstico v obliki \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Razumem, da bo ta povezava OPDS preusmerjena prek strežnikov Readest v spletni aplikaciji. Če ne zaupam Readest s temi poverilnicami ali glavami, moram uporabiti izvorno aplikacijo.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Povezava s Hardcover ni mogoča. Preverite omrežno povezavo.",
|
||||
"Invalid Hardcover API token": "Neveljaven žeton API za Hardcover",
|
||||
"Disconnected from Hardcover": "Prekinjeno s Hardcover",
|
||||
"Hardcover Settings": "Nastavitve Hardcover",
|
||||
"Connected to Hardcover": "Povezano s Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Povežite svoj račun Hardcover za sinhronizacijo napredka branja in zapiskov.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Pridobite žeton API na hardcover.app → Nastavitve → API.",
|
||||
"API Token": "Žeton API",
|
||||
"Paste your Hardcover API token": "Prilepite žeton API za Hardcover",
|
||||
"Hardcover sync enabled for this book": "Sinhronizacija Hardcover je omogočena za to knjigo",
|
||||
"Hardcover sync disabled for this book": "Sinhronizacija Hardcover je onemogočena za to knjigo",
|
||||
"Hardcover Sync": "Sinhronizacija Hardcover",
|
||||
"Enable for This Book": "Omogoči za to knjigo",
|
||||
"Push Notes": "Pošlji zapiske",
|
||||
"Enable Hardcover sync for this book first.": "Najprej omogočite sinhronizacijo Hardcover za to knjigo.",
|
||||
"No annotations or excerpts to sync for this book.": "Za to knjigo ni opomb ali izpiskov za sinhronizacijo.",
|
||||
"Configure Hardcover in Settings first.": "Najprej nastavite Hardcover v nastavitvah.",
|
||||
"No new Hardcover note changes to sync.": "Ni novih sprememb zapiskov Hardcover za sinhronizacijo.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover sinhronizirano: {{inserted}} novih, {{updated}} posodobljenih, {{skipped}} nespremenjenih",
|
||||
"Hardcover notes sync failed: {{error}}": "Sinhronizacija zapiskov Hardcover ni uspela: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Napredek branja sinhroniziran s Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Sinhronizacija napredka Hardcover ni uspela: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Ohrani obstoječi identifikator vira",
|
||||
"Toggle Toolbar": "Preklopi orodno vrstico"
|
||||
}
|
||||
|
||||
@@ -446,7 +446,6 @@
|
||||
"Enable Highlighting": "Aktivera markering",
|
||||
"Code Language": "Kodspråk",
|
||||
"Scroll": "Rullning",
|
||||
"Continuous Scroll": "Kontinuerlig rullning",
|
||||
"Overlap Pixels": "Överlappande pixlar",
|
||||
"Disable Double Click": "Inaktivera dubbelklick",
|
||||
"Volume Keys for Page Flip": "Volymknappar för sidbyte",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "ord",
|
||||
"{{time}} left": "{{time}} kvar",
|
||||
"Reading progress": "Läsningens framsteg",
|
||||
"Click to seek": "Klicka för att söka",
|
||||
"Skip back 15 words": "Hoppa bakåt 15 ord",
|
||||
"Back 15 words (Shift+Left)": "Bakåt 15 ord (Shift+Vänster)",
|
||||
"Pause (Space)": "Pausa (Mellanslag)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "{{count}} bok uppdaterad",
|
||||
"{{count}} books refreshed_other": "{{count}} böcker uppdaterade",
|
||||
"Failed to refresh metadata": "Kunde inte uppdatera metadata",
|
||||
"Refresh Metadata": "Uppdatera metadata"
|
||||
"Refresh Metadata": "Uppdatera metadata",
|
||||
"Keyboard Shortcuts": "Tangentbordsgenvägar",
|
||||
"View all keyboard shortcuts": "Visa alla tangentbordsgenvägar",
|
||||
"Switch Sidebar Tab": "Byt flik i sidofältet",
|
||||
"Toggle Notebook": "Visa/dölj anteckningsbok",
|
||||
"Search in Book": "Sök i boken",
|
||||
"Toggle Scroll Mode": "Växla rullningsläge",
|
||||
"Toggle Select Mode": "Växla markeringsläge",
|
||||
"Toggle Bookmark": "Växla bokmärke",
|
||||
"Toggle Text to Speech": "Växla text-till-tal",
|
||||
"Play / Pause TTS": "Spela upp / Pausa TTS",
|
||||
"Toggle Paragraph Mode": "Växla styckeläge",
|
||||
"Highlight Selection": "Markera urval",
|
||||
"Underline Selection": "Stryka under urval",
|
||||
"Annotate Selection": "Kommentera urval",
|
||||
"Search Selection": "Sök urval",
|
||||
"Copy Selection": "Kopiera urval",
|
||||
"Translate Selection": "Översätt urval",
|
||||
"Dictionary Lookup": "Slå upp i ordbok",
|
||||
"Wikipedia Lookup": "Slå upp på Wikipedia",
|
||||
"Read Aloud Selection": "Läs upp urval",
|
||||
"Proofread Selection": "Korrekturläs urval",
|
||||
"Open Settings": "Öppna inställningar",
|
||||
"Open Command Palette": "Öppna kommandopaletten",
|
||||
"Show Keyboard Shortcuts": "Visa tangentbordsgenvägar",
|
||||
"Open Books": "Öppna böcker",
|
||||
"Toggle Fullscreen": "Växla helskärm",
|
||||
"Close Window": "Stäng fönster",
|
||||
"Quit App": "Avsluta appen",
|
||||
"Go Left / Previous Page": "Vänster / Föregående sida",
|
||||
"Go Right / Next Page": "Höger / Nästa sida",
|
||||
"Go Up": "Uppåt",
|
||||
"Go Down": "Nedåt",
|
||||
"Previous Chapter": "Föregående kapitel",
|
||||
"Next Chapter": "Nästa kapitel",
|
||||
"Scroll Half Page Down": "Rulla en halv sida nedåt",
|
||||
"Scroll Half Page Up": "Rulla en halv sida uppåt",
|
||||
"Save Note": "Spara anteckning",
|
||||
"Single Section Scroll": "Rullning per avsnitt",
|
||||
"General": "Allmänt",
|
||||
"Text to Speech": "Text till tal",
|
||||
"Zoom": "Zoom",
|
||||
"Window": "Fönster",
|
||||
"Your Bookshelf": "Din bokhylla",
|
||||
"TTS": "Uppläsning",
|
||||
"Media Info": "Medieinformation",
|
||||
"Update Frequency": "Uppdateringsfrekvens",
|
||||
"Every Sentence": "Varje mening",
|
||||
"Every Paragraph": "Varje stycke",
|
||||
"Every Chapter": "Varje kapitel",
|
||||
"TTS Media Info Update Frequency": "Uppdateringsfrekvens för TTS-medieinformation",
|
||||
"Select reading speed": "Välj läshastighet",
|
||||
"Drag to seek": "Dra för att söka",
|
||||
"Punctuation Delay": "Skiljeteckenfördröjning",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Bekräfta att denna OPDS-anslutning kommer att dirigeras via Readest-servrar i webbappen innan du fortsätter.",
|
||||
"Custom Headers": "Anpassade rubriker",
|
||||
"Custom Headers (optional)": "Anpassade rubriker (valfritt)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Lägg till en rubrik per rad med formatet \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Jag förstår att denna OPDS-anslutning kommer att dirigeras via Readest-servrar i webbappen. Om jag inte litar på Readest med dessa autentiseringsuppgifter eller rubriker bör jag använda den inbyggda appen istället.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Kan inte ansluta till Hardcover. Kontrollera din nätverksanslutning.",
|
||||
"Invalid Hardcover API token": "Ogiltig Hardcover API-token",
|
||||
"Disconnected from Hardcover": "Frånkopplad från Hardcover",
|
||||
"Hardcover Settings": "Hardcover-inställningar",
|
||||
"Connected to Hardcover": "Ansluten till Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Anslut ditt Hardcover-konto för att synkronisera läsframsteg och anteckningar.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Hämta din API-token från hardcover.app → Inställningar → API.",
|
||||
"API Token": "API-token",
|
||||
"Paste your Hardcover API token": "Klistra in din Hardcover API-token",
|
||||
"Hardcover sync enabled for this book": "Hardcover-synkronisering aktiverad för den här boken",
|
||||
"Hardcover sync disabled for this book": "Hardcover-synkronisering inaktiverad för den här boken",
|
||||
"Hardcover Sync": "Hardcover-synkronisering",
|
||||
"Enable for This Book": "Aktivera för den här boken",
|
||||
"Push Notes": "Skicka anteckningar",
|
||||
"Enable Hardcover sync for this book first.": "Aktivera först Hardcover-synkronisering för den här boken.",
|
||||
"No annotations or excerpts to sync for this book.": "Inga anteckningar eller utdrag att synkronisera för den här boken.",
|
||||
"Configure Hardcover in Settings first.": "Konfigurera först Hardcover i inställningarna.",
|
||||
"No new Hardcover note changes to sync.": "Inga nya ändringar av Hardcover-anteckningar att synkronisera.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover synkroniserat: {{inserted}} nya, {{updated}} uppdaterade, {{skipped}} oförändrade",
|
||||
"Hardcover notes sync failed: {{error}}": "Synkronisering av Hardcover-anteckningar misslyckades: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Läsframsteg synkroniserat med Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Synkronisering av Hardcover-framsteg misslyckades: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Behåll befintlig källidentifierare",
|
||||
"Toggle Toolbar": "Visa/dölj verktygsfältet"
|
||||
}
|
||||
|
||||
@@ -199,7 +199,6 @@
|
||||
"Auto": "தானியங்கி",
|
||||
"Scroll": "உருட்டவும்",
|
||||
"Scrolled Mode": "உருட்டல் பயன்முறை",
|
||||
"Continuous Scroll": "தொடர்ச்சியான உருட்டல்",
|
||||
"Overlap Pixels": "ஒன்றுடன் ஒன்று பிக்சல்கள்",
|
||||
"Disable Double Click": "இரட்டை கிளிக்கை முடக்கவும்",
|
||||
"Volume Keys for Page Flip": "பக்கம் புரட்டுவதற்கு ஒலி விசைகள்",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "வார்த்தைகள்",
|
||||
"{{time}} left": "{{time}} மீதமுள்ளது",
|
||||
"Reading progress": "வாசிப்பு முன்னேற்றம்",
|
||||
"Click to seek": "தேட கிளிக் செய்க",
|
||||
"Skip back 15 words": "15 வார்த்தைகள் பின்னால் செல்",
|
||||
"Back 15 words (Shift+Left)": "15 வார்த்தைகள் பின்னால் செல் (Shift+Left)",
|
||||
"Pause (Space)": "நிறுத்து (Space)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "{{count}} புத்தகம் புதுப்பிக்கப்பட்டது",
|
||||
"{{count}} books refreshed_other": "{{count}} புத்தகங்கள் புதுப்பிக்கப்பட்டன",
|
||||
"Failed to refresh metadata": "மெட்டாடேட்டா புதுப்பிப்பு தோல்வி",
|
||||
"Refresh Metadata": "மெட்டாடேட்டா புதுப்பிக்கவும்"
|
||||
"Refresh Metadata": "மெட்டாடேட்டா புதுப்பிக்கவும்",
|
||||
"Keyboard Shortcuts": "விசைப்பலகை குறுக்குவழிகள்",
|
||||
"View all keyboard shortcuts": "அனைத்து விசைப்பலகை குறுக்குவழிகளையும் காண்க",
|
||||
"Switch Sidebar Tab": "பக்கப்பட்டி தாவலை மாற்றுக",
|
||||
"Toggle Notebook": "குறிப்பேட்டைக் காட்டு/மறை",
|
||||
"Search in Book": "புத்தகத்தில் தேடுக",
|
||||
"Toggle Scroll Mode": "உருள் பயன்முறையை மாற்றுக",
|
||||
"Toggle Select Mode": "தேர்வு பயன்முறையை மாற்றுக",
|
||||
"Toggle Bookmark": "புக்மார்க்கை மாற்றுக",
|
||||
"Toggle Text to Speech": "உரையிலிருந்து பேச்சுக்கு மாற்றுக",
|
||||
"Play / Pause TTS": "TTS இயக்கு / இடைநிறுத்து",
|
||||
"Toggle Paragraph Mode": "பத்தி பயன்முறையை மாற்றுக",
|
||||
"Highlight Selection": "தேர்வை சிறப்பிக்கவும்",
|
||||
"Underline Selection": "தேர்வுக்கு அடிக்கோடிடுக",
|
||||
"Annotate Selection": "தேர்வுக்கு குறிப்பு சேர்க்கவும்",
|
||||
"Search Selection": "தேர்வைத் தேடுக",
|
||||
"Copy Selection": "தேர்வை நகலெடுக்கவும்",
|
||||
"Translate Selection": "தேர்வை மொழிபெயர்க்கவும்",
|
||||
"Dictionary Lookup": "அகராதியில் தேடுக",
|
||||
"Wikipedia Lookup": "விக்கிப்பீடியாவில் தேடுக",
|
||||
"Read Aloud Selection": "தேர்வை சத்தமாக படிக்கவும்",
|
||||
"Proofread Selection": "தேர்வை சரிபார்க்கவும்",
|
||||
"Open Settings": "அமைப்புகளைத் திறக்கவும்",
|
||||
"Open Command Palette": "கட்டளை தட்டை திறக்கவும்",
|
||||
"Show Keyboard Shortcuts": "விசைப்பலகை குறுக்குவழிகளைக் காட்டுக",
|
||||
"Open Books": "புத்தகங்களைத் திறக்கவும்",
|
||||
"Toggle Fullscreen": "முழுத்திரையை மாற்றுக",
|
||||
"Close Window": "சாளரத்தை மூடுக",
|
||||
"Quit App": "பயன்பாட்டிலிருந்து வெளியேறுக",
|
||||
"Go Left / Previous Page": "இடது / முந்தைய பக்கம்",
|
||||
"Go Right / Next Page": "வலது / அடுத்த பக்கம்",
|
||||
"Go Up": "மேலே",
|
||||
"Go Down": "கீழே",
|
||||
"Previous Chapter": "முந்தைய அத்தியாயம்",
|
||||
"Next Chapter": "அடுத்த அத்தியாயம்",
|
||||
"Scroll Half Page Down": "அரை பக்கம் கீழே உருட்டுக",
|
||||
"Scroll Half Page Up": "அரை பக்கம் மேலே உருட்டுக",
|
||||
"Save Note": "குறிப்பைச் சேமிக்கவும்",
|
||||
"Single Section Scroll": "ஒற்றைப் பகுதி உருட்டல்",
|
||||
"General": "பொது",
|
||||
"Text to Speech": "உரையிலிருந்து பேச்சு",
|
||||
"Zoom": "பெரிதாக்கு",
|
||||
"Window": "சாளரம்",
|
||||
"Your Bookshelf": "உங்கள் புத்தக அலமாரி",
|
||||
"TTS": "உரை வாசிப்பு",
|
||||
"Media Info": "ஊடக தகவல்",
|
||||
"Update Frequency": "புதுப்பிப்பு அதிர்வெண்",
|
||||
"Every Sentence": "ஒவ்வொரு வாக்கியமும்",
|
||||
"Every Paragraph": "ஒவ்வொரு பத்தியும்",
|
||||
"Every Chapter": "ஒவ்வொரு அத்தியாயமும்",
|
||||
"TTS Media Info Update Frequency": "TTS ஊடக தகவல் புதுப்பிப்பு அதிர்வெண்",
|
||||
"Select reading speed": "படிக்கும் வேகத்தைத் தேர்ந்தெடுக்கவும்",
|
||||
"Drag to seek": "தேட இழுக்கவும்",
|
||||
"Punctuation Delay": "நிறுத்தக்குறி தாமதம்",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "தொடர்வதற்கு முன், இந்த OPDS இணைப்பு வலை பயன்பாட்டில் Readest சேவையகங்கள் வழியாக ப்ராக்ஸி செய்யப்படும் என்பதை உறுதிப்படுத்தவும்.",
|
||||
"Custom Headers": "தனிப்பயன் தலைப்புகள்",
|
||||
"Custom Headers (optional)": "தனிப்பயன் தலைப்புகள் (விரும்பினால்)",
|
||||
"Add one header per line using \"Header-Name: value\".": "\"Header-Name: value\" வடிவமைப்பைப் பயன்படுத்தி ஒவ்வொரு வரியிலும் ஒரு தலைப்பைச் சேர்க்கவும்.",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "இந்த OPDS இணைப்பு வலை பயன்பாட்டில் Readest சேவையகங்கள் வழியாக ப்ராக்ஸி செய்யப்படும் என்பதை நான் புரிந்துகொள்கிறேன். இந்த சான்றுகள் அல்லது தலைப்புகளுடன் Readest-ஐ நம்பவில்லை என்றால், நான் நேட்டிவ் பயன்பாட்டைப் பயன்படுத்த வேண்டும்.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Hardcover உடன் இணைக்க முடியவில்லை. உங்கள் நெட்வொர்க் இணைப்பைச் சரிபார்க்கவும்.",
|
||||
"Invalid Hardcover API token": "தவறான Hardcover API டோக்கன்",
|
||||
"Disconnected from Hardcover": "Hardcover இலிருந்து துண்டிக்கப்பட்டது",
|
||||
"Hardcover Settings": "Hardcover அமைப்புகள்",
|
||||
"Connected to Hardcover": "Hardcover உடன் இணைக்கப்பட்டது",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "வாசிப்பு முன்னேற்றம் மற்றும் குறிப்புகளை ஒத்திசைக்க உங்கள் Hardcover கணக்கை இணைக்கவும்.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "hardcover.app → அமைப்புகள் → API இலிருந்து உங்கள் API டோக்கனைப் பெறவும்.",
|
||||
"API Token": "API டோக்கன்",
|
||||
"Paste your Hardcover API token": "உங்கள் Hardcover API டோக்கனை ஒட்டவும்",
|
||||
"Hardcover sync enabled for this book": "இந்த புத்தகத்திற்கு Hardcover ஒத்திசைவு இயக்கப்பட்டது",
|
||||
"Hardcover sync disabled for this book": "இந்த புத்தகத்திற்கு Hardcover ஒத்திசைவு முடக்கப்பட்டது",
|
||||
"Hardcover Sync": "Hardcover ஒத்திசைவு",
|
||||
"Enable for This Book": "இந்த புத்தகத்திற்கு இயக்கு",
|
||||
"Push Notes": "குறிப்புகளை அனுப்பு",
|
||||
"Enable Hardcover sync for this book first.": "முதலில் இந்த புத்தகத்திற்கு Hardcover ஒத்திசைவை இயக்கவும்.",
|
||||
"No annotations or excerpts to sync for this book.": "இந்த புத்தகத்திற்கு ஒத்திசைக்க குறிப்புகள் அல்லது பகுதிகள் இல்லை.",
|
||||
"Configure Hardcover in Settings first.": "முதலில் அமைப்புகளில் Hardcover-ஐ கட்டமைக்கவும்.",
|
||||
"No new Hardcover note changes to sync.": "ஒத்திசைக்க புதிய Hardcover குறிப்பு மாற்றங்கள் இல்லை.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover ஒத்திசைவு: {{inserted}} புதிய, {{updated}} புதுப்பிக்கப்பட்ட, {{skipped}} மாற்றமற்ற",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover குறிப்புகள் ஒத்திசைவு தோல்வி: {{error}}",
|
||||
"Reading progress synced to Hardcover": "வாசிப்பு முன்னேற்றம் Hardcover உடன் ஒத்திசைக்கப்பட்டது",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover முன்னேற்ற ஒத்திசைவு தோல்வி: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "ஏற்கனவே உள்ள மூல அடையாளங்காட்டியை வைத்திருக்கவும்",
|
||||
"Toggle Toolbar": "கருவிப்பட்டியை நிலைமாற்று"
|
||||
}
|
||||
|
||||
@@ -164,7 +164,6 @@
|
||||
"Code Language": "ภาษาโค้ด",
|
||||
"Scroll": "เลื่อน",
|
||||
"Scrolled Mode": "โหมดเลื่อน",
|
||||
"Continuous Scroll": "เลื่อนต่อเนื่อง",
|
||||
"Overlap Pixels": "พิกเซลซ้อน",
|
||||
"Volume Keys for Page Flip": "ปุ่มเสียงเพื่อพลิกหน้า",
|
||||
"Animation": "ภาพเคลื่อนไหว",
|
||||
@@ -971,7 +970,6 @@
|
||||
"words": "คำ",
|
||||
"{{time}} left": "เหลือ {{time}}",
|
||||
"Reading progress": "ความคืบหน้าการอ่าน",
|
||||
"Click to seek": "คลิกเพื่อค้นหาตำแหน่ง",
|
||||
"Skip back 15 words": "ย้อนกลับ 15 คำ",
|
||||
"Back 15 words (Shift+Left)": "ย้อนกลับ 15 คำ (Shift+ซ้าย)",
|
||||
"Pause (Space)": "หยุดชั่วคราว (Space)",
|
||||
@@ -1089,5 +1087,88 @@
|
||||
"Loading library...": "กำลังโหลดห้องสมุด...",
|
||||
"{{count}} books refreshed_other": "รีเฟรชแล้ว {{count}} เล่ม",
|
||||
"Failed to refresh metadata": "รีเฟรชข้อมูลเมตาล้มเหลว",
|
||||
"Refresh Metadata": "รีเฟรชข้อมูลเมตา"
|
||||
"Refresh Metadata": "รีเฟรชข้อมูลเมตา",
|
||||
"Keyboard Shortcuts": "แป้นพิมพ์ลัด",
|
||||
"View all keyboard shortcuts": "ดูแป้นพิมพ์ลัดทั้งหมด",
|
||||
"Switch Sidebar Tab": "สลับแท็บแถบด้านข้าง",
|
||||
"Toggle Notebook": "แสดง/ซ่อนสมุดบันทึก",
|
||||
"Search in Book": "ค้นหาในหนังสือ",
|
||||
"Toggle Scroll Mode": "สลับโหมดเลื่อน",
|
||||
"Toggle Select Mode": "สลับโหมดเลือก",
|
||||
"Toggle Bookmark": "สลับที่คั่นหนังสือ",
|
||||
"Toggle Text to Speech": "สลับข้อความเป็นเสียง",
|
||||
"Play / Pause TTS": "เล่น / หยุดชั่วคราว TTS",
|
||||
"Toggle Paragraph Mode": "สลับโหมดย่อหน้า",
|
||||
"Highlight Selection": "ไฮไลต์ข้อความที่เลือก",
|
||||
"Underline Selection": "ขีดเส้นใต้ข้อความที่เลือก",
|
||||
"Annotate Selection": "เพิ่มหมายเหตุให้ข้อความที่เลือก",
|
||||
"Search Selection": "ค้นหาข้อความที่เลือก",
|
||||
"Copy Selection": "คัดลอกข้อความที่เลือก",
|
||||
"Translate Selection": "แปลข้อความที่เลือก",
|
||||
"Dictionary Lookup": "ค้นหาในพจนานุกรม",
|
||||
"Wikipedia Lookup": "ค้นหาใน Wikipedia",
|
||||
"Read Aloud Selection": "อ่านออกเสียงข้อความที่เลือก",
|
||||
"Proofread Selection": "ตรวจทานข้อความที่เลือก",
|
||||
"Open Settings": "เปิดการตั้งค่า",
|
||||
"Open Command Palette": "เปิดแถบคำสั่ง",
|
||||
"Show Keyboard Shortcuts": "แสดงแป้นพิมพ์ลัด",
|
||||
"Open Books": "เปิดหนังสือ",
|
||||
"Toggle Fullscreen": "สลับเต็มหน้าจอ",
|
||||
"Close Window": "ปิดหน้าต่าง",
|
||||
"Quit App": "ออกจากแอป",
|
||||
"Go Left / Previous Page": "ไปซ้าย / หน้าก่อนหน้า",
|
||||
"Go Right / Next Page": "ไปขวา / หน้าถัดไป",
|
||||
"Go Up": "ขึ้น",
|
||||
"Go Down": "ลง",
|
||||
"Previous Chapter": "บทก่อนหน้า",
|
||||
"Next Chapter": "บทถัดไป",
|
||||
"Scroll Half Page Down": "เลื่อนลงครึ่งหน้า",
|
||||
"Scroll Half Page Up": "เลื่อนขึ้นครึ่งหน้า",
|
||||
"Save Note": "บันทึกโน้ต",
|
||||
"Single Section Scroll": "เลื่อนทีละส่วน",
|
||||
"General": "ทั่วไป",
|
||||
"Text to Speech": "อ่านออกเสียง",
|
||||
"Zoom": "ซูม",
|
||||
"Window": "หน้าต่าง",
|
||||
"Your Bookshelf": "ชั้นหนังสือของคุณ",
|
||||
"TTS": "อ่านออกเสียง",
|
||||
"Media Info": "ข้อมูลสื่อ",
|
||||
"Update Frequency": "ความถี่ในการอัปเดต",
|
||||
"Every Sentence": "ทุกประโยค",
|
||||
"Every Paragraph": "ทุกย่อหน้า",
|
||||
"Every Chapter": "ทุกบท",
|
||||
"TTS Media Info Update Frequency": "ความถี่ในการอัปเดตข้อมูลสื่อ TTS",
|
||||
"Select reading speed": "เลือกความเร็วในการอ่าน",
|
||||
"Drag to seek": "ลากเพื่อค้นหา",
|
||||
"Punctuation Delay": "หน่วงเวลาเครื่องหมายวรรคตอน",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "กรุณายืนยันว่าการเชื่อมต่อ OPDS นี้จะถูกส่งผ่านเซิร์ฟเวอร์ Readest บนเว็บแอปก่อนดำเนินการต่อ",
|
||||
"Custom Headers": "ส่วนหัวที่กำหนดเอง",
|
||||
"Custom Headers (optional)": "ส่วนหัวที่กำหนดเอง (ไม่บังคับ)",
|
||||
"Add one header per line using \"Header-Name: value\".": "เพิ่มส่วนหัวหนึ่งรายการต่อบรรทัดโดยใช้ \"Header-Name: value\"",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "ฉันเข้าใจว่าการเชื่อมต่อ OPDS นี้จะถูกส่งผ่านเซิร์ฟเวอร์ Readest บนเว็บแอป หากฉันไม่ไว้วางใจ Readest กับข้อมูลรับรองหรือส่วนหัวเหล่านี้ ฉันควรใช้แอปเนทีฟแทน",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "ไม่สามารถเชื่อมต่อกับ Hardcover ได้ กรุณาตรวจสอบการเชื่อมต่อเครือข่ายของคุณ",
|
||||
"Invalid Hardcover API token": "โทเค็น API ของ Hardcover ไม่ถูกต้อง",
|
||||
"Disconnected from Hardcover": "ตัดการเชื่อมต่อจาก Hardcover แล้ว",
|
||||
"Hardcover Settings": "การตั้งค่า Hardcover",
|
||||
"Connected to Hardcover": "เชื่อมต่อกับ Hardcover แล้ว",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "เชื่อมต่อบัญชี Hardcover ของคุณเพื่อซิงค์ความคืบหน้าการอ่านและบันทึก",
|
||||
"Get your API token from hardcover.app → Settings → API.": "รับโทเค็น API ของคุณจาก hardcover.app → การตั้งค่า → API",
|
||||
"API Token": "โทเค็น API",
|
||||
"Paste your Hardcover API token": "วางโทเค็น API ของ Hardcover ของคุณ",
|
||||
"Hardcover sync enabled for this book": "เปิดใช้งานการซิงค์ Hardcover สำหรับหนังสือนี้แล้ว",
|
||||
"Hardcover sync disabled for this book": "ปิดใช้งานการซิงค์ Hardcover สำหรับหนังสือนี้แล้ว",
|
||||
"Hardcover Sync": "การซิงค์ Hardcover",
|
||||
"Enable for This Book": "เปิดใช้งานสำหรับหนังสือนี้",
|
||||
"Push Notes": "ส่งบันทึก",
|
||||
"Enable Hardcover sync for this book first.": "เปิดใช้งานการซิงค์ Hardcover สำหรับหนังสือนี้ก่อน",
|
||||
"No annotations or excerpts to sync for this book.": "ไม่มีคำอธิบายประกอบหรือข้อความคัดลอกที่จะซิงค์สำหรับหนังสือนี้",
|
||||
"Configure Hardcover in Settings first.": "กำหนดค่า Hardcover ในการตั้งค่าก่อน",
|
||||
"No new Hardcover note changes to sync.": "ไม่มีการเปลี่ยนแปลงบันทึก Hardcover ใหม่ที่จะซิงค์",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "ซิงค์ Hardcover แล้ว: {{inserted}} รายการใหม่, {{updated}} อัปเดต, {{skipped}} ไม่เปลี่ยนแปลง",
|
||||
"Hardcover notes sync failed: {{error}}": "การซิงค์บันทึก Hardcover ล้มเหลว: {{error}}",
|
||||
"Reading progress synced to Hardcover": "ความคืบหน้าการอ่านซิงค์กับ Hardcover แล้ว",
|
||||
"Hardcover progress sync failed: {{error}}": "การซิงค์ความคืบหน้า Hardcover ล้มเหลว: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "เก็บตัวระบุแหล่งที่มาที่มีอยู่",
|
||||
"Toggle Toolbar": "สลับแถบเครื่องมือ"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "RTL Yönü",
|
||||
"Maximum Column Height": "Maksimum Sütun Yüksekliği",
|
||||
"Maximum Column Width": "Maksimum Sütun Genişliği",
|
||||
"Continuous Scroll": "Sürekli Kaydırma",
|
||||
"Fullscreen": "Tam Ekran",
|
||||
"No supported files found. Supported formats: {{formats}}": "Desteklenen dosya bulunamadı. Desteklenen formatlar: {{formats}}",
|
||||
"Drop to Import Books": "Kitapları İçe Aktarmak İçin Bırak",
|
||||
@@ -983,7 +982,6 @@
|
||||
"words": "kelime",
|
||||
"{{time}} left": "{{time}} kaldı",
|
||||
"Reading progress": "Okuma ilerlemesi",
|
||||
"Click to seek": "Konum aramak için tıkla",
|
||||
"Skip back 15 words": "15 kelime geri atla",
|
||||
"Back 15 words (Shift+Left)": "15 kelime geri (Shift+Sol)",
|
||||
"Pause (Space)": "Duraklat (Boşluk)",
|
||||
@@ -1102,5 +1100,88 @@
|
||||
"{{count}} books refreshed_one": "{{count}} kitap yenilendi",
|
||||
"{{count}} books refreshed_other": "{{count}} kitap yenilendi",
|
||||
"Failed to refresh metadata": "Meta veri yenileme başarısız",
|
||||
"Refresh Metadata": "Meta Verileri Yenile"
|
||||
"Refresh Metadata": "Meta Verileri Yenile",
|
||||
"Keyboard Shortcuts": "Klavye Kısayolları",
|
||||
"View all keyboard shortcuts": "Tüm klavye kısayollarını görüntüle",
|
||||
"Switch Sidebar Tab": "Kenar çubuğu sekmesini değiştir",
|
||||
"Toggle Notebook": "Not defterini göster/gizle",
|
||||
"Search in Book": "Kitapta ara",
|
||||
"Toggle Scroll Mode": "Kaydırma modunu değiştir",
|
||||
"Toggle Select Mode": "Seçim modunu değiştir",
|
||||
"Toggle Bookmark": "Yer imini değiştir",
|
||||
"Toggle Text to Speech": "Metinden konuşmayı değiştir",
|
||||
"Play / Pause TTS": "TTS Oynat / Duraklat",
|
||||
"Toggle Paragraph Mode": "Paragraf modunu değiştir",
|
||||
"Highlight Selection": "Seçimi vurgula",
|
||||
"Underline Selection": "Seçimin altını çiz",
|
||||
"Annotate Selection": "Seçime not ekle",
|
||||
"Search Selection": "Seçimi ara",
|
||||
"Copy Selection": "Seçimi kopyala",
|
||||
"Translate Selection": "Seçimi çevir",
|
||||
"Dictionary Lookup": "Sözlükte ara",
|
||||
"Wikipedia Lookup": "Wikipedia'da ara",
|
||||
"Read Aloud Selection": "Seçimi sesli oku",
|
||||
"Proofread Selection": "Seçimi düzelt",
|
||||
"Open Settings": "Ayarları aç",
|
||||
"Open Command Palette": "Komut paletini aç",
|
||||
"Show Keyboard Shortcuts": "Klavye kısayollarını göster",
|
||||
"Open Books": "Kitapları aç",
|
||||
"Toggle Fullscreen": "Tam ekranı değiştir",
|
||||
"Close Window": "Pencereyi kapat",
|
||||
"Quit App": "Uygulamadan çık",
|
||||
"Go Left / Previous Page": "Sola git / Önceki sayfa",
|
||||
"Go Right / Next Page": "Sağa git / Sonraki sayfa",
|
||||
"Go Up": "Yukarı",
|
||||
"Go Down": "Aşağı",
|
||||
"Previous Chapter": "Önceki bölüm",
|
||||
"Next Chapter": "Sonraki bölüm",
|
||||
"Scroll Half Page Down": "Yarım sayfa aşağı kaydır",
|
||||
"Scroll Half Page Up": "Yarım sayfa yukarı kaydır",
|
||||
"Save Note": "Notu kaydet",
|
||||
"Single Section Scroll": "Tek Bölüm Kaydırma",
|
||||
"General": "Genel",
|
||||
"Text to Speech": "Metinden konuşmaya",
|
||||
"Zoom": "Yakınlaştırma",
|
||||
"Window": "Pencere",
|
||||
"Your Bookshelf": "Kitaplığınız",
|
||||
"TTS": "Sesli Okuma",
|
||||
"Media Info": "Medya Bilgisi",
|
||||
"Update Frequency": "Güncelleme Sıklığı",
|
||||
"Every Sentence": "Her Cümle",
|
||||
"Every Paragraph": "Her Paragraf",
|
||||
"Every Chapter": "Her Bölüm",
|
||||
"TTS Media Info Update Frequency": "TTS Medya Bilgisi Güncelleme Sıklığı",
|
||||
"Select reading speed": "Okuma hızını seçin",
|
||||
"Drag to seek": "Aramak için sürükleyin",
|
||||
"Punctuation Delay": "Noktalama gecikmesi",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Devam etmeden önce bu OPDS bağlantısının web uygulamasında Readest sunucuları üzerinden yönlendirileceğini onaylayın.",
|
||||
"Custom Headers": "Özel Başlıklar",
|
||||
"Custom Headers (optional)": "Özel Başlıklar (isteğe bağlı)",
|
||||
"Add one header per line using \"Header-Name: value\".": "\"Header-Name: value\" biçimini kullanarak her satıra bir başlık ekleyin.",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Bu OPDS bağlantısının web uygulamasında Readest sunucuları üzerinden yönlendirileceğini anlıyorum. Bu kimlik bilgileri veya başlıklar konusunda Readest'e güvenmiyorsam, bunun yerine yerel uygulamayı kullanmalıyım.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Hardcover'a bağlanılamıyor. Lütfen ağ bağlantınızı kontrol edin.",
|
||||
"Invalid Hardcover API token": "Geçersiz Hardcover API belirteci",
|
||||
"Disconnected from Hardcover": "Hardcover bağlantısı kesildi",
|
||||
"Hardcover Settings": "Hardcover Ayarları",
|
||||
"Connected to Hardcover": "Hardcover'a bağlandı",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Okuma ilerlemenizi ve notlarınızı senkronize etmek için Hardcover hesabınızı bağlayın.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "API belirtecinizi hardcover.app → Ayarlar → API'den alın.",
|
||||
"API Token": "API Belirteci",
|
||||
"Paste your Hardcover API token": "Hardcover API belirtecinizi yapıştırın",
|
||||
"Hardcover sync enabled for this book": "Bu kitap için Hardcover senkronizasyonu etkinleştirildi",
|
||||
"Hardcover sync disabled for this book": "Bu kitap için Hardcover senkronizasyonu devre dışı bırakıldı",
|
||||
"Hardcover Sync": "Hardcover Senkronizasyonu",
|
||||
"Enable for This Book": "Bu Kitap İçin Etkinleştir",
|
||||
"Push Notes": "Notları Gönder",
|
||||
"Enable Hardcover sync for this book first.": "Önce bu kitap için Hardcover senkronizasyonunu etkinleştirin.",
|
||||
"No annotations or excerpts to sync for this book.": "Bu kitap için senkronize edilecek açıklama veya alıntı yok.",
|
||||
"Configure Hardcover in Settings first.": "Önce Ayarlar'da Hardcover'ı yapılandırın.",
|
||||
"No new Hardcover note changes to sync.": "Senkronize edilecek yeni Hardcover not değişikliği yok.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover senkronize edildi: {{inserted}} yeni, {{updated}} güncellendi, {{skipped}} değişmedi",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover not senkronizasyonu başarısız: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Okuma ilerlemesi Hardcover ile senkronize edildi",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover ilerleme senkronizasyonu başarısız: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Mevcut kaynak tanımlayıcısını koru",
|
||||
"Toggle Toolbar": "Araç Çubuğunu Aç/Kapat"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "Напрямок RTL",
|
||||
"Maximum Column Height": "Максимальна висота колонки",
|
||||
"Maximum Column Width": "Максимальна ширина колонки",
|
||||
"Continuous Scroll": "Постійна прокрутка",
|
||||
"Fullscreen": "Повноекранний",
|
||||
"No supported files found. Supported formats: {{formats}}": "Не знайдено підтримуваних файлів. Підтримувані формати: {{formats}}",
|
||||
"Drop to Import Books": "Перетягніть для імпорту книг",
|
||||
@@ -1007,7 +1006,6 @@
|
||||
"words": "слів",
|
||||
"{{time}} left": "залишилося {{time}}",
|
||||
"Reading progress": "Прогрес читання",
|
||||
"Click to seek": "Натисніть для пошуку",
|
||||
"Skip back 15 words": "Назад на 15 слів",
|
||||
"Back 15 words (Shift+Left)": "Назад на 15 слів (Shift+Стрілка вліво)",
|
||||
"Pause (Space)": "Пауза (Пробіл)",
|
||||
@@ -1128,5 +1126,88 @@
|
||||
"{{count}} books refreshed_many": "Оновлено {{count}} книг",
|
||||
"{{count}} books refreshed_other": "Оновлено {{count}} книг",
|
||||
"Failed to refresh metadata": "Не вдалося оновити метадані",
|
||||
"Refresh Metadata": "Оновити метадані"
|
||||
"Refresh Metadata": "Оновити метадані",
|
||||
"Keyboard Shortcuts": "Комбінації клавіш",
|
||||
"View all keyboard shortcuts": "Переглянути всі комбінації клавіш",
|
||||
"Switch Sidebar Tab": "Перемкнути вкладку бічної панелі",
|
||||
"Toggle Notebook": "Показати/сховати блокнот",
|
||||
"Search in Book": "Пошук у книзі",
|
||||
"Toggle Scroll Mode": "Перемкнути режим прокрутки",
|
||||
"Toggle Select Mode": "Перемкнути режим виділення",
|
||||
"Toggle Bookmark": "Перемкнути закладку",
|
||||
"Toggle Text to Speech": "Перемкнути озвучення тексту",
|
||||
"Play / Pause TTS": "Відтворити / Пауза TTS",
|
||||
"Toggle Paragraph Mode": "Перемкнути режим абзацу",
|
||||
"Highlight Selection": "Виділити вибране",
|
||||
"Underline Selection": "Підкреслити вибране",
|
||||
"Annotate Selection": "Додати примітку до вибраного",
|
||||
"Search Selection": "Шукати вибране",
|
||||
"Copy Selection": "Копіювати вибране",
|
||||
"Translate Selection": "Перекласти вибране",
|
||||
"Dictionary Lookup": "Пошук у словнику",
|
||||
"Wikipedia Lookup": "Пошук у Вікіпедії",
|
||||
"Read Aloud Selection": "Прочитати вибране вголос",
|
||||
"Proofread Selection": "Перевірити вибране",
|
||||
"Open Settings": "Відкрити налаштування",
|
||||
"Open Command Palette": "Відкрити палітру команд",
|
||||
"Show Keyboard Shortcuts": "Показати комбінації клавіш",
|
||||
"Open Books": "Відкрити книги",
|
||||
"Toggle Fullscreen": "Перемкнути повноекранний режим",
|
||||
"Close Window": "Закрити вікно",
|
||||
"Quit App": "Вийти з програми",
|
||||
"Go Left / Previous Page": "Вліво / Попередня сторінка",
|
||||
"Go Right / Next Page": "Вправо / Наступна сторінка",
|
||||
"Go Up": "Вгору",
|
||||
"Go Down": "Вниз",
|
||||
"Previous Chapter": "Попередній розділ",
|
||||
"Next Chapter": "Наступний розділ",
|
||||
"Scroll Half Page Down": "Прокрутити на півсторінки вниз",
|
||||
"Scroll Half Page Up": "Прокрутити на півсторінки вгору",
|
||||
"Save Note": "Зберегти нотатку",
|
||||
"Single Section Scroll": "Прокрутка одного розділу",
|
||||
"General": "Загальне",
|
||||
"Text to Speech": "Озвучення",
|
||||
"Zoom": "Масштаб",
|
||||
"Window": "Вікно",
|
||||
"Your Bookshelf": "Ваша книжкова полиця",
|
||||
"TTS": "Озвучування",
|
||||
"Media Info": "Медіа-інформація",
|
||||
"Update Frequency": "Частота оновлення",
|
||||
"Every Sentence": "Кожне речення",
|
||||
"Every Paragraph": "Кожен абзац",
|
||||
"Every Chapter": "Кожен розділ",
|
||||
"TTS Media Info Update Frequency": "Частота оновлення медіа-інформації TTS",
|
||||
"Select reading speed": "Виберіть швидкість читання",
|
||||
"Drag to seek": "Перетягніть для пошуку",
|
||||
"Punctuation Delay": "Затримка на розділових знаках",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Підтвердіть, що це з'єднання OPDS буде проксовано через сервери Readest у веб-додатку, перш ніж продовжити.",
|
||||
"Custom Headers": "Користувацькі заголовки",
|
||||
"Custom Headers (optional)": "Користувацькі заголовки (необов'язково)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Додайте один заголовок на рядок у форматі \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Я розумію, що це з'єднання OPDS буде проксовано через сервери Readest у веб-додатку. Якщо я не довіряю Readest свої облікові дані або заголовки, мені слід використовувати рідний додаток.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Не вдалося підключитися до Hardcover. Перевірте мережеве з'єднання.",
|
||||
"Invalid Hardcover API token": "Недійсний API-токен Hardcover",
|
||||
"Disconnected from Hardcover": "Від'єднано від Hardcover",
|
||||
"Hardcover Settings": "Налаштування Hardcover",
|
||||
"Connected to Hardcover": "Підключено до Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Підключіть свій обліковий запис Hardcover для синхронізації прогресу читання та нотаток.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Отримайте API-токен на hardcover.app → Налаштування → API.",
|
||||
"API Token": "API-токен",
|
||||
"Paste your Hardcover API token": "Вставте ваш API-токен Hardcover",
|
||||
"Hardcover sync enabled for this book": "Синхронізацію Hardcover увімкнено для цієї книги",
|
||||
"Hardcover sync disabled for this book": "Синхронізацію Hardcover вимкнено для цієї книги",
|
||||
"Hardcover Sync": "Синхронізація Hardcover",
|
||||
"Enable for This Book": "Увімкнути для цієї книги",
|
||||
"Push Notes": "Надіслати нотатки",
|
||||
"Enable Hardcover sync for this book first.": "Спочатку увімкніть синхронізацію Hardcover для цієї книги.",
|
||||
"No annotations or excerpts to sync for this book.": "Немає анотацій або витягів для синхронізації для цієї книги.",
|
||||
"Configure Hardcover in Settings first.": "Спочатку налаштуйте Hardcover у параметрах.",
|
||||
"No new Hardcover note changes to sync.": "Немає нових змін нотаток Hardcover для синхронізації.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover синхронізовано: {{inserted}} нових, {{updated}} оновлених, {{skipped}} без змін",
|
||||
"Hardcover notes sync failed: {{error}}": "Помилка синхронізації нотаток Hardcover: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Прогрес читання синхронізовано з Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Помилка синхронізації прогресу Hardcover: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Зберегти наявний ідентифікатор джерела",
|
||||
"Toggle Toolbar": "Перемкнути панель інструментів"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "Hướng RTL",
|
||||
"Maximum Column Height": "Chiều cao cột tối đa",
|
||||
"Maximum Column Width": "Chiều rộng cột tối đa",
|
||||
"Continuous Scroll": "Cuộn liên tục",
|
||||
"Fullscreen": "Toàn màn hình",
|
||||
"No supported files found. Supported formats: {{formats}}": "Không tìm thấy tệp được hỗ trợ. Định dạng được hỗ trợ: {{formats}}",
|
||||
"Drop to Import Books": "Kéo và thả để nhập sách",
|
||||
@@ -971,7 +970,6 @@
|
||||
"words": "từ",
|
||||
"{{time}} left": "còn lại {{time}}",
|
||||
"Reading progress": "Tiến độ đọc",
|
||||
"Click to seek": "Nhấp để tua",
|
||||
"Skip back 15 words": "Lùi lại 15 từ",
|
||||
"Back 15 words (Shift+Left)": "Lùi lại 15 từ (Shift+Trái)",
|
||||
"Pause (Space)": "Tạm dừng (Khoảng trắng)",
|
||||
@@ -1089,5 +1087,88 @@
|
||||
"Loading library...": "Đang tải thư viện...",
|
||||
"{{count}} books refreshed_other": "Đã làm mới {{count}} sách",
|
||||
"Failed to refresh metadata": "Không thể làm mới siêu dữ liệu",
|
||||
"Refresh Metadata": "Làm mới siêu dữ liệu"
|
||||
"Refresh Metadata": "Làm mới siêu dữ liệu",
|
||||
"Keyboard Shortcuts": "Phím tắt",
|
||||
"View all keyboard shortcuts": "Xem tất cả phím tắt",
|
||||
"Switch Sidebar Tab": "Chuyển tab thanh bên",
|
||||
"Toggle Notebook": "Hiện/ẩn sổ ghi chú",
|
||||
"Search in Book": "Tìm kiếm trong sách",
|
||||
"Toggle Scroll Mode": "Chuyển chế độ cuộn",
|
||||
"Toggle Select Mode": "Chuyển chế độ chọn",
|
||||
"Toggle Bookmark": "Bật/tắt đánh dấu",
|
||||
"Toggle Text to Speech": "Bật/tắt đọc văn bản",
|
||||
"Play / Pause TTS": "Phát / Tạm dừng TTS",
|
||||
"Toggle Paragraph Mode": "Chuyển chế độ đoạn văn",
|
||||
"Highlight Selection": "Tô sáng vùng chọn",
|
||||
"Underline Selection": "Gạch chân vùng chọn",
|
||||
"Annotate Selection": "Thêm ghi chú cho vùng chọn",
|
||||
"Search Selection": "Tìm kiếm vùng chọn",
|
||||
"Copy Selection": "Sao chép vùng chọn",
|
||||
"Translate Selection": "Dịch vùng chọn",
|
||||
"Dictionary Lookup": "Tra từ điển",
|
||||
"Wikipedia Lookup": "Tra cứu Wikipedia",
|
||||
"Read Aloud Selection": "Đọc to vùng chọn",
|
||||
"Proofread Selection": "Kiểm tra vùng chọn",
|
||||
"Open Settings": "Mở cài đặt",
|
||||
"Open Command Palette": "Mở bảng lệnh",
|
||||
"Show Keyboard Shortcuts": "Hiển thị phím tắt",
|
||||
"Open Books": "Mở sách",
|
||||
"Toggle Fullscreen": "Chuyển toàn màn hình",
|
||||
"Close Window": "Đóng cửa sổ",
|
||||
"Quit App": "Thoát ứng dụng",
|
||||
"Go Left / Previous Page": "Sang trái / Trang trước",
|
||||
"Go Right / Next Page": "Sang phải / Trang tiếp",
|
||||
"Go Up": "Lên trên",
|
||||
"Go Down": "Xuống dưới",
|
||||
"Previous Chapter": "Chương trước",
|
||||
"Next Chapter": "Chương tiếp",
|
||||
"Scroll Half Page Down": "Cuộn xuống nửa trang",
|
||||
"Scroll Half Page Up": "Cuộn lên nửa trang",
|
||||
"Save Note": "Lưu ghi chú",
|
||||
"Single Section Scroll": "Cuộn từng phần",
|
||||
"General": "Chung",
|
||||
"Text to Speech": "Chuyển văn bản thành giọng nói",
|
||||
"Zoom": "Thu phóng",
|
||||
"Window": "Cửa sổ",
|
||||
"Your Bookshelf": "Tủ sách của bạn",
|
||||
"TTS": "Đọc văn bản",
|
||||
"Media Info": "Thông tin phương tiện",
|
||||
"Update Frequency": "Tần suất cập nhật",
|
||||
"Every Sentence": "Mỗi câu",
|
||||
"Every Paragraph": "Mỗi đoạn văn",
|
||||
"Every Chapter": "Mỗi chương",
|
||||
"TTS Media Info Update Frequency": "Tần suất cập nhật thông tin phương tiện TTS",
|
||||
"Select reading speed": "Chọn tốc độ đọc",
|
||||
"Drag to seek": "Kéo để tìm kiếm",
|
||||
"Punctuation Delay": "Độ trễ dấu câu",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "Vui lòng xác nhận rằng kết nối OPDS này sẽ được chuyển tiếp qua máy chủ Readest trên ứng dụng web trước khi tiếp tục.",
|
||||
"Custom Headers": "Tiêu đề tùy chỉnh",
|
||||
"Custom Headers (optional)": "Tiêu đề tùy chỉnh (tùy chọn)",
|
||||
"Add one header per line using \"Header-Name: value\".": "Thêm một tiêu đề mỗi dòng sử dụng \"Header-Name: value\".",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "Tôi hiểu rằng kết nối OPDS này sẽ được chuyển tiếp qua máy chủ Readest trên ứng dụng web. Nếu tôi không tin tưởng Readest với các thông tin đăng nhập hoặc tiêu đề này, tôi nên sử dụng ứng dụng gốc.",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "Không thể kết nối với Hardcover. Vui lòng kiểm tra kết nối mạng của bạn.",
|
||||
"Invalid Hardcover API token": "Token API Hardcover không hợp lệ",
|
||||
"Disconnected from Hardcover": "Đã ngắt kết nối khỏi Hardcover",
|
||||
"Hardcover Settings": "Cài đặt Hardcover",
|
||||
"Connected to Hardcover": "Đã kết nối với Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "Kết nối tài khoản Hardcover của bạn để đồng bộ tiến trình đọc và ghi chú.",
|
||||
"Get your API token from hardcover.app → Settings → API.": "Lấy token API của bạn từ hardcover.app → Cài đặt → API.",
|
||||
"API Token": "Token API",
|
||||
"Paste your Hardcover API token": "Dán token API Hardcover của bạn",
|
||||
"Hardcover sync enabled for this book": "Đồng bộ Hardcover đã được bật cho cuốn sách này",
|
||||
"Hardcover sync disabled for this book": "Đồng bộ Hardcover đã được tắt cho cuốn sách này",
|
||||
"Hardcover Sync": "Đồng bộ Hardcover",
|
||||
"Enable for This Book": "Bật cho cuốn sách này",
|
||||
"Push Notes": "Gửi ghi chú",
|
||||
"Enable Hardcover sync for this book first.": "Bật đồng bộ Hardcover cho cuốn sách này trước.",
|
||||
"No annotations or excerpts to sync for this book.": "Không có chú thích hoặc trích đoạn nào để đồng bộ cho cuốn sách này.",
|
||||
"Configure Hardcover in Settings first.": "Cấu hình Hardcover trong Cài đặt trước.",
|
||||
"No new Hardcover note changes to sync.": "Không có thay đổi ghi chú Hardcover mới để đồng bộ.",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Đồng bộ Hardcover: {{inserted}} mới, {{updated}} đã cập nhật, {{skipped}} không đổi",
|
||||
"Hardcover notes sync failed: {{error}}": "Đồng bộ ghi chú Hardcover thất bại: {{error}}",
|
||||
"Reading progress synced to Hardcover": "Tiến trình đọc đã đồng bộ với Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Đồng bộ tiến trình Hardcover thất bại: {{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "Giữ mã định danh nguồn hiện tại",
|
||||
"Toggle Toolbar": "Bật/tắt thanh công cụ"
|
||||
}
|
||||
|
||||
@@ -185,7 +185,6 @@
|
||||
"RTL Direction": "从右向左",
|
||||
"Maximum Column Height": "最大列高",
|
||||
"Maximum Column Width": "最大列宽",
|
||||
"Continuous Scroll": "连续滚动",
|
||||
"Fullscreen": "全屏显示",
|
||||
"No supported files found. Supported formats: {{formats}}": "未找到支持的文件。支持的格式:{{formats}}",
|
||||
"Drop to Import Books": "拖放导入书籍",
|
||||
@@ -972,7 +971,6 @@
|
||||
"words": "词",
|
||||
"{{time}} left": "剩余 {{time}}",
|
||||
"Reading progress": "阅读进度",
|
||||
"Click to seek": "点击跳转",
|
||||
"Skip back 15 words": "回退 15 词",
|
||||
"Back 15 words (Shift+Left)": "回退 15 词 (Shift+Left)",
|
||||
"Pause (Space)": "暂停 (空格)",
|
||||
@@ -1089,5 +1087,88 @@
|
||||
"Loading library...": "正在加载书库...",
|
||||
"{{count}} books refreshed_other": "已刷新 {{count}} 本书",
|
||||
"Failed to refresh metadata": "刷新元数据失败",
|
||||
"Refresh Metadata": "刷新元数据"
|
||||
"Refresh Metadata": "刷新元数据",
|
||||
"Keyboard Shortcuts": "键盘快捷键",
|
||||
"View all keyboard shortcuts": "查看所有键盘快捷键",
|
||||
"Switch Sidebar Tab": "切换侧边栏标签",
|
||||
"Toggle Notebook": "显示/隐藏笔记本",
|
||||
"Search in Book": "在书中搜索",
|
||||
"Toggle Scroll Mode": "切换滚动模式",
|
||||
"Toggle Select Mode": "切换选择模式",
|
||||
"Toggle Bookmark": "切换书签",
|
||||
"Toggle Text to Speech": "切换文字转语音",
|
||||
"Play / Pause TTS": "播放 / 暂停朗读",
|
||||
"Toggle Paragraph Mode": "切换段落模式",
|
||||
"Highlight Selection": "高亮选中内容",
|
||||
"Underline Selection": "为选中内容添加下划线",
|
||||
"Annotate Selection": "为选中内容添加注释",
|
||||
"Search Selection": "搜索选中内容",
|
||||
"Copy Selection": "复制选中内容",
|
||||
"Translate Selection": "翻译选中内容",
|
||||
"Dictionary Lookup": "词典查询",
|
||||
"Wikipedia Lookup": "维基百科查询",
|
||||
"Read Aloud Selection": "朗读选中内容",
|
||||
"Proofread Selection": "校对选中内容",
|
||||
"Open Settings": "打开设置",
|
||||
"Open Command Palette": "打开命令面板",
|
||||
"Show Keyboard Shortcuts": "显示键盘快捷键",
|
||||
"Open Books": "打开书库",
|
||||
"Toggle Fullscreen": "切换全屏",
|
||||
"Close Window": "关闭窗口",
|
||||
"Quit App": "退出应用",
|
||||
"Go Left / Previous Page": "向左 / 上一页",
|
||||
"Go Right / Next Page": "向右 / 下一页",
|
||||
"Go Up": "向上",
|
||||
"Go Down": "向下",
|
||||
"Previous Chapter": "上一章",
|
||||
"Next Chapter": "下一章",
|
||||
"Scroll Half Page Down": "向下滚动半页",
|
||||
"Scroll Half Page Up": "向上滚动半页",
|
||||
"Save Note": "保存笔记",
|
||||
"Single Section Scroll": "单章节滚动",
|
||||
"General": "常规",
|
||||
"Text to Speech": "文字转语音",
|
||||
"Zoom": "缩放",
|
||||
"Window": "窗口",
|
||||
"Your Bookshelf": "你的书架",
|
||||
"TTS": "语音朗读",
|
||||
"Media Info": "媒体信息",
|
||||
"Update Frequency": "更新频率",
|
||||
"Every Sentence": "每句",
|
||||
"Every Paragraph": "每段",
|
||||
"Every Chapter": "每章",
|
||||
"TTS Media Info Update Frequency": "TTS 媒体信息更新频率",
|
||||
"Select reading speed": "选择朗读速度",
|
||||
"Drag to seek": "拖动以定位",
|
||||
"Punctuation Delay": "标点符号停顿",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "继续前请确认此 OPDS 连接将通过网页应用中的 Readest 服务器进行代理。",
|
||||
"Custom Headers": "自定义标头",
|
||||
"Custom Headers (optional)": "自定义标头(可选)",
|
||||
"Add one header per line using \"Header-Name: value\".": "每行添加一个标头,格式为 \"Header-Name: value\"。",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "我了解此 OPDS 连接将通过网页应用中的 Readest 服务器进行代理。如果我不信任 Readest 处理这些凭据或标头,我应该使用原生应用。",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "无法连接到 Hardcover。请检查您的网络连接。",
|
||||
"Invalid Hardcover API token": "无效的 Hardcover API 令牌",
|
||||
"Disconnected from Hardcover": "已断开与 Hardcover 的连接",
|
||||
"Hardcover Settings": "Hardcover 设置",
|
||||
"Connected to Hardcover": "已连接到 Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "连接您的 Hardcover 账户以同步阅读进度和笔记。",
|
||||
"Get your API token from hardcover.app → Settings → API.": "从 hardcover.app → 设置 → API 获取您的 API 令牌。",
|
||||
"API Token": "API 令牌",
|
||||
"Paste your Hardcover API token": "粘贴您的 Hardcover API 令牌",
|
||||
"Hardcover sync enabled for this book": "已为此书启用 Hardcover 同步",
|
||||
"Hardcover sync disabled for this book": "已为此书禁用 Hardcover 同步",
|
||||
"Hardcover Sync": "Hardcover 同步",
|
||||
"Enable for This Book": "为此书启用",
|
||||
"Push Notes": "推送笔记",
|
||||
"Enable Hardcover sync for this book first.": "请先为此书启用 Hardcover 同步。",
|
||||
"No annotations or excerpts to sync for this book.": "此书没有可同步的注释或摘录。",
|
||||
"Configure Hardcover in Settings first.": "请先在设置中配置 Hardcover。",
|
||||
"No new Hardcover note changes to sync.": "没有新的 Hardcover 笔记更改需要同步。",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover 已同步:{{inserted}} 个新增、{{updated}} 个更新、{{skipped}} 个未变",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover 笔记同步失败:{{error}}",
|
||||
"Reading progress synced to Hardcover": "阅读进度已同步到 Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover 进度同步失败:{{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "保留现有来源标识符",
|
||||
"Toggle Toolbar": "切换工具栏"
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@
|
||||
"RTL Direction": "從右向左",
|
||||
"Maximum Column Height": "最大列高",
|
||||
"Maximum Column Width": "最大列寬",
|
||||
"Continuous Scroll": "連續滾動",
|
||||
"Fullscreen": "全螢幕",
|
||||
"No supported files found. Supported formats: {{formats}}": "未找到支援的檔案。支援的格式:{{formats}}",
|
||||
"Drop to Import Books": "拖放導入書籍",
|
||||
@@ -971,7 +970,6 @@
|
||||
"words": "詞",
|
||||
"{{time}} left": "剩餘 {{time}}",
|
||||
"Reading progress": "閱讀進度",
|
||||
"Click to seek": "點擊跳轉",
|
||||
"Skip back 15 words": "回退 15 詞",
|
||||
"Back 15 words (Shift+Left)": "回退 15 詞 (Shift+Left)",
|
||||
"Pause (Space)": "暫停 (空格)",
|
||||
@@ -1089,5 +1087,88 @@
|
||||
"Loading library...": "正在載入書庫...",
|
||||
"{{count}} books refreshed_other": "已重新整理 {{count}} 本書",
|
||||
"Failed to refresh metadata": "重新整理中繼資料失敗",
|
||||
"Refresh Metadata": "重新整理中繼資料"
|
||||
"Refresh Metadata": "重新整理中繼資料",
|
||||
"Keyboard Shortcuts": "鍵盤快捷鍵",
|
||||
"View all keyboard shortcuts": "查看所有鍵盤快捷鍵",
|
||||
"Switch Sidebar Tab": "切換側邊欄標籤",
|
||||
"Toggle Notebook": "顯示/隱藏筆記本",
|
||||
"Search in Book": "在書中搜尋",
|
||||
"Toggle Scroll Mode": "切換捲動模式",
|
||||
"Toggle Select Mode": "切換選取模式",
|
||||
"Toggle Bookmark": "切換書籤",
|
||||
"Toggle Text to Speech": "切換文字轉語音",
|
||||
"Play / Pause TTS": "播放 / 暫停朗讀",
|
||||
"Toggle Paragraph Mode": "切換段落模式",
|
||||
"Highlight Selection": "醒目標示選取內容",
|
||||
"Underline Selection": "為選取內容加底線",
|
||||
"Annotate Selection": "為選取內容加註釋",
|
||||
"Search Selection": "搜尋選取內容",
|
||||
"Copy Selection": "複製選取內容",
|
||||
"Translate Selection": "翻譯選取內容",
|
||||
"Dictionary Lookup": "字典查詢",
|
||||
"Wikipedia Lookup": "維基百科查詢",
|
||||
"Read Aloud Selection": "朗讀選取內容",
|
||||
"Proofread Selection": "校對選取內容",
|
||||
"Open Settings": "開啟設定",
|
||||
"Open Command Palette": "開啟指令面板",
|
||||
"Show Keyboard Shortcuts": "顯示鍵盤快捷鍵",
|
||||
"Open Books": "開啟書庫",
|
||||
"Toggle Fullscreen": "切換全螢幕",
|
||||
"Close Window": "關閉視窗",
|
||||
"Quit App": "結束應用程式",
|
||||
"Go Left / Previous Page": "向左 / 上一頁",
|
||||
"Go Right / Next Page": "向右 / 下一頁",
|
||||
"Go Up": "向上",
|
||||
"Go Down": "向下",
|
||||
"Previous Chapter": "上一章",
|
||||
"Next Chapter": "下一章",
|
||||
"Scroll Half Page Down": "向下捲動半頁",
|
||||
"Scroll Half Page Up": "向上捲動半頁",
|
||||
"Save Note": "儲存筆記",
|
||||
"Single Section Scroll": "單章節捲動",
|
||||
"General": "一般",
|
||||
"Text to Speech": "文字轉語音",
|
||||
"Zoom": "縮放",
|
||||
"Window": "視窗",
|
||||
"Your Bookshelf": "你的書架",
|
||||
"TTS": "語音朗讀",
|
||||
"Media Info": "媒體資訊",
|
||||
"Update Frequency": "更新頻率",
|
||||
"Every Sentence": "每句",
|
||||
"Every Paragraph": "每段",
|
||||
"Every Chapter": "每章",
|
||||
"TTS Media Info Update Frequency": "TTS 媒體資訊更新頻率",
|
||||
"Select reading speed": "選擇朗讀速度",
|
||||
"Drag to seek": "拖曳以定位",
|
||||
"Punctuation Delay": "標點符號停頓",
|
||||
"Please confirm that this OPDS connection will be proxied through Readest servers on the web app before continuing.": "繼續前請確認此 OPDS 連線將透過網頁應用程式中的 Readest 伺服器進行代理。",
|
||||
"Custom Headers": "自訂標頭",
|
||||
"Custom Headers (optional)": "自訂標頭(選填)",
|
||||
"Add one header per line using \"Header-Name: value\".": "每行新增一個標頭,格式為 \"Header-Name: value\"。",
|
||||
"I understand this OPDS connection will be proxied through Readest servers on the web app. If I do not trust Readest with these credentials or headers, I should use the native app instead.": "我了解此 OPDS 連線將透過網頁應用程式中的 Readest 伺服器進行代理。若我不信任 Readest 處理這些憑證或標頭,我應該使用原生應用程式。",
|
||||
"Unable to connect to Hardcover. Please check your network connection.": "無法連線到 Hardcover。請檢查您的網路連線。",
|
||||
"Invalid Hardcover API token": "無效的 Hardcover API 權杖",
|
||||
"Disconnected from Hardcover": "已中斷與 Hardcover 的連線",
|
||||
"Hardcover Settings": "Hardcover 設定",
|
||||
"Connected to Hardcover": "已連線到 Hardcover",
|
||||
"Connect your Hardcover account to sync reading progress and notes.": "連結您的 Hardcover 帳戶以同步閱讀進度和筆記。",
|
||||
"Get your API token from hardcover.app → Settings → API.": "從 hardcover.app → 設定 → API 取得您的 API 權杖。",
|
||||
"API Token": "API 權杖",
|
||||
"Paste your Hardcover API token": "貼上您的 Hardcover API 權杖",
|
||||
"Hardcover sync enabled for this book": "已為此書啟用 Hardcover 同步",
|
||||
"Hardcover sync disabled for this book": "已為此書停用 Hardcover 同步",
|
||||
"Hardcover Sync": "Hardcover 同步",
|
||||
"Enable for This Book": "為此書啟用",
|
||||
"Push Notes": "推送筆記",
|
||||
"Enable Hardcover sync for this book first.": "請先為此書啟用 Hardcover 同步。",
|
||||
"No annotations or excerpts to sync for this book.": "此書沒有可同步的註釋或摘錄。",
|
||||
"Configure Hardcover in Settings first.": "請先在設定中配置 Hardcover。",
|
||||
"No new Hardcover note changes to sync.": "沒有新的 Hardcover 筆記變更需要同步。",
|
||||
"Hardcover synced: {{inserted}} new, {{updated}} updated, {{skipped}} unchanged": "Hardcover 已同步:{{inserted}} 個新增、{{updated}} 個更新、{{skipped}} 個未變",
|
||||
"Hardcover notes sync failed: {{error}}": "Hardcover 筆記同步失敗:{{error}}",
|
||||
"Reading progress synced to Hardcover": "閱讀進度已同步到 Hardcover",
|
||||
"Hardcover progress sync failed: {{error}}": "Hardcover 進度同步失敗:{{error}}",
|
||||
"ISBN": "ISBN",
|
||||
"Keep existing source identifier": "保留現有來源識別碼",
|
||||
"Toggle Toolbar": "切換工具列"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,33 @@
|
||||
{
|
||||
"releases": {
|
||||
"0.10.4": {
|
||||
"date": "2026-04-06",
|
||||
"notes": [
|
||||
"Annotations: You can now name your highlight colors, and your custom names sync across devices",
|
||||
"Annotations: Fixed highlights that stayed on the page after being deleted from the sidebar",
|
||||
"Speed Reading: Added an option to split long words, a faster countdown",
|
||||
"Text-to-Speech: Fixed double playback when tapping the play button in quick succession",
|
||||
"Accessibility: Dropdown menus now open reliably when activated with the keyboard",
|
||||
"Reading: Background textures now display correctly when you override the theme background color",
|
||||
"Translation: Temporarily disabled the Yandex provider while its service is unavailable"
|
||||
]
|
||||
},
|
||||
"0.10.2": {
|
||||
"date": "2026-04-05",
|
||||
"notes": [
|
||||
"Reading: Added single section scroll option, keyboard shortcuts help dialog, and reading ruler improvements",
|
||||
"Reading: Fixed Adobe font deobfuscation and applied theme colors to PDFs",
|
||||
"Reading: Fixed paginator freeze, image sizing on resize, and vertical writing mode compatibility",
|
||||
"Annotations: Fixed annotations grouped under wrong chapter and added highlight opacity setting",
|
||||
"Text-to-Speech: Added dedicated TTS settings tab with highlight opacity and keyboard shortcuts for navigation",
|
||||
"Sync: Added Hardcover.app sync integration and improved KOSync progress accuracy",
|
||||
"KOReader Plugin: Added full annotation sync option and fixed sync-related crashes",
|
||||
"OPDS: Added custom catalog headers with web proxy consent and fixed feed display issues",
|
||||
"Speed Reading: Added per-chapter progress bar and speed selector dropdown",
|
||||
"Android: Added D-pad navigation for Android TV remote controller",
|
||||
"Theme: Added atmosphere Easter egg with video overlay and ambient audio"
|
||||
]
|
||||
},
|
||||
"0.10.1": {
|
||||
"date": "2026-03-22",
|
||||
"notes": [
|
||||
|
||||
@@ -38,8 +38,9 @@ if grep -q 'MANAGE_EXTERNAL_STORAGE' "$MANIFEST"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "🚀 Running: pnpm tauri android build"
|
||||
pnpm tauri android build --config src-tauri/tauri.playstore.conf.json
|
||||
source .env.google-play.local
|
||||
echo "🚀 Running: pnpm tauri android build (googleplay flavor)"
|
||||
ORG_GRADLE_PROJECT_storeFlavor=googleplay pnpm tauri android build --config src-tauri/tauri.playstore.conf.json
|
||||
|
||||
# --- ADD PERMISSION BACK AFTER BUILD ---
|
||||
if ! grep -q 'REQUEST_INSTALL_PACKAGES' "$MANIFEST"; then
|
||||
@@ -56,11 +57,27 @@ if ! grep -q 'MANAGE_EXTERNAL_STORAGE' "$MANIFEST"; then
|
||||
" "$MANIFEST"
|
||||
fi
|
||||
|
||||
source .env.google-play.local
|
||||
if [[ -z "$GOOGLE_PLAY_JSON_KEY_FILE" ]]; then
|
||||
echo "❌ GOOGLE_PLAY_JSON_KEY_FILE is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# --- GENERATE CHANGELOG FOR GOOGLE PLAY ---
|
||||
CHANGELOG_DIR="../../fastlane/metadata/android/en-US/changelogs"
|
||||
mkdir -p "$CHANGELOG_DIR"
|
||||
|
||||
NOTES=$(jq -r --arg ver "$VERSION" '.releases[$ver].notes // empty | map("• " + .) | join("\n")' release-notes.json)
|
||||
if [[ -n "$NOTES" ]]; then
|
||||
# Google Play has a 500-character limit for release notes per language
|
||||
if [[ ${#NOTES} -gt 480 ]]; then
|
||||
NOTES="${NOTES:0:477}..."
|
||||
fi
|
||||
echo "$NOTES" > "$CHANGELOG_DIR/default.txt"
|
||||
echo "📝 Release notes for v$VERSION written to changelogs/default.txt"
|
||||
else
|
||||
echo "⚠️ No release notes found for v$VERSION in release-notes.json"
|
||||
fi
|
||||
|
||||
cd ../../
|
||||
|
||||
fastlane android upload_production
|
||||
|
||||
@@ -29,6 +29,8 @@ android {
|
||||
targetSdk = 36
|
||||
versionCode = tauriProperties.getProperty("tauri.android.versionCode", "1").toInt()
|
||||
versionName = tauriProperties.getProperty("tauri.android.versionName", "1.0")
|
||||
val storeFlavor = project.findProperty("storeFlavor")?.toString() ?: "foss"
|
||||
missingDimensionStrategy("store", storeFlavor)
|
||||
}
|
||||
signingConfigs {
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
@@ -85,9 +87,10 @@ dependencies {
|
||||
implementation("androidx.appcompat:appcompat:1.7.1")
|
||||
implementation("androidx.activity:activity-ktx:1.10.1")
|
||||
implementation("com.google.android.material:material:1.12.0")
|
||||
implementation("androidx.lifecycle:lifecycle-process:2.10.0")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.4")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
|
||||
}
|
||||
|
||||
apply(from = "tauri.build.gradle.kts")
|
||||
apply(from = "tauri.build.gradle.kts")
|
||||
|
||||
+12
-1
@@ -30,10 +30,21 @@ android {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
flavorDimensions += "store"
|
||||
productFlavors {
|
||||
create("foss") {
|
||||
dimension = "store"
|
||||
}
|
||||
create("googleplay") {
|
||||
dimension = "store"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.android.billingclient:billing-ktx:7.1.1")
|
||||
"googleplayImplementation"("com.android.billingclient:billing-ktx:7.1.1")
|
||||
"googleplayImplementation"("com.google.android.gms:play-services-base:18.5.0")
|
||||
implementation("androidx.core:core-ktx:1.12.0")
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("androidx.browser:browser:1.8.0")
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.readest.native_bridge
|
||||
|
||||
import android.app.Activity
|
||||
import android.util.Log
|
||||
|
||||
class BillingManager(private val activity: Activity) {
|
||||
companion object {
|
||||
private const val TAG = "BillingManager"
|
||||
}
|
||||
|
||||
fun isBillingAvailable(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
fun initialize(callback: (Boolean) -> Unit) {
|
||||
Log.d(TAG, "Google Play billing not available in this build")
|
||||
callback(false)
|
||||
}
|
||||
|
||||
fun fetchProducts(productIds: List<String>, callback: (List<ProductData>) -> Unit) {
|
||||
callback(emptyList())
|
||||
}
|
||||
|
||||
fun purchaseProduct(productId: String, callback: (PurchaseData?) -> Unit) {
|
||||
callback(null)
|
||||
}
|
||||
|
||||
fun restorePurchases(callback: (List<PurchaseData>) -> Unit) {
|
||||
callback(emptyList())
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -285,7 +285,7 @@ class NativeBridgePlugin(private val activity: Activity): Plugin(activity) {
|
||||
}
|
||||
if (visible) {
|
||||
controller.show(WindowInsets.Type.statusBars())
|
||||
controller.show(WindowInsets.Type.navigationBars())
|
||||
controller.hide(WindowInsets.Type.navigationBars())
|
||||
} else {
|
||||
controller.hide(WindowInsets.Type.systemBars())
|
||||
}
|
||||
@@ -301,7 +301,7 @@ class NativeBridgePlugin(private val activity: Activity): Plugin(activity) {
|
||||
}
|
||||
if (visible) {
|
||||
it.show(WindowInsetsCompat.Type.statusBars())
|
||||
it.show(WindowInsetsCompat.Type.navigationBars())
|
||||
it.hide(WindowInsetsCompat.Type.navigationBars())
|
||||
} else {
|
||||
it.hide(WindowInsetsCompat.Type.systemBars())
|
||||
}
|
||||
|
||||
+120
-48
@@ -2,6 +2,8 @@ package com.readest.native_tts
|
||||
|
||||
import android.Manifest
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.provider.Settings
|
||||
@@ -110,25 +112,33 @@ class NativeTTSPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
companion object {
|
||||
private const val TAG = "NativeTTSPlugin"
|
||||
private const val CHANNEL_NAME = "tts_events"
|
||||
private const val IDLE_TIMEOUT_MS = 30L * 60 * 1000 // 30 minutes
|
||||
var NOTIFICATION_TITLE = "Read Aloud"
|
||||
var NOTIFICATION_TEXT = "Ready to read aloud"
|
||||
var FOREGROUND_SERVICE_TITLE = "Read Aloud"
|
||||
var FOREGROUND_SERVICE_TEXT = "Ready to read aloud"
|
||||
}
|
||||
|
||||
|
||||
private var textToSpeech: TextToSpeech? = null
|
||||
private var isInitialized = AtomicBoolean(false)
|
||||
private var isPaused = AtomicBoolean(false)
|
||||
private var isSpeaking = AtomicBoolean(false)
|
||||
private var currentRate = AtomicReference<Float>(1.0f)
|
||||
private var currentPitch = AtomicReference<Float>(1.0f)
|
||||
|
||||
|
||||
private val eventChannels = ConcurrentHashMap<String, Channel<TTSMessageEvent>>()
|
||||
private val speakingJobs = ConcurrentHashMap<String, Job>()
|
||||
private val coroutineScope = CoroutineScope(Dispatchers.Main + SupervisorJob())
|
||||
|
||||
private val idleHandler = Handler(Looper.getMainLooper())
|
||||
private val idleShutdownRunnable = Runnable {
|
||||
Log.d(TAG, "Idle timeout reached, shutting down TTS engine to save battery")
|
||||
shutdownTTSEngine()
|
||||
}
|
||||
|
||||
@Command
|
||||
fun init(invoke: Invoke) {
|
||||
cancelIdleTimer()
|
||||
coroutineScope.launch {
|
||||
try {
|
||||
val success = initializeTTS()
|
||||
@@ -215,34 +225,46 @@ class NativeTTSPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
|
||||
@Command
|
||||
fun speak(invoke: Invoke) {
|
||||
cancelIdleTimer()
|
||||
|
||||
val args = invoke.parseArgs(SpeakArgs::class.java)
|
||||
val text = args.text ?: ""
|
||||
|
||||
|
||||
if (text.isEmpty()) {
|
||||
invoke.reject("Text cannot be empty")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
val utteranceId = UUID.randomUUID().toString()
|
||||
|
||||
|
||||
coroutineScope.launch {
|
||||
try {
|
||||
// Re-initialize TTS engine if it was shut down by the idle timer
|
||||
if (!isInitialized.get()) {
|
||||
val success = initializeTTS()
|
||||
if (!success) {
|
||||
invoke.reject("Failed to re-initialize TTS engine")
|
||||
return@launch
|
||||
}
|
||||
Log.d(TAG, "TTS engine re-initialized after idle shutdown")
|
||||
}
|
||||
|
||||
val eventChannel = Channel<TTSMessageEvent>(Channel.UNLIMITED)
|
||||
eventChannels[utteranceId] = eventChannel
|
||||
|
||||
|
||||
val speakJob = launch {
|
||||
speakText(text, utteranceId, args.preload ?: false)
|
||||
}
|
||||
speakingJobs[utteranceId] = speakJob
|
||||
|
||||
|
||||
val result = JSObject().apply {
|
||||
put("utteranceId", utteranceId)
|
||||
}
|
||||
invoke.resolve(result)
|
||||
|
||||
|
||||
// Start sending events to the frontend
|
||||
startEventStream(utteranceId)
|
||||
|
||||
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Failed to start speaking", e)
|
||||
invoke.reject("Failed to start speaking: ${e.message}")
|
||||
@@ -317,6 +339,7 @@ class NativeTTSPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
try {
|
||||
if (textToSpeech?.stop() == TextToSpeech.SUCCESS) {
|
||||
isPaused.set(true)
|
||||
startIdleTimer()
|
||||
invoke.resolve()
|
||||
} else {
|
||||
invoke.reject("Failed to pause TTS")
|
||||
@@ -328,6 +351,7 @@ class NativeTTSPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
|
||||
@Command
|
||||
fun resume(invoke: Invoke) {
|
||||
cancelIdleTimer()
|
||||
try {
|
||||
isPaused.set(false)
|
||||
invoke.resolve()
|
||||
@@ -346,7 +370,8 @@ class NativeTTSPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
eventChannels.values.forEach { it.close() }
|
||||
speakingJobs.clear()
|
||||
eventChannels.clear()
|
||||
|
||||
startIdleTimer()
|
||||
|
||||
invoke.resolve()
|
||||
} else {
|
||||
invoke.reject("Failed to stop TTS")
|
||||
@@ -377,57 +402,67 @@ class NativeTTSPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
invoke.reject("Exception setting pitch: ${e.message}")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Command
|
||||
fun set_voice(invoke: Invoke) {
|
||||
val args = invoke.parseArgs(SetVoiceArgs::class.java)
|
||||
try {
|
||||
val voices = textToSpeech?.voices
|
||||
val targetVoice = voices?.find { voice ->
|
||||
val languageTag = voice.locale.toLanguageTag()
|
||||
voice.name == args.voice || (languageTag.contains(voice.name) && languageTag == args.voice)
|
||||
}
|
||||
|
||||
if (targetVoice != null) {
|
||||
val result = textToSpeech?.setVoice(targetVoice)
|
||||
if (result == TextToSpeech.SUCCESS) {
|
||||
invoke.resolve()
|
||||
} else {
|
||||
invoke.reject("Failed to set voice: ${args.voice}")
|
||||
coroutineScope.launch {
|
||||
try {
|
||||
if (!isInitialized.get()) {
|
||||
initializeTTS()
|
||||
}
|
||||
} else {
|
||||
invoke.reject("Voice not found: ${args.voice}")
|
||||
val voices = textToSpeech?.voices
|
||||
val targetVoice = voices?.find { voice ->
|
||||
val languageTag = voice.locale.toLanguageTag()
|
||||
voice.name == args.voice || (languageTag.contains(voice.name) && languageTag == args.voice)
|
||||
}
|
||||
|
||||
if (targetVoice != null) {
|
||||
val result = textToSpeech?.setVoice(targetVoice)
|
||||
if (result == TextToSpeech.SUCCESS) {
|
||||
invoke.resolve()
|
||||
} else {
|
||||
invoke.reject("Failed to set voice: ${args.voice}")
|
||||
}
|
||||
} else {
|
||||
invoke.reject("Voice not found: ${args.voice}")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
invoke.reject("Exception setting voice: ${e.message}")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
invoke.reject("Exception setting voice: ${e.message}")
|
||||
}
|
||||
}
|
||||
|
||||
@Command
|
||||
fun get_all_voices(invoke: Invoke) {
|
||||
try {
|
||||
val voices = textToSpeech?.voices?.map { voice ->
|
||||
val voiceName = voice.name
|
||||
val language = voice.locale.toLanguageTag()
|
||||
val (id, name) = if (language.contains(voiceName)) {
|
||||
language to language
|
||||
} else {
|
||||
voiceName to voiceName
|
||||
coroutineScope.launch {
|
||||
try {
|
||||
if (!isInitialized.get()) {
|
||||
initializeTTS()
|
||||
}
|
||||
JSObject().apply {
|
||||
put("id", id)
|
||||
put("name", name)
|
||||
put("lang", language)
|
||||
put("disabled", false)
|
||||
val voices = textToSpeech?.voices?.map { voice ->
|
||||
val voiceName = voice.name
|
||||
val language = voice.locale.toLanguageTag()
|
||||
val (id, name) = if (language.contains(voiceName)) {
|
||||
language to language
|
||||
} else {
|
||||
voiceName to voiceName
|
||||
}
|
||||
JSObject().apply {
|
||||
put("id", id)
|
||||
put("name", name)
|
||||
put("lang", language)
|
||||
put("disabled", false)
|
||||
}
|
||||
} ?: emptyList()
|
||||
|
||||
val result = JSObject().apply {
|
||||
put("voices", JSONArray(voices))
|
||||
}
|
||||
} ?: emptyList()
|
||||
|
||||
val result = JSObject().apply {
|
||||
put("voices", JSONArray(voices))
|
||||
invoke.resolve(result)
|
||||
} catch (e: Exception) {
|
||||
invoke.reject("Exception getting voices: ${e.message}")
|
||||
}
|
||||
invoke.resolve(result)
|
||||
} catch (e: Exception) {
|
||||
invoke.reject("Exception getting voices: ${e.message}")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -516,6 +551,7 @@ class NativeTTSPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
try {
|
||||
val intent = Intent(activity, MediaPlaybackService::class.java)
|
||||
if (active) {
|
||||
cancelIdleTimer()
|
||||
MediaPlaybackService.pluginEventTrigger = { event, data -> trigger(event, data) }
|
||||
MediaPlaybackService.currentTitle = FOREGROUND_SERVICE_TITLE
|
||||
MediaPlaybackService.currentArtist = FOREGROUND_SERVICE_TEXT
|
||||
@@ -530,13 +566,49 @@ class NativeTTSPlugin(private val activity: Activity) : Plugin(activity) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun startIdleTimer() {
|
||||
idleHandler.removeCallbacks(idleShutdownRunnable)
|
||||
idleHandler.postDelayed(idleShutdownRunnable, IDLE_TIMEOUT_MS)
|
||||
}
|
||||
|
||||
private fun cancelIdleTimer() {
|
||||
idleHandler.removeCallbacks(idleShutdownRunnable)
|
||||
}
|
||||
|
||||
private fun shutdownTTSEngine() {
|
||||
try {
|
||||
val intent = Intent(activity, MediaPlaybackService::class.java)
|
||||
activity.stopService(intent)
|
||||
MediaPlaybackService.pluginEventTrigger = null
|
||||
|
||||
textToSpeech?.shutdown()
|
||||
textToSpeech = null
|
||||
isInitialized.set(false)
|
||||
isSpeaking.set(false)
|
||||
isPaused.set(false)
|
||||
|
||||
speakingJobs.values.forEach { it.cancel() }
|
||||
eventChannels.values.forEach { it.close() }
|
||||
speakingJobs.clear()
|
||||
eventChannels.clear()
|
||||
|
||||
Log.d(TAG, "TTS engine shut down due to idle timeout")
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Error during idle TTS shutdown", e)
|
||||
}
|
||||
}
|
||||
|
||||
fun destroy() {
|
||||
try {
|
||||
cancelIdleTimer()
|
||||
|
||||
val intent = Intent(activity, MediaPlaybackService::class.java)
|
||||
activity.stopService(intent)
|
||||
|
||||
coroutineScope.cancel()
|
||||
textToSpeech?.shutdown()
|
||||
textToSpeech = null
|
||||
isInitialized.set(false)
|
||||
eventChannels.values.forEach { it.close() }
|
||||
eventChannels.clear()
|
||||
speakingJobs.values.forEach { it.cancel() }
|
||||
|
||||
Submodule apps/readest-app/src-tauri/plugins/tauri-plugin-turso updated: b18e78107a...21125f0769
@@ -0,0 +1,313 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import {
|
||||
createBookFilter,
|
||||
getBreadcrumbs,
|
||||
getBookSortValue,
|
||||
compareSortValues,
|
||||
createBookSorter,
|
||||
} from '@/app/library/utils/libraryUtils';
|
||||
import { Book } from '@/types/book';
|
||||
import { LibrarySortByType } from '@/types/settings';
|
||||
import { BookMetadata } from '@/libs/document';
|
||||
|
||||
/**
|
||||
* Tests for functions NOT covered by the existing library-utils.test.ts:
|
||||
* - createBookFilter
|
||||
* - getBreadcrumbs
|
||||
* - getBookSortValue
|
||||
* - compareSortValues
|
||||
* - createBookSorter (additional sort-by cases: Author, Format, Series, Published, default)
|
||||
*/
|
||||
|
||||
const createMockBook = (
|
||||
overrides: Partial<Omit<Book, 'metadata'> & { metadata?: Partial<BookMetadata> }> = {},
|
||||
): Book => ({
|
||||
hash: `hash-${Math.random().toString(36).substr(2, 9)}`,
|
||||
format: 'EPUB',
|
||||
title: 'Test Book',
|
||||
author: 'Test Author',
|
||||
createdAt: Date.now(),
|
||||
updatedAt: Date.now(),
|
||||
...overrides,
|
||||
metadata: { ...overrides.metadata } as BookMetadata,
|
||||
});
|
||||
|
||||
describe('createBookFilter', () => {
|
||||
it('should return true for all books when queryTerm is null', () => {
|
||||
const filter = createBookFilter(null);
|
||||
const book = createMockBook({ title: 'Anything' });
|
||||
expect(filter(book)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for all non-deleted books when queryTerm is empty string', () => {
|
||||
const filter = createBookFilter('');
|
||||
const book = createMockBook({ title: 'Anything' });
|
||||
expect(filter(book)).toBe(true);
|
||||
});
|
||||
|
||||
it('should match by title', () => {
|
||||
const filter = createBookFilter('Moby');
|
||||
const book = createMockBook({ title: 'Moby Dick' });
|
||||
expect(filter(book)).toBe(true);
|
||||
});
|
||||
|
||||
it('should match by author', () => {
|
||||
const filter = createBookFilter('Twain');
|
||||
const book = createMockBook({ title: 'Adventures', author: 'Mark Twain' });
|
||||
expect(filter(book)).toBe(true);
|
||||
});
|
||||
|
||||
it('should match by format', () => {
|
||||
const filter = createBookFilter('PDF');
|
||||
const book = createMockBook({ format: 'PDF', title: 'Some Book' });
|
||||
expect(filter(book)).toBe(true);
|
||||
});
|
||||
|
||||
it('should match by groupName', () => {
|
||||
const filter = createBookFilter('fiction');
|
||||
const book = createMockBook({ title: 'A Book', groupName: 'Science Fiction' });
|
||||
expect(filter(book)).toBe(true);
|
||||
});
|
||||
|
||||
it('should match by description in metadata', () => {
|
||||
const filter = createBookFilter('adventure');
|
||||
const book = createMockBook({
|
||||
title: 'A Book',
|
||||
metadata: { description: 'An adventure tale' },
|
||||
});
|
||||
expect(filter(book)).toBe(true);
|
||||
});
|
||||
|
||||
it('should be case-insensitive', () => {
|
||||
const filter = createBookFilter('moby');
|
||||
const book = createMockBook({ title: 'MOBY DICK' });
|
||||
expect(filter(book)).toBe(true);
|
||||
});
|
||||
|
||||
it('should not match non-matching books', () => {
|
||||
const filter = createBookFilter('nonexistent');
|
||||
const book = createMockBook({ title: 'Real Book', author: 'Real Author' });
|
||||
expect(filter(book)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return false for deleted books', () => {
|
||||
const filter = createBookFilter('test');
|
||||
const book = createMockBook({ title: 'test book', deletedAt: Date.now() });
|
||||
expect(filter(book)).toBe(false);
|
||||
});
|
||||
|
||||
it('should handle invalid regex gracefully by doing substring match', () => {
|
||||
// The string "[invalid" is an invalid regex pattern
|
||||
const filter = createBookFilter('[invalid');
|
||||
const book = createMockBook({ title: 'A book with [invalid text' });
|
||||
expect(filter(book)).toBe(true);
|
||||
});
|
||||
|
||||
it('should not match when invalid regex query does not match', () => {
|
||||
const filter = createBookFilter('[invalid');
|
||||
const book = createMockBook({ title: 'Normal Title', author: 'Normal Author' });
|
||||
expect(filter(book)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should support regex patterns', () => {
|
||||
const filter = createBookFilter('^Moby');
|
||||
const bookMatch = createMockBook({ title: 'Moby Dick' });
|
||||
const bookNoMatch = createMockBook({ title: 'The Moby Dick' });
|
||||
expect(filter(bookMatch)).toBeTruthy();
|
||||
expect(filter(bookNoMatch)).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('getBreadcrumbs', () => {
|
||||
it('should return empty array for empty string', () => {
|
||||
expect(getBreadcrumbs('')).toEqual([]);
|
||||
});
|
||||
|
||||
it('should return single breadcrumb for single segment', () => {
|
||||
const result = getBreadcrumbs('Library');
|
||||
expect(result).toEqual([{ name: 'Library', path: 'Library' }]);
|
||||
});
|
||||
|
||||
it('should return multiple breadcrumbs for path with separators', () => {
|
||||
const result = getBreadcrumbs('Library/Fiction/Scifi');
|
||||
expect(result).toEqual([
|
||||
{ name: 'Library', path: 'Library' },
|
||||
{ name: 'Fiction', path: 'Library/Fiction' },
|
||||
{ name: 'Scifi', path: 'Library/Fiction/Scifi' },
|
||||
]);
|
||||
});
|
||||
|
||||
it('should handle two segments', () => {
|
||||
const result = getBreadcrumbs('A/B');
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result[0]).toEqual({ name: 'A', path: 'A' });
|
||||
expect(result[1]).toEqual({ name: 'B', path: 'A/B' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('getBookSortValue', () => {
|
||||
it('should return formatted title for Title sort', () => {
|
||||
const book = createMockBook({ title: 'The Great Book' });
|
||||
const value = getBookSortValue(book, LibrarySortByType.Title);
|
||||
expect(typeof value).toBe('string');
|
||||
expect(value).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should return formatted author for Author sort', () => {
|
||||
const book = createMockBook({ author: 'Jane Austen' });
|
||||
const value = getBookSortValue(book, LibrarySortByType.Author);
|
||||
expect(typeof value).toBe('string');
|
||||
expect(value).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should return updatedAt for Updated sort', () => {
|
||||
const book = createMockBook({ updatedAt: 12345 });
|
||||
expect(getBookSortValue(book, LibrarySortByType.Updated)).toBe(12345);
|
||||
});
|
||||
|
||||
it('should return createdAt for Created sort', () => {
|
||||
const book = createMockBook({ createdAt: 67890 });
|
||||
expect(getBookSortValue(book, LibrarySortByType.Created)).toBe(67890);
|
||||
});
|
||||
|
||||
it('should return format string for Format sort', () => {
|
||||
const book = createMockBook({ format: 'PDF' });
|
||||
expect(getBookSortValue(book, LibrarySortByType.Format)).toBe('PDF');
|
||||
});
|
||||
|
||||
it('should return published date timestamp for Published sort', () => {
|
||||
const book = createMockBook({ metadata: { published: '2023-01-15' } });
|
||||
const value = getBookSortValue(book, LibrarySortByType.Published);
|
||||
expect(value).toBe(new Date('2023-01-15').getTime());
|
||||
});
|
||||
|
||||
it('should return 0 for Published sort when no published date', () => {
|
||||
const book = createMockBook({ metadata: {} });
|
||||
expect(getBookSortValue(book, LibrarySortByType.Published)).toBe(0);
|
||||
});
|
||||
|
||||
it('should return 0 for Published sort when date is invalid', () => {
|
||||
const book = createMockBook({ metadata: { published: 'not-a-date' } });
|
||||
expect(getBookSortValue(book, LibrarySortByType.Published)).toBe(0);
|
||||
});
|
||||
|
||||
it('should return updatedAt for unknown sort type', () => {
|
||||
const book = createMockBook({ updatedAt: 99999 });
|
||||
expect(getBookSortValue(book, 'unknown' as LibrarySortByType)).toBe(99999);
|
||||
});
|
||||
});
|
||||
|
||||
describe('compareSortValues', () => {
|
||||
it('should compare two strings using locale comparison', () => {
|
||||
const result = compareSortValues('Apple', 'Banana', 'en');
|
||||
expect(result).toBeLessThan(0);
|
||||
});
|
||||
|
||||
it('should compare two numbers', () => {
|
||||
expect(compareSortValues(10, 20, 'en')).toBeLessThan(0);
|
||||
expect(compareSortValues(20, 10, 'en')).toBeGreaterThan(0);
|
||||
expect(compareSortValues(10, 10, 'en')).toBe(0);
|
||||
});
|
||||
|
||||
it('should return 0 when types are mismatched', () => {
|
||||
expect(compareSortValues('hello', 42, 'en')).toBe(0);
|
||||
expect(compareSortValues(42, 'hello', 'en')).toBe(0);
|
||||
});
|
||||
|
||||
it('should handle equal strings', () => {
|
||||
expect(compareSortValues('same', 'same', 'en')).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('createBookSorter - additional cases', () => {
|
||||
it('should sort by author with last-name-first formatting', () => {
|
||||
const books = [
|
||||
createMockBook({ author: 'Jane Austen' }),
|
||||
createMockBook({ author: 'Charles Dickens' }),
|
||||
];
|
||||
const sorter = createBookSorter(LibrarySortByType.Author, 'en');
|
||||
const sorted = [...books].sort(sorter);
|
||||
// Austen < Dickens (by last name)
|
||||
expect(sorted[0]!.author).toBe('Jane Austen');
|
||||
expect(sorted[1]!.author).toBe('Charles Dickens');
|
||||
});
|
||||
|
||||
it('should sort by createdAt', () => {
|
||||
const books = [
|
||||
createMockBook({ title: 'Newer', createdAt: 2000 }),
|
||||
createMockBook({ title: 'Older', createdAt: 1000 }),
|
||||
];
|
||||
const sorter = createBookSorter(LibrarySortByType.Created, 'en');
|
||||
const sorted = [...books].sort(sorter);
|
||||
expect(sorted[0]!.title).toBe('Older');
|
||||
expect(sorted[1]!.title).toBe('Newer');
|
||||
});
|
||||
|
||||
it('should sort by format alphabetically', () => {
|
||||
const books = [createMockBook({ format: 'PDF' }), createMockBook({ format: 'EPUB' })];
|
||||
const sorter = createBookSorter(LibrarySortByType.Format, 'en');
|
||||
const sorted = [...books].sort(sorter);
|
||||
expect(sorted[0]!.format).toBe('EPUB');
|
||||
expect(sorted[1]!.format).toBe('PDF');
|
||||
});
|
||||
|
||||
it('should sort by seriesIndex', () => {
|
||||
const books = [
|
||||
createMockBook({ metadata: { seriesIndex: 3 } }),
|
||||
createMockBook({ metadata: { seriesIndex: 1 } }),
|
||||
createMockBook({ metadata: { seriesIndex: 2 } }),
|
||||
];
|
||||
const sorter = createBookSorter(LibrarySortByType.Series, 'en');
|
||||
const sorted = [...books].sort(sorter);
|
||||
expect(sorted[0]!.metadata?.seriesIndex).toBe(1);
|
||||
expect(sorted[1]!.metadata?.seriesIndex).toBe(2);
|
||||
expect(sorted[2]!.metadata?.seriesIndex).toBe(3);
|
||||
});
|
||||
|
||||
it('should sort by published date', () => {
|
||||
const books = [
|
||||
createMockBook({ metadata: { published: '2023-06-15' } }),
|
||||
createMockBook({ metadata: { published: '2020-01-01' } }),
|
||||
createMockBook({ metadata: { published: '2021-12-31' } }),
|
||||
];
|
||||
const sorter = createBookSorter(LibrarySortByType.Published, 'en');
|
||||
const sorted = [...books].sort(sorter);
|
||||
expect(sorted[0]!.metadata?.published).toBe('2020-01-01');
|
||||
expect(sorted[1]!.metadata?.published).toBe('2021-12-31');
|
||||
expect(sorted[2]!.metadata?.published).toBe('2023-06-15');
|
||||
});
|
||||
|
||||
it('should handle missing published dates in sort (books without date use fallback 0001-01-01)', () => {
|
||||
const books = [
|
||||
createMockBook({ metadata: {} }),
|
||||
createMockBook({ metadata: { published: '2020-01-01' } }),
|
||||
];
|
||||
const sorter = createBookSorter(LibrarySortByType.Published, 'en');
|
||||
const sorted = [...books].sort(sorter);
|
||||
// Book without published date defaults to '0001-01-01', which is earlier
|
||||
expect(sorted[0]!.metadata?.published).toBeUndefined();
|
||||
expect(sorted[1]!.metadata?.published).toBe('2020-01-01');
|
||||
});
|
||||
|
||||
it('should handle invalid published dates', () => {
|
||||
const books = [
|
||||
createMockBook({ metadata: { published: 'not-a-date' } }),
|
||||
createMockBook({ metadata: { published: '2020-01-01' } }),
|
||||
];
|
||||
const sorter = createBookSorter(LibrarySortByType.Published, 'en');
|
||||
const sorted = [...books].sort(sorter);
|
||||
// Invalid date treated like missing, should sort after valid dates
|
||||
expect(sorted[0]!.metadata?.published).toBe('2020-01-01');
|
||||
});
|
||||
|
||||
it('should use updatedAt as default sort for unknown sort type', () => {
|
||||
const books = [
|
||||
createMockBook({ title: 'Newer', updatedAt: 2000 }),
|
||||
createMockBook({ title: 'Older', updatedAt: 1000 }),
|
||||
];
|
||||
const sorter = createBookSorter('unknown', 'en');
|
||||
const sorted = [...books].sort(sorter);
|
||||
expect(sorted[0]!.title).toBe('Older');
|
||||
expect(sorted[1]!.title).toBe('Newer');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,575 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
|
||||
// Mock dependencies before importing the module under test
|
||||
vi.mock('foliate-js/opds.js', () => ({
|
||||
isOPDSCatalog: vi.fn((type: string) => {
|
||||
return (
|
||||
type.includes('application/atom+xml') &&
|
||||
(type.includes('opds-catalog') || type.includes('opds'))
|
||||
);
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/libs/document', () => ({
|
||||
EXTS: {
|
||||
EPUB: 'epub',
|
||||
PDF: 'pdf',
|
||||
MOBI: 'mobi',
|
||||
AZW: 'azw',
|
||||
AZW3: 'azw3',
|
||||
CBZ: 'cbz',
|
||||
FB2: 'fb2',
|
||||
FBZ: 'fbz',
|
||||
TXT: 'txt',
|
||||
MD: 'md',
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('@/services/environment', () => ({
|
||||
isWebAppPlatform: vi.fn(() => true),
|
||||
isTauriAppPlatform: vi.fn(() => false),
|
||||
getAPIBaseUrl: () => '/api',
|
||||
getNodeAPIBaseUrl: () => '/node-api',
|
||||
getBaseUrl: () => 'https://web.readest.com',
|
||||
getNodeBaseUrl: () => 'https://node.readest.com',
|
||||
isWebDevMode: () => true,
|
||||
}));
|
||||
|
||||
vi.mock('@tauri-apps/plugin-http', () => ({
|
||||
fetch: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/opds/utils/opdsReq', () => ({
|
||||
fetchWithAuth: vi.fn(),
|
||||
}));
|
||||
|
||||
import {
|
||||
groupByArray,
|
||||
parseMediaType,
|
||||
isSearchLink,
|
||||
resolveURL,
|
||||
getFileExtFromPath,
|
||||
MIME,
|
||||
validateOPDSURL,
|
||||
} from '@/app/opds/utils/opdsUtils';
|
||||
import type { OPDSLink } from '@/types/opds';
|
||||
import { fetchWithAuth } from '@/app/opds/utils/opdsReq';
|
||||
|
||||
const mockFetchWithAuth = vi.mocked(fetchWithAuth);
|
||||
|
||||
describe('opdsUtils', () => {
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('groupByArray', () => {
|
||||
it('should group items by a single key', () => {
|
||||
const items = [
|
||||
{ name: 'Alice', role: 'admin' },
|
||||
{ name: 'Bob', role: 'user' },
|
||||
{ name: 'Charlie', role: 'admin' },
|
||||
];
|
||||
const grouped = groupByArray(items, (item) => item.role);
|
||||
|
||||
expect(grouped.get('admin')).toHaveLength(2);
|
||||
expect(grouped.get('user')).toHaveLength(1);
|
||||
expect(grouped.get('admin')![0]!.name).toBe('Alice');
|
||||
expect(grouped.get('admin')![1]!.name).toBe('Charlie');
|
||||
});
|
||||
|
||||
it('should group items by multiple keys (array return)', () => {
|
||||
const items = [
|
||||
{ name: 'Alice', tags: ['a', 'b'] },
|
||||
{ name: 'Bob', tags: ['b', 'c'] },
|
||||
];
|
||||
const grouped = groupByArray(items, (item) => item.tags);
|
||||
|
||||
expect(grouped.get('a')).toHaveLength(1);
|
||||
expect(grouped.get('b')).toHaveLength(2);
|
||||
expect(grouped.get('c')).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('should return an empty map for undefined input', () => {
|
||||
const grouped = groupByArray(undefined, (item: string) => item);
|
||||
expect(grouped.size).toBe(0);
|
||||
});
|
||||
|
||||
it('should return an empty map for empty array', () => {
|
||||
const grouped = groupByArray([], (item: string) => item);
|
||||
expect(grouped.size).toBe(0);
|
||||
});
|
||||
|
||||
it('should handle single-element arrays', () => {
|
||||
const items = [{ id: 1 }];
|
||||
const grouped = groupByArray(items, (item) => item.id);
|
||||
expect(grouped.get(1)).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('MIME constants', () => {
|
||||
it('should have correct XML MIME type', () => {
|
||||
expect(MIME.XML).toBe('application/xml');
|
||||
});
|
||||
|
||||
it('should have correct ATOM MIME type', () => {
|
||||
expect(MIME.ATOM).toBe('application/atom+xml');
|
||||
});
|
||||
|
||||
it('should have correct XHTML MIME type', () => {
|
||||
expect(MIME.XHTML).toBe('application/xhtml+xml');
|
||||
});
|
||||
|
||||
it('should have correct HTML MIME type', () => {
|
||||
expect(MIME.HTML).toBe('text/html');
|
||||
});
|
||||
|
||||
it('should have correct EPUB MIME type', () => {
|
||||
expect(MIME.EPUB).toBe('application/epub+zip');
|
||||
});
|
||||
|
||||
it('should have correct PDF MIME type', () => {
|
||||
expect(MIME.PDF).toBe('application/pdf');
|
||||
});
|
||||
|
||||
it('should have correct OPENSEARCH MIME type', () => {
|
||||
expect(MIME.OPENSEARCH).toBe('application/opensearchdescription+xml');
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseMediaType', () => {
|
||||
it('should parse a simple media type', () => {
|
||||
const result = parseMediaType('application/atom+xml');
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.mediaType).toBe('application/atom+xml');
|
||||
expect(Object.keys(result!.parameters)).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('should parse media type with parameters', () => {
|
||||
const result = parseMediaType('application/atom+xml; charset=utf-8');
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.mediaType).toBe('application/atom+xml');
|
||||
expect(result!.parameters['charset']).toBe('utf-8');
|
||||
});
|
||||
|
||||
it('should parse media type with multiple parameters', () => {
|
||||
const result = parseMediaType('text/html; charset=utf-8; boundary=something');
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.mediaType).toBe('text/html');
|
||||
expect(result!.parameters['charset']).toBe('utf-8');
|
||||
expect(result!.parameters['boundary']).toBe('something');
|
||||
});
|
||||
|
||||
it('should parse media type with quoted parameter values', () => {
|
||||
const result = parseMediaType('application/atom+xml; profile="opds-catalog"');
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.parameters['profile']).toBe('opds-catalog');
|
||||
});
|
||||
|
||||
it('should lowercase the media type', () => {
|
||||
const result = parseMediaType('Application/Atom+XML');
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.mediaType).toBe('application/atom+xml');
|
||||
});
|
||||
|
||||
it('should lowercase parameter names', () => {
|
||||
const result = parseMediaType('text/html; Charset=utf-8');
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.parameters['charset']).toBe('utf-8');
|
||||
});
|
||||
|
||||
it('should return null for empty string', () => {
|
||||
expect(parseMediaType('')).toBeNull();
|
||||
});
|
||||
|
||||
it('should return null for undefined input', () => {
|
||||
expect(parseMediaType(undefined)).toBeNull();
|
||||
});
|
||||
|
||||
it('should handle extra spaces around semicolons', () => {
|
||||
const result = parseMediaType('text/html ; charset=utf-8');
|
||||
expect(result).not.toBeNull();
|
||||
expect(result!.mediaType).toBe('text/html');
|
||||
expect(result!.parameters['charset']).toBe('utf-8');
|
||||
});
|
||||
});
|
||||
|
||||
describe('isSearchLink', () => {
|
||||
it('should return true for a search link with OPENSEARCH type', () => {
|
||||
const link: OPDSLink = {
|
||||
rel: 'search',
|
||||
href: '/search',
|
||||
type: MIME.OPENSEARCH,
|
||||
properties: {},
|
||||
};
|
||||
expect(isSearchLink(link)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for a search link with ATOM type', () => {
|
||||
const link: OPDSLink = {
|
||||
rel: 'search',
|
||||
href: '/search',
|
||||
type: MIME.ATOM,
|
||||
properties: {},
|
||||
};
|
||||
expect(isSearchLink(link)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true when rel is an array containing "search"', () => {
|
||||
const link: OPDSLink = {
|
||||
rel: ['self', 'search'],
|
||||
href: '/search',
|
||||
type: MIME.OPENSEARCH,
|
||||
properties: {},
|
||||
};
|
||||
expect(isSearchLink(link)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false when rel does not include "search"', () => {
|
||||
const link: OPDSLink = {
|
||||
rel: 'self',
|
||||
href: '/search',
|
||||
type: MIME.OPENSEARCH,
|
||||
properties: {},
|
||||
};
|
||||
expect(isSearchLink(link)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false when type is not OPENSEARCH or ATOM', () => {
|
||||
const link: OPDSLink = {
|
||||
rel: 'search',
|
||||
href: '/search',
|
||||
type: 'text/html',
|
||||
properties: {},
|
||||
};
|
||||
expect(isSearchLink(link)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false when rel is undefined', () => {
|
||||
const link: OPDSLink = {
|
||||
href: '/search',
|
||||
type: MIME.OPENSEARCH,
|
||||
properties: {},
|
||||
};
|
||||
expect(isSearchLink(link)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false when rel is an empty array', () => {
|
||||
const link: OPDSLink = {
|
||||
rel: [],
|
||||
href: '/search',
|
||||
type: MIME.ATOM,
|
||||
properties: {},
|
||||
};
|
||||
expect(isSearchLink(link)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveURL', () => {
|
||||
it('should resolve an absolute URL relative to a base URL', () => {
|
||||
const result = resolveURL('/feed/new', 'https://example.com/opds');
|
||||
expect(result).toBe('https://example.com/feed/new');
|
||||
});
|
||||
|
||||
it('should resolve a relative URL relative to a base URL', () => {
|
||||
const result = resolveURL('new', 'https://example.com/opds/feed');
|
||||
expect(result).toBe('https://example.com/opds/new');
|
||||
});
|
||||
|
||||
it('should return empty string for empty url', () => {
|
||||
expect(resolveURL('', 'https://example.com')).toBe('');
|
||||
});
|
||||
|
||||
it('should resolve through proxy URL', () => {
|
||||
const proxyBase = '/api/opds/proxy?url=https%3A%2F%2Fexample.com%2Fopds';
|
||||
const result = resolveURL('/feed/new', proxyBase);
|
||||
expect(result).toBe('https://example.com/feed/new');
|
||||
});
|
||||
|
||||
it('should handle non-scheme relativeTo (path-only)', () => {
|
||||
const result = resolveURL('subdir/file.xml', '/opds/catalog/');
|
||||
// Should use the invalid.invalid root and strip it
|
||||
expect(result).toContain('subdir/file.xml');
|
||||
expect(result).not.toContain('invalid.invalid');
|
||||
});
|
||||
|
||||
it('should return the URL itself when resolution fails', () => {
|
||||
// Suppress console.warn for this test
|
||||
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
const result = resolveURL('://broken', '://also-broken');
|
||||
// Should fall through to the catch and return url
|
||||
expect(result).toBe('://broken');
|
||||
warnSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('should handle full absolute URLs as the url parameter', () => {
|
||||
const result = resolveURL('https://other.com/feed', 'https://example.com/opds');
|
||||
expect(result).toBe('https://other.com/feed');
|
||||
});
|
||||
|
||||
it('should strip query parameters for non-scheme relativeTo', () => {
|
||||
const result = resolveURL('feed.xml?page=2', '/opds/catalog/');
|
||||
// The function strips search params for non-scheme relativeTo
|
||||
expect(result).not.toContain('page=2');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getFileExtFromPath', () => {
|
||||
it('should find epub extension in path', () => {
|
||||
expect(getFileExtFromPath('/books/epub/my-book')).toBe('epub');
|
||||
});
|
||||
|
||||
it('should find pdf extension in path', () => {
|
||||
expect(getFileExtFromPath('/books/pdf/my-doc')).toBe('pdf');
|
||||
});
|
||||
|
||||
it('should find mobi extension in path', () => {
|
||||
expect(getFileExtFromPath('/books/mobi/my-book')).toBe('mobi');
|
||||
});
|
||||
|
||||
it('should find cbz extension in path', () => {
|
||||
expect(getFileExtFromPath('/comics/cbz/issue1')).toBe('cbz');
|
||||
});
|
||||
|
||||
it('should find fb2 extension in path', () => {
|
||||
expect(getFileExtFromPath('/books/fb2/russian-novel')).toBe('fb2');
|
||||
});
|
||||
|
||||
it('should find txt extension in path', () => {
|
||||
expect(getFileExtFromPath('/texts/txt/readme')).toBe('txt');
|
||||
});
|
||||
|
||||
it('should find md extension in path', () => {
|
||||
expect(getFileExtFromPath('/notes/md/guide')).toBe('md');
|
||||
});
|
||||
|
||||
it('should return empty string when no extension found', () => {
|
||||
expect(getFileExtFromPath('/books/unknown/my-book')).toBe('');
|
||||
});
|
||||
|
||||
it('should return empty string for empty path', () => {
|
||||
expect(getFileExtFromPath('')).toBe('');
|
||||
});
|
||||
|
||||
it('should use custom delimiter', () => {
|
||||
expect(getFileExtFromPath('books.epub.my-book', '.')).toBe('epub');
|
||||
});
|
||||
|
||||
it('should return the first matching extension', () => {
|
||||
// If both epub and pdf appear, returns whichever EXTS entry matches first
|
||||
const result = getFileExtFromPath('/books/epub/pdf/file');
|
||||
expect(['epub', 'pdf']).toContain(result);
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateOPDSURL', () => {
|
||||
beforeEach(() => {
|
||||
mockFetchWithAuth.mockReset();
|
||||
// Suppress expected error noise from validation failure tests.
|
||||
vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
it('should return valid feed for XML OPDS feed', async () => {
|
||||
const xmlFeed = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>Test Feed</title>
|
||||
</feed>`;
|
||||
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: true,
|
||||
url: 'https://example.com/opds',
|
||||
text: () => Promise.resolve(xmlFeed),
|
||||
headers: new Headers({ 'Content-Type': 'application/atom+xml' }),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/opds');
|
||||
expect(result.isValid).toBe(true);
|
||||
expect(result.data?.type).toBe('feed');
|
||||
expect(result.data?.responseURL).toBe('https://example.com/opds');
|
||||
});
|
||||
|
||||
it('should return valid entry for XML entry document', async () => {
|
||||
const xmlEntry = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entry xmlns="http://www.w3.org/2005/Atom">
|
||||
<title>Single Book</title>
|
||||
</entry>`;
|
||||
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: true,
|
||||
url: 'https://example.com/opds/entry',
|
||||
text: () => Promise.resolve(xmlEntry),
|
||||
headers: new Headers(),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/opds/entry');
|
||||
expect(result.isValid).toBe(true);
|
||||
expect(result.data?.type).toBe('entry');
|
||||
});
|
||||
|
||||
it('should return valid opensearch for OpenSearchDescription', async () => {
|
||||
const xmlOSD = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<ShortName>Search</ShortName>
|
||||
</OpenSearchDescription>`;
|
||||
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: true,
|
||||
url: 'https://example.com/search',
|
||||
text: () => Promise.resolve(xmlOSD),
|
||||
headers: new Headers(),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/search');
|
||||
expect(result.isValid).toBe(true);
|
||||
expect(result.data?.type).toBe('opensearch');
|
||||
});
|
||||
|
||||
it('should return authentication error for 401 status', async () => {
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: false,
|
||||
status: 401,
|
||||
statusText: 'Unauthorized',
|
||||
url: 'https://example.com/opds',
|
||||
text: () => Promise.resolve(''),
|
||||
headers: new Headers(),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/opds');
|
||||
expect(result.isValid).toBe(false);
|
||||
expect(result.error).toContain('Authentication required');
|
||||
});
|
||||
|
||||
it('should return error for non-OK HTTP response', async () => {
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: false,
|
||||
status: 500,
|
||||
statusText: 'Internal Server Error',
|
||||
url: 'https://example.com/opds',
|
||||
text: () => Promise.resolve(''),
|
||||
headers: new Headers(),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/opds');
|
||||
expect(result.isValid).toBe(false);
|
||||
expect(result.error).toContain('500');
|
||||
});
|
||||
|
||||
it('should return valid feed for JSON-based OPDS', async () => {
|
||||
const jsonFeed = JSON.stringify({
|
||||
metadata: { title: 'Test Feed' },
|
||||
links: [],
|
||||
publications: [],
|
||||
});
|
||||
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: true,
|
||||
url: 'https://example.com/opds.json',
|
||||
text: () => Promise.resolve(jsonFeed),
|
||||
headers: new Headers(),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/opds.json');
|
||||
expect(result.isValid).toBe(true);
|
||||
expect(result.data?.type).toBe('feed');
|
||||
});
|
||||
|
||||
it('should return invalid for JSON without OPDS fields', async () => {
|
||||
const jsonData = JSON.stringify({ foo: 'bar' });
|
||||
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: true,
|
||||
url: 'https://example.com/data.json',
|
||||
text: () => Promise.resolve(jsonData),
|
||||
headers: new Headers(),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/data.json');
|
||||
expect(result.isValid).toBe(false);
|
||||
});
|
||||
|
||||
it('should return invalid for non-XML, non-JSON content', async () => {
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: true,
|
||||
url: 'https://example.com/page',
|
||||
text: () => Promise.resolve('Just some plain text'),
|
||||
headers: new Headers(),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/page');
|
||||
expect(result.isValid).toBe(false);
|
||||
});
|
||||
|
||||
it('should handle fetch errors gracefully', async () => {
|
||||
mockFetchWithAuth.mockRejectedValue(new Error('Network error'));
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/opds');
|
||||
expect(result.isValid).toBe(false);
|
||||
expect(result.error).toBe('Network error');
|
||||
});
|
||||
|
||||
it('should handle non-Error exceptions', async () => {
|
||||
mockFetchWithAuth.mockRejectedValue('string error');
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/opds');
|
||||
expect(result.isValid).toBe(false);
|
||||
});
|
||||
|
||||
it('should return valid for JSON feed with only navigation', async () => {
|
||||
const jsonFeed = JSON.stringify({
|
||||
navigation: [{ title: 'New', href: '/new' }],
|
||||
});
|
||||
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: true,
|
||||
url: 'https://example.com/opds.json',
|
||||
text: () => Promise.resolve(jsonFeed),
|
||||
headers: new Headers(),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/opds.json');
|
||||
expect(result.isValid).toBe(true);
|
||||
});
|
||||
|
||||
it('should return invalid for XML that is not a recognized OPDS document type', async () => {
|
||||
const xmlDoc = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<catalog>
|
||||
<book>Test</book>
|
||||
</catalog>`;
|
||||
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: true,
|
||||
url: 'https://example.com/catalog',
|
||||
text: () => Promise.resolve(xmlDoc),
|
||||
headers: new Headers({ 'Content-Type': 'application/xml' }),
|
||||
} as Response);
|
||||
|
||||
const result = await validateOPDSURL('https://example.com/catalog');
|
||||
expect(result.isValid).toBe(false);
|
||||
});
|
||||
|
||||
it('should pass auth and custom headers to fetchWithAuth', async () => {
|
||||
const xmlFeed = `<feed xmlns="http://www.w3.org/2005/Atom"><title>Auth Feed</title></feed>`;
|
||||
const customHeaders = {
|
||||
'CF-Access-Client-Id': 'client-id',
|
||||
'CF-Access-Client-Secret': 'client-secret',
|
||||
};
|
||||
|
||||
mockFetchWithAuth.mockResolvedValue({
|
||||
ok: true,
|
||||
url: 'https://example.com/opds',
|
||||
text: () => Promise.resolve(xmlFeed),
|
||||
headers: new Headers(),
|
||||
} as Response);
|
||||
|
||||
await validateOPDSURL('https://example.com/opds', 'user', 'pass', true, customHeaders);
|
||||
|
||||
expect(mockFetchWithAuth).toHaveBeenCalledWith(
|
||||
'https://example.com/opds',
|
||||
'user',
|
||||
'pass',
|
||||
true,
|
||||
expect.objectContaining({ signal: expect.anything() }),
|
||||
customHeaders,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,305 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { getPlanDetails } from '@/app/user/utils/plan';
|
||||
import { AvailablePlan, UserPlan, PlanInterval, QuotaFeature } from '@/types/quota';
|
||||
import { StripeProductMetadata } from '@/types/payment';
|
||||
|
||||
// getPlanDetails expects (AvailablePlan & StripeAvailablePlan)[].
|
||||
// StripeAvailablePlan = AvailablePlan & { metadata?: StripeProductMetadata; product?: Stripe.Product }
|
||||
// We build the exact shape needed to satisfy the type.
|
||||
|
||||
type TestPlan = AvailablePlan & {
|
||||
metadata?: StripeProductMetadata;
|
||||
};
|
||||
|
||||
function makePlan(overrides: Partial<TestPlan> = {}): TestPlan {
|
||||
return {
|
||||
plan: 'free' as UserPlan,
|
||||
productId: 'prod_test',
|
||||
price: 0,
|
||||
currency: 'USD',
|
||||
interval: 'month' as PlanInterval,
|
||||
productName: 'Test Plan',
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
describe('getPlanDetails', () => {
|
||||
describe('free plan', () => {
|
||||
it('should return free plan details with no available plans', () => {
|
||||
const result = getPlanDetails('free', []);
|
||||
expect(result.name).toBe('Free Plan');
|
||||
expect(result.plan).toBe('free');
|
||||
expect(result.type).toBe('subscription');
|
||||
expect(result.price).toBe(0);
|
||||
expect(result.currency).toBe('USD');
|
||||
});
|
||||
|
||||
it('should use currency from available plans', () => {
|
||||
const plans = [makePlan({ plan: 'free', currency: 'EUR' })];
|
||||
const result = getPlanDetails('free', plans);
|
||||
expect(result.currency).toBe('EUR');
|
||||
});
|
||||
|
||||
it('should include features array', () => {
|
||||
const result = getPlanDetails('free', []);
|
||||
expect(result.features.length).toBeGreaterThan(0);
|
||||
const labels = result.features.map((f) => f.label);
|
||||
expect(labels).toContain('Cross-Platform Sync');
|
||||
expect(labels).toContain('AI Read Aloud');
|
||||
});
|
||||
|
||||
it('should include limits', () => {
|
||||
const result = getPlanDetails('free', []);
|
||||
expect(result.limits).toBeDefined();
|
||||
expect(Object.keys(result.limits!).length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('should use month interval label by default', () => {
|
||||
const result = getPlanDetails('free', []);
|
||||
expect(result.interval).toBe('month');
|
||||
});
|
||||
|
||||
it('should use year interval label when specified', () => {
|
||||
const result = getPlanDetails('free', [], 'year');
|
||||
expect(result.interval).toBe('year');
|
||||
});
|
||||
|
||||
it('should set productId from matching available plan', () => {
|
||||
const plans = [makePlan({ plan: 'free', productId: 'prod_free_123' })];
|
||||
const result = getPlanDetails('free', plans);
|
||||
expect(result.productId).toBe('prod_free_123');
|
||||
});
|
||||
});
|
||||
|
||||
describe('plus plan', () => {
|
||||
it('should return plus plan details', () => {
|
||||
const plans = [makePlan({ plan: 'plus', price: 499 })];
|
||||
const result = getPlanDetails('plus', plans);
|
||||
expect(result.name).toBe('Plus Plan');
|
||||
expect(result.plan).toBe('plus');
|
||||
expect(result.type).toBe('subscription');
|
||||
expect(result.price).toBe(499);
|
||||
});
|
||||
|
||||
it('should use default price when no matching plan found', () => {
|
||||
const result = getPlanDetails('plus', []);
|
||||
expect(result.price).toBe(499);
|
||||
});
|
||||
|
||||
it('should include expected features', () => {
|
||||
const result = getPlanDetails('plus', []);
|
||||
const labels = result.features.map((f) => f.label);
|
||||
expect(labels).toContain('Includes All Free Plan Benefits');
|
||||
expect(labels).toContain('Unlimited AI Read Aloud Hours');
|
||||
expect(labels).toContain('Priority Support');
|
||||
});
|
||||
|
||||
it('should include limits with storage and translation', () => {
|
||||
const result = getPlanDetails('plus', []);
|
||||
expect(result.limits).toBeDefined();
|
||||
const limitKeys = Object.keys(result.limits!);
|
||||
expect(limitKeys.some((k) => k.includes('Storage'))).toBe(true);
|
||||
expect(limitKeys.some((k) => k.includes('Translation'))).toBe(true);
|
||||
});
|
||||
|
||||
it('should match correct plan by interval', () => {
|
||||
const plans = [
|
||||
makePlan({ plan: 'plus', price: 499, interval: 'month' }),
|
||||
makePlan({ plan: 'plus', price: 3999, interval: 'year' }),
|
||||
];
|
||||
const monthResult = getPlanDetails('plus', plans, 'month');
|
||||
expect(monthResult.price).toBe(499);
|
||||
|
||||
const yearResult = getPlanDetails('plus', plans, 'year');
|
||||
expect(yearResult.price).toBe(3999);
|
||||
});
|
||||
});
|
||||
|
||||
describe('pro plan', () => {
|
||||
it('should return pro plan details', () => {
|
||||
const plans = [makePlan({ plan: 'pro', price: 999 })];
|
||||
const result = getPlanDetails('pro', plans);
|
||||
expect(result.name).toBe('Pro Plan');
|
||||
expect(result.plan).toBe('pro');
|
||||
expect(result.type).toBe('subscription');
|
||||
expect(result.price).toBe(999);
|
||||
});
|
||||
|
||||
it('should use default price when no matching plan found', () => {
|
||||
const result = getPlanDetails('pro', []);
|
||||
expect(result.price).toBe(999);
|
||||
});
|
||||
|
||||
it('should include expected features', () => {
|
||||
const result = getPlanDetails('pro', []);
|
||||
const labels = result.features.map((f) => f.label);
|
||||
expect(labels).toContain('Includes All Plus Plan Benefits');
|
||||
expect(labels).toContain('Early Feature Access');
|
||||
expect(labels).toContain('Advanced AI Tools');
|
||||
});
|
||||
|
||||
it('should have higher storage limit than plus', () => {
|
||||
const proResult = getPlanDetails('pro', []);
|
||||
const plusResult = getPlanDetails('plus', []);
|
||||
|
||||
// Both should have limits
|
||||
expect(proResult.limits).toBeDefined();
|
||||
expect(plusResult.limits).toBeDefined();
|
||||
|
||||
// Find storage limit values
|
||||
const proStorageKey = Object.keys(proResult.limits!).find((k) => k.includes('Storage'));
|
||||
const plusStorageKey = Object.keys(plusResult.limits!).find((k) => k.includes('Storage'));
|
||||
expect(proStorageKey).toBeDefined();
|
||||
expect(plusStorageKey).toBeDefined();
|
||||
|
||||
// Pro should have 20 GB, Plus should have 5 GB
|
||||
expect(proResult.limits![proStorageKey!]).toBe('20 GB');
|
||||
expect(plusResult.limits![plusStorageKey!]).toBe('5 GB');
|
||||
});
|
||||
});
|
||||
|
||||
describe('purchase plan', () => {
|
||||
it('should return purchase plan details', () => {
|
||||
const plans = [makePlan({ plan: 'purchase', price: 1999 })];
|
||||
const result = getPlanDetails('purchase', plans);
|
||||
expect(result.name).toBe('Lifetime Plan');
|
||||
expect(result.plan).toBe('purchase');
|
||||
expect(result.type).toBe('purchase');
|
||||
expect(result.interval).toBe('lifetime');
|
||||
});
|
||||
|
||||
it('should use default price when no matching plan found', () => {
|
||||
const result = getPlanDetails('purchase', []);
|
||||
expect(result.price).toBe(1999);
|
||||
});
|
||||
|
||||
it('should include products sorted by price', () => {
|
||||
const plans = [
|
||||
makePlan({
|
||||
plan: 'purchase',
|
||||
productId: 'prod_expensive',
|
||||
price: 5000,
|
||||
productName: 'Expensive',
|
||||
}),
|
||||
makePlan({ plan: 'purchase', productId: 'prod_cheap', price: 1000, productName: 'Cheap' }),
|
||||
makePlan({ plan: 'purchase', productId: 'prod_mid', price: 3000, productName: 'Mid' }),
|
||||
];
|
||||
const result = getPlanDetails('purchase', plans);
|
||||
expect(result.products).toBeDefined();
|
||||
expect(result.products).toHaveLength(3);
|
||||
expect(result.products![0]!.price).toBe(1000);
|
||||
expect(result.products![1]!.price).toBe(3000);
|
||||
expect(result.products![2]!.price).toBe(5000);
|
||||
});
|
||||
|
||||
it('should derive feature from productId when metadata.feature is missing', () => {
|
||||
const plans = [
|
||||
makePlan({
|
||||
plan: 'purchase',
|
||||
productId: 'prod_storage_100gb',
|
||||
price: 1000,
|
||||
productName: 'Storage',
|
||||
}),
|
||||
makePlan({
|
||||
plan: 'purchase',
|
||||
productId: 'prod_translation_pack',
|
||||
price: 500,
|
||||
productName: 'Translation',
|
||||
}),
|
||||
makePlan({
|
||||
plan: 'purchase',
|
||||
productId: 'prod_tokens_bundle',
|
||||
price: 2000,
|
||||
productName: 'Tokens',
|
||||
}),
|
||||
makePlan({
|
||||
plan: 'purchase',
|
||||
productId: 'prod_customization_pro',
|
||||
price: 1500,
|
||||
productName: 'Custom',
|
||||
}),
|
||||
];
|
||||
const result = getPlanDetails('purchase', plans);
|
||||
expect(result.products![0]!.feature).toBe('translation');
|
||||
expect(result.products![1]!.feature).toBe('storage');
|
||||
expect(result.products![2]!.feature).toBe('customization');
|
||||
expect(result.products![3]!.feature).toBe('tokens');
|
||||
});
|
||||
|
||||
it('should use metadata.feature when present', () => {
|
||||
const plans = [
|
||||
makePlan({
|
||||
plan: 'purchase',
|
||||
productId: 'prod_xyz',
|
||||
price: 1000,
|
||||
productName: 'XYZ',
|
||||
metadata: { plan: 'purchase', feature: 'storage' as QuotaFeature },
|
||||
}),
|
||||
];
|
||||
const result = getPlanDetails('purchase', plans);
|
||||
expect(result.products![0]!.feature).toBe('storage');
|
||||
});
|
||||
|
||||
it('should fall back to generic when productId does not match any feature', () => {
|
||||
const plans = [
|
||||
makePlan({
|
||||
plan: 'purchase',
|
||||
productId: 'prod_unknown_thing',
|
||||
price: 1000,
|
||||
productName: 'Unknown',
|
||||
}),
|
||||
];
|
||||
const result = getPlanDetails('purchase', plans);
|
||||
expect(result.products![0]!.feature).toBe('generic');
|
||||
});
|
||||
|
||||
it('should include expected features', () => {
|
||||
const result = getPlanDetails('purchase', []);
|
||||
const labels = result.features.map((f) => f.label);
|
||||
expect(labels).toContain('One-Time Payment');
|
||||
expect(labels).toContain('Expand Cloud Sync Storage');
|
||||
});
|
||||
});
|
||||
|
||||
describe('default / unknown plan', () => {
|
||||
it('should fall back to free plan for unknown plan code', () => {
|
||||
const result = getPlanDetails('unknown_plan' as UserPlan, []);
|
||||
expect(result.plan).toBe('free');
|
||||
expect(result.name).toBe('Free Plan');
|
||||
});
|
||||
});
|
||||
|
||||
describe('plan color and hintColor', () => {
|
||||
it('should assign distinct colors per plan', () => {
|
||||
const colors: Record<string, string> = {};
|
||||
const planCodes: UserPlan[] = ['free', 'plus', 'pro', 'purchase'];
|
||||
for (const code of planCodes) {
|
||||
const details = getPlanDetails(code, []);
|
||||
colors[code] = details.color;
|
||||
}
|
||||
// Each plan should have a unique color
|
||||
const uniqueColors = new Set(Object.values(colors));
|
||||
expect(uniqueColors.size).toBe(4);
|
||||
});
|
||||
|
||||
it('should provide hintColor for all plans', () => {
|
||||
const planCodes: UserPlan[] = ['free', 'plus', 'pro', 'purchase'];
|
||||
for (const code of planCodes) {
|
||||
const details = getPlanDetails(code, []);
|
||||
expect(details.hintColor).toBeTruthy();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('plan without interval match', () => {
|
||||
it('should handle plan with no interval specified', () => {
|
||||
// A plan with no interval should match any interval request
|
||||
const plans = [
|
||||
makePlan({ plan: 'purchase', price: 1999, interval: undefined as unknown as PlanInterval }),
|
||||
];
|
||||
// When interval is not set on available plan, it should still be found
|
||||
const result = getPlanDetails('purchase', plans);
|
||||
expect(result.price).toBe(1999);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,94 @@
|
||||
import { describe, it, expect, vi, afterEach } from 'vitest';
|
||||
import { render, screen, cleanup, fireEvent } from '@testing-library/react';
|
||||
|
||||
import Dropdown from '@/components/Dropdown';
|
||||
import { DropdownProvider } from '@/context/DropdownContext';
|
||||
|
||||
vi.mock('@/hooks/useTranslation', () => ({
|
||||
useTranslation: () => (s: string) => s,
|
||||
}));
|
||||
|
||||
afterEach(() => cleanup());
|
||||
|
||||
// Simulates the browser behavior where pressing Enter/Space on a focused
|
||||
// <button> fires both a keydown event and a click event. JSDOM does not
|
||||
// dispatch the click automatically, so we do it here.
|
||||
const pressActivationKey = (el: HTMLElement, key: 'Enter' | ' ') => {
|
||||
fireEvent.keyDown(el, { key });
|
||||
fireEvent.click(el);
|
||||
};
|
||||
|
||||
const renderDropdown = () =>
|
||||
render(
|
||||
<DropdownProvider>
|
||||
<Dropdown label='Test Menu' toggleButton={<span>Toggle</span>} showTooltip={false}>
|
||||
<div>
|
||||
<button type='button'>Menu Item</button>
|
||||
</div>
|
||||
</Dropdown>
|
||||
</DropdownProvider>,
|
||||
);
|
||||
|
||||
describe('Dropdown keyboard activation', () => {
|
||||
it('opens when Enter is pressed on the toggle button', () => {
|
||||
renderDropdown();
|
||||
const toggle = screen.getByRole('button', { name: 'Test Menu' });
|
||||
|
||||
toggle.focus();
|
||||
pressActivationKey(toggle, 'Enter');
|
||||
|
||||
expect(toggle.getAttribute('aria-expanded')).toBe('true');
|
||||
});
|
||||
|
||||
it('opens when Space is pressed on the toggle button', () => {
|
||||
renderDropdown();
|
||||
const toggle = screen.getByRole('button', { name: 'Test Menu' });
|
||||
|
||||
toggle.focus();
|
||||
pressActivationKey(toggle, ' ');
|
||||
|
||||
expect(toggle.getAttribute('aria-expanded')).toBe('true');
|
||||
});
|
||||
|
||||
it('closes when Enter is pressed again on an open dropdown', () => {
|
||||
renderDropdown();
|
||||
const toggle = screen.getByRole('button', { name: 'Test Menu' });
|
||||
|
||||
toggle.focus();
|
||||
pressActivationKey(toggle, 'Enter');
|
||||
expect(toggle.getAttribute('aria-expanded')).toBe('true');
|
||||
|
||||
pressActivationKey(toggle, 'Enter');
|
||||
expect(toggle.getAttribute('aria-expanded')).toBe('false');
|
||||
});
|
||||
|
||||
it('stops propagation on Enter to prevent global shortcuts from firing', () => {
|
||||
renderDropdown();
|
||||
const toggle = screen.getByRole('button', { name: 'Test Menu' });
|
||||
|
||||
const onWindowKeyDown = vi.fn();
|
||||
window.addEventListener('keydown', onWindowKeyDown);
|
||||
try {
|
||||
toggle.focus();
|
||||
fireEvent.keyDown(toggle, { key: 'Enter' });
|
||||
expect(onWindowKeyDown).not.toHaveBeenCalled();
|
||||
} finally {
|
||||
window.removeEventListener('keydown', onWindowKeyDown);
|
||||
}
|
||||
});
|
||||
|
||||
it('stops propagation on Space to prevent global shortcuts from firing', () => {
|
||||
renderDropdown();
|
||||
const toggle = screen.getByRole('button', { name: 'Test Menu' });
|
||||
|
||||
const onWindowKeyDown = vi.fn();
|
||||
window.addEventListener('keydown', onWindowKeyDown);
|
||||
try {
|
||||
toggle.focus();
|
||||
fireEvent.keyDown(toggle, { key: ' ' });
|
||||
expect(onWindowKeyDown).not.toHaveBeenCalled();
|
||||
} finally {
|
||||
window.removeEventListener('keydown', onWindowKeyDown);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,5 @@
|
||||
import { describe, it, expect, vi, afterEach } from 'vitest';
|
||||
import { render, screen, cleanup, fireEvent } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import NumberInput from '@/components/settings/NumberInput';
|
||||
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
import { cleanup, fireEvent, render, waitFor } from '@testing-library/react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import ReadingRuler from '@/app/reader/components/ReadingRuler';
|
||||
import { ViewSettings } from '@/types/book';
|
||||
import { eventDispatcher } from '@/utils/event';
|
||||
|
||||
const saveViewSettings = vi.fn();
|
||||
|
||||
vi.mock('@/context/EnvContext', () => ({
|
||||
useEnv: () => ({ envConfig: {} }),
|
||||
}));
|
||||
|
||||
vi.mock('@/store/readerStore', () => ({
|
||||
useReaderStore: () => ({
|
||||
getProgress: () => null,
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/helpers/settings', () => ({
|
||||
saveViewSettings: (...args: unknown[]) => saveViewSettings(...args),
|
||||
}));
|
||||
|
||||
global.ResizeObserver = class ResizeObserver {
|
||||
observe() {}
|
||||
disconnect() {}
|
||||
unobserve() {}
|
||||
};
|
||||
|
||||
HTMLElement.prototype.setPointerCapture = vi.fn();
|
||||
HTMLElement.prototype.releasePointerCapture = vi.fn();
|
||||
|
||||
describe('ReadingRuler', () => {
|
||||
const viewSettings = {
|
||||
defaultFontSize: 16,
|
||||
lineHeight: 1.5,
|
||||
} as ViewSettings;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
|
||||
Object.defineProperty(HTMLElement.prototype, 'clientHeight', {
|
||||
configurable: true,
|
||||
get: () => 1000,
|
||||
});
|
||||
|
||||
Object.defineProperty(HTMLElement.prototype, 'clientWidth', {
|
||||
configurable: true,
|
||||
get: () => 800,
|
||||
});
|
||||
|
||||
HTMLElement.prototype.getBoundingClientRect = vi.fn(() => ({
|
||||
x: 0,
|
||||
y: 0,
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 800,
|
||||
bottom: 1000,
|
||||
width: 800,
|
||||
height: 1000,
|
||||
toJSON: () => ({}),
|
||||
}));
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
|
||||
it('keeps the ruler body pass-through and exposes dedicated drag handles', () => {
|
||||
const { container } = render(
|
||||
<ReadingRuler
|
||||
bookKey='book-1'
|
||||
isVertical={false}
|
||||
rtl={false}
|
||||
lines={2}
|
||||
position={33}
|
||||
opacity={0.5}
|
||||
color='transparent'
|
||||
bookFormat='EPUB'
|
||||
viewSettings={viewSettings}
|
||||
gridInsets={{ top: 0, right: 0, bottom: 0, left: 0 }}
|
||||
/>,
|
||||
);
|
||||
|
||||
const ruler = container.querySelector('.ruler');
|
||||
const dragHandles = container.querySelectorAll('.cursor-row-resize');
|
||||
|
||||
expect(ruler?.className).toContain('pointer-events-none');
|
||||
expect(dragHandles).toHaveLength(2);
|
||||
dragHandles.forEach((handle) => {
|
||||
expect(handle.className).toContain('pointer-events-auto');
|
||||
});
|
||||
});
|
||||
|
||||
it('moves and persists the ruler position when a ruler-step event is dispatched', async () => {
|
||||
const { container } = render(
|
||||
<ReadingRuler
|
||||
bookKey='book-1'
|
||||
isVertical={false}
|
||||
rtl={false}
|
||||
lines={2}
|
||||
position={33}
|
||||
opacity={0.5}
|
||||
color='transparent'
|
||||
bookFormat='EPUB'
|
||||
viewSettings={viewSettings}
|
||||
gridInsets={{ top: 0, right: 0, bottom: 0, left: 0 }}
|
||||
/>,
|
||||
);
|
||||
|
||||
eventDispatcher.dispatchSync('reading-ruler-move', {
|
||||
bookKey: 'book-1',
|
||||
direction: 'forward',
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
const ruler = container.querySelector('.ruler') as HTMLDivElement;
|
||||
const overlays = container.querySelectorAll('.bg-base-100');
|
||||
|
||||
expect(ruler.style.top).toBe('37.8%');
|
||||
expect(ruler.style.transition).toContain('top 0.6s');
|
||||
expect(overlays[0]?.getAttribute('style')).toContain('transition: height 0.6s');
|
||||
expect(overlays[1]?.getAttribute('style')).toContain('transition: height 0.6s');
|
||||
expect(saveViewSettings).toHaveBeenCalledWith(
|
||||
{},
|
||||
'book-1',
|
||||
'readingRulerPosition',
|
||||
37.8,
|
||||
false,
|
||||
false,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('keeps the drag handle anchored instead of snapping the ruler center to the pointer', () => {
|
||||
const { container } = render(
|
||||
<ReadingRuler
|
||||
bookKey='book-1'
|
||||
isVertical={false}
|
||||
rtl={false}
|
||||
lines={2}
|
||||
position={33}
|
||||
opacity={0.5}
|
||||
color='transparent'
|
||||
bookFormat='EPUB'
|
||||
viewSettings={viewSettings}
|
||||
gridInsets={{ top: 0, right: 0, bottom: 0, left: 0 }}
|
||||
/>,
|
||||
);
|
||||
|
||||
const ruler = container.querySelector('.ruler') as HTMLDivElement;
|
||||
const topHandle = container.querySelector('.cursor-row-resize') as HTMLDivElement;
|
||||
|
||||
expect(ruler.style.top).toBe('33%');
|
||||
|
||||
fireEvent.pointerDown(topHandle, { pointerId: 1, clientY: 306 });
|
||||
fireEvent.pointerMove(topHandle, { pointerId: 1, clientY: 316 });
|
||||
|
||||
expect(ruler.style.top).toBe('34%');
|
||||
});
|
||||
|
||||
it('does not consume ruler movement when already at the boundary', () => {
|
||||
render(
|
||||
<ReadingRuler
|
||||
bookKey='book-1'
|
||||
isVertical={false}
|
||||
rtl={false}
|
||||
lines={2}
|
||||
position={97.6}
|
||||
opacity={0.5}
|
||||
color='transparent'
|
||||
bookFormat='EPUB'
|
||||
viewSettings={viewSettings}
|
||||
gridInsets={{ top: 0, right: 0, bottom: 0, left: 0 }}
|
||||
/>,
|
||||
);
|
||||
|
||||
const consumed = eventDispatcher.dispatchSync('reading-ruler-move', {
|
||||
bookKey: 'book-1',
|
||||
direction: 'forward',
|
||||
});
|
||||
|
||||
expect(consumed).toBe(false);
|
||||
expect(saveViewSettings).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,5 @@
|
||||
import { describe, it, expect, vi, afterEach } from 'vitest';
|
||||
import { render, screen, cleanup } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { StaticListRow } from '@/app/reader/components/sidebar/TOCItem';
|
||||
import { TOCItem } from '@/libs/document';
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
import { cleanup, render } from '@testing-library/react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import useBookShortcuts from '@/app/reader/hooks/useBookShortcuts';
|
||||
import { eventDispatcher } from '@/utils/event';
|
||||
|
||||
const shortcutState = {
|
||||
actions: null as Record<
|
||||
string,
|
||||
((event?: KeyboardEvent | MessageEvent) => void) | undefined
|
||||
> | null,
|
||||
};
|
||||
|
||||
const mockView = {
|
||||
book: { dir: 'ltr' },
|
||||
prev: vi.fn(),
|
||||
next: vi.fn(),
|
||||
pan: vi.fn(),
|
||||
renderer: {
|
||||
scrolled: false,
|
||||
setAttribute: vi.fn(),
|
||||
},
|
||||
history: {
|
||||
back: vi.fn(),
|
||||
forward: vi.fn(),
|
||||
},
|
||||
};
|
||||
|
||||
const currentViewSettings = {
|
||||
defaultFontSize: 16,
|
||||
lineHeight: 1.5,
|
||||
readingRulerEnabled: true,
|
||||
writingMode: 'horizontal-tb',
|
||||
vertical: false,
|
||||
rtl: false,
|
||||
paragraphMode: { enabled: false },
|
||||
};
|
||||
|
||||
vi.mock('@/store/readerStore', () => ({
|
||||
useReaderStore: () => ({
|
||||
getView: () => mockView,
|
||||
getViewState: () => ({ ttsEnabled: false }),
|
||||
getViewSettings: () => currentViewSettings,
|
||||
setViewSettings: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/store/sidebarStore', () => ({
|
||||
useSidebarStore: () => ({
|
||||
toggleSideBar: vi.fn(),
|
||||
setSideBarBookKey: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/store/settingsStore', () => ({
|
||||
useSettingsStore: () => ({
|
||||
setSettingsDialogOpen: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/store/bookDataStore', () => ({
|
||||
useBookDataStore: () => ({
|
||||
getBookData: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/store/notebookStore', () => ({
|
||||
useNotebookStore: () => ({
|
||||
toggleNotebook: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/store/themeStore', () => ({
|
||||
useThemeStore: () => ({
|
||||
safeAreaInsets: null,
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/components/command-palette', () => ({
|
||||
useCommandPalette: () => ({
|
||||
open: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/hooks/useShortcuts', () => ({
|
||||
default: (actions: typeof shortcutState.actions) => {
|
||||
shortcutState.actions = actions;
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('@/services/environment', () => ({
|
||||
isTauriAppPlatform: () => false,
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/window', () => ({
|
||||
tauriHandleClose: vi.fn(),
|
||||
tauriHandleToggleFullScreen: vi.fn(),
|
||||
tauriQuitApp: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/style', () => ({
|
||||
getStyles: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/services/constants', () => ({
|
||||
MAX_ZOOM_LEVEL: 200,
|
||||
MIN_ZOOM_LEVEL: 50,
|
||||
ZOOM_STEP: 10,
|
||||
}));
|
||||
|
||||
vi.mock('@/app/reader/hooks/useBooksManager', () => ({
|
||||
default: () => ({
|
||||
getNextBookKey: () => 'book-1',
|
||||
}),
|
||||
}));
|
||||
|
||||
const Harness = () => {
|
||||
useBookShortcuts({ sideBarBookKey: 'book-1', bookKeys: ['book-1'] });
|
||||
return null;
|
||||
};
|
||||
|
||||
describe('useBookShortcuts', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
shortcutState.actions = null;
|
||||
currentViewSettings.readingRulerEnabled = true;
|
||||
currentViewSettings.writingMode = 'horizontal-tb';
|
||||
currentViewSettings.vertical = false;
|
||||
currentViewSettings.rtl = false;
|
||||
currentViewSettings.paragraphMode.enabled = false;
|
||||
mockView.book.dir = 'ltr';
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
|
||||
it('routes page-turn shortcuts to reading ruler movement when enabled', () => {
|
||||
const dispatchSpy = vi.spyOn(eventDispatcher, 'dispatchSync').mockReturnValue(true);
|
||||
|
||||
render(<Harness />);
|
||||
shortcutState.actions?.['onGoNext']?.();
|
||||
|
||||
expect(dispatchSpy).toHaveBeenCalledWith('reading-ruler-move', {
|
||||
bookKey: 'book-1',
|
||||
direction: 'forward',
|
||||
});
|
||||
expect(mockView.next).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('uses reading order when directional shortcuts are handled in rtl books', () => {
|
||||
const dispatchSpy = vi.spyOn(eventDispatcher, 'dispatchSync').mockReturnValue(true);
|
||||
mockView.book.dir = 'rtl';
|
||||
|
||||
render(<Harness />);
|
||||
shortcutState.actions?.['onGoRight']?.();
|
||||
|
||||
expect(dispatchSpy).toHaveBeenCalledWith('reading-ruler-move', {
|
||||
bookKey: 'book-1',
|
||||
direction: 'backward',
|
||||
});
|
||||
});
|
||||
|
||||
it('falls back to normal page navigation when the ruler is disabled', () => {
|
||||
currentViewSettings.readingRulerEnabled = false;
|
||||
|
||||
render(<Harness />);
|
||||
shortcutState.actions?.['onGoNext']?.();
|
||||
|
||||
expect(mockView.next).toHaveBeenCalledWith(72);
|
||||
});
|
||||
|
||||
it('falls back to normal page navigation when the ruler cannot move further', () => {
|
||||
vi.spyOn(eventDispatcher, 'dispatchSync').mockReturnValue(false);
|
||||
|
||||
render(<Harness />);
|
||||
shortcutState.actions?.['onGoNext']?.();
|
||||
|
||||
expect(mockView.next).toHaveBeenCalledWith(72);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,292 @@
|
||||
import { describe, it, expect, beforeAll, afterEach } from 'vitest';
|
||||
import { DocumentLoader } from '@/libs/document';
|
||||
import type { BookDoc } from '@/libs/document';
|
||||
import type { Renderer } from '@/types/view';
|
||||
|
||||
// repro-3683: cover page with display:table + position:absolute + width:100% on body
|
||||
const REPRO_3683_URL = new URL('../fixtures/data/repro-3683.epub', import.meta.url).href;
|
||||
// repro-3583: vertical writing mode with height/width:100% divs and SVG image
|
||||
const REPRO_3583_URL = new URL('../fixtures/data/repro-3583.epub', import.meta.url).href;
|
||||
const ALICE_URL = new URL('../fixtures/data/sample-alice.epub', import.meta.url).href;
|
||||
|
||||
const loadEPUB = async (url: string) => {
|
||||
const resp = await fetch(url);
|
||||
const buffer = await resp.arrayBuffer();
|
||||
const name = url.split('/').pop() ?? 'book.epub';
|
||||
const file = new File([buffer], name, { type: 'application/epub+zip' });
|
||||
const loader = new DocumentLoader(file);
|
||||
const { book } = await loader.open();
|
||||
return book;
|
||||
};
|
||||
|
||||
const waitForStabilized = (el: HTMLElement, timeout = 5000) =>
|
||||
new Promise<void>((resolve, reject) => {
|
||||
const timer = setTimeout(() => reject(new Error('stabilized timeout')), timeout);
|
||||
el.addEventListener(
|
||||
'stabilized',
|
||||
() => {
|
||||
clearTimeout(timer);
|
||||
resolve();
|
||||
},
|
||||
{ once: true },
|
||||
);
|
||||
});
|
||||
|
||||
const waitForFillComplete = async (el: Renderer, timeout = 5000) => {
|
||||
const start = Date.now();
|
||||
let lastCount = -1;
|
||||
let stableFor = 0;
|
||||
while (Date.now() - start < timeout) {
|
||||
const count = el.getContents().length;
|
||||
if (count === lastCount) {
|
||||
stableFor += 50;
|
||||
if (stableFor >= 300) return;
|
||||
} else {
|
||||
stableFor = 0;
|
||||
lastCount = count;
|
||||
}
|
||||
await new Promise((r) => setTimeout(r, 50));
|
||||
}
|
||||
};
|
||||
|
||||
let repro3683: BookDoc;
|
||||
let repro3583: BookDoc;
|
||||
let aliceBook: BookDoc;
|
||||
|
||||
/** Check all iframes and SVGs in shadow DOM stay within a size bound. */
|
||||
const assertBoundedWidths = (paginator: Renderer, maxWidth: number) => {
|
||||
const shadow = paginator.shadowRoot;
|
||||
expect(shadow).toBeDefined();
|
||||
for (const iframe of shadow!.querySelectorAll('iframe')) {
|
||||
const w = parseFloat(iframe.style.width) || iframe.getBoundingClientRect().width;
|
||||
expect(w, `iframe width ${w}px exceeds ${maxWidth}px`).toBeLessThan(maxWidth);
|
||||
}
|
||||
for (const svg of shadow!.querySelectorAll('svg')) {
|
||||
const w = parseFloat(svg.style.width) || svg.getBoundingClientRect().width;
|
||||
expect(w, `svg width ${w}px exceeds ${maxWidth}px`).toBeLessThan(maxWidth);
|
||||
}
|
||||
};
|
||||
|
||||
const assertBoundedHeights = (paginator: Renderer, maxHeight: number) => {
|
||||
const shadow = paginator.shadowRoot;
|
||||
expect(shadow).toBeDefined();
|
||||
for (const iframe of shadow!.querySelectorAll('iframe')) {
|
||||
const h = parseFloat(iframe.style.height) || iframe.getBoundingClientRect().height;
|
||||
expect(h, `iframe height ${h}px exceeds ${maxHeight}px`).toBeLessThan(maxHeight);
|
||||
}
|
||||
for (const svg of shadow!.querySelectorAll('svg')) {
|
||||
const h = parseFloat(svg.style.height) || svg.getBoundingClientRect().height;
|
||||
expect(h, `svg height ${h}px exceeds ${maxHeight}px`).toBeLessThan(maxHeight);
|
||||
}
|
||||
};
|
||||
|
||||
describe('Paginator expand loop regression', () => {
|
||||
let paginator: Renderer;
|
||||
|
||||
const suppressHandler = (e: ErrorEvent) => {
|
||||
if (e.message?.includes('getComputedStyle')) e.preventDefault();
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
window.addEventListener('error', suppressHandler);
|
||||
[repro3683, repro3583, aliceBook] = await Promise.all([
|
||||
loadEPUB(REPRO_3683_URL),
|
||||
loadEPUB(REPRO_3583_URL),
|
||||
loadEPUB(ALICE_URL),
|
||||
]);
|
||||
await import('foliate-js/paginator.js');
|
||||
}, 30000);
|
||||
|
||||
const createPaginator = () => {
|
||||
const el = document.createElement('foliate-paginator') as Renderer;
|
||||
Object.assign(el.style, {
|
||||
width: '800px',
|
||||
height: '600px',
|
||||
position: 'absolute',
|
||||
left: '0',
|
||||
top: '0',
|
||||
});
|
||||
document.body.appendChild(el);
|
||||
return el;
|
||||
};
|
||||
|
||||
afterEach(async () => {
|
||||
if (paginator) {
|
||||
await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
|
||||
try {
|
||||
paginator.destroy();
|
||||
} catch {
|
||||
/* iframe body may already be torn down */
|
||||
}
|
||||
paginator.remove();
|
||||
}
|
||||
window.removeEventListener('error', suppressHandler);
|
||||
});
|
||||
|
||||
describe('Table-layout cover page (repro EPUB)', () => {
|
||||
it('should stabilize without freezing on the problematic cover section', async () => {
|
||||
paginator = createPaginator();
|
||||
paginator.open(repro3683);
|
||||
|
||||
// Section 0 is the cover with display:table + position:absolute + width:100%
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: 0 });
|
||||
await stabilized;
|
||||
|
||||
// If we reach here, the paginator didn't loop infinitely
|
||||
expect(paginator.primaryIndex).toBe(0);
|
||||
expect(paginator.getContents().length).toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
|
||||
it('should render the cover content correctly', async () => {
|
||||
paginator = createPaginator();
|
||||
paginator.open(repro3683);
|
||||
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: 0 });
|
||||
await stabilized;
|
||||
|
||||
const contents = paginator.getContents();
|
||||
const cover = contents.find((c) => c.index === 0);
|
||||
expect(cover).toBeDefined();
|
||||
expect(cover!.doc.body.textContent).toContain('COVER PAGE');
|
||||
});
|
||||
|
||||
it('should navigate from cover to chapter without freezing', async () => {
|
||||
paginator = createPaginator();
|
||||
paginator.open(repro3683);
|
||||
|
||||
// Go to cover first
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: 0 });
|
||||
await stabilized;
|
||||
await waitForFillComplete(paginator);
|
||||
|
||||
// Navigate to chapter 1 — it may already be loaded as an adjacent
|
||||
// section during fill, so goTo reuses the view without emitting
|
||||
// 'stabilized'. Just await goTo and verify the result.
|
||||
await paginator.goTo({ index: 1 });
|
||||
// Allow layout to settle
|
||||
await new Promise((r) => setTimeout(r, 200));
|
||||
|
||||
expect(paginator.primaryIndex).toBe(1);
|
||||
const contents = paginator.getContents();
|
||||
const ch1 = contents.find((c) => c.index === 1);
|
||||
expect(ch1).toBeDefined();
|
||||
expect(ch1!.doc.body.textContent).toContain('Hello, world.');
|
||||
});
|
||||
|
||||
it('should stabilize the cover in scrolled mode', async () => {
|
||||
paginator = createPaginator();
|
||||
paginator.open(repro3683);
|
||||
paginator.setAttribute('flow', 'scrolled');
|
||||
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: 0 });
|
||||
await stabilized;
|
||||
|
||||
expect(paginator.scrolled).toBe(true);
|
||||
expect(paginator.primaryIndex).toBe(0);
|
||||
});
|
||||
|
||||
it('should keep element sizes bounded in paginated mode', async () => {
|
||||
// Without the fix, expand() diverges: body (position:absolute,
|
||||
// width:100%) mirrors the iframe width, each expand computes an
|
||||
// even larger expandedSize. Iframes/SVGs grow to millions of px.
|
||||
paginator = createPaginator();
|
||||
paginator.open(repro3683);
|
||||
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: 0 });
|
||||
await stabilized;
|
||||
await waitForFillComplete(paginator);
|
||||
|
||||
// Let ResizeObserver cycles run — divergence would explode here
|
||||
await new Promise((r) => setTimeout(r, 500));
|
||||
assertBoundedWidths(paginator, 800 * 20);
|
||||
assertBoundedHeights(paginator, 600 * 20);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Vertical writing mode with 100% divs in scrolled mode (repro-3583)', () => {
|
||||
it('should stabilize without freezing', async () => {
|
||||
paginator = createPaginator();
|
||||
paginator.open(repro3583);
|
||||
paginator.setAttribute('flow', 'scrolled');
|
||||
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: 0 });
|
||||
await stabilized;
|
||||
|
||||
expect(paginator.scrolled).toBe(true);
|
||||
expect(paginator.primaryIndex).toBe(0);
|
||||
});
|
||||
|
||||
it('should keep element sizes bounded', async () => {
|
||||
paginator = createPaginator();
|
||||
paginator.open(repro3583);
|
||||
paginator.setAttribute('flow', 'scrolled');
|
||||
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: 0 });
|
||||
await stabilized;
|
||||
await waitForFillComplete(paginator);
|
||||
await new Promise((r) => setTimeout(r, 500));
|
||||
|
||||
assertBoundedWidths(paginator, 800 * 20);
|
||||
assertBoundedHeights(paginator, 600 * 20);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Normal EPUB regression check', () => {
|
||||
it('should stabilize normally on a regular section', async () => {
|
||||
paginator = createPaginator();
|
||||
paginator.open(aliceBook);
|
||||
|
||||
const idx = aliceBook.sections!.findIndex((s) => s.linear !== 'no');
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: idx });
|
||||
await stabilized;
|
||||
|
||||
expect(paginator.primaryIndex).toBe(idx);
|
||||
expect(paginator.getContents().length).toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
|
||||
it('should allow legitimate re-expansion after render', async () => {
|
||||
paginator = createPaginator();
|
||||
paginator.open(aliceBook);
|
||||
|
||||
const idx = aliceBook.sections!.findIndex((s) => s.linear !== 'no');
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: idx });
|
||||
await stabilized;
|
||||
await waitForFillComplete(paginator);
|
||||
|
||||
// Re-render should work (expand history resets on layout changes)
|
||||
const stabilized2 = waitForStabilized(paginator);
|
||||
paginator.render?.();
|
||||
await stabilized2;
|
||||
|
||||
expect(paginator.primaryIndex).toBe(idx);
|
||||
});
|
||||
|
||||
it('should handle flow mode switch with convergence detection', async () => {
|
||||
paginator = createPaginator();
|
||||
paginator.open(aliceBook);
|
||||
|
||||
const idx = aliceBook.sections!.findIndex((s) => s.linear !== 'no');
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
await paginator.goTo({ index: idx });
|
||||
await stabilized;
|
||||
await waitForFillComplete(paginator);
|
||||
|
||||
// Switch to scrolled — triggers full re-layout
|
||||
const stabilized2 = waitForStabilized(paginator);
|
||||
paginator.setAttribute('flow', 'scrolled');
|
||||
await stabilized2;
|
||||
|
||||
expect(paginator.scrolled).toBe(true);
|
||||
expect(paginator.primaryIndex).toBe(idx);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,34 +1,11 @@
|
||||
import { describe, it, expect, beforeAll, afterEach } from 'vitest';
|
||||
import { DocumentLoader } from '@/libs/document';
|
||||
import type { BookDoc } from '@/libs/document';
|
||||
import type { FoliateView } from '@/types/view';
|
||||
import type { FoliateView, Renderer } from '@/types/view';
|
||||
|
||||
// Vite serves fixture files; fetch the EPUB at runtime in the browser.
|
||||
const EPUB_URL = new URL('../fixtures/data/sample-alice.epub', import.meta.url).href;
|
||||
|
||||
interface PaginatorElement extends HTMLElement {
|
||||
open: (book: BookDoc) => void;
|
||||
goTo: (target: {
|
||||
index: number;
|
||||
anchor?: number | (() => number);
|
||||
select?: boolean;
|
||||
}) => Promise<void>;
|
||||
prev: () => Promise<void>;
|
||||
next: () => Promise<void>;
|
||||
destroy: () => void;
|
||||
getContents: () => Array<{ index: number; doc: Document; overlayer: unknown }>;
|
||||
setStyles: (styles: string | [string, string]) => void;
|
||||
render: () => void;
|
||||
primaryIndex: number;
|
||||
pages: number;
|
||||
page: number;
|
||||
size: number;
|
||||
viewSize: number;
|
||||
scrolled: boolean;
|
||||
columnCount: number;
|
||||
sections: Array<{ linear?: string; load: () => Promise<string> }>;
|
||||
}
|
||||
|
||||
let book: BookDoc;
|
||||
|
||||
const loadEPUB = async () => {
|
||||
@@ -59,7 +36,7 @@ const waitForStabilized = (el: HTMLElement, timeout = 10000) =>
|
||||
});
|
||||
|
||||
/** Wait until `getContents().length >= n` or timeout. */
|
||||
const waitForViews = async (el: PaginatorElement, n: number, timeout = 10000) => {
|
||||
const waitForViews = async (el: Renderer, n: number, timeout = 10000) => {
|
||||
const start = Date.now();
|
||||
while (Date.now() - start < timeout) {
|
||||
if (el.getContents().length >= n) return;
|
||||
@@ -68,7 +45,7 @@ const waitForViews = async (el: PaginatorElement, n: number, timeout = 10000) =>
|
||||
};
|
||||
|
||||
/** Wait for fill to complete by polling until getContents count stabilizes. */
|
||||
const waitForFillComplete = async (el: PaginatorElement, timeout = 10000) => {
|
||||
const waitForFillComplete = async (el: Renderer, timeout = 10000) => {
|
||||
const start = Date.now();
|
||||
let lastCount = -1;
|
||||
let stableFor = 0;
|
||||
@@ -86,7 +63,7 @@ const waitForFillComplete = async (el: PaginatorElement, timeout = 10000) => {
|
||||
};
|
||||
|
||||
describe('Paginator multi-view architecture (browser)', () => {
|
||||
let paginator: PaginatorElement;
|
||||
let paginator: Renderer;
|
||||
|
||||
beforeAll(async () => {
|
||||
book = await loadEPUB();
|
||||
@@ -94,7 +71,7 @@ describe('Paginator multi-view architecture (browser)', () => {
|
||||
}, 30000);
|
||||
|
||||
const createPaginator = () => {
|
||||
const el = document.createElement('foliate-paginator') as PaginatorElement;
|
||||
const el = document.createElement('foliate-paginator') as Renderer;
|
||||
// The paginator needs non-zero dimensions for layout calculations
|
||||
Object.assign(el.style, {
|
||||
width: '800px',
|
||||
@@ -210,7 +187,7 @@ describe('Paginator multi-view architecture (browser)', () => {
|
||||
await waitForViews(paginator, 2);
|
||||
const contents = paginator.getContents();
|
||||
const indices = contents.map((c) => c.index);
|
||||
expect(indices).toEqual([...indices].sort((a, b) => a - b));
|
||||
expect(indices).toEqual([...indices].sort((a, b) => (a ?? 0) - (b ?? 0)));
|
||||
});
|
||||
|
||||
it('should include the primary section in getContents', async () => {
|
||||
@@ -254,8 +231,14 @@ describe('Paginator multi-view architecture (browser)', () => {
|
||||
await paginator.goTo({ index: idx, anchor: 0.5 });
|
||||
await stabilized;
|
||||
expect(paginator.primaryIndex).toBe(idx);
|
||||
// When anchored at 0.5 in a multi-page section, page > 0
|
||||
expect(paginator.page).toBeGreaterThan(0);
|
||||
// When anchored at 0.5 in a multi-page section, page should be
|
||||
// roughly in the middle — at least past page 0 when there are
|
||||
// enough pages (sections with few columns may legitimately land
|
||||
// on page 0 at 50%).
|
||||
if (paginator.pages > 2) {
|
||||
expect(paginator.page).toBeGreaterThan(0);
|
||||
}
|
||||
expect(paginator.page).toBeLessThan(paginator.pages);
|
||||
});
|
||||
|
||||
it('should navigate to a later section and back', async () => {
|
||||
|
||||
@@ -235,10 +235,12 @@ describe('Paginator multi-view architecture', () => {
|
||||
{ index: 5, offset: 150, size: 200 },
|
||||
];
|
||||
const detectPrimary = (visibleStart: number) => {
|
||||
let offset = 0;
|
||||
for (const view of views) {
|
||||
if (visibleStart < view.offset + view.size) {
|
||||
if (visibleStart < offset + view.size - 1) {
|
||||
return view.index;
|
||||
}
|
||||
offset += view.size;
|
||||
}
|
||||
return views[views.length - 1]?.index;
|
||||
};
|
||||
@@ -249,6 +251,33 @@ describe('Paginator multi-view architecture', () => {
|
||||
expect(detectPrimary(150)).toBe(5); // at boundary → third view
|
||||
expect(detectPrimary(300)).toBe(5); // in third view
|
||||
});
|
||||
|
||||
it('should handle floating-point precision at view boundaries (Android DPR)', () => {
|
||||
// On Android with non-integer DPR, container scrollLeft and accumulated
|
||||
// getBoundingClientRect() sizes diverge by tiny amounts (~0.0001px).
|
||||
// Real trace: visibleStart=1570.9090576171875, accumulated offset+viewSize=1570.9091796875
|
||||
// Fix: 1px tolerance so sub-pixel drift doesn't pick the wrong view.
|
||||
const viewSize = 785.45458984375;
|
||||
const detectPrimary = (visibleStart: number) => {
|
||||
let offset = 0;
|
||||
const views = [
|
||||
{ index: 1, size: viewSize },
|
||||
{ index: 2, size: viewSize },
|
||||
{ index: 3, size: viewSize },
|
||||
];
|
||||
for (const view of views) {
|
||||
if (visibleStart < offset + view.size - 1) {
|
||||
return view.index;
|
||||
}
|
||||
offset += view.size;
|
||||
}
|
||||
return views[views.length - 1]?.index;
|
||||
};
|
||||
// visibleStart from scrollLeft: 2 * viewSize computed differently than sum of rects
|
||||
const visibleStart = 1570.9090576171875; // container.scrollLeft
|
||||
// With tolerance, this should detect index 3 (not 2)
|
||||
expect(detectPrimary(visibleStart)).toBe(3);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Adjacent index with fromIndex parameter', () => {
|
||||
|
||||
@@ -1,34 +1,11 @@
|
||||
import { describe, it, expect, beforeAll, afterAll, afterEach } from 'vitest';
|
||||
import { DocumentLoader } from '@/libs/document';
|
||||
import type { BookDoc } from '@/libs/document';
|
||||
import type { Renderer } from '@/types/view';
|
||||
|
||||
// Vite serves fixture files; fetch the EPUB at runtime in the browser.
|
||||
const EPUB_URL = new URL('../fixtures/data/sample-alice.epub', import.meta.url).href;
|
||||
|
||||
interface PaginatorElement extends HTMLElement {
|
||||
open: (book: BookDoc) => void;
|
||||
goTo: (target: {
|
||||
index: number;
|
||||
anchor?: number | (() => number);
|
||||
select?: boolean;
|
||||
}) => Promise<void>;
|
||||
prev: () => Promise<void>;
|
||||
next: () => Promise<void>;
|
||||
destroy: () => void;
|
||||
getContents: () => Array<{ index: number; doc: Document; overlayer: unknown }>;
|
||||
setStyles: (styles: string | [string, string]) => void;
|
||||
render: () => void;
|
||||
scrollToAnchor: (anchor: number | Range, select?: boolean, smooth?: boolean) => Promise<void>;
|
||||
primaryIndex: number;
|
||||
pages: number;
|
||||
page: number;
|
||||
size: number;
|
||||
viewSize: number;
|
||||
scrolled: boolean;
|
||||
columnCount: number;
|
||||
sections: Array<{ linear?: string; load: () => Promise<string> }>;
|
||||
}
|
||||
|
||||
let book: BookDoc;
|
||||
|
||||
const loadEPUB = async () => {
|
||||
@@ -59,7 +36,7 @@ const waitForStabilized = (el: HTMLElement, timeout = 10000) =>
|
||||
});
|
||||
|
||||
/** Wait until `getContents().length >= n` or timeout. */
|
||||
const waitForViews = async (el: PaginatorElement, n: number, timeout = 10000) => {
|
||||
const waitForViews = async (el: Renderer, n: number, timeout = 10000) => {
|
||||
const start = Date.now();
|
||||
while (Date.now() - start < timeout) {
|
||||
if (el.getContents().length >= n) return;
|
||||
@@ -68,7 +45,7 @@ const waitForViews = async (el: PaginatorElement, n: number, timeout = 10000) =>
|
||||
};
|
||||
|
||||
/** Wait for fill to complete by polling until getContents count stabilizes. */
|
||||
const waitForFillComplete = async (el: PaginatorElement, timeout = 10000) => {
|
||||
const waitForFillComplete = async (el: Renderer, timeout = 10000) => {
|
||||
const start = Date.now();
|
||||
let lastCount = -1;
|
||||
let stableFor = 0;
|
||||
@@ -86,7 +63,7 @@ const waitForFillComplete = async (el: PaginatorElement, timeout = 10000) => {
|
||||
};
|
||||
|
||||
describe('Paginator stabilization (browser)', () => {
|
||||
let paginator: PaginatorElement;
|
||||
let paginator: Renderer;
|
||||
|
||||
// Suppress unhandled errors from paginator's #replaceBackground firing
|
||||
// after views are destroyed (queued iframe loads from rapid navigation).
|
||||
@@ -106,7 +83,7 @@ describe('Paginator stabilization (browser)', () => {
|
||||
});
|
||||
|
||||
const createPaginator = () => {
|
||||
const el = document.createElement('foliate-paginator') as PaginatorElement;
|
||||
const el = document.createElement('foliate-paginator') as Renderer;
|
||||
Object.assign(el.style, {
|
||||
width: '800px',
|
||||
height: '600px',
|
||||
@@ -255,7 +232,7 @@ describe('Paginator stabilization (browser)', () => {
|
||||
await waitForFillComplete(paginator);
|
||||
|
||||
const stabilizedFromRender = waitForStabilized(paginator);
|
||||
paginator.render();
|
||||
paginator.render?.();
|
||||
// render() dispatches stabilized in a RAF
|
||||
await stabilizedFromRender;
|
||||
// If we get here, stabilized was emitted
|
||||
@@ -269,7 +246,7 @@ describe('Paginator stabilization (browser)', () => {
|
||||
|
||||
const indexBefore = paginator.primaryIndex;
|
||||
const stabilized = waitForStabilized(paginator);
|
||||
paginator.render();
|
||||
paginator.render?.();
|
||||
await stabilized;
|
||||
expect(paginator.primaryIndex).toBe(indexBefore);
|
||||
});
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,240 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import type { User, AuthError } from '@supabase/supabase-js';
|
||||
|
||||
// Mock supabase before importing the module under test
|
||||
const mockSetSession = vi.fn();
|
||||
const mockGetUser = vi.fn();
|
||||
|
||||
vi.mock('@/utils/supabase', () => ({
|
||||
supabase: {
|
||||
auth: {
|
||||
setSession: (...args: unknown[]) => mockSetSession(...args),
|
||||
getUser: () => mockGetUser(),
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
import { handleAuthCallback } from '@/helpers/auth';
|
||||
|
||||
describe('handleAuthCallback', () => {
|
||||
let mockLogin: ReturnType<typeof vi.fn<(accessToken: string, user: User) => void>>;
|
||||
let mockNavigate: ReturnType<typeof vi.fn<(path: string) => void>>;
|
||||
|
||||
const fakeUser: User = {
|
||||
id: 'user-123',
|
||||
app_metadata: {},
|
||||
user_metadata: {},
|
||||
aud: 'authenticated',
|
||||
created_at: '2024-01-01T00:00:00Z',
|
||||
} as User;
|
||||
|
||||
beforeEach(() => {
|
||||
mockLogin = vi.fn<(accessToken: string, user: User) => void>();
|
||||
mockNavigate = vi.fn<(path: string) => void>();
|
||||
mockSetSession.mockReset();
|
||||
mockGetUser.mockReset();
|
||||
vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should navigate to /auth/error when error is present', async () => {
|
||||
handleAuthCallback({
|
||||
accessToken: 'token',
|
||||
refreshToken: 'refresh',
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
error: 'some_error',
|
||||
});
|
||||
|
||||
// Wait for the async finalizeSession to complete
|
||||
await vi.waitFor(() => {
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/auth/error');
|
||||
});
|
||||
|
||||
expect(mockLogin).not.toHaveBeenCalled();
|
||||
expect(mockSetSession).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should navigate to /library when accessToken is missing', async () => {
|
||||
handleAuthCallback({
|
||||
accessToken: null,
|
||||
refreshToken: 'refresh',
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/library');
|
||||
});
|
||||
|
||||
expect(mockLogin).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should navigate to /library when refreshToken is missing', async () => {
|
||||
handleAuthCallback({
|
||||
accessToken: 'token',
|
||||
refreshToken: null,
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/library');
|
||||
});
|
||||
|
||||
expect(mockLogin).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should navigate to /library when both tokens are missing', async () => {
|
||||
handleAuthCallback({
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/library');
|
||||
});
|
||||
});
|
||||
|
||||
it('should navigate to /auth/error when setSession fails', async () => {
|
||||
const sessionError: AuthError = {
|
||||
message: 'Invalid token',
|
||||
name: 'AuthError',
|
||||
status: 401,
|
||||
} as AuthError;
|
||||
|
||||
mockSetSession.mockResolvedValue({ error: sessionError });
|
||||
|
||||
handleAuthCallback({
|
||||
accessToken: 'bad-token',
|
||||
refreshToken: 'bad-refresh',
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/auth/error');
|
||||
});
|
||||
|
||||
expect(mockSetSession).toHaveBeenCalledWith({
|
||||
access_token: 'bad-token',
|
||||
refresh_token: 'bad-refresh',
|
||||
});
|
||||
expect(mockLogin).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should login and navigate to next URL on successful auth', async () => {
|
||||
mockSetSession.mockResolvedValue({ error: null });
|
||||
mockGetUser.mockResolvedValue({ data: { user: fakeUser } });
|
||||
|
||||
handleAuthCallback({
|
||||
accessToken: 'good-token',
|
||||
refreshToken: 'good-refresh',
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
next: '/reader',
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockLogin).toHaveBeenCalledWith('good-token', fakeUser);
|
||||
});
|
||||
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/reader');
|
||||
});
|
||||
|
||||
it('should default next to "/" when not specified', async () => {
|
||||
mockSetSession.mockResolvedValue({ error: null });
|
||||
mockGetUser.mockResolvedValue({ data: { user: fakeUser } });
|
||||
|
||||
handleAuthCallback({
|
||||
accessToken: 'token',
|
||||
refreshToken: 'refresh',
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/');
|
||||
});
|
||||
});
|
||||
|
||||
it('should navigate to /auth/recovery when type is "recovery"', async () => {
|
||||
mockSetSession.mockResolvedValue({ error: null });
|
||||
mockGetUser.mockResolvedValue({ data: { user: fakeUser } });
|
||||
|
||||
handleAuthCallback({
|
||||
accessToken: 'token',
|
||||
refreshToken: 'refresh',
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
type: 'recovery',
|
||||
next: '/some-page',
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockLogin).toHaveBeenCalledWith('token', fakeUser);
|
||||
});
|
||||
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/auth/recovery');
|
||||
// Should NOT navigate to next when type is recovery
|
||||
expect(mockNavigate).not.toHaveBeenCalledWith('/some-page');
|
||||
});
|
||||
|
||||
it('should navigate to /auth/error when getUser returns null user', async () => {
|
||||
mockSetSession.mockResolvedValue({ error: null });
|
||||
mockGetUser.mockResolvedValue({ data: { user: null } });
|
||||
|
||||
handleAuthCallback({
|
||||
accessToken: 'token',
|
||||
refreshToken: 'refresh',
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/auth/error');
|
||||
});
|
||||
|
||||
expect(mockLogin).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not call login when user is undefined from getUser', async () => {
|
||||
mockSetSession.mockResolvedValue({ error: null });
|
||||
mockGetUser.mockResolvedValue({ data: { user: undefined } });
|
||||
|
||||
handleAuthCallback({
|
||||
accessToken: 'token',
|
||||
refreshToken: 'refresh',
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockNavigate).toHaveBeenCalledWith('/auth/error');
|
||||
});
|
||||
|
||||
expect(mockLogin).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should pass the correct session parameters to setSession', async () => {
|
||||
mockSetSession.mockResolvedValue({ error: null });
|
||||
mockGetUser.mockResolvedValue({ data: { user: fakeUser } });
|
||||
|
||||
handleAuthCallback({
|
||||
accessToken: 'my-access-token',
|
||||
refreshToken: 'my-refresh-token',
|
||||
login: mockLogin,
|
||||
navigate: mockNavigate,
|
||||
});
|
||||
|
||||
await vi.waitFor(() => {
|
||||
expect(mockSetSession).toHaveBeenCalledWith({
|
||||
access_token: 'my-access-token',
|
||||
refresh_token: 'my-refresh-token',
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,262 @@
|
||||
import { describe, test, expect, beforeEach, afterEach, vi } from 'vitest';
|
||||
|
||||
// ── Mocks ────────────────────────────────────────────────────────
|
||||
let mockIsWebAppPlatform = false;
|
||||
let mockHasCli = false;
|
||||
|
||||
vi.mock('@/services/environment', () => ({
|
||||
isWebAppPlatform: () => mockIsWebAppPlatform,
|
||||
hasCli: () => mockHasCli,
|
||||
}));
|
||||
|
||||
const mockGetCurrent = vi.fn<() => Promise<string[] | null>>();
|
||||
vi.mock('@tauri-apps/plugin-deep-link', () => ({
|
||||
getCurrent: () => mockGetCurrent(),
|
||||
}));
|
||||
|
||||
const mockGetMatches = vi.fn();
|
||||
vi.mock('@tauri-apps/plugin-cli', () => ({
|
||||
getMatches: () => mockGetMatches(),
|
||||
}));
|
||||
|
||||
import { parseOpenWithFiles } from '@/helpers/openWith';
|
||||
|
||||
// Helper type matching the AppService subset used in openWith
|
||||
interface MockAppService {
|
||||
isIOSApp: boolean;
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
// Suppress expected console noise from parseIntentOpenWithFiles.
|
||||
vi.spyOn(console, 'log').mockImplementation(() => {});
|
||||
vi.spyOn(console, 'info').mockImplementation(() => {});
|
||||
mockIsWebAppPlatform = false;
|
||||
mockHasCli = false;
|
||||
// Reset window globals
|
||||
delete window.OPEN_WITH_FILES;
|
||||
// Reset location.search
|
||||
Object.defineProperty(window, 'location', {
|
||||
value: { ...window.location, search: '' },
|
||||
writable: true,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('parseOpenWithFiles', () => {
|
||||
// ── Web platform ───────────────────────────────────────────────
|
||||
describe('web platform', () => {
|
||||
test('returns empty array on web platform', async () => {
|
||||
mockIsWebAppPlatform = true;
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
// ── Window URL params ──────────────────────────────────────────
|
||||
describe('window URL params', () => {
|
||||
test('parses file params from URL search', async () => {
|
||||
Object.defineProperty(window, 'location', {
|
||||
value: { ...window.location, search: '?file=book1.epub&file=book2.epub' },
|
||||
writable: true,
|
||||
});
|
||||
mockGetCurrent.mockResolvedValue(null);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['book1.epub', 'book2.epub']);
|
||||
});
|
||||
|
||||
test('uses window.OPEN_WITH_FILES when no URL params', async () => {
|
||||
window.OPEN_WITH_FILES = ['/path/to/book.epub'];
|
||||
mockGetCurrent.mockResolvedValue(null);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['/path/to/book.epub']);
|
||||
});
|
||||
|
||||
test('prefers URL params over OPEN_WITH_FILES', async () => {
|
||||
Object.defineProperty(window, 'location', {
|
||||
value: { ...window.location, search: '?file=url-book.epub' },
|
||||
writable: true,
|
||||
});
|
||||
window.OPEN_WITH_FILES = ['/path/to/window-book.epub'];
|
||||
mockGetCurrent.mockResolvedValue(null);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['url-book.epub']);
|
||||
});
|
||||
});
|
||||
|
||||
// ── CLI arguments ──────────────────────────────────────────────
|
||||
describe('CLI arguments', () => {
|
||||
test('parses files from CLI matches', async () => {
|
||||
mockHasCli = true;
|
||||
mockGetMatches.mockResolvedValue({
|
||||
args: {
|
||||
file1: { value: '/path/file1.epub', occurrences: 1 },
|
||||
file2: { value: '/path/file2.epub', occurrences: 1 },
|
||||
file3: { value: '', occurrences: 0 },
|
||||
file4: { value: '', occurrences: 0 },
|
||||
},
|
||||
});
|
||||
mockGetCurrent.mockResolvedValue(null);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['/path/file1.epub', '/path/file2.epub']);
|
||||
});
|
||||
|
||||
test('returns empty array when CLI has no file args', async () => {
|
||||
mockHasCli = true;
|
||||
mockGetMatches.mockResolvedValue({
|
||||
args: {
|
||||
file1: { value: '', occurrences: 0 },
|
||||
file2: { value: '', occurrences: 0 },
|
||||
file3: { value: '', occurrences: 0 },
|
||||
file4: { value: '', occurrences: 0 },
|
||||
},
|
||||
});
|
||||
mockGetCurrent.mockResolvedValue(null);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
// Falls through to intent, which returns null
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
test('skips CLI parsing when hasCli is false', async () => {
|
||||
mockHasCli = false;
|
||||
mockGetCurrent.mockResolvedValue(null);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(mockGetMatches).not.toHaveBeenCalled();
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
test('handles null args from CLI', async () => {
|
||||
mockHasCli = true;
|
||||
mockGetMatches.mockResolvedValue({ args: null });
|
||||
mockGetCurrent.mockResolvedValue(null);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
// ── Intent / Deep Link ────────────────────────────────────────
|
||||
describe('intent open with files', () => {
|
||||
test('parses file:// URLs', async () => {
|
||||
mockGetCurrent.mockResolvedValue(['file:///path/to/book.epub']);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['/path/to/book.epub']);
|
||||
});
|
||||
|
||||
test('preserves file:// prefix for iOS', async () => {
|
||||
const mockAppService = { isIOSApp: true } as MockAppService;
|
||||
mockGetCurrent.mockResolvedValue(['file:///path/to/book.epub']);
|
||||
|
||||
const result = await parseOpenWithFiles(mockAppService as never);
|
||||
|
||||
expect(result).toEqual(['file:///path/to/book.epub']);
|
||||
});
|
||||
|
||||
test('handles content:// URLs (Android)', async () => {
|
||||
mockGetCurrent.mockResolvedValue(['content://com.example/book.epub']);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['content://com.example/book.epub']);
|
||||
});
|
||||
|
||||
test('filters out non-file, non-content URLs', async () => {
|
||||
mockGetCurrent.mockResolvedValue([
|
||||
'file:///path/book.epub',
|
||||
'https://example.com/book.epub',
|
||||
'content://com.example/book2.epub',
|
||||
]);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['/path/book.epub', 'content://com.example/book2.epub']);
|
||||
});
|
||||
|
||||
test('decodes URI-encoded file paths', async () => {
|
||||
mockGetCurrent.mockResolvedValue(['file:///path/to/my%20book.epub']);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['/path/to/my book.epub']);
|
||||
});
|
||||
|
||||
test('returns null when no deep link URLs', async () => {
|
||||
mockGetCurrent.mockResolvedValue(null);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
|
||||
test('returns null when deep link returns empty array', async () => {
|
||||
mockGetCurrent.mockResolvedValue([]);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
// ── Priority / fallthrough ─────────────────────────────────────
|
||||
describe('fallthrough logic', () => {
|
||||
test('uses window params first, skips CLI and intent', async () => {
|
||||
Object.defineProperty(window, 'location', {
|
||||
value: { ...window.location, search: '?file=from-url.epub' },
|
||||
writable: true,
|
||||
});
|
||||
mockHasCli = true;
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['from-url.epub']);
|
||||
expect(mockGetMatches).not.toHaveBeenCalled();
|
||||
expect(mockGetCurrent).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('falls through from empty window params to CLI', async () => {
|
||||
mockHasCli = true;
|
||||
mockGetMatches.mockResolvedValue({
|
||||
args: {
|
||||
file1: { value: '/cli-file.epub', occurrences: 1 },
|
||||
file2: { value: '', occurrences: 0 },
|
||||
file3: { value: '', occurrences: 0 },
|
||||
file4: { value: '', occurrences: 0 },
|
||||
},
|
||||
});
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['/cli-file.epub']);
|
||||
expect(mockGetCurrent).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('falls through from empty window params and no CLI to intent', async () => {
|
||||
mockHasCli = false;
|
||||
mockGetCurrent.mockResolvedValue(['file:///intent-file.epub']);
|
||||
|
||||
const result = await parseOpenWithFiles(null);
|
||||
|
||||
expect(result).toEqual(['/intent-file.epub']);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,155 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
|
||||
const getModule = async () => {
|
||||
return await import('../../helpers/shortcuts');
|
||||
};
|
||||
|
||||
const getDefaults = async () => {
|
||||
const mod = await getModule();
|
||||
return mod.loadShortcuts();
|
||||
};
|
||||
|
||||
describe('Shortcut entry structure', () => {
|
||||
it('each shortcut entry has keys, description, and section', async () => {
|
||||
const shortcuts = await getDefaults();
|
||||
for (const [name, entry] of Object.entries(shortcuts)) {
|
||||
expect(entry, `${name} should have keys array`).toHaveProperty('keys');
|
||||
expect(Array.isArray(entry.keys), `${name}.keys should be an array`).toBe(true);
|
||||
expect(entry, `${name} should have description`).toHaveProperty('description');
|
||||
expect(typeof entry.description, `${name}.description should be a string`).toBe('string');
|
||||
expect(entry, `${name} should have section`).toHaveProperty('section');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('TTS play/pause shortcut', () => {
|
||||
it('should have onTTSPlayPause shortcut with space', async () => {
|
||||
const shortcuts = await getDefaults();
|
||||
expect(shortcuts.onTTSPlayPause.keys).toEqual([' ']);
|
||||
});
|
||||
|
||||
it('should also have space in onGoRight as fallback', async () => {
|
||||
const shortcuts = await getDefaults();
|
||||
expect(shortcuts.onGoRight.keys).toContain(' ');
|
||||
});
|
||||
});
|
||||
|
||||
describe('TTS navigation shortcuts', () => {
|
||||
it('should have onTTSGoNextSentence shortcut with ctrl+] and cmd+]', async () => {
|
||||
const shortcuts = await getDefaults();
|
||||
expect(shortcuts.onTTSGoNextSentence.keys).toEqual(['ctrl+]', 'cmd+]']);
|
||||
});
|
||||
|
||||
it('should have onTTSGoPreviousSentence shortcut with ctrl+[ and cmd+[', async () => {
|
||||
const shortcuts = await getDefaults();
|
||||
expect(shortcuts.onTTSGoPreviousSentence.keys).toEqual(['ctrl+[', 'cmd+[']);
|
||||
});
|
||||
|
||||
it('should have onTTSGoNextParagraph shortcut with ctrl+shift+} and cmd+shift+}', async () => {
|
||||
const shortcuts = await getDefaults();
|
||||
expect(shortcuts.onTTSGoNextParagraph.keys).toEqual(['ctrl+shift+}', 'cmd+shift+}']);
|
||||
});
|
||||
|
||||
it('should have onTTSGoPreviousParagraph shortcut with ctrl+shift+{ and cmd+shift+{', async () => {
|
||||
const shortcuts = await getDefaults();
|
||||
expect(shortcuts.onTTSGoPreviousParagraph.keys).toEqual(['ctrl+shift+{', 'cmd+shift+{']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('No identical keybinding lists across actions (#3675)', () => {
|
||||
// Pre-existing pairs where two actions intentionally share the exact
|
||||
// same key list — both handlers guard on runtime context.
|
||||
// TODO: consider giving these distinct bindings to avoid the same
|
||||
// class of bug as #3675.
|
||||
const KNOWN_PAIRS: ReadonlySet<string> = new Set([
|
||||
'onSearchSelection,onShowSearchBar', // ctrl+f / cmd+f
|
||||
'onCloseWindow,onWikipediaSelection', // ctrl+w / cmd+w
|
||||
]);
|
||||
|
||||
it('should not have two actions with exactly the same key list', async () => {
|
||||
const shortcuts = await getDefaults();
|
||||
const keyListToActions = new Map<string, string[]>();
|
||||
for (const [name, entry] of Object.entries(shortcuts)) {
|
||||
const id = [...entry.keys].sort().join(',').toLowerCase();
|
||||
const actions = keyListToActions.get(id) ?? [];
|
||||
actions.push(name);
|
||||
keyListToActions.set(id, actions);
|
||||
}
|
||||
const duplicates: string[] = [];
|
||||
for (const [keys, actions] of keyListToActions) {
|
||||
if (actions.length > 1) {
|
||||
const pairId = [...actions].sort().join(',');
|
||||
if (!KNOWN_PAIRS.has(pairId)) {
|
||||
duplicates.push(`[${keys}] is shared by: ${actions.join(', ')}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
expect(
|
||||
duplicates,
|
||||
`Actions with identical keybinding lists:\n${duplicates.join('\n')}`,
|
||||
).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getShortcutsForDisplay', () => {
|
||||
it('returns sections in the correct order', async () => {
|
||||
const mod = await getModule();
|
||||
const result = mod.getShortcutsForDisplay(true);
|
||||
const sectionNames = result.map((s) => s.section);
|
||||
expect(sectionNames).toEqual([
|
||||
'General',
|
||||
'Navigation',
|
||||
'Text to Speech',
|
||||
'Selection',
|
||||
'Zoom',
|
||||
'Window',
|
||||
]);
|
||||
});
|
||||
|
||||
it('excludes entries with empty section', async () => {
|
||||
const mod = await getModule();
|
||||
const result = mod.getShortcutsForDisplay(true);
|
||||
const allDescriptions = result.flatMap((s) => s.items.map((i) => i.description));
|
||||
// onEscape and onSaveNote have empty section, should be excluded
|
||||
const shortcuts = mod.loadShortcuts();
|
||||
const hiddenEntries = Object.values(shortcuts).filter((e) => e.section === '');
|
||||
for (const hidden of hiddenEntries) {
|
||||
expect(allDescriptions).not.toContain(hidden.description);
|
||||
}
|
||||
});
|
||||
|
||||
it('each item has a description and non-empty keys', async () => {
|
||||
const mod = await getModule();
|
||||
const result = mod.getShortcutsForDisplay(false);
|
||||
for (const section of result) {
|
||||
for (const item of section.items) {
|
||||
expect(item.description.length).toBeGreaterThan(0);
|
||||
expect(item.keys.length).toBeGreaterThan(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it('on Mac, returns cmd-prefixed keys for onShowSearchBar', async () => {
|
||||
const mod = await getModule();
|
||||
const result = mod.getShortcutsForDisplay(true);
|
||||
const general = result.find((s) => s.section === 'General');
|
||||
const searchItem = general?.items.find((i) =>
|
||||
i.keys.some((k) => k.includes('cmd') || k.includes('f')),
|
||||
);
|
||||
expect(searchItem).toBeDefined();
|
||||
expect(searchItem!.keys.some((k) => k.includes('cmd'))).toBe(true);
|
||||
expect(searchItem!.keys.some((k) => k.includes('ctrl'))).toBe(false);
|
||||
});
|
||||
|
||||
it('on non-Mac, returns ctrl-prefixed keys for onShowSearchBar', async () => {
|
||||
const mod = await getModule();
|
||||
const result = mod.getShortcutsForDisplay(false);
|
||||
const general = result.find((s) => s.section === 'General');
|
||||
const searchItem = general?.items.find((i) =>
|
||||
i.keys.some((k) => k.includes('ctrl') || k.includes('f')),
|
||||
);
|
||||
expect(searchItem).toBeDefined();
|
||||
expect(searchItem!.keys.some((k) => k.includes('ctrl'))).toBe(true);
|
||||
expect(searchItem!.keys.some((k) => k.includes('cmd'))).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -45,8 +45,7 @@ export const setupSupabaseMocks = async (
|
||||
eq: vi.fn().mockResolvedValue(customResponses.update || { data: {}, error: null }),
|
||||
})),
|
||||
insert: vi.fn().mockResolvedValue(customResponses.insert || { data: {}, error: null }),
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any);
|
||||
} as unknown as ReturnType<typeof supabase.from>);
|
||||
|
||||
vi.mocked(createSupabaseAdminClient).mockReturnValue({
|
||||
from: vi.fn(() => ({
|
||||
@@ -102,6 +101,5 @@ export const setupSupabaseMocks = async (
|
||||
match: vi.fn().mockResolvedValue(customResponses.adminDelete || { data: {}, error: null }),
|
||||
})),
|
||||
})),
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any);
|
||||
} as unknown as ReturnType<typeof createSupabaseAdminClient>);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,365 @@
|
||||
import { describe, test, expect, beforeEach, afterEach, vi } from 'vitest';
|
||||
import semver from 'semver';
|
||||
|
||||
// ── Mocks for Tauri and internal modules ─────────────────────────
|
||||
const mockCheck = vi.fn();
|
||||
const mockOsType = vi.fn();
|
||||
const mockTauriFetch = vi.fn();
|
||||
|
||||
vi.mock('@tauri-apps/plugin-updater', () => ({
|
||||
check: (...args: unknown[]) => mockCheck(...args),
|
||||
}));
|
||||
|
||||
vi.mock('@tauri-apps/plugin-os', () => ({
|
||||
type: () => mockOsType(),
|
||||
}));
|
||||
|
||||
vi.mock('@tauri-apps/plugin-http', () => ({
|
||||
fetch: (...args: unknown[]) => mockTauriFetch(...args),
|
||||
}));
|
||||
|
||||
// WebviewWindow is used with `new`, so the mock must be a constructor
|
||||
const mockWebviewWindowOnce = vi.fn();
|
||||
const MockWebviewWindowLastArgs: unknown[][] = [];
|
||||
vi.mock('@tauri-apps/api/webviewWindow', () => {
|
||||
return {
|
||||
WebviewWindow: class MockWebviewWindow {
|
||||
once = mockWebviewWindowOnce;
|
||||
constructor(...args: unknown[]) {
|
||||
MockWebviewWindowLastArgs.push(args);
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
const mockSetUpdaterWindowVisible = vi.fn();
|
||||
vi.mock('@/components/UpdaterWindow', () => ({
|
||||
setUpdaterWindowVisible: (...args: unknown[]) => mockSetUpdaterWindowVisible(...args),
|
||||
}));
|
||||
|
||||
let mockIsTauriAppPlatform = false;
|
||||
vi.mock('@/services/environment', () => ({
|
||||
isTauriAppPlatform: () => mockIsTauriAppPlatform,
|
||||
}));
|
||||
|
||||
let mockAppVersion = '1.0.0';
|
||||
vi.mock('@/utils/version', () => ({
|
||||
getAppVersion: () => mockAppVersion,
|
||||
}));
|
||||
|
||||
vi.mock('@/services/constants', () => ({
|
||||
CHECK_UPDATE_INTERVAL_SEC: 86400,
|
||||
READEST_UPDATER_FILE: 'https://example.com/latest.json',
|
||||
READEST_CHANGELOG_FILE: 'https://example.com/release-notes.json',
|
||||
}));
|
||||
|
||||
import {
|
||||
checkForAppUpdates,
|
||||
checkAppReleaseNotes,
|
||||
setLastShownReleaseNotesVersion,
|
||||
getLastShownReleaseNotesVersion,
|
||||
} from '@/helpers/updater';
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
localStorage.clear();
|
||||
mockIsTauriAppPlatform = false;
|
||||
mockAppVersion = '1.0.0';
|
||||
MockWebviewWindowLastArgs.length = 0;
|
||||
vi.spyOn(console, 'log').mockImplementation(() => {});
|
||||
vi.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
// ── Helper to create a dummy TranslationFunc ─────────────────────
|
||||
const dummyTranslate = (key: string) => key;
|
||||
|
||||
describe('updater', () => {
|
||||
// ── setLastShownReleaseNotesVersion / getLastShownReleaseNotesVersion ──
|
||||
describe('release notes version tracking', () => {
|
||||
test('getLastShownReleaseNotesVersion returns empty string when not set', () => {
|
||||
expect(getLastShownReleaseNotesVersion()).toBe('');
|
||||
});
|
||||
|
||||
test('setLastShownReleaseNotesVersion stores value in localStorage', () => {
|
||||
setLastShownReleaseNotesVersion('2.0.0');
|
||||
expect(getLastShownReleaseNotesVersion()).toBe('2.0.0');
|
||||
});
|
||||
|
||||
test('overwrites previous value', () => {
|
||||
setLastShownReleaseNotesVersion('1.0.0');
|
||||
setLastShownReleaseNotesVersion('2.0.0');
|
||||
expect(getLastShownReleaseNotesVersion()).toBe('2.0.0');
|
||||
});
|
||||
});
|
||||
|
||||
// ── checkForAppUpdates ─────────────────────────────────────────
|
||||
describe('checkForAppUpdates', () => {
|
||||
test('skips check when auto-check and interval has not elapsed', async () => {
|
||||
const now = Date.now();
|
||||
localStorage.setItem('lastAppUpdateCheck', now.toString());
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, true);
|
||||
|
||||
expect(result).toBe(false);
|
||||
expect(mockCheck).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('proceeds with check when interval has elapsed', async () => {
|
||||
const pastTime = Date.now() - 86400 * 1000 - 1000;
|
||||
localStorage.setItem('lastAppUpdateCheck', pastTime.toString());
|
||||
|
||||
mockOsType.mockReturnValue('macos');
|
||||
mockCheck.mockResolvedValue(null);
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, true);
|
||||
|
||||
expect(result).toBe(false);
|
||||
expect(mockCheck).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('proceeds when no previous check timestamp', async () => {
|
||||
mockOsType.mockReturnValue('macos');
|
||||
mockCheck.mockResolvedValue(null);
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, true);
|
||||
|
||||
expect(result).toBe(false);
|
||||
expect(mockCheck).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('always checks when isAutoCheck is false', async () => {
|
||||
const now = Date.now();
|
||||
localStorage.setItem('lastAppUpdateCheck', now.toString());
|
||||
|
||||
mockOsType.mockReturnValue('macos');
|
||||
mockCheck.mockResolvedValue(null);
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, false);
|
||||
|
||||
expect(result).toBe(false);
|
||||
expect(mockCheck).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('returns true and shows update window when update available on macOS', async () => {
|
||||
mockOsType.mockReturnValue('macos');
|
||||
mockCheck.mockResolvedValue({ version: '2.0.0' });
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, false);
|
||||
|
||||
expect(result).toBe(true);
|
||||
expect(MockWebviewWindowLastArgs).toHaveLength(1);
|
||||
expect(MockWebviewWindowLastArgs[0]![0]).toBe('updater');
|
||||
expect(MockWebviewWindowLastArgs[0]![1]).toEqual(
|
||||
expect.objectContaining({
|
||||
url: '/updater?latestVersion=2.0.0',
|
||||
title: 'Software Update',
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
test('handles windows platform', async () => {
|
||||
mockOsType.mockReturnValue('windows');
|
||||
mockCheck.mockResolvedValue(null);
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, false);
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
test('handles linux platform', async () => {
|
||||
mockOsType.mockReturnValue('linux');
|
||||
mockCheck.mockResolvedValue({ version: '3.0.0' });
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, false);
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
|
||||
test('checks Android update via fetch when OS is android', async () => {
|
||||
mockOsType.mockReturnValue('android');
|
||||
mockAppVersion = '1.0.0';
|
||||
|
||||
mockTauriFetch.mockResolvedValue({
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
version: '2.0.0',
|
||||
platforms: { 'android-arm64': {} },
|
||||
}),
|
||||
});
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, false);
|
||||
|
||||
expect(result).toBe(true);
|
||||
expect(mockSetUpdaterWindowVisible).toHaveBeenCalledWith(true, '2.0.0', '1.0.0');
|
||||
});
|
||||
|
||||
test('Android check with android-universal platform', async () => {
|
||||
mockOsType.mockReturnValue('android');
|
||||
mockAppVersion = '1.0.0';
|
||||
|
||||
mockTauriFetch.mockResolvedValue({
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
version: '2.0.0',
|
||||
platforms: { 'android-universal': {} },
|
||||
}),
|
||||
});
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, false);
|
||||
|
||||
expect(result).toBe(true);
|
||||
expect(mockSetUpdaterWindowVisible).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('Android returns false when version is not newer', async () => {
|
||||
mockOsType.mockReturnValue('android');
|
||||
mockAppVersion = '2.0.0';
|
||||
|
||||
mockTauriFetch.mockResolvedValue({
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
version: '1.0.0',
|
||||
platforms: { 'android-arm64': {} },
|
||||
}),
|
||||
});
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, false);
|
||||
|
||||
expect(result).toBe(false);
|
||||
expect(mockSetUpdaterWindowVisible).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('Android fetch failure throws error', async () => {
|
||||
mockOsType.mockReturnValue('android');
|
||||
|
||||
mockTauriFetch.mockRejectedValue(new Error('Network error'));
|
||||
|
||||
await expect(checkForAppUpdates(dummyTranslate, false)).rejects.toThrow(
|
||||
'Failed to fetch Android update info',
|
||||
);
|
||||
});
|
||||
|
||||
test('returns false for unsupported OS types', async () => {
|
||||
mockOsType.mockReturnValue('ios');
|
||||
|
||||
const result = await checkForAppUpdates(dummyTranslate, false);
|
||||
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
test('stores check timestamp in localStorage', async () => {
|
||||
mockOsType.mockReturnValue('macos');
|
||||
mockCheck.mockResolvedValue(null);
|
||||
|
||||
const before = Date.now();
|
||||
await checkForAppUpdates(dummyTranslate, false);
|
||||
const after = Date.now();
|
||||
|
||||
const stored = parseInt(localStorage.getItem('lastAppUpdateCheck')!, 10);
|
||||
expect(stored).toBeGreaterThanOrEqual(before);
|
||||
expect(stored).toBeLessThanOrEqual(after);
|
||||
});
|
||||
});
|
||||
|
||||
// ── checkAppReleaseNotes ───────────────────────────────────────
|
||||
describe('checkAppReleaseNotes', () => {
|
||||
test('shows release notes when current version is newer than last shown', async () => {
|
||||
mockAppVersion = '2.0.0';
|
||||
setLastShownReleaseNotesVersion('1.0.0');
|
||||
|
||||
const mockFetchFn = vi.fn().mockResolvedValue({ ok: true });
|
||||
vi.stubGlobal('fetch', mockFetchFn);
|
||||
|
||||
const result = await checkAppReleaseNotes(true);
|
||||
|
||||
expect(result).toBe(true);
|
||||
expect(mockSetUpdaterWindowVisible).toHaveBeenCalledWith(true, '2.0.0', '1.0.0', false);
|
||||
});
|
||||
|
||||
test('returns false when current version equals last shown', async () => {
|
||||
mockAppVersion = '1.0.0';
|
||||
setLastShownReleaseNotesVersion('1.0.0');
|
||||
|
||||
const result = await checkAppReleaseNotes(true);
|
||||
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
test('sets current version as last shown when no previous version recorded', async () => {
|
||||
mockAppVersion = '1.5.0';
|
||||
|
||||
const result = await checkAppReleaseNotes(true);
|
||||
|
||||
expect(result).toBe(false);
|
||||
expect(getLastShownReleaseNotesVersion()).toBe('1.5.0');
|
||||
});
|
||||
|
||||
test('shows release notes when isAutoCheck is false regardless of version comparison', async () => {
|
||||
mockAppVersion = '1.0.0';
|
||||
setLastShownReleaseNotesVersion('1.0.0');
|
||||
|
||||
const mockFetchFn = vi.fn().mockResolvedValue({ ok: true });
|
||||
vi.stubGlobal('fetch', mockFetchFn);
|
||||
|
||||
const result = await checkAppReleaseNotes(false);
|
||||
|
||||
expect(result).toBe(true);
|
||||
expect(mockSetUpdaterWindowVisible).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('returns false when fetch fails', async () => {
|
||||
mockAppVersion = '2.0.0';
|
||||
setLastShownReleaseNotesVersion('1.0.0');
|
||||
|
||||
const mockFetchFn = vi.fn().mockRejectedValue(new Error('Network error'));
|
||||
vi.stubGlobal('fetch', mockFetchFn);
|
||||
|
||||
const result = await checkAppReleaseNotes(true);
|
||||
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false when fetch response is not ok', async () => {
|
||||
mockAppVersion = '2.0.0';
|
||||
setLastShownReleaseNotesVersion('1.0.0');
|
||||
|
||||
const mockFetchFn = vi.fn().mockResolvedValue({ ok: false });
|
||||
vi.stubGlobal('fetch', mockFetchFn);
|
||||
|
||||
const result = await checkAppReleaseNotes(true);
|
||||
|
||||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
test('uses tauri fetch when on tauri platform', async () => {
|
||||
mockIsTauriAppPlatform = true;
|
||||
mockAppVersion = '2.0.0';
|
||||
setLastShownReleaseNotesVersion('1.0.0');
|
||||
|
||||
mockTauriFetch.mockResolvedValue({ ok: true });
|
||||
|
||||
const result = await checkAppReleaseNotes(true);
|
||||
|
||||
expect(result).toBe(true);
|
||||
expect(mockTauriFetch).toHaveBeenCalledWith('https://example.com/release-notes.json');
|
||||
});
|
||||
});
|
||||
|
||||
// ── semver usage validation ────────────────────────────────────
|
||||
describe('semver gt (sanity checks for the logic used)', () => {
|
||||
test('2.0.0 is greater than 1.0.0', () => {
|
||||
expect(semver.gt('2.0.0', '1.0.0')).toBe(true);
|
||||
});
|
||||
|
||||
test('1.0.0 is not greater than 2.0.0', () => {
|
||||
expect(semver.gt('1.0.0', '2.0.0')).toBe(false);
|
||||
});
|
||||
|
||||
test('equal versions return false', () => {
|
||||
expect(semver.gt('1.0.0', '1.0.0')).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,188 @@
|
||||
import { cleanup, render, act } from '@testing-library/react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { useRef } from 'react';
|
||||
import {
|
||||
useSpatialNavigation,
|
||||
_resetLastKeyboardTime,
|
||||
} from '@/app/reader/hooks/useSpatialNavigation';
|
||||
|
||||
function TestToolbar({ isVisible }: { isVisible: boolean }) {
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
useSpatialNavigation(ref, isVisible);
|
||||
|
||||
return (
|
||||
<div ref={ref} data-testid='toolbar'>
|
||||
<button data-testid='btn-1'>Button 1</button>
|
||||
<button data-testid='btn-2'>Button 2</button>
|
||||
<button data-testid='btn-3'>Button 3</button>
|
||||
<button disabled data-testid='btn-disabled'>
|
||||
Disabled
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function TestHeaderFooter({ isVisible }: { isVisible: boolean }) {
|
||||
const headerRef = useRef<HTMLDivElement>(null);
|
||||
const footerRef = useRef<HTMLDivElement>(null);
|
||||
useSpatialNavigation(headerRef, isVisible);
|
||||
useSpatialNavigation(footerRef, isVisible);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div ref={headerRef} className='header-bar' data-testid='header'>
|
||||
<button data-testid='header-btn-1'>H1</button>
|
||||
<button data-testid='header-btn-2'>H2</button>
|
||||
</div>
|
||||
<div ref={footerRef} className='footer-bar' data-testid='footer'>
|
||||
<button data-testid='footer-btn-1'>F1</button>
|
||||
<button data-testid='footer-btn-2'>F2</button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function pressKey(element: HTMLElement, key: string) {
|
||||
const event = new KeyboardEvent('keydown', {
|
||||
key,
|
||||
bubbles: true,
|
||||
cancelable: true,
|
||||
});
|
||||
const spy = vi.spyOn(event, 'stopPropagation');
|
||||
element.dispatchEvent(event);
|
||||
return { event, stopPropagationCalled: spy.mock.calls.length > 0 };
|
||||
}
|
||||
|
||||
function simulateKeyboardActivation() {
|
||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }));
|
||||
}
|
||||
|
||||
async function waitForAutoFocus() {
|
||||
await act(() => new Promise((r) => setTimeout(r, 150)));
|
||||
}
|
||||
|
||||
describe('useToolbarKeyNavigation', () => {
|
||||
beforeEach(() => {
|
||||
_resetLastKeyboardTime();
|
||||
});
|
||||
afterEach(() => cleanup());
|
||||
|
||||
describe('auto-focus', () => {
|
||||
it('focuses first enabled button when keyboard-activated', async () => {
|
||||
simulateKeyboardActivation();
|
||||
render(<TestToolbar isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
expect(document.activeElement).toBe(document.querySelector('[data-testid="btn-1"]'));
|
||||
});
|
||||
|
||||
it('does not auto-focus when not visible', async () => {
|
||||
simulateKeyboardActivation();
|
||||
render(<TestToolbar isVisible={false} />);
|
||||
await waitForAutoFocus();
|
||||
expect(document.activeElement).not.toBe(document.querySelector('[data-testid="btn-1"]'));
|
||||
});
|
||||
|
||||
it('does not auto-focus when mouse-activated (no recent keyboard)', async () => {
|
||||
// No simulateKeyboardActivation() — simulates mouse hover activation
|
||||
render(<TestToolbar isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
expect(document.activeElement).not.toBe(document.querySelector('[data-testid="btn-1"]'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('left/right navigation', () => {
|
||||
it('ArrowRight moves focus to the next button', async () => {
|
||||
simulateKeyboardActivation();
|
||||
render(<TestToolbar isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
|
||||
const btn1 = document.querySelector<HTMLElement>('[data-testid="btn-1"]')!;
|
||||
const btn2 = document.querySelector<HTMLElement>('[data-testid="btn-2"]')!;
|
||||
expect(document.activeElement).toBe(btn1);
|
||||
|
||||
pressKey(btn1, 'ArrowRight');
|
||||
expect(document.activeElement).toBe(btn2);
|
||||
});
|
||||
|
||||
it('ArrowLeft moves focus to the previous button', async () => {
|
||||
simulateKeyboardActivation();
|
||||
render(<TestToolbar isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
|
||||
const btn1 = document.querySelector<HTMLElement>('[data-testid="btn-1"]')!;
|
||||
const btn2 = document.querySelector<HTMLElement>('[data-testid="btn-2"]')!;
|
||||
|
||||
btn2.focus();
|
||||
pressKey(btn2, 'ArrowLeft');
|
||||
expect(document.activeElement).toBe(btn1);
|
||||
});
|
||||
|
||||
it('ArrowRight does not go past the last enabled button', async () => {
|
||||
simulateKeyboardActivation();
|
||||
render(<TestToolbar isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
|
||||
const btn3 = document.querySelector<HTMLElement>('[data-testid="btn-3"]')!;
|
||||
btn3.focus();
|
||||
pressKey(btn3, 'ArrowRight');
|
||||
expect(document.activeElement).toBe(btn3);
|
||||
});
|
||||
|
||||
it('ArrowLeft does not go before the first button', async () => {
|
||||
simulateKeyboardActivation();
|
||||
render(<TestToolbar isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
|
||||
const btn1 = document.querySelector<HTMLElement>('[data-testid="btn-1"]')!;
|
||||
pressKey(btn1, 'ArrowLeft');
|
||||
expect(document.activeElement).toBe(btn1);
|
||||
});
|
||||
|
||||
it('ArrowRight calls stopPropagation', async () => {
|
||||
simulateKeyboardActivation();
|
||||
render(<TestToolbar isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
|
||||
const btn1 = document.querySelector<HTMLElement>('[data-testid="btn-1"]')!;
|
||||
const { stopPropagationCalled } = pressKey(btn1, 'ArrowRight');
|
||||
expect(stopPropagationCalled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('up/down navigation between header and footer', () => {
|
||||
it('ArrowDown from header focuses first footer button', async () => {
|
||||
render(<TestHeaderFooter isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
|
||||
const headerBtn = document.querySelector<HTMLElement>('[data-testid="header-btn-1"]')!;
|
||||
const footerBtn1 = document.querySelector<HTMLElement>('[data-testid="footer-btn-1"]')!;
|
||||
|
||||
headerBtn.focus();
|
||||
pressKey(headerBtn, 'ArrowDown');
|
||||
expect(document.activeElement).toBe(footerBtn1);
|
||||
});
|
||||
|
||||
it('ArrowUp from footer focuses first header button', async () => {
|
||||
render(<TestHeaderFooter isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
|
||||
const headerBtn1 = document.querySelector<HTMLElement>('[data-testid="header-btn-1"]')!;
|
||||
const footerBtn = document.querySelector<HTMLElement>('[data-testid="footer-btn-1"]')!;
|
||||
|
||||
footerBtn.focus();
|
||||
pressKey(footerBtn, 'ArrowUp');
|
||||
expect(document.activeElement).toBe(headerBtn1);
|
||||
});
|
||||
|
||||
it('ArrowDown from header calls stopPropagation', async () => {
|
||||
render(<TestHeaderFooter isVisible={true} />);
|
||||
await waitForAutoFocus();
|
||||
|
||||
const headerBtn = document.querySelector<HTMLElement>('[data-testid="header-btn-1"]')!;
|
||||
headerBtn.focus();
|
||||
|
||||
const { stopPropagationCalled } = pressKey(headerBtn, 'ArrowDown');
|
||||
expect(stopPropagationCalled).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,243 @@
|
||||
import { act, cleanup, render } from '@testing-library/react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
// --- Dependency mocks (must be set up before importing the hook) ---
|
||||
|
||||
vi.mock('@/context/EnvContext', () => ({
|
||||
useEnv: () => ({
|
||||
appService: { isIOSApp: false, isMobile: false },
|
||||
envConfig: {},
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/context/AuthContext', () => ({
|
||||
useAuth: () => ({ user: null }),
|
||||
}));
|
||||
|
||||
vi.mock('@/store/themeStore', () => ({
|
||||
useThemeStore: () => ({ isDarkMode: false }),
|
||||
}));
|
||||
|
||||
const mockView = {
|
||||
book: { primaryLanguage: 'en', sections: [{ id: 0 }] },
|
||||
renderer: {
|
||||
getContents: () => [{ index: 0, doc: document as unknown as Document }],
|
||||
scrollToAnchor: vi.fn(),
|
||||
primaryIndex: 0,
|
||||
scrolled: false,
|
||||
nextSection: vi.fn(),
|
||||
start: 0,
|
||||
end: 0,
|
||||
sideProp: 'height',
|
||||
goTo: vi.fn(),
|
||||
},
|
||||
resolveCFI: vi.fn().mockReturnValue({ index: 0, anchor: () => new Range() }),
|
||||
getCFI: vi.fn().mockReturnValue('cfi'),
|
||||
deselect: vi.fn(),
|
||||
resolveNavigation: vi.fn(),
|
||||
history: { back: vi.fn(), forward: vi.fn() },
|
||||
tts: {
|
||||
from: vi.fn().mockReturnValue('<speak>hello</speak>'),
|
||||
start: vi.fn().mockReturnValue('<speak>hello</speak>'),
|
||||
getLastRange: vi.fn().mockReturnValue(null),
|
||||
highlight: vi.fn(),
|
||||
},
|
||||
};
|
||||
|
||||
const mockProgress = {
|
||||
location: { start: { cfi: '' }, end: { cfi: '' } },
|
||||
index: 0,
|
||||
range: null,
|
||||
sectionLabel: '',
|
||||
};
|
||||
|
||||
const mockViewSettings = {
|
||||
ttsLocation: null as string | null,
|
||||
ttsRate: 1,
|
||||
ttsHighlightOptions: { style: 'highlight', color: '#ffff00' },
|
||||
isEink: false,
|
||||
showTTSBar: false,
|
||||
ttsMediaMetadata: 'sentence',
|
||||
translationEnabled: false,
|
||||
ttsReadAloudText: 'source',
|
||||
};
|
||||
|
||||
const mockBookData = {
|
||||
isFixedLayout: false,
|
||||
book: { primaryLanguage: 'en', title: 'T', author: 'A', coverImageUrl: '' },
|
||||
};
|
||||
|
||||
vi.mock('@/store/readerStore', () => {
|
||||
const store = {
|
||||
hoveredBookKey: null,
|
||||
getView: () => mockView,
|
||||
getProgress: () => mockProgress,
|
||||
getViewSettings: () => mockViewSettings,
|
||||
setViewSettings: vi.fn(),
|
||||
setTTSEnabled: vi.fn(),
|
||||
};
|
||||
const useReaderStore = () => store;
|
||||
useReaderStore.getState = () => store;
|
||||
return { useReaderStore };
|
||||
});
|
||||
|
||||
vi.mock('@/store/bookDataStore', () => ({
|
||||
useBookDataStore: () => ({
|
||||
getBookData: () => mockBookData,
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/store/proofreadStore', () => ({
|
||||
useProofreadStore: () => ({
|
||||
getMergedRules: () => [],
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/services/transformers/proofread', () => ({
|
||||
proofreadTransformer: {
|
||||
transform: vi.fn(async (ctx: { content: string }) => ctx.content),
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('@/hooks/useTranslation', () => ({
|
||||
useTranslation: () => (s: string) => s,
|
||||
}));
|
||||
|
||||
// Track TTSController instantiations — this is the assertion target.
|
||||
const ttsControllerInstances: unknown[] = [];
|
||||
// Gate init() calls so that handleTTSSpeak stays suspended inside an `await`.
|
||||
// This is the exact point where a second concurrent invocation would otherwise
|
||||
// race ahead and construct a second TTSController. The test releases all
|
||||
// pending resolvers once both dispatches have had a chance to interleave.
|
||||
const pendingInitResolvers: Array<() => void> = [];
|
||||
|
||||
vi.mock('@/services/tts', () => ({
|
||||
TTSController: vi.fn().mockImplementation(function (this: Record<string, unknown>) {
|
||||
Object.assign(this, {
|
||||
init: vi.fn().mockImplementation(
|
||||
() =>
|
||||
new Promise<void>((resolve) => {
|
||||
pendingInitResolvers.push(() => resolve());
|
||||
}),
|
||||
),
|
||||
initViewTTS: vi.fn().mockResolvedValue(undefined),
|
||||
updateHighlightOptions: vi.fn(),
|
||||
setLang: vi.fn(),
|
||||
setRate: vi.fn(),
|
||||
setVoice: vi.fn(),
|
||||
setTargetLang: vi.fn(),
|
||||
speak: vi.fn(),
|
||||
pause: vi.fn().mockResolvedValue(undefined),
|
||||
resume: vi.fn().mockResolvedValue(undefined),
|
||||
stop: vi.fn().mockResolvedValue(undefined),
|
||||
shutdown: vi.fn().mockResolvedValue(undefined),
|
||||
forward: vi.fn().mockResolvedValue(undefined),
|
||||
backward: vi.fn().mockResolvedValue(undefined),
|
||||
getVoices: vi.fn().mockResolvedValue([]),
|
||||
getVoiceId: vi.fn().mockReturnValue(''),
|
||||
state: 'idle',
|
||||
addEventListener: vi.fn(),
|
||||
removeEventListener: vi.fn(),
|
||||
dispatchEvent: vi.fn(),
|
||||
});
|
||||
ttsControllerInstances.push(this);
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/libs/mediaSession', () => ({
|
||||
TauriMediaSession: class {},
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/ssml', () => ({
|
||||
genSSMLRaw: vi.fn((s: string) => `<speak>${s}</speak>`),
|
||||
parseSSMLLang: vi.fn(() => 'en'),
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/throttle', () => ({
|
||||
throttle: <T extends (...args: unknown[]) => unknown>(fn: T) => fn,
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/cfi', () => ({
|
||||
isCfiInLocation: () => false,
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/misc', () => ({
|
||||
getLocale: () => 'en',
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/ttsMetadata', () => ({
|
||||
buildTTSMediaMetadata: () => ({
|
||||
shouldUpdate: false,
|
||||
title: '',
|
||||
artist: '',
|
||||
album: '',
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/bridge', () => ({
|
||||
invokeUseBackgroundAudio: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/ttsTime', () => ({
|
||||
estimateTTSTime: () => ({
|
||||
chapterRemainingSec: 0,
|
||||
bookRemainingSec: 0,
|
||||
finishAtTimestamp: 0,
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@/app/reader/hooks/useTTSMediaSession', () => ({
|
||||
useTTSMediaSession: () => ({
|
||||
mediaSessionRef: { current: null },
|
||||
unblockAudio: vi.fn(),
|
||||
releaseUnblockAudio: vi.fn(),
|
||||
initMediaSession: vi.fn().mockResolvedValue(undefined),
|
||||
deinitMediaSession: vi.fn().mockResolvedValue(undefined),
|
||||
}),
|
||||
}));
|
||||
|
||||
// Imports must come AFTER vi.mock calls so they pick up the mocked modules.
|
||||
import { useTTSControl } from '@/app/reader/hooks/useTTSControl';
|
||||
import { eventDispatcher } from '@/utils/event';
|
||||
|
||||
const Harness = () => {
|
||||
useTTSControl({ bookKey: 'book-1' });
|
||||
return null;
|
||||
};
|
||||
|
||||
describe('useTTSControl concurrent tts-speak events', () => {
|
||||
beforeEach(() => {
|
||||
ttsControllerInstances.length = 0;
|
||||
pendingInitResolvers.length = 0;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
|
||||
it('creates only one TTSController when two tts-speak events fire back-to-back', async () => {
|
||||
render(<Harness />);
|
||||
|
||||
await act(async () => {
|
||||
// Kick off both dispatches without awaiting — this models rapid clicks
|
||||
// where the second click arrives while the first is still inside its
|
||||
// initial awaits (initMediaSession / backgroundAudio / init()).
|
||||
const p1 = eventDispatcher.dispatch('tts-speak', { bookKey: 'book-1' });
|
||||
const p2 = eventDispatcher.dispatch('tts-speak', { bookKey: 'book-1' });
|
||||
|
||||
// Let both invocations drain microtasks and reach their gated await.
|
||||
// Without the single-flight guard in handleTTSSpeak, both invocations
|
||||
// would construct a TTSController here and both would be queued in
|
||||
// pendingInitResolvers.
|
||||
for (let i = 0; i < 10; i++) await Promise.resolve();
|
||||
|
||||
// The assertion that matters: exactly one controller was constructed.
|
||||
expect(ttsControllerInstances.length).toBe(1);
|
||||
|
||||
// Release any pending init() promises so the dispatch chain can unwind
|
||||
// cleanly (otherwise the act() would never settle).
|
||||
while (pendingInitResolvers.length > 0) pendingInitResolvers.shift()!();
|
||||
await Promise.all([p1, p2]);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,283 @@
|
||||
import React from 'react';
|
||||
import { act, cleanup, fireEvent, render, waitFor } from '@testing-library/react';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import ParagraphOverlay from '@/app/reader/components/paragraph/ParagraphOverlay';
|
||||
import { useParagraphMode } from '@/app/reader/hooks/useParagraphMode';
|
||||
import type { FoliateView } from '@/types/view';
|
||||
import { eventDispatcher } from '@/utils/event';
|
||||
import {
|
||||
getParagraphActionForKey,
|
||||
getParagraphActionForZone,
|
||||
getParagraphPresentation,
|
||||
} from '@/utils/paragraphPresentation';
|
||||
|
||||
const currentViewSettings = {
|
||||
paragraphMode: { enabled: true },
|
||||
writingMode: 'horizontal-tb',
|
||||
vertical: false,
|
||||
rtl: false,
|
||||
};
|
||||
|
||||
const mockGetViewSettings = vi.fn(() => currentViewSettings);
|
||||
const mockSetViewSettings = vi.fn();
|
||||
const mockGetProgress = vi.fn(() => null);
|
||||
|
||||
vi.mock('@/context/EnvContext', () => ({
|
||||
useEnv: () => ({ envConfig: {}, appService: { hasSafeAreaInset: false } }),
|
||||
}));
|
||||
|
||||
vi.mock('@/helpers/settings', () => ({
|
||||
saveViewSettings: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/store/readerStore', () => ({
|
||||
useReaderStore: () => ({
|
||||
getViewSettings: mockGetViewSettings,
|
||||
setViewSettings: mockSetViewSettings,
|
||||
getProgress: mockGetProgress,
|
||||
}),
|
||||
}));
|
||||
|
||||
global.ResizeObserver = class ResizeObserver {
|
||||
constructor(private readonly callback: ResizeObserverCallback) {}
|
||||
|
||||
observe(target: Element) {
|
||||
this.callback([{ target } as ResizeObserverEntry], this);
|
||||
}
|
||||
|
||||
disconnect() {}
|
||||
|
||||
unobserve() {}
|
||||
} as typeof ResizeObserver;
|
||||
|
||||
const createDoc = (body: string): Document =>
|
||||
new DOMParser().parseFromString(`<html><body>${body}</body></html>`, 'text/html');
|
||||
|
||||
const attachDefaultView = (
|
||||
doc: Document,
|
||||
getComputedStyle: (element: Element) => CSSStyleDeclaration,
|
||||
) => {
|
||||
Object.defineProperty(doc, 'defaultView', {
|
||||
value: { getComputedStyle },
|
||||
configurable: true,
|
||||
});
|
||||
};
|
||||
|
||||
function createMockView(docs: Document[], initialPrimaryIndex: number) {
|
||||
const contents = docs.map((doc, index) => ({ doc, index }));
|
||||
|
||||
const renderer = {
|
||||
primaryIndex: initialPrimaryIndex,
|
||||
getContents: vi.fn(() => contents),
|
||||
nextSection: vi.fn(async () => {
|
||||
renderer.primaryIndex = Math.min(renderer.primaryIndex + 1, contents.length - 1);
|
||||
}),
|
||||
prevSection: vi.fn(async () => {
|
||||
renderer.primaryIndex = Math.max(renderer.primaryIndex - 1, 0);
|
||||
}),
|
||||
addEventListener: vi.fn(),
|
||||
removeEventListener: vi.fn(),
|
||||
goTo: vi.fn(),
|
||||
scrollToAnchor: vi.fn(),
|
||||
};
|
||||
|
||||
const view = {
|
||||
renderer,
|
||||
resolveCFI: vi.fn(),
|
||||
getCFI: vi.fn(() => 'epubcfi(/6/4!/4/2/1:0)'),
|
||||
} as unknown as FoliateView;
|
||||
|
||||
return { view, renderer };
|
||||
}
|
||||
|
||||
let hookApi: ReturnType<typeof useParagraphMode> | null = null;
|
||||
|
||||
const HookHarness = ({ view }: { view: React.RefObject<FoliateView | null> }) => {
|
||||
hookApi = useParagraphMode({ bookKey: 'book-1', viewRef: view });
|
||||
return null;
|
||||
};
|
||||
|
||||
describe('paragraph mode', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
hookApi = null;
|
||||
currentViewSettings.writingMode = 'horizontal-tb';
|
||||
currentViewSettings.vertical = false;
|
||||
currentViewSettings.rtl = false;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
|
||||
it('preserves source presentation and navigation rules', () => {
|
||||
const verticalDoc = createDoc('<p lang="ja">縦書きの段落です。</p>');
|
||||
const verticalParagraph = verticalDoc.querySelector('p')!;
|
||||
const verticalRange = verticalDoc.createRange();
|
||||
verticalRange.selectNodeContents(verticalParagraph);
|
||||
|
||||
attachDefaultView(verticalDoc, (element: Element) => {
|
||||
if (element === verticalParagraph || element === verticalDoc.body) {
|
||||
return {
|
||||
writingMode: 'vertical-rl',
|
||||
direction: 'ltr',
|
||||
textOrientation: 'upright',
|
||||
unicodeBidi: 'plaintext',
|
||||
textAlign: 'start',
|
||||
} as CSSStyleDeclaration;
|
||||
}
|
||||
|
||||
return {
|
||||
writingMode: 'horizontal-tb',
|
||||
direction: 'ltr',
|
||||
} as CSSStyleDeclaration;
|
||||
});
|
||||
|
||||
const arabicDoc = createDoc('<p dir="rtl">هذا نص عربي</p>');
|
||||
const arabicParagraph = arabicDoc.querySelector('p')!;
|
||||
const arabicRange = arabicDoc.createRange();
|
||||
arabicRange.selectNodeContents(arabicParagraph);
|
||||
attachDefaultView(
|
||||
arabicDoc,
|
||||
() =>
|
||||
({
|
||||
writingMode: 'horizontal-tb',
|
||||
direction: 'rtl',
|
||||
textAlign: 'start',
|
||||
}) as CSSStyleDeclaration,
|
||||
);
|
||||
|
||||
expect(getParagraphPresentation(verticalDoc, verticalRange)).toEqual(
|
||||
expect.objectContaining({
|
||||
lang: 'ja',
|
||||
dir: 'ltr',
|
||||
writingMode: 'vertical-rl',
|
||||
vertical: true,
|
||||
}),
|
||||
);
|
||||
expect(getParagraphPresentation(arabicDoc, arabicRange)).toEqual(
|
||||
expect.objectContaining({
|
||||
dir: 'rtl',
|
||||
rtl: true,
|
||||
}),
|
||||
);
|
||||
|
||||
expect(getParagraphActionForZone('left', { rtl: true, vertical: false })).toBe('next');
|
||||
expect(getParagraphActionForZone('top', { vertical: true, writingMode: 'vertical-rl' })).toBe(
|
||||
'prev',
|
||||
);
|
||||
expect(getParagraphActionForKey('ArrowLeft', { rtl: true, vertical: false })).toBe('next');
|
||||
expect(
|
||||
getParagraphActionForKey('ArrowLeft', { vertical: true, writingMode: 'vertical-rl' }),
|
||||
).toBe('next');
|
||||
});
|
||||
|
||||
it('uses the active primary section when moving across chapter boundaries', async () => {
|
||||
const previousChapterDoc = createDoc('<p>Old chapter ending</p>');
|
||||
const nextChapterDoc = createDoc('<h1>Chapter 2</h1><p>First paragraph</p>');
|
||||
const { view, renderer } = createMockView([previousChapterDoc, nextChapterDoc], 0);
|
||||
const viewRef = { current: view } as React.RefObject<FoliateView | null>;
|
||||
|
||||
render(<HookHarness view={viewRef} />);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(hookApi?.paragraphState.currentRange?.toString()).toContain('Old chapter ending');
|
||||
});
|
||||
|
||||
await act(async () => {
|
||||
await hookApi?.goToNextParagraph();
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(hookApi?.paragraphState.currentRange?.toString()).toContain('Chapter 2');
|
||||
});
|
||||
|
||||
expect(renderer.nextSection).toHaveBeenCalledTimes(1);
|
||||
await waitFor(() => {
|
||||
expect(renderer.goTo).toHaveBeenLastCalledWith(expect.objectContaining({ index: 1 }));
|
||||
});
|
||||
});
|
||||
|
||||
it('renders preserved presentation and layout-aware click zones in the overlay', async () => {
|
||||
const dispatchSpy = vi.spyOn(eventDispatcher, 'dispatch');
|
||||
const overlayBookKey = 'overlay-book';
|
||||
const doc = createDoc('<p>مرحبا بالعالم</p>');
|
||||
const paragraph = doc.querySelector('p')!;
|
||||
const range = doc.createRange();
|
||||
range.selectNodeContents(paragraph);
|
||||
|
||||
const { container } = render(
|
||||
<ParagraphOverlay
|
||||
bookKey={overlayBookKey}
|
||||
dimOpacity={0.3}
|
||||
viewSettings={{ writingMode: 'horizontal-tb', vertical: false, rtl: true } as never}
|
||||
/>,
|
||||
);
|
||||
|
||||
await act(async () => {
|
||||
await eventDispatcher.dispatch('paragraph-focus', {
|
||||
bookKey: overlayBookKey,
|
||||
range,
|
||||
presentation: {
|
||||
lang: 'ja',
|
||||
dir: 'ltr',
|
||||
writingMode: 'vertical-rl',
|
||||
textOrientation: 'upright',
|
||||
vertical: true,
|
||||
rtl: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const paragraphContent = await waitFor(() => {
|
||||
const node = container.querySelector('.paragraph-content') as HTMLDivElement | null;
|
||||
expect(node).not.toBeNull();
|
||||
return node!;
|
||||
});
|
||||
expect(paragraphContent.getAttribute('lang')).toBe('ja');
|
||||
expect(paragraphContent.style.writingMode).toBe('vertical-rl');
|
||||
dispatchSpy.mockClear();
|
||||
|
||||
const contentArea = container.querySelector('.relative.flex') as HTMLDivElement;
|
||||
vi.spyOn(contentArea, 'getBoundingClientRect').mockReturnValue({
|
||||
width: 300,
|
||||
height: 300,
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 300,
|
||||
bottom: 300,
|
||||
x: 0,
|
||||
y: 0,
|
||||
toJSON: () => ({}),
|
||||
} as DOMRect);
|
||||
|
||||
fireEvent.click(contentArea, { clientX: 150, clientY: 20 });
|
||||
await waitFor(() => {
|
||||
expect(dispatchSpy).toHaveBeenCalledWith('paragraph-prev', { bookKey: overlayBookKey });
|
||||
});
|
||||
|
||||
await act(async () => {
|
||||
await eventDispatcher.dispatch('paragraph-focus', {
|
||||
bookKey: overlayBookKey,
|
||||
range,
|
||||
presentation: {
|
||||
dir: 'rtl',
|
||||
writingMode: 'horizontal-tb',
|
||||
vertical: false,
|
||||
rtl: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
dispatchSpy.mockClear();
|
||||
|
||||
await act(async () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 320));
|
||||
});
|
||||
|
||||
fireEvent.click(contentArea, { clientX: 40, clientY: 150 });
|
||||
await waitFor(() => {
|
||||
expect(dispatchSpy).toHaveBeenCalledWith('paragraph-next', { bookKey: overlayBookKey });
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,372 @@
|
||||
import { describe, test, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { BaseDir, FileSystem, ResolvedPath } from '@/types/system';
|
||||
import { DatabaseOpts, DatabaseService } from '@/types/database';
|
||||
import { SchemaType } from '@/services/database/migrate';
|
||||
|
||||
// Mock all service dependencies
|
||||
vi.mock('@/services/settingsService', () => ({
|
||||
getDefaultViewSettings: vi.fn().mockReturnValue({ theme: 'light' }),
|
||||
loadSettings: vi.fn().mockResolvedValue({
|
||||
localBooksDir: 'books-dir',
|
||||
migrationVersion: 99999999,
|
||||
}),
|
||||
saveSettings: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock('@/services/libraryService', () => ({
|
||||
loadLibraryBooks: vi.fn().mockResolvedValue([{ title: 'Book1' }]),
|
||||
saveLibraryBooks: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock('@/services/bookService', () => ({
|
||||
getCoverImageUrl: vi.fn().mockReturnValue('cover-url'),
|
||||
getCoverImageBlobUrl: vi.fn().mockResolvedValue('blob:cover'),
|
||||
getCachedImageUrl: vi.fn().mockResolvedValue('cached:url'),
|
||||
generateCoverImageUrl: vi.fn().mockResolvedValue('generated:url'),
|
||||
updateCoverImage: vi.fn().mockResolvedValue(undefined),
|
||||
importBook: vi.fn().mockResolvedValue(null),
|
||||
exportBook: vi.fn().mockResolvedValue(true),
|
||||
refreshBookMetadata: vi.fn().mockResolvedValue(true),
|
||||
isBookAvailable: vi.fn().mockResolvedValue(true),
|
||||
getBookFileSize: vi.fn().mockResolvedValue(1024),
|
||||
loadBookContent: vi.fn().mockResolvedValue({ html: '<p>test</p>' }),
|
||||
loadBookConfig: vi.fn().mockResolvedValue({ updatedAt: 0 }),
|
||||
fetchBookDetails: vi.fn().mockResolvedValue({ title: 'Test' }),
|
||||
saveBookConfig: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock('@/services/cloudService', () => ({
|
||||
deleteBook: vi.fn().mockResolvedValue(undefined),
|
||||
uploadFileToCloud: vi.fn().mockResolvedValue('url'),
|
||||
uploadBook: vi.fn().mockResolvedValue(undefined),
|
||||
downloadCloudFile: vi.fn().mockResolvedValue(undefined),
|
||||
downloadBookCovers: vi.fn().mockResolvedValue(undefined),
|
||||
downloadBook: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock('@/services/fontService', () => ({
|
||||
importFont: vi.fn().mockResolvedValue({ name: 'Font', path: '/f' }),
|
||||
deleteFont: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock('@/services/imageService', () => ({
|
||||
importImage: vi.fn().mockResolvedValue({ id: 'img', url: '/img' }),
|
||||
deleteImage: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/book', () => ({
|
||||
getLibraryFilename: vi.fn().mockReturnValue('library.json'),
|
||||
getLibraryBackupFilename: vi.fn().mockReturnValue('library_backup.json'),
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/misc', async (importOriginal) => {
|
||||
const original = await importOriginal<Record<string, unknown>>();
|
||||
return {
|
||||
...original,
|
||||
getOSPlatform: vi.fn().mockReturnValue('macos'),
|
||||
};
|
||||
});
|
||||
|
||||
import { BaseAppService } from '@/services/appService';
|
||||
import * as Settings from '@/services/settingsService';
|
||||
import * as BookSvc from '@/services/bookService';
|
||||
|
||||
// Concrete test implementation of BaseAppService
|
||||
class TestAppService extends BaseAppService {
|
||||
fs: FileSystem;
|
||||
|
||||
constructor(fs: FileSystem) {
|
||||
super();
|
||||
this.fs = fs;
|
||||
}
|
||||
|
||||
resolvePath(fp: string, base: BaseDir): ResolvedPath {
|
||||
return this.fs.resolvePath(fp, base);
|
||||
}
|
||||
|
||||
async init() {
|
||||
await this.loadSettings();
|
||||
}
|
||||
|
||||
async setCustomRootDir(_dir: string) {}
|
||||
|
||||
async selectDirectory(): Promise<string> {
|
||||
return '/test/dir';
|
||||
}
|
||||
|
||||
async selectFiles(): Promise<string[]> {
|
||||
return ['/test/file.epub'];
|
||||
}
|
||||
|
||||
async saveFile(): Promise<boolean> {
|
||||
return true;
|
||||
}
|
||||
|
||||
async ask(): Promise<boolean> {
|
||||
return true;
|
||||
}
|
||||
|
||||
async openDatabase(
|
||||
_schema: SchemaType,
|
||||
_path: string,
|
||||
_base: BaseDir,
|
||||
_opts?: DatabaseOpts,
|
||||
): Promise<DatabaseService> {
|
||||
return {} as DatabaseService;
|
||||
}
|
||||
}
|
||||
|
||||
function createMockFs(): FileSystem {
|
||||
return {
|
||||
resolvePath: vi.fn().mockReturnValue({
|
||||
baseDir: 0,
|
||||
basePrefix: async () => '/base',
|
||||
fp: 'path',
|
||||
base: 'Books' as BaseDir,
|
||||
}),
|
||||
getURL: vi.fn().mockReturnValue('url'),
|
||||
getBlobURL: vi.fn().mockResolvedValue('blob:url'),
|
||||
getImageURL: vi.fn().mockResolvedValue('image:url'),
|
||||
openFile: vi.fn().mockResolvedValue(new File(['content'], 'test.epub')),
|
||||
copyFile: vi.fn().mockResolvedValue(undefined),
|
||||
readFile: vi.fn().mockResolvedValue('content'),
|
||||
writeFile: vi.fn().mockResolvedValue(undefined),
|
||||
removeFile: vi.fn().mockResolvedValue(undefined),
|
||||
readDir: vi.fn().mockResolvedValue([{ path: 'a.txt', size: 10 }]),
|
||||
createDir: vi.fn().mockResolvedValue(undefined),
|
||||
removeDir: vi.fn().mockResolvedValue(undefined),
|
||||
exists: vi.fn().mockResolvedValue(true),
|
||||
stats: vi.fn().mockResolvedValue({
|
||||
isFile: true,
|
||||
isDirectory: false,
|
||||
size: 100,
|
||||
mtime: null,
|
||||
atime: null,
|
||||
birthtime: null,
|
||||
}),
|
||||
getPrefix: vi.fn().mockResolvedValue('/base/books'),
|
||||
};
|
||||
}
|
||||
|
||||
describe('BaseAppService', () => {
|
||||
let service: TestAppService;
|
||||
let mockFs: FileSystem;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
mockFs = createMockFs();
|
||||
service = new TestAppService(mockFs);
|
||||
vi.spyOn(console, 'log').mockImplementation(() => {});
|
||||
vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('default properties', () => {
|
||||
test('has correct default platform flags', () => {
|
||||
expect(service.appPlatform).toBe('tauri');
|
||||
expect(service.isMobile).toBe(false);
|
||||
expect(service.isMacOSApp).toBe(false);
|
||||
expect(service.isAndroidApp).toBe(false);
|
||||
expect(service.isIOSApp).toBe(false);
|
||||
expect(service.isDesktopApp).toBe(false);
|
||||
expect(service.hasTrafficLight).toBe(false);
|
||||
expect(service.hasWindow).toBe(false);
|
||||
expect(service.hasHaptics).toBe(false);
|
||||
expect(service.hasUpdater).toBe(false);
|
||||
expect(service.isEink).toBe(false);
|
||||
expect(service.localBooksDir).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('prepareBooksDir', () => {
|
||||
test('sets localBooksDir from fs.getPrefix', async () => {
|
||||
await service.prepareBooksDir();
|
||||
expect(mockFs.getPrefix).toHaveBeenCalledWith('Books');
|
||||
expect(service.localBooksDir).toBe('/base/books');
|
||||
});
|
||||
});
|
||||
|
||||
describe('file operations', () => {
|
||||
test('openFile delegates to fs', async () => {
|
||||
await service.openFile('test.epub', 'Books');
|
||||
expect(mockFs.openFile).toHaveBeenCalledWith('test.epub', 'Books');
|
||||
});
|
||||
|
||||
test('copyFile delegates to fs', async () => {
|
||||
await service.copyFile('src.epub', 'dst.epub', 'Books');
|
||||
expect(mockFs.copyFile).toHaveBeenCalledWith('src.epub', 'dst.epub', 'Books');
|
||||
});
|
||||
|
||||
test('readFile delegates to fs', async () => {
|
||||
const result = await service.readFile('test.txt', 'Data', 'text');
|
||||
expect(mockFs.readFile).toHaveBeenCalledWith('test.txt', 'Data', 'text');
|
||||
expect(result).toBe('content');
|
||||
});
|
||||
|
||||
test('writeFile delegates to fs', async () => {
|
||||
await service.writeFile('test.txt', 'Data', 'hello');
|
||||
expect(mockFs.writeFile).toHaveBeenCalledWith('test.txt', 'Data', 'hello');
|
||||
});
|
||||
|
||||
test('createDir delegates to fs', async () => {
|
||||
await service.createDir('newdir', 'Books');
|
||||
expect(mockFs.createDir).toHaveBeenCalledWith('newdir', 'Books', true);
|
||||
});
|
||||
|
||||
test('createDir respects recursive parameter', async () => {
|
||||
await service.createDir('newdir', 'Books', false);
|
||||
expect(mockFs.createDir).toHaveBeenCalledWith('newdir', 'Books', false);
|
||||
});
|
||||
|
||||
test('deleteFile delegates to fs.removeFile', async () => {
|
||||
await service.deleteFile('old.txt', 'Data');
|
||||
expect(mockFs.removeFile).toHaveBeenCalledWith('old.txt', 'Data');
|
||||
});
|
||||
|
||||
test('deleteDir delegates to fs.removeDir', async () => {
|
||||
await service.deleteDir('olddir', 'Books');
|
||||
expect(mockFs.removeDir).toHaveBeenCalledWith('olddir', 'Books', true);
|
||||
});
|
||||
|
||||
test('deleteDir respects recursive parameter', async () => {
|
||||
await service.deleteDir('olddir', 'Books', false);
|
||||
expect(mockFs.removeDir).toHaveBeenCalledWith('olddir', 'Books', false);
|
||||
});
|
||||
|
||||
test('exists delegates to fs', async () => {
|
||||
const result = await service.exists('test.txt', 'Data');
|
||||
expect(mockFs.exists).toHaveBeenCalledWith('test.txt', 'Data');
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
|
||||
test('readDirectory delegates to fs.readDir', async () => {
|
||||
const result = await service.readDirectory('dir', 'Books');
|
||||
expect(mockFs.readDir).toHaveBeenCalledWith('dir', 'Books');
|
||||
expect(result).toEqual([{ path: 'a.txt', size: 10 }]);
|
||||
});
|
||||
|
||||
test('getImageURL delegates to fs', async () => {
|
||||
const result = await service.getImageURL('/img.png');
|
||||
expect(mockFs.getImageURL).toHaveBeenCalledWith('/img.png');
|
||||
expect(result).toBe('image:url');
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveFilePath', () => {
|
||||
test('combines prefix with path', async () => {
|
||||
const result = await service.resolveFilePath('test.json', 'Data');
|
||||
expect(result).toBe('/base/books/test.json');
|
||||
});
|
||||
|
||||
test('returns just prefix when path is empty', async () => {
|
||||
const result = await service.resolveFilePath('', 'Data');
|
||||
expect(result).toBe('/base/books');
|
||||
});
|
||||
});
|
||||
|
||||
describe('settings', () => {
|
||||
test('loadSettings delegates and updates localBooksDir', async () => {
|
||||
const settings = await service.loadSettings();
|
||||
expect(Settings.loadSettings).toHaveBeenCalled();
|
||||
expect(settings.localBooksDir).toBe('books-dir');
|
||||
expect(service.localBooksDir).toBe('books-dir');
|
||||
});
|
||||
|
||||
test('saveSettings delegates to settingsService', async () => {
|
||||
const settings = { localBooksDir: 'dir' } as Parameters<typeof service.saveSettings>[0];
|
||||
await service.saveSettings(settings);
|
||||
expect(Settings.saveSettings).toHaveBeenCalledWith(mockFs, settings);
|
||||
});
|
||||
|
||||
test('getDefaultViewSettings delegates', () => {
|
||||
const result = service.getDefaultViewSettings();
|
||||
expect(Settings.getDefaultViewSettings).toHaveBeenCalled();
|
||||
expect(result).toEqual({ theme: 'light' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('cover image operations', () => {
|
||||
const mockBook = { hash: 'h1', title: 'Book' } as Parameters<
|
||||
typeof service.getCoverImageUrl
|
||||
>[0];
|
||||
|
||||
test('getCoverImageUrl delegates', () => {
|
||||
const result = service.getCoverImageUrl(mockBook);
|
||||
expect(BookSvc.getCoverImageUrl).toHaveBeenCalled();
|
||||
expect(result).toBe('cover-url');
|
||||
});
|
||||
|
||||
test('getCoverImageBlobUrl delegates', async () => {
|
||||
const result = await service.getCoverImageBlobUrl(mockBook);
|
||||
expect(BookSvc.getCoverImageBlobUrl).toHaveBeenCalled();
|
||||
expect(result).toBe('blob:cover');
|
||||
});
|
||||
|
||||
test('getCachedImageUrl delegates', async () => {
|
||||
const result = await service.getCachedImageUrl('http://img.com/x.png');
|
||||
expect(BookSvc.getCachedImageUrl).toHaveBeenCalled();
|
||||
expect(result).toBe('cached:url');
|
||||
});
|
||||
|
||||
test('generateCoverImageUrl delegates', async () => {
|
||||
const result = await service.generateCoverImageUrl(mockBook);
|
||||
expect(BookSvc.generateCoverImageUrl).toHaveBeenCalled();
|
||||
expect(result).toBe('generated:url');
|
||||
});
|
||||
});
|
||||
|
||||
describe('library operations', () => {
|
||||
test('loadLibraryBooks delegates', async () => {
|
||||
const result = await service.loadLibraryBooks();
|
||||
expect(result).toEqual([{ title: 'Book1' }]);
|
||||
});
|
||||
|
||||
test('saveLibraryBooks delegates', async () => {
|
||||
await service.saveLibraryBooks([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('runMigrations', () => {
|
||||
test('runs migration when version is lower', async () => {
|
||||
vi.mocked(mockFs.exists).mockResolvedValue(true);
|
||||
vi.mocked(mockFs.readFile).mockResolvedValue('library data');
|
||||
|
||||
// Access protected method through init -> loadSettings -> runMigrations flow
|
||||
vi.mocked(Settings.loadSettings).mockResolvedValue({
|
||||
localBooksDir: 'dir',
|
||||
migrationVersion: 0,
|
||||
} as ReturnType<typeof Settings.loadSettings> extends Promise<infer T> ? T : never);
|
||||
|
||||
// Create a service that calls runMigrations in init
|
||||
class MigratingService extends TestAppService {
|
||||
override async init() {
|
||||
await this.loadSettings();
|
||||
await this.runMigrations(0);
|
||||
}
|
||||
}
|
||||
|
||||
const svc = new MigratingService(mockFs);
|
||||
await svc.init();
|
||||
|
||||
// Migration should have checked for the old backup file
|
||||
expect(mockFs.exists).toHaveBeenCalledWith('library_backup.json', 'Books');
|
||||
});
|
||||
|
||||
test('skips migration when version is current', async () => {
|
||||
class MigratingService extends TestAppService {
|
||||
override async init() {
|
||||
await this.runMigrations(99999999);
|
||||
}
|
||||
}
|
||||
|
||||
const svc = new MigratingService(mockFs);
|
||||
await svc.init();
|
||||
|
||||
// Should not have tried to read the backup file
|
||||
expect(mockFs.readFile).not.toHaveBeenCalledWith('library_backup.json', 'Books', 'text');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,268 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import {
|
||||
mergeBookConfigs,
|
||||
mergeBookMetadata,
|
||||
validateBackupStructure,
|
||||
} from '@/services/backupService';
|
||||
import { Book, BookConfig, BookNote } from '@/types/book';
|
||||
|
||||
/**
|
||||
* Extended tests for backupService covering:
|
||||
* - validateBackupStructure
|
||||
* - mergeBookConfigs edge cases (empty configs, no booknotes, notes with zero/undefined updatedAt)
|
||||
* - mergeBookMetadata edge cases (equal timestamps, undefined deletedAt)
|
||||
*/
|
||||
|
||||
function makeBook(overrides: Partial<Book> = {}): Book {
|
||||
return {
|
||||
hash: 'abc123',
|
||||
format: 'EPUB',
|
||||
title: 'Test Book',
|
||||
author: 'Author',
|
||||
createdAt: 1000,
|
||||
updatedAt: 2000,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
function makeNote(overrides: Partial<BookNote> = {}): BookNote {
|
||||
return {
|
||||
id: 'note-1',
|
||||
type: 'annotation',
|
||||
cfi: 'cfi-1',
|
||||
note: 'test note',
|
||||
createdAt: 100,
|
||||
updatedAt: 100,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
describe('validateBackupStructure', () => {
|
||||
it('should return true when library.json is present', () => {
|
||||
expect(validateBackupStructure(['library.json', 'abc123/book.epub'])).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false when library.json is missing', () => {
|
||||
expect(validateBackupStructure(['abc123/book.epub', 'abc123/config.json'])).toBe(false);
|
||||
});
|
||||
|
||||
it('should return false for empty entries', () => {
|
||||
expect(validateBackupStructure([])).toBe(false);
|
||||
});
|
||||
|
||||
it('should not match partial names like library.json.bak', () => {
|
||||
expect(validateBackupStructure(['library.json.bak'])).toBe(false);
|
||||
});
|
||||
|
||||
it('should not match subdirectory library.json', () => {
|
||||
// Only exact match counts; 'subdir/library.json' !== 'library.json'
|
||||
expect(validateBackupStructure(['subdir/library.json'])).toBe(false);
|
||||
});
|
||||
|
||||
it('should return true even with many other entries', () => {
|
||||
const entries = Array.from({ length: 100 }, (_, i) => `hash${i}/book.epub`);
|
||||
entries.push('library.json');
|
||||
expect(validateBackupStructure(entries)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('mergeBookConfigs - extended', () => {
|
||||
it('should handle both configs having zero progress', () => {
|
||||
const current: BookConfig = { progress: [0, 200], updatedAt: 100 };
|
||||
const backup: BookConfig = { progress: [0, 200], updatedAt: 90 };
|
||||
const result = mergeBookConfigs(current, backup);
|
||||
// When progress is equal (both 0), current wins (backupPage > currentPage is false)
|
||||
expect(result.progress).toEqual([0, 200]);
|
||||
});
|
||||
|
||||
it('should handle configs with no progress at all', () => {
|
||||
const current: Partial<BookConfig> = { updatedAt: 100 };
|
||||
const backup: Partial<BookConfig> = { updatedAt: 90 };
|
||||
const result = mergeBookConfigs(current, backup);
|
||||
// Both progress[0] default to 0, so current wins
|
||||
expect(result.booknotes).toEqual([]);
|
||||
});
|
||||
|
||||
it('should merge notes from current when backup has none', () => {
|
||||
const note = makeNote({ id: 'c1', note: 'current-only' });
|
||||
const current: BookConfig = { booknotes: [note], updatedAt: 100 };
|
||||
const backup: BookConfig = { updatedAt: 90 };
|
||||
const result = mergeBookConfigs(current, backup);
|
||||
expect(result.booknotes).toHaveLength(1);
|
||||
expect(result.booknotes![0]!.id).toBe('c1');
|
||||
});
|
||||
|
||||
it('should merge notes from backup when current has none', () => {
|
||||
const note = makeNote({ id: 'b1', note: 'backup-only' });
|
||||
const current: BookConfig = { updatedAt: 100 };
|
||||
const backup: BookConfig = { booknotes: [note], updatedAt: 90 };
|
||||
const result = mergeBookConfigs(current, backup);
|
||||
expect(result.booknotes).toHaveLength(1);
|
||||
expect(result.booknotes![0]!.id).toBe('b1');
|
||||
});
|
||||
|
||||
it('should handle notes with updatedAt of 0', () => {
|
||||
const currentNote = makeNote({ id: '1', note: 'current', updatedAt: 0 });
|
||||
const backupNote = makeNote({ id: '1', note: 'backup', updatedAt: 0 });
|
||||
const current: BookConfig = { booknotes: [currentNote], updatedAt: 100 };
|
||||
const backup: BookConfig = { booknotes: [backupNote], updatedAt: 100 };
|
||||
const result = mergeBookConfigs(current, backup);
|
||||
// When both are 0, backup note doesn't win ((0 || 0) > (0 || 0) is false)
|
||||
expect(result.booknotes).toHaveLength(1);
|
||||
expect(result.booknotes![0]!.note).toBe('current');
|
||||
});
|
||||
|
||||
it('should handle notes with undefined updatedAt (treated as 0)', () => {
|
||||
const currentNote = makeNote({
|
||||
id: '1',
|
||||
note: 'current',
|
||||
updatedAt: undefined as unknown as number,
|
||||
});
|
||||
const backupNote = makeNote({ id: '1', note: 'backup', updatedAt: 50 });
|
||||
const current: BookConfig = { booknotes: [currentNote], updatedAt: 100 };
|
||||
const backup: BookConfig = { booknotes: [backupNote], updatedAt: 100 };
|
||||
const result = mergeBookConfigs(current, backup);
|
||||
// Backup note has updatedAt 50, current has undefined (treated as 0)
|
||||
// (50 || 0) > (undefined || 0) => 50 > 0 => true, backup wins
|
||||
expect(result.booknotes).toHaveLength(1);
|
||||
expect(result.booknotes![0]!.note).toBe('backup');
|
||||
});
|
||||
|
||||
it('should merge many notes from both sides without duplicates', () => {
|
||||
const currentNotes = Array.from({ length: 5 }, (_, i) =>
|
||||
makeNote({ id: `note-${i}`, note: `current-${i}`, updatedAt: 100 }),
|
||||
);
|
||||
const backupNotes = Array.from({ length: 5 }, (_, i) =>
|
||||
makeNote({ id: `note-${i + 3}`, note: `backup-${i + 3}`, updatedAt: 200 }),
|
||||
);
|
||||
// Overlapping ids: note-3, note-4 (exist in both)
|
||||
const current: BookConfig = { booknotes: currentNotes, updatedAt: 100 };
|
||||
const backup: BookConfig = { booknotes: backupNotes, updatedAt: 100 };
|
||||
const result = mergeBookConfigs(current, backup);
|
||||
|
||||
// Total unique ids: note-0..note-7 = 8
|
||||
expect(result.booknotes).toHaveLength(8);
|
||||
|
||||
// Overlapping notes should use backup version (higher updatedAt)
|
||||
const note3 = result.booknotes!.find((n) => n.id === 'note-3');
|
||||
expect(note3!.note).toBe('backup-3');
|
||||
const note4 = result.booknotes!.find((n) => n.id === 'note-4');
|
||||
expect(note4!.note).toBe('backup-4');
|
||||
|
||||
// Non-overlapping from current should be preserved
|
||||
const note0 = result.booknotes!.find((n) => n.id === 'note-0');
|
||||
expect(note0!.note).toBe('current-0');
|
||||
});
|
||||
|
||||
it('should preserve location from config with higher progress', () => {
|
||||
const current: BookConfig = { progress: [10, 200], location: 'loc-A', updatedAt: 100 };
|
||||
const backup: BookConfig = { progress: [20, 200], location: 'loc-B', updatedAt: 90 };
|
||||
const result = mergeBookConfigs(current, backup);
|
||||
expect(result.location).toBe('loc-B'); // backup has higher progress
|
||||
});
|
||||
|
||||
it('should preserve location from current when current has higher progress', () => {
|
||||
const current: BookConfig = { progress: [30, 200], location: 'loc-A', updatedAt: 100 };
|
||||
const backup: BookConfig = { progress: [20, 200], location: 'loc-B', updatedAt: 90 };
|
||||
const result = mergeBookConfigs(current, backup);
|
||||
expect(result.location).toBe('loc-A');
|
||||
});
|
||||
|
||||
it('should not mutate the original configs', () => {
|
||||
const currentNote = makeNote({ id: '1', note: 'original' });
|
||||
const current: BookConfig = { booknotes: [currentNote], progress: [10, 200], updatedAt: 100 };
|
||||
const backup: BookConfig = { progress: [20, 200], updatedAt: 90 };
|
||||
const currentCopy = JSON.parse(JSON.stringify(current)) as BookConfig;
|
||||
const backupCopy = JSON.parse(JSON.stringify(backup)) as BookConfig;
|
||||
|
||||
mergeBookConfigs(current, backup);
|
||||
|
||||
// Original objects should not be mutated
|
||||
expect(current.booknotes).toHaveLength(1);
|
||||
expect(JSON.stringify(current)).toBe(JSON.stringify(currentCopy));
|
||||
expect(JSON.stringify(backup)).toBe(JSON.stringify(backupCopy));
|
||||
});
|
||||
});
|
||||
|
||||
describe('mergeBookMetadata - extended', () => {
|
||||
it('should handle equal updatedAt timestamps', () => {
|
||||
const current = makeBook({ updatedAt: 2000, title: 'Current Title' });
|
||||
const backup = makeBook({ updatedAt: 2000, title: 'Backup Title' });
|
||||
const result = mergeBookMetadata(current, backup);
|
||||
// When equal, backup.updatedAt > current.updatedAt is false, so current wins
|
||||
expect(result.title).toBe('Current Title');
|
||||
expect(result.updatedAt).toBe(2000);
|
||||
});
|
||||
|
||||
it('should handle equal createdAt timestamps', () => {
|
||||
const current = makeBook({ createdAt: 1000 });
|
||||
const backup = makeBook({ createdAt: 1000 });
|
||||
const result = mergeBookMetadata(current, backup);
|
||||
expect(result.createdAt).toBe(1000);
|
||||
});
|
||||
|
||||
it('should handle deletedAt being undefined (treated like null)', () => {
|
||||
const current = makeBook({ deletedAt: undefined });
|
||||
const backup = makeBook({ deletedAt: 5000 });
|
||||
const result = mergeBookMetadata(current, backup);
|
||||
// Only deleted if BOTH sides agree; undefined is falsy
|
||||
expect(result.deletedAt).toBeNull();
|
||||
});
|
||||
|
||||
it('should handle both deletedAt being undefined', () => {
|
||||
const current = makeBook({ deletedAt: undefined });
|
||||
const backup = makeBook({ deletedAt: undefined });
|
||||
const result = mergeBookMetadata(current, backup);
|
||||
expect(result.deletedAt).toBeNull();
|
||||
});
|
||||
|
||||
it('should handle deletedAt being 0 (falsy number)', () => {
|
||||
const current = makeBook({ deletedAt: 0 });
|
||||
const backup = makeBook({ deletedAt: 5000 });
|
||||
const result = mergeBookMetadata(current, backup);
|
||||
// 0 is falsy, so current.deletedAt && backup.deletedAt is falsy
|
||||
expect(result.deletedAt).toBeNull();
|
||||
});
|
||||
|
||||
it('should preserve other fields from the base (higher updatedAt)', () => {
|
||||
const current = makeBook({
|
||||
updatedAt: 1000,
|
||||
hash: 'hash1',
|
||||
format: 'EPUB',
|
||||
author: 'Author A',
|
||||
});
|
||||
const backup = makeBook({
|
||||
updatedAt: 3000,
|
||||
hash: 'hash1',
|
||||
format: 'PDF',
|
||||
author: 'Author B',
|
||||
});
|
||||
const result = mergeBookMetadata(current, backup);
|
||||
// Backup has higher updatedAt, so its fields are base
|
||||
expect(result.format).toBe('PDF');
|
||||
expect(result.author).toBe('Author B');
|
||||
});
|
||||
|
||||
it('should reconcile timestamps correctly when backup is older', () => {
|
||||
const current = makeBook({ updatedAt: 5000, createdAt: 500 });
|
||||
const backup = makeBook({ updatedAt: 3000, createdAt: 200 });
|
||||
const result = mergeBookMetadata(current, backup);
|
||||
expect(result.updatedAt).toBe(5000); // max
|
||||
expect(result.createdAt).toBe(200); // min
|
||||
});
|
||||
|
||||
it('should reconcile timestamps correctly when current is older', () => {
|
||||
const current = makeBook({ updatedAt: 1000, createdAt: 100 });
|
||||
const backup = makeBook({ updatedAt: 5000, createdAt: 500 });
|
||||
const result = mergeBookMetadata(current, backup);
|
||||
expect(result.updatedAt).toBe(5000); // max
|
||||
expect(result.createdAt).toBe(100); // min
|
||||
});
|
||||
|
||||
it('should handle both sides deleted with equal timestamps', () => {
|
||||
const current = makeBook({ deletedAt: 4000 });
|
||||
const backup = makeBook({ deletedAt: 4000 });
|
||||
const result = mergeBookMetadata(current, backup);
|
||||
expect(result.deletedAt).toBe(4000);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,207 @@
|
||||
import { describe, test, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { deleteBook } from '@/services/cloudService';
|
||||
import { Book, BookFormat } from '@/types/book';
|
||||
import { FileSystem } from '@/types/system';
|
||||
|
||||
// Mock external dependencies
|
||||
vi.mock('@/utils/book', () => ({
|
||||
getDir: vi.fn((book: Book) => book.hash),
|
||||
getLocalBookFilename: vi.fn((book: Book) => `${book.hash}/${book.title}.epub`),
|
||||
getRemoteBookFilename: vi.fn((book: Book) => `${book.hash}/${book.hash}.epub`),
|
||||
getCoverFilename: vi.fn((book: Book) => `${book.hash}/cover.png`),
|
||||
}));
|
||||
|
||||
vi.mock('@/libs/storage', () => ({
|
||||
downloadFile: vi.fn().mockResolvedValue(undefined),
|
||||
uploadFile: vi.fn().mockResolvedValue('https://example.com/file'),
|
||||
deleteFile: vi.fn(),
|
||||
createProgressHandler: vi.fn().mockReturnValue(vi.fn()),
|
||||
batchGetDownloadUrls: vi.fn().mockResolvedValue([]),
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/file', () => ({
|
||||
ClosableFile: class {},
|
||||
RemoteFile: class {
|
||||
async open() {
|
||||
return new File(['content'], 'test.epub');
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
||||
function createMockBook(overrides: Partial<Book> = {}): Book {
|
||||
return {
|
||||
hash: 'abc123',
|
||||
format: 'EPUB' as BookFormat,
|
||||
title: 'Test Book',
|
||||
author: 'Author',
|
||||
createdAt: Date.now(),
|
||||
updatedAt: Date.now(),
|
||||
deletedAt: null,
|
||||
uploadedAt: null,
|
||||
downloadedAt: Date.now(),
|
||||
coverDownloadedAt: Date.now(),
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
function createMockFs(): FileSystem {
|
||||
return {
|
||||
resolvePath: vi
|
||||
.fn()
|
||||
.mockReturnValue({ baseDir: 0, basePrefix: async () => '', fp: 'test', base: 'Books' }),
|
||||
getURL: vi.fn().mockReturnValue('url'),
|
||||
getBlobURL: vi.fn().mockResolvedValue('blob:url'),
|
||||
getImageURL: vi.fn().mockResolvedValue('image:url'),
|
||||
openFile: vi.fn().mockResolvedValue(new File(['content'], 'test.epub')),
|
||||
copyFile: vi.fn().mockResolvedValue(undefined),
|
||||
readFile: vi.fn().mockResolvedValue('content'),
|
||||
writeFile: vi.fn().mockResolvedValue(undefined),
|
||||
removeFile: vi.fn().mockResolvedValue(undefined),
|
||||
readDir: vi.fn().mockResolvedValue([]),
|
||||
createDir: vi.fn().mockResolvedValue(undefined),
|
||||
removeDir: vi.fn().mockResolvedValue(undefined),
|
||||
exists: vi.fn().mockResolvedValue(true),
|
||||
stats: vi.fn().mockResolvedValue({
|
||||
isFile: true,
|
||||
isDirectory: false,
|
||||
size: 100,
|
||||
mtime: null,
|
||||
atime: null,
|
||||
birthtime: null,
|
||||
}),
|
||||
getPrefix: vi.fn().mockResolvedValue('Readest/Books'),
|
||||
};
|
||||
}
|
||||
|
||||
describe('cloudService', () => {
|
||||
let mockFs: FileSystem;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
mockFs = createMockFs();
|
||||
vi.spyOn(console, 'log').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('deleteBook', () => {
|
||||
describe('local delete action', () => {
|
||||
test('removes the local book file', async () => {
|
||||
const book = createMockBook();
|
||||
await deleteBook(mockFs, book, 'local');
|
||||
|
||||
expect(mockFs.exists).toHaveBeenCalledWith(`${book.hash}/${book.title}.epub`, 'Books');
|
||||
expect(mockFs.removeFile).toHaveBeenCalledWith(`${book.hash}/${book.title}.epub`, 'Books');
|
||||
});
|
||||
|
||||
test('sets downloadedAt to null', async () => {
|
||||
const book = createMockBook({ downloadedAt: 12345 });
|
||||
await deleteBook(mockFs, book, 'local');
|
||||
|
||||
expect(book.downloadedAt).toBeNull();
|
||||
});
|
||||
|
||||
test('does not set deletedAt for local-only delete', async () => {
|
||||
const book = createMockBook({ deletedAt: null });
|
||||
await deleteBook(mockFs, book, 'local');
|
||||
|
||||
// local action does not modify deletedAt
|
||||
expect(book.deletedAt).toBeNull();
|
||||
});
|
||||
|
||||
test('skips removal when file does not exist', async () => {
|
||||
vi.mocked(mockFs.exists).mockResolvedValue(false);
|
||||
const book = createMockBook();
|
||||
await deleteBook(mockFs, book, 'local');
|
||||
|
||||
expect(mockFs.removeFile).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('only deletes book file, not cover (local action)', async () => {
|
||||
const book = createMockBook();
|
||||
await deleteBook(mockFs, book, 'local');
|
||||
|
||||
// local action only deletes the book file
|
||||
expect(mockFs.removeFile).toHaveBeenCalledTimes(1);
|
||||
expect(mockFs.removeFile).toHaveBeenCalledWith(`${book.hash}/${book.title}.epub`, 'Books');
|
||||
});
|
||||
});
|
||||
|
||||
describe('both delete action', () => {
|
||||
test('removes book file and cover', async () => {
|
||||
const book = createMockBook({ uploadedAt: 1000 });
|
||||
await deleteBook(mockFs, book, 'both');
|
||||
|
||||
// 'both' deletes localBookFilename + coverFilename
|
||||
expect(mockFs.removeFile).toHaveBeenCalledWith(`${book.hash}/${book.title}.epub`, 'Books');
|
||||
expect(mockFs.removeFile).toHaveBeenCalledWith(`${book.hash}/cover.png`, 'Books');
|
||||
});
|
||||
|
||||
test('sets deletedAt, clears downloadedAt and coverDownloadedAt', async () => {
|
||||
const book = createMockBook({
|
||||
uploadedAt: 1000,
|
||||
downloadedAt: 2000,
|
||||
coverDownloadedAt: 3000,
|
||||
});
|
||||
await deleteBook(mockFs, book, 'both');
|
||||
|
||||
expect(book.deletedAt).toBeGreaterThan(0);
|
||||
expect(book.downloadedAt).toBeNull();
|
||||
expect(book.coverDownloadedAt).toBeNull();
|
||||
});
|
||||
|
||||
test('clears uploadedAt when uploaded', async () => {
|
||||
const book = createMockBook({ uploadedAt: 1000 });
|
||||
await deleteBook(mockFs, book, 'both');
|
||||
|
||||
expect(book.uploadedAt).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('cloud delete action', () => {
|
||||
test('does not delete local files', async () => {
|
||||
const book = createMockBook({ uploadedAt: 1000 });
|
||||
await deleteBook(mockFs, book, 'cloud');
|
||||
|
||||
expect(mockFs.removeFile).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('clears uploadedAt when previously uploaded', async () => {
|
||||
const book = createMockBook({ uploadedAt: 1000 });
|
||||
await deleteBook(mockFs, book, 'cloud');
|
||||
|
||||
expect(book.uploadedAt).toBeNull();
|
||||
});
|
||||
|
||||
test('skips cloud delete when not uploaded', async () => {
|
||||
const { deleteFile: deleteCloudFile } = await import('@/libs/storage');
|
||||
const book = createMockBook({ uploadedAt: null });
|
||||
await deleteBook(mockFs, book, 'cloud');
|
||||
|
||||
expect(deleteCloudFile).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('calls deleteFile for remote book and cover', async () => {
|
||||
const { deleteFile: deleteCloudFile } = await import('@/libs/storage');
|
||||
const book = createMockBook({ uploadedAt: 1000 });
|
||||
await deleteBook(mockFs, book, 'cloud');
|
||||
|
||||
expect(deleteCloudFile).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
test('does not throw when cloud delete fails', async () => {
|
||||
const { deleteFile: deleteCloudFile } = await import('@/libs/storage');
|
||||
vi.mocked(deleteCloudFile).mockImplementation(() => {
|
||||
throw new Error('network error');
|
||||
});
|
||||
const book = createMockBook({ uploadedAt: 1000 });
|
||||
|
||||
// Should not throw
|
||||
await deleteBook(mockFs, book, 'cloud');
|
||||
expect(book.uploadedAt).toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,481 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
|
||||
// Mock react-icons before importing the module under test
|
||||
vi.mock('react-icons/ri', () => ({
|
||||
RiFontSize: () => null,
|
||||
RiDashboardLine: () => null,
|
||||
RiTranslate: () => null,
|
||||
}));
|
||||
vi.mock('react-icons/vsc', () => ({
|
||||
VscSymbolColor: () => null,
|
||||
}));
|
||||
vi.mock('react-icons/lia', () => ({
|
||||
LiaHandPointerSolid: () => null,
|
||||
}));
|
||||
vi.mock('react-icons/io5', () => ({
|
||||
IoAccessibilityOutline: () => null,
|
||||
}));
|
||||
vi.mock('react-icons/pi', () => ({
|
||||
PiRobot: () => null,
|
||||
PiSpeakerHigh: () => null,
|
||||
PiSun: () => null,
|
||||
PiMoon: () => null,
|
||||
}));
|
||||
vi.mock('react-icons/tb', () => ({
|
||||
TbSunMoon: () => null,
|
||||
}));
|
||||
vi.mock('react-icons/md', () => ({
|
||||
MdRefresh: () => null,
|
||||
}));
|
||||
vi.mock('react-icons', () => ({
|
||||
IconType: undefined,
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/misc', () => ({
|
||||
stubTranslation: (key: string) => key,
|
||||
}));
|
||||
|
||||
import {
|
||||
buildCommandRegistry,
|
||||
searchCommands,
|
||||
groupResultsByCategory,
|
||||
getCategoryLabel,
|
||||
getRecentCommands,
|
||||
trackCommandUsage,
|
||||
CommandItem,
|
||||
CommandRegistryOptions,
|
||||
CommandCategory,
|
||||
} from '@/services/commandRegistry';
|
||||
|
||||
function createMockOptions(
|
||||
overrides: Partial<CommandRegistryOptions> = {},
|
||||
): CommandRegistryOptions {
|
||||
return {
|
||||
_: (key: string) => key,
|
||||
openSettingsPanel: vi.fn(),
|
||||
toggleTheme: vi.fn(),
|
||||
toggleFullscreen: vi.fn(),
|
||||
toggleAlwaysOnTop: vi.fn(),
|
||||
toggleScreenWakeLock: vi.fn(),
|
||||
toggleAutoUpload: vi.fn(),
|
||||
reloadPage: vi.fn(),
|
||||
toggleOpenLastBooks: vi.fn(),
|
||||
showAbout: vi.fn(),
|
||||
toggleTelemetry: vi.fn(),
|
||||
isDesktop: false,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
describe('buildCommandRegistry', () => {
|
||||
it('should return an array of command items', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
expect(items.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('should include settings items from all panels', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
const settingsItems = items.filter((i) => i.category === 'settings');
|
||||
expect(settingsItems.length).toBeGreaterThan(0);
|
||||
|
||||
// Check that multiple panels are represented
|
||||
const panels = new Set(settingsItems.map((i) => i.panel));
|
||||
expect(panels.has('Font')).toBe(true);
|
||||
expect(panels.has('Layout')).toBe(true);
|
||||
expect(panels.has('Color')).toBe(true);
|
||||
expect(panels.has('Control')).toBe(true);
|
||||
expect(panels.has('Language')).toBe(true);
|
||||
expect(panels.has('Custom')).toBe(true);
|
||||
});
|
||||
|
||||
it('should include action items', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
const actionItems = items.filter((i) => i.category === 'actions');
|
||||
expect(actionItems.length).toBeGreaterThan(0);
|
||||
|
||||
const actionIds = actionItems.map((i) => i.id);
|
||||
expect(actionIds).toContain('action.toggleTheme');
|
||||
expect(actionIds).toContain('action.fullscreen');
|
||||
expect(actionIds).toContain('action.reload');
|
||||
expect(actionIds).toContain('action.about');
|
||||
expect(actionIds).toContain('action.telemetry');
|
||||
});
|
||||
|
||||
it('should use the provided translation function for localized labels', () => {
|
||||
const translate = (key: string) => `translated:${key}`;
|
||||
const items = buildCommandRegistry(createMockOptions({ _: translate }));
|
||||
const fontItem = items.find((i) => i.id === 'settings.font.defaultFontSize');
|
||||
expect(fontItem).toBeDefined();
|
||||
expect(fontItem!.localizedLabel).toBe('translated:Default Font Size');
|
||||
});
|
||||
|
||||
it('should set panelLabel using translation function', () => {
|
||||
const translate = (key: string) => `t:${key}`;
|
||||
const items = buildCommandRegistry(createMockOptions({ _: translate }));
|
||||
|
||||
const fontItem = items.find((i) => i.id === 'settings.font.defaultFontSize');
|
||||
expect(fontItem!.panelLabel).toBe('t:Font');
|
||||
|
||||
// Control panel items use panelLabel 'Behavior'
|
||||
const controlItem = items.find((i) => i.id === 'settings.control.scrolledMode');
|
||||
expect(controlItem!.panelLabel).toBe('t:Behavior');
|
||||
});
|
||||
|
||||
it('should call openSettingsPanel when settings item action is invoked', () => {
|
||||
const openSettingsPanel = vi.fn();
|
||||
const items = buildCommandRegistry(createMockOptions({ openSettingsPanel }));
|
||||
const fontItem = items.find((i) => i.id === 'settings.font.defaultFontSize')!;
|
||||
fontItem.action();
|
||||
expect(openSettingsPanel).toHaveBeenCalledWith('Font', 'settings.font.defaultFontSize');
|
||||
});
|
||||
|
||||
it('should call correct action handler for action items', () => {
|
||||
const toggleTheme = vi.fn();
|
||||
const reloadPage = vi.fn();
|
||||
const items = buildCommandRegistry(createMockOptions({ toggleTheme, reloadPage }));
|
||||
|
||||
items.find((i) => i.id === 'action.toggleTheme')!.action();
|
||||
expect(toggleTheme).toHaveBeenCalled();
|
||||
|
||||
items.find((i) => i.id === 'action.reload')!.action();
|
||||
expect(reloadPage).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should set isAvailable for desktop-only actions', () => {
|
||||
const items = buildCommandRegistry(createMockOptions({ isDesktop: false }));
|
||||
|
||||
const fullscreen = items.find((i) => i.id === 'action.fullscreen')!;
|
||||
expect(fullscreen.isAvailable).toBeDefined();
|
||||
expect(fullscreen.isAvailable!()).toBe(false);
|
||||
|
||||
const alwaysOnTop = items.find((i) => i.id === 'action.alwaysOnTop')!;
|
||||
expect(alwaysOnTop.isAvailable!()).toBe(false);
|
||||
|
||||
const openLastBooks = items.find((i) => i.id === 'action.openLastBooks')!;
|
||||
expect(openLastBooks.isAvailable!()).toBe(false);
|
||||
});
|
||||
|
||||
it('should report desktop-only actions as available on desktop', () => {
|
||||
const items = buildCommandRegistry(createMockOptions({ isDesktop: true }));
|
||||
|
||||
const fullscreen = items.find((i) => i.id === 'action.fullscreen')!;
|
||||
expect(fullscreen.isAvailable!()).toBe(true);
|
||||
});
|
||||
|
||||
it('should not set isAvailable for non-desktop-only actions', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
const themeItem = items.find((i) => i.id === 'action.toggleTheme')!;
|
||||
expect(themeItem.isAvailable).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should have unique ids for all items', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
const ids = items.map((i) => i.id);
|
||||
expect(new Set(ids).size).toBe(ids.length);
|
||||
});
|
||||
|
||||
it('should include AI panel items in non-production', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
const aiItems = items.filter((i) => i.panel === 'AI');
|
||||
// In test environment (not production), AI items should be included
|
||||
expect(aiItems.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('should give each settings item keywords and section', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
const settingsItems = items.filter((i) => i.category === 'settings');
|
||||
for (const item of settingsItems) {
|
||||
expect(item.keywords.length).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('searchCommands', () => {
|
||||
let items: CommandItem[];
|
||||
|
||||
beforeEach(() => {
|
||||
items = buildCommandRegistry(createMockOptions());
|
||||
});
|
||||
|
||||
it('should return empty array for empty query', () => {
|
||||
expect(searchCommands('', items)).toEqual([]);
|
||||
});
|
||||
|
||||
it('should return empty array for whitespace-only query', () => {
|
||||
expect(searchCommands(' ', items)).toEqual([]);
|
||||
});
|
||||
|
||||
it('should find items matching the query', () => {
|
||||
const results = searchCommands('font', items);
|
||||
expect(results.length).toBeGreaterThan(0);
|
||||
// At least some results should be font-related
|
||||
const hasFontResult = results.some(
|
||||
(r) => r.item.id.includes('font') || r.item.labelKey.toLowerCase().includes('font'),
|
||||
);
|
||||
expect(hasFontResult).toBe(true);
|
||||
});
|
||||
|
||||
it('should filter out unavailable items', () => {
|
||||
const itemsNonDesktop = buildCommandRegistry(createMockOptions({ isDesktop: false }));
|
||||
const results = searchCommands('fullscreen', itemsNonDesktop);
|
||||
// Fullscreen is desktop-only; should not appear when isDesktop is false
|
||||
const hasFullscreen = results.some((r) => r.item.id === 'action.fullscreen');
|
||||
expect(hasFullscreen).toBe(false);
|
||||
});
|
||||
|
||||
it('should include available items', () => {
|
||||
const desktopItems = buildCommandRegistry(createMockOptions({ isDesktop: true }));
|
||||
const results = searchCommands('fullscreen', desktopItems);
|
||||
const hasFullscreen = results.some((r) => r.item.id === 'action.fullscreen');
|
||||
expect(hasFullscreen).toBe(true);
|
||||
});
|
||||
|
||||
it('should return results with score and positions', () => {
|
||||
const results = searchCommands('reload', items);
|
||||
expect(results.length).toBeGreaterThan(0);
|
||||
const first = results[0]!;
|
||||
expect(typeof first.score).toBe('number');
|
||||
expect(first.positions).toBeDefined();
|
||||
expect(first.highlightIndices).toBeDefined();
|
||||
});
|
||||
|
||||
it('should search across keywords', () => {
|
||||
const results = searchCommands('hyphen', items);
|
||||
expect(results.length).toBeGreaterThan(0);
|
||||
const hasHyphenation = results.some((r) => r.item.id === 'settings.layout.hyphenation');
|
||||
expect(hasHyphenation).toBe(true);
|
||||
});
|
||||
|
||||
it('should search across panel label', () => {
|
||||
const results = searchCommands('Behavior', items);
|
||||
// Control panel items have panelLabel 'Behavior'
|
||||
expect(results.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('groupResultsByCategory', () => {
|
||||
let items: CommandItem[];
|
||||
|
||||
beforeEach(() => {
|
||||
items = buildCommandRegistry(createMockOptions({ isDesktop: true }));
|
||||
});
|
||||
|
||||
it('should group results by category', () => {
|
||||
const results = searchCommands('theme', items);
|
||||
const grouped = groupResultsByCategory(results);
|
||||
|
||||
expect(grouped).toHaveProperty('settings');
|
||||
expect(grouped).toHaveProperty('actions');
|
||||
expect(grouped).toHaveProperty('navigation');
|
||||
|
||||
// 'theme' should match both settings (Theme Mode under Color) and action (toggle theme)
|
||||
expect(grouped.settings.length).toBeGreaterThan(0);
|
||||
expect(grouped.actions.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('should return empty arrays when no results', () => {
|
||||
const grouped = groupResultsByCategory([]);
|
||||
expect(grouped.settings).toEqual([]);
|
||||
expect(grouped.actions).toEqual([]);
|
||||
expect(grouped.navigation).toEqual([]);
|
||||
});
|
||||
|
||||
it('should place all results into their correct category', () => {
|
||||
const results = searchCommands('font', items);
|
||||
const grouped = groupResultsByCategory(results);
|
||||
|
||||
let totalGrouped = 0;
|
||||
totalGrouped += grouped.settings.length;
|
||||
totalGrouped += grouped.actions.length;
|
||||
totalGrouped += grouped.navigation.length;
|
||||
expect(totalGrouped).toBe(results.length);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getCategoryLabel', () => {
|
||||
const translate = (key: string) => `t:${key}`;
|
||||
|
||||
it('should return translated label for settings', () => {
|
||||
expect(getCategoryLabel(translate, 'settings')).toBe('t:Settings');
|
||||
});
|
||||
|
||||
it('should return translated label for actions', () => {
|
||||
expect(getCategoryLabel(translate, 'actions')).toBe('t:Actions');
|
||||
});
|
||||
|
||||
it('should return translated label for navigation', () => {
|
||||
expect(getCategoryLabel(translate, 'navigation')).toBe('t:Navigation');
|
||||
});
|
||||
|
||||
it('should return the category string for unknown category', () => {
|
||||
// Force an unknown category via type assertion
|
||||
const unknown = 'unknown' as CommandCategory;
|
||||
expect(getCategoryLabel(translate, unknown)).toBe('unknown');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getRecentCommands', () => {
|
||||
const originalLocalStorage = globalThis.localStorage;
|
||||
|
||||
beforeEach(() => {
|
||||
// Set up a fresh localStorage mock
|
||||
const store: Record<string, string> = {};
|
||||
const mockLocalStorage = {
|
||||
getItem: vi.fn((key: string) => store[key] ?? null),
|
||||
setItem: vi.fn((key: string, value: string) => {
|
||||
store[key] = value;
|
||||
}),
|
||||
removeItem: vi.fn((key: string) => {
|
||||
delete store[key];
|
||||
}),
|
||||
clear: vi.fn(() => {
|
||||
for (const key of Object.keys(store)) {
|
||||
delete store[key];
|
||||
}
|
||||
}),
|
||||
get length() {
|
||||
return Object.keys(store).length;
|
||||
},
|
||||
key: vi.fn((_index: number) => null),
|
||||
};
|
||||
Object.defineProperty(globalThis, 'localStorage', {
|
||||
value: mockLocalStorage,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
Object.defineProperty(globalThis, 'localStorage', {
|
||||
value: originalLocalStorage,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('should return empty array when no recent commands stored', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
expect(getRecentCommands(items)).toEqual([]);
|
||||
});
|
||||
|
||||
it('should return matching recent commands', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
localStorage.setItem('recentCommands', JSON.stringify(['action.reload', 'action.about']));
|
||||
|
||||
const recent = getRecentCommands(items);
|
||||
expect(recent).toHaveLength(2);
|
||||
expect(recent[0]!.id).toBe('action.reload');
|
||||
expect(recent[1]!.id).toBe('action.about');
|
||||
});
|
||||
|
||||
it('should skip ids that do not exist in items', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
localStorage.setItem('recentCommands', JSON.stringify(['nonexistent.item', 'action.reload']));
|
||||
|
||||
const recent = getRecentCommands(items);
|
||||
expect(recent).toHaveLength(1);
|
||||
expect(recent[0]!.id).toBe('action.reload');
|
||||
});
|
||||
|
||||
it('should respect the limit parameter', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
localStorage.setItem(
|
||||
'recentCommands',
|
||||
JSON.stringify(['action.reload', 'action.about', 'action.toggleTheme']),
|
||||
);
|
||||
|
||||
const recent = getRecentCommands(items, 2);
|
||||
expect(recent).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('should use default limit of 5', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
const ids = items.slice(0, 8).map((i) => i.id);
|
||||
localStorage.setItem('recentCommands', JSON.stringify(ids));
|
||||
|
||||
const recent = getRecentCommands(items);
|
||||
expect(recent).toHaveLength(5);
|
||||
});
|
||||
|
||||
it('should return empty array on invalid JSON', () => {
|
||||
const items = buildCommandRegistry(createMockOptions());
|
||||
localStorage.setItem('recentCommands', 'not-json');
|
||||
|
||||
const recent = getRecentCommands(items);
|
||||
expect(recent).toEqual([]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('trackCommandUsage', () => {
|
||||
const originalLocalStorage = globalThis.localStorage;
|
||||
|
||||
beforeEach(() => {
|
||||
const store: Record<string, string> = {};
|
||||
const mockLocalStorage = {
|
||||
getItem: vi.fn((key: string) => store[key] ?? null),
|
||||
setItem: vi.fn((key: string, value: string) => {
|
||||
store[key] = value;
|
||||
}),
|
||||
removeItem: vi.fn((key: string) => {
|
||||
delete store[key];
|
||||
}),
|
||||
clear: vi.fn(() => {
|
||||
for (const key of Object.keys(store)) {
|
||||
delete store[key];
|
||||
}
|
||||
}),
|
||||
get length() {
|
||||
return Object.keys(store).length;
|
||||
},
|
||||
key: vi.fn((_index: number) => null),
|
||||
};
|
||||
Object.defineProperty(globalThis, 'localStorage', {
|
||||
value: mockLocalStorage,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
Object.defineProperty(globalThis, 'localStorage', {
|
||||
value: originalLocalStorage,
|
||||
writable: true,
|
||||
configurable: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('should store a new command id', () => {
|
||||
trackCommandUsage('action.reload');
|
||||
const stored = JSON.parse(localStorage.getItem('recentCommands') ?? '[]') as string[];
|
||||
expect(stored).toContain('action.reload');
|
||||
});
|
||||
|
||||
it('should move existing command to front', () => {
|
||||
localStorage.setItem('recentCommands', JSON.stringify(['action.about', 'action.reload']));
|
||||
|
||||
trackCommandUsage('action.reload');
|
||||
const stored = JSON.parse(localStorage.getItem('recentCommands') ?? '[]') as string[];
|
||||
expect(stored[0]).toBe('action.reload');
|
||||
expect(stored[1]).toBe('action.about');
|
||||
// No duplicates
|
||||
expect(stored.filter((id) => id === 'action.reload')).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('should limit stored commands to 10', () => {
|
||||
const existingIds = Array.from({ length: 10 }, (_, i) => `cmd-${i}`);
|
||||
localStorage.setItem('recentCommands', JSON.stringify(existingIds));
|
||||
|
||||
trackCommandUsage('new-cmd');
|
||||
const stored = JSON.parse(localStorage.getItem('recentCommands') ?? '[]') as string[];
|
||||
expect(stored).toHaveLength(10);
|
||||
expect(stored[0]).toBe('new-cmd');
|
||||
// Last item from the original list should have been dropped
|
||||
expect(stored).not.toContain('cmd-9');
|
||||
});
|
||||
|
||||
it('should handle empty localStorage gracefully', () => {
|
||||
trackCommandUsage('action.reload');
|
||||
const stored = JSON.parse(localStorage.getItem('recentCommands') ?? '[]') as string[];
|
||||
expect(stored).toEqual(['action.reload']);
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,380 @@
|
||||
import { describe, test, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
|
||||
// Shared mock control: tests can override createBehavior to change how create() behaves
|
||||
let createBehavior: () => Promise<undefined> = () => Promise.resolve(undefined);
|
||||
|
||||
// --- Mocks ---
|
||||
|
||||
vi.mock('@/libs/edgeTTS', () => {
|
||||
const voices = [
|
||||
{ id: 'en-US-AriaNeural', name: 'Aria', lang: 'en-US' },
|
||||
{ id: 'en-US-AnaNeural', name: 'Ana', lang: 'en-US' },
|
||||
{ id: 'en-GB-SoniaNeural', name: 'Sonia', lang: 'en-GB' },
|
||||
{ id: 'fr-FR-DeniseNeural', name: 'Denise', lang: 'fr-FR' },
|
||||
];
|
||||
return {
|
||||
EdgeSpeechTTS: class MockEdgeSpeechTTS {
|
||||
static voices = voices;
|
||||
create = vi.fn().mockImplementation(() => createBehavior());
|
||||
createAudioUrl = vi.fn().mockResolvedValue('blob:mock-url');
|
||||
},
|
||||
EDGE_TTS_PROTOCOL: 'wss',
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('@/utils/ssml', () => ({
|
||||
parseSSMLMarks: vi.fn(() => ({ marks: [] })),
|
||||
}));
|
||||
|
||||
vi.mock('@/utils/misc', () => ({
|
||||
getUserLocale: vi.fn((lang: string) => (lang === 'en' ? 'en-US' : lang)),
|
||||
}));
|
||||
|
||||
vi.mock('@/services/tts/TTSUtils', () => ({
|
||||
TTSUtils: {
|
||||
getPreferredVoice: vi.fn(() => null),
|
||||
sortVoicesFunc: (a: { id: string }, b: { id: string }) => a.id.localeCompare(b.id),
|
||||
},
|
||||
}));
|
||||
|
||||
import { EdgeTTSClient } from '@/services/tts/EdgeTTSClient';
|
||||
import { TTSController } from '@/services/tts/TTSController';
|
||||
|
||||
// Suppress console noise during tests
|
||||
const consoleSpy = {
|
||||
warn: vi.spyOn(console, 'warn').mockImplementation(() => {}),
|
||||
error: vi.spyOn(console, 'error').mockImplementation(() => {}),
|
||||
log: vi.spyOn(console, 'log').mockImplementation(() => {}),
|
||||
};
|
||||
void consoleSpy;
|
||||
|
||||
describe('EdgeTTSClient', () => {
|
||||
let client: EdgeTTSClient;
|
||||
|
||||
beforeEach(() => {
|
||||
createBehavior = () => Promise.resolve(undefined);
|
||||
client = new EdgeTTSClient();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
describe('constructor', () => {
|
||||
test('sets name to edge-tts', () => {
|
||||
expect(client.name).toBe('edge-tts');
|
||||
});
|
||||
|
||||
test('starts uninitialized', () => {
|
||||
expect(client.initialized).toBe(false);
|
||||
});
|
||||
|
||||
test('stores controller and appService when provided', () => {
|
||||
const mockController = {} as TTSController;
|
||||
const mockAppService = { isLinuxApp: false } as never;
|
||||
const c = new EdgeTTSClient(mockController, mockAppService);
|
||||
expect(c.controller).toBe(mockController);
|
||||
expect(c.appService).toBe(mockAppService);
|
||||
});
|
||||
|
||||
test('controller and appService are undefined when not provided', () => {
|
||||
expect(client.controller).toBeUndefined();
|
||||
expect(client.appService).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('init', () => {
|
||||
test('succeeds when create resolves and sets initialized to true', async () => {
|
||||
const result = await client.init();
|
||||
expect(result).toBe(true);
|
||||
expect(client.initialized).toBe(true);
|
||||
});
|
||||
|
||||
test('populates voices from EdgeSpeechTTS.voices on init', async () => {
|
||||
await client.init();
|
||||
const voices = await client.getAllVoices();
|
||||
expect(voices).toHaveLength(4);
|
||||
expect(voices.map((v) => v.id)).toContain('en-US-AriaNeural');
|
||||
});
|
||||
|
||||
test('wss failure falls back to https when controller is authenticated', async () => {
|
||||
const mockController = {
|
||||
isAuthenticated: true,
|
||||
dispatchEvent: vi.fn(),
|
||||
} as unknown as TTSController;
|
||||
const c = new EdgeTTSClient(mockController);
|
||||
|
||||
// First call (wss protocol) fails, second call (https fallback) succeeds
|
||||
let callCount = 0;
|
||||
createBehavior = () => {
|
||||
callCount++;
|
||||
if (callCount === 1) return Promise.reject(new Error('wss failed'));
|
||||
return Promise.resolve(undefined);
|
||||
};
|
||||
|
||||
const result = await c.init();
|
||||
expect(result).toBe(true);
|
||||
expect(c.initialized).toBe(true);
|
||||
// Two calls: initial wss attempt + https fallback
|
||||
expect(callCount).toBe(2);
|
||||
});
|
||||
|
||||
test('wss failure dispatches tts-need-auth when not authenticated', async () => {
|
||||
const dispatchEvent = vi.fn();
|
||||
const mockController = {
|
||||
isAuthenticated: false,
|
||||
dispatchEvent,
|
||||
} as unknown as TTSController;
|
||||
const c = new EdgeTTSClient(mockController);
|
||||
|
||||
createBehavior = () => Promise.reject(new Error('wss failed'));
|
||||
|
||||
const result = await c.init();
|
||||
expect(result).toBe(false);
|
||||
expect(dispatchEvent).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ type: 'tts-need-auth' }),
|
||||
);
|
||||
});
|
||||
|
||||
test('https failure sets initialized to false', async () => {
|
||||
const mockController = {
|
||||
isAuthenticated: true,
|
||||
dispatchEvent: vi.fn(),
|
||||
} as unknown as TTSController;
|
||||
const c = new EdgeTTSClient(mockController);
|
||||
|
||||
// Both wss and https always fail
|
||||
createBehavior = () => Promise.reject(new Error('failed'));
|
||||
|
||||
const result = await c.init();
|
||||
expect(result).toBe(false);
|
||||
expect(c.initialized).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('setRate', () => {
|
||||
test('stores rate value', async () => {
|
||||
await client.setRate(1.5);
|
||||
// Rate is private, so we verify indirectly - no error thrown
|
||||
await expect(client.setRate(0.5)).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
test('accepts boundary values', async () => {
|
||||
await expect(client.setRate(0.5)).resolves.toBeUndefined();
|
||||
await expect(client.setRate(2.0)).resolves.toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('setPitch', () => {
|
||||
test('stores pitch value', async () => {
|
||||
await expect(client.setPitch(1.2)).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
test('accepts boundary values', async () => {
|
||||
await expect(client.setPitch(0.5)).resolves.toBeUndefined();
|
||||
await expect(client.setPitch(1.5)).resolves.toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('setVoice', () => {
|
||||
test('sets voice when voice id exists in voice list', async () => {
|
||||
await client.init();
|
||||
await client.setVoice('en-US-AriaNeural');
|
||||
expect(client.getVoiceId()).toBe('en-US-AriaNeural');
|
||||
});
|
||||
|
||||
test('does not change voice id when voice id is not found', async () => {
|
||||
await client.init();
|
||||
await client.setVoice('en-US-AriaNeural');
|
||||
await client.setVoice('nonexistent-voice');
|
||||
expect(client.getVoiceId()).toBe('en-US-AriaNeural');
|
||||
});
|
||||
|
||||
test('voice id remains empty when no voice has been set', () => {
|
||||
expect(client.getVoiceId()).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('setPrimaryLang', () => {
|
||||
test('sets primary language', () => {
|
||||
client.setPrimaryLang('fr');
|
||||
// No public getter for primaryLang, but we verify no error
|
||||
// The effect is observed when speak() uses it
|
||||
});
|
||||
|
||||
test('accepts any language string', () => {
|
||||
client.setPrimaryLang('zh-CN');
|
||||
client.setPrimaryLang('ja');
|
||||
client.setPrimaryLang('en');
|
||||
// No error thrown
|
||||
});
|
||||
});
|
||||
|
||||
describe('getGranularities', () => {
|
||||
test('returns array with sentence granularity only', () => {
|
||||
const granularities = client.getGranularities();
|
||||
expect(granularities).toEqual(['sentence']);
|
||||
});
|
||||
|
||||
test('returns the same value regardless of initialization', async () => {
|
||||
const before = client.getGranularities();
|
||||
await client.init();
|
||||
const after = client.getGranularities();
|
||||
expect(before).toEqual(after);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getVoiceId', () => {
|
||||
test('returns empty string by default', () => {
|
||||
expect(client.getVoiceId()).toBe('');
|
||||
});
|
||||
|
||||
test('returns the set voice id after setVoice', async () => {
|
||||
await client.init();
|
||||
await client.setVoice('fr-FR-DeniseNeural');
|
||||
expect(client.getVoiceId()).toBe('fr-FR-DeniseNeural');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getSpeakingLang', () => {
|
||||
test('returns empty string by default', () => {
|
||||
expect(client.getSpeakingLang()).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getAllVoices', () => {
|
||||
test('returns voices from EdgeSpeechTTS after init', async () => {
|
||||
await client.init();
|
||||
const voices = await client.getAllVoices();
|
||||
expect(voices).toHaveLength(4);
|
||||
expect(voices[0]!.id).toBe('en-US-AriaNeural');
|
||||
});
|
||||
|
||||
test('marks voices as disabled when not initialized', async () => {
|
||||
// Do NOT call init
|
||||
const voices = await client.getAllVoices();
|
||||
for (const voice of voices) {
|
||||
expect(voice.disabled).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
test('marks voices as enabled when initialized', async () => {
|
||||
await client.init();
|
||||
const voices = await client.getAllVoices();
|
||||
for (const voice of voices) {
|
||||
expect(voice.disabled).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
test('returns empty array before init since voices are assigned during init', async () => {
|
||||
// Before init, #voices is the empty default
|
||||
const voices = await client.getAllVoices();
|
||||
// Actually, the constructor doesn't call init, so #voices starts as []
|
||||
// But wait - init sets #voices = EdgeSpeechTTS.voices. Without init, it stays [].
|
||||
// However, getAllVoices returns this.#voices which starts as [].
|
||||
// Let's check: the mock voices are set on static, not on the instance default.
|
||||
expect(voices).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getVoices', () => {
|
||||
beforeEach(async () => {
|
||||
await client.init();
|
||||
});
|
||||
|
||||
test('filters voices by language prefix', async () => {
|
||||
const groups = await client.getVoices('fr-FR');
|
||||
expect(groups).toHaveLength(1);
|
||||
expect(groups[0]!.id).toBe('edge-tts');
|
||||
expect(groups[0]!.name).toBe('Edge TTS');
|
||||
expect(groups[0]!.voices).toHaveLength(1);
|
||||
expect(groups[0]!.voices[0]!.id).toBe('fr-FR-DeniseNeural');
|
||||
});
|
||||
|
||||
test('handles "en" by expanding to locale and including en-US and en-GB', async () => {
|
||||
const groups = await client.getVoices('en');
|
||||
const voiceIds = groups[0]!.voices.map((v) => v.id);
|
||||
expect(voiceIds).toContain('en-US-AriaNeural');
|
||||
expect(voiceIds).toContain('en-US-AnaNeural');
|
||||
expect(voiceIds).toContain('en-GB-SoniaNeural');
|
||||
});
|
||||
|
||||
test('returns sorted voices using TTSUtils.sortVoicesFunc', async () => {
|
||||
const groups = await client.getVoices('en');
|
||||
const voiceIds = groups[0]!.voices.map((v) => v.id);
|
||||
const sorted = [...voiceIds].sort();
|
||||
expect(voiceIds).toEqual(sorted);
|
||||
});
|
||||
|
||||
test('marks group as disabled when not initialized', async () => {
|
||||
const uninitClient = new EdgeTTSClient();
|
||||
// We need voices to be populated but not initialized
|
||||
// Since uninitClient hasn't called init, #voices is empty
|
||||
const groups = await uninitClient.getVoices('en');
|
||||
expect(groups[0]!.disabled).toBe(true);
|
||||
});
|
||||
|
||||
test('marks group as disabled when no matching voices found', async () => {
|
||||
const groups = await client.getVoices('zh-CN');
|
||||
expect(groups[0]!.disabled).toBe(true);
|
||||
expect(groups[0]!.voices).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('returns group not disabled when initialized and voices match', async () => {
|
||||
const groups = await client.getVoices('en');
|
||||
expect(groups[0]!.disabled).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('shutdown', () => {
|
||||
test('sets initialized to false', async () => {
|
||||
await client.init();
|
||||
expect(client.initialized).toBe(true);
|
||||
await client.shutdown();
|
||||
expect(client.initialized).toBe(false);
|
||||
});
|
||||
|
||||
test('clears the voice list', async () => {
|
||||
await client.init();
|
||||
const voicesBefore = await client.getAllVoices();
|
||||
expect(voicesBefore.length).toBeGreaterThan(0);
|
||||
|
||||
await client.shutdown();
|
||||
const voicesAfter = await client.getAllVoices();
|
||||
expect(voicesAfter).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('can be called multiple times without error', async () => {
|
||||
await client.shutdown();
|
||||
await client.shutdown();
|
||||
expect(client.initialized).toBe(false);
|
||||
});
|
||||
|
||||
test('can re-initialize after shutdown', async () => {
|
||||
await client.init();
|
||||
await client.shutdown();
|
||||
expect(client.initialized).toBe(false);
|
||||
|
||||
await client.init();
|
||||
expect(client.initialized).toBe(true);
|
||||
const voices = await client.getAllVoices();
|
||||
expect(voices.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('pause / resume / stop', () => {
|
||||
test('pause returns true when no audio element exists', async () => {
|
||||
const result = await client.pause();
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
|
||||
test('resume returns true when no audio element exists', async () => {
|
||||
const result = await client.resume();
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
|
||||
test('stop resolves without error when no audio element exists', async () => {
|
||||
await expect(client.stop()).resolves.toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,250 @@
|
||||
import { describe, test, expect, beforeEach, vi } from 'vitest';
|
||||
|
||||
// ── Mocks for constants ──────────────────────────────────────────
|
||||
vi.mock('@/services/constants', () => ({
|
||||
READEST_WEB_BASE_URL: 'https://web.readest.com',
|
||||
READEST_NODE_BASE_URL: 'https://node.readest.com',
|
||||
}));
|
||||
|
||||
// We need to reset modules between tests to pick up env var changes,
|
||||
// so we import dynamically in each test or test group.
|
||||
|
||||
// Cast process.env to a mutable record for test manipulation
|
||||
const env = process.env as Record<string, string | undefined>;
|
||||
const originalEnv = { ...env };
|
||||
|
||||
beforeEach(() => {
|
||||
vi.resetModules();
|
||||
Object.keys(env).forEach((key) => delete env[key]);
|
||||
Object.assign(env, originalEnv);
|
||||
// Clean up any window globals we set
|
||||
delete (window as unknown as Record<string, unknown>)['__READEST_CLI_ACCESS'];
|
||||
});
|
||||
|
||||
describe('environment', () => {
|
||||
// ── isTauriAppPlatform ─────────────────────────────────────────
|
||||
describe('isTauriAppPlatform', () => {
|
||||
test('returns true when NEXT_PUBLIC_APP_PLATFORM is tauri', async () => {
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'tauri';
|
||||
const { isTauriAppPlatform } = await import('@/services/environment');
|
||||
expect(isTauriAppPlatform()).toBe(true);
|
||||
});
|
||||
|
||||
test('returns false when NEXT_PUBLIC_APP_PLATFORM is web', async () => {
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'web';
|
||||
const { isTauriAppPlatform } = await import('@/services/environment');
|
||||
expect(isTauriAppPlatform()).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false when NEXT_PUBLIC_APP_PLATFORM is not set', async () => {
|
||||
delete env['NEXT_PUBLIC_APP_PLATFORM'];
|
||||
const { isTauriAppPlatform } = await import('@/services/environment');
|
||||
expect(isTauriAppPlatform()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
// ── isWebAppPlatform ───────────────────────────────────────────
|
||||
describe('isWebAppPlatform', () => {
|
||||
test('returns true when NEXT_PUBLIC_APP_PLATFORM is web', async () => {
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'web';
|
||||
const { isWebAppPlatform } = await import('@/services/environment');
|
||||
expect(isWebAppPlatform()).toBe(true);
|
||||
});
|
||||
|
||||
test('returns false when NEXT_PUBLIC_APP_PLATFORM is tauri', async () => {
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'tauri';
|
||||
const { isWebAppPlatform } = await import('@/services/environment');
|
||||
expect(isWebAppPlatform()).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false when NEXT_PUBLIC_APP_PLATFORM is not set', async () => {
|
||||
delete env['NEXT_PUBLIC_APP_PLATFORM'];
|
||||
const { isWebAppPlatform } = await import('@/services/environment');
|
||||
expect(isWebAppPlatform()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
// ── hasCli ─────────────────────────────────────────────────────
|
||||
describe('hasCli', () => {
|
||||
test('returns true when __READEST_CLI_ACCESS is true', async () => {
|
||||
window.__READEST_CLI_ACCESS = true;
|
||||
const { hasCli } = await import('@/services/environment');
|
||||
expect(hasCli()).toBe(true);
|
||||
});
|
||||
|
||||
test('returns false when __READEST_CLI_ACCESS is not set', async () => {
|
||||
const { hasCli } = await import('@/services/environment');
|
||||
expect(hasCli()).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false when __READEST_CLI_ACCESS is explicitly false', async () => {
|
||||
window.__READEST_CLI_ACCESS = false;
|
||||
const { hasCli } = await import('@/services/environment');
|
||||
expect(hasCli()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
// ── isPWA ──────────────────────────────────────────────────────
|
||||
describe('isPWA', () => {
|
||||
test('returns false by default (jsdom matchMedia mock returns false)', async () => {
|
||||
const { isPWA } = await import('@/services/environment');
|
||||
expect(isPWA()).toBe(false);
|
||||
});
|
||||
|
||||
test('returns true when display-mode is standalone', async () => {
|
||||
const originalMatchMedia = window.matchMedia;
|
||||
window.matchMedia = vi
|
||||
.fn()
|
||||
.mockReturnValue({ matches: true }) as unknown as typeof window.matchMedia;
|
||||
|
||||
const { isPWA } = await import('@/services/environment');
|
||||
expect(isPWA()).toBe(true);
|
||||
|
||||
window.matchMedia = originalMatchMedia;
|
||||
});
|
||||
});
|
||||
|
||||
// ── getBaseUrl ─────────────────────────────────────────────────
|
||||
describe('getBaseUrl', () => {
|
||||
test('returns NEXT_PUBLIC_API_BASE_URL when set', async () => {
|
||||
env['NEXT_PUBLIC_API_BASE_URL'] = 'https://custom-api.example.com';
|
||||
const { getBaseUrl } = await import('@/services/environment');
|
||||
expect(getBaseUrl()).toBe('https://custom-api.example.com');
|
||||
});
|
||||
|
||||
test('falls back to READEST_WEB_BASE_URL when env var not set', async () => {
|
||||
delete env['NEXT_PUBLIC_API_BASE_URL'];
|
||||
const { getBaseUrl } = await import('@/services/environment');
|
||||
expect(getBaseUrl()).toBe('https://web.readest.com');
|
||||
});
|
||||
});
|
||||
|
||||
// ── getNodeBaseUrl ─────────────────────────────────────────────
|
||||
describe('getNodeBaseUrl', () => {
|
||||
test('returns NEXT_PUBLIC_NODE_BASE_URL when set', async () => {
|
||||
env['NEXT_PUBLIC_NODE_BASE_URL'] = 'https://custom-node.example.com';
|
||||
const { getNodeBaseUrl } = await import('@/services/environment');
|
||||
expect(getNodeBaseUrl()).toBe('https://custom-node.example.com');
|
||||
});
|
||||
|
||||
test('falls back to READEST_NODE_BASE_URL when env var not set', async () => {
|
||||
delete env['NEXT_PUBLIC_NODE_BASE_URL'];
|
||||
const { getNodeBaseUrl } = await import('@/services/environment');
|
||||
expect(getNodeBaseUrl()).toBe('https://node.readest.com');
|
||||
});
|
||||
});
|
||||
|
||||
// ── isMacPlatform ──────────────────────────────────────────────
|
||||
describe('isMacPlatform', () => {
|
||||
test('returns true when navigator.platform contains Mac', async () => {
|
||||
Object.defineProperty(navigator, 'platform', { value: 'MacIntel', configurable: true });
|
||||
const { isMacPlatform } = await import('@/services/environment');
|
||||
expect(isMacPlatform()).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true when navigator.platform is iPhone', async () => {
|
||||
Object.defineProperty(navigator, 'platform', { value: 'iPhone', configurable: true });
|
||||
const { isMacPlatform } = await import('@/services/environment');
|
||||
expect(isMacPlatform()).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true when navigator.platform is iPad', async () => {
|
||||
Object.defineProperty(navigator, 'platform', { value: 'iPad', configurable: true });
|
||||
const { isMacPlatform } = await import('@/services/environment');
|
||||
expect(isMacPlatform()).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true when navigator.platform is iPod', async () => {
|
||||
Object.defineProperty(navigator, 'platform', { value: 'iPod', configurable: true });
|
||||
const { isMacPlatform } = await import('@/services/environment');
|
||||
expect(isMacPlatform()).toBe(true);
|
||||
});
|
||||
|
||||
test('returns false when navigator.platform is Win32', async () => {
|
||||
Object.defineProperty(navigator, 'platform', { value: 'Win32', configurable: true });
|
||||
const { isMacPlatform } = await import('@/services/environment');
|
||||
expect(isMacPlatform()).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false when navigator.platform is Linux', async () => {
|
||||
Object.defineProperty(navigator, 'platform', { value: 'Linux x86_64', configurable: true });
|
||||
const { isMacPlatform } = await import('@/services/environment');
|
||||
expect(isMacPlatform()).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
// ── getCommandPaletteShortcut ──────────────────────────────────
|
||||
describe('getCommandPaletteShortcut', () => {
|
||||
test('returns Mac shortcut on Mac platforms', async () => {
|
||||
Object.defineProperty(navigator, 'platform', { value: 'MacIntel', configurable: true });
|
||||
const { getCommandPaletteShortcut } = await import('@/services/environment');
|
||||
expect(getCommandPaletteShortcut()).toContain('P');
|
||||
});
|
||||
|
||||
test('returns Ctrl shortcut on non-Mac platforms', async () => {
|
||||
Object.defineProperty(navigator, 'platform', { value: 'Win32', configurable: true });
|
||||
const { getCommandPaletteShortcut } = await import('@/services/environment');
|
||||
expect(getCommandPaletteShortcut()).toBe('Ctrl+Shift+P');
|
||||
});
|
||||
});
|
||||
|
||||
// ── getAPIBaseUrl ──────────────────────────────────────────────
|
||||
describe('getAPIBaseUrl', () => {
|
||||
test('returns /api in web development mode', async () => {
|
||||
env['NODE_ENV'] = 'development';
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'web';
|
||||
const { getAPIBaseUrl } = await import('@/services/environment');
|
||||
expect(getAPIBaseUrl()).toBe('/api');
|
||||
});
|
||||
|
||||
test('returns full URL in production', async () => {
|
||||
env['NODE_ENV'] = 'production';
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'web';
|
||||
delete env['NEXT_PUBLIC_API_BASE_URL'];
|
||||
const { getAPIBaseUrl } = await import('@/services/environment');
|
||||
expect(getAPIBaseUrl()).toBe('https://web.readest.com/api');
|
||||
});
|
||||
|
||||
test('returns full URL for tauri platform even in development', async () => {
|
||||
env['NODE_ENV'] = 'development';
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'tauri';
|
||||
delete env['NEXT_PUBLIC_API_BASE_URL'];
|
||||
const { getAPIBaseUrl } = await import('@/services/environment');
|
||||
expect(getAPIBaseUrl()).toBe('https://web.readest.com/api');
|
||||
});
|
||||
});
|
||||
|
||||
// ── getNodeAPIBaseUrl ──────────────────────────────────────────
|
||||
describe('getNodeAPIBaseUrl', () => {
|
||||
test('returns /api in web development mode', async () => {
|
||||
env['NODE_ENV'] = 'development';
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'web';
|
||||
const { getNodeAPIBaseUrl } = await import('@/services/environment');
|
||||
expect(getNodeAPIBaseUrl()).toBe('/api');
|
||||
});
|
||||
|
||||
test('returns full node URL in production', async () => {
|
||||
env['NODE_ENV'] = 'production';
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'web';
|
||||
delete env['NEXT_PUBLIC_NODE_BASE_URL'];
|
||||
const { getNodeAPIBaseUrl } = await import('@/services/environment');
|
||||
expect(getNodeAPIBaseUrl()).toBe('https://node.readest.com/api');
|
||||
});
|
||||
|
||||
test('returns full node URL for tauri platform even in development', async () => {
|
||||
env['NODE_ENV'] = 'development';
|
||||
env['NEXT_PUBLIC_APP_PLATFORM'] = 'tauri';
|
||||
delete env['NEXT_PUBLIC_NODE_BASE_URL'];
|
||||
const { getNodeAPIBaseUrl } = await import('@/services/environment');
|
||||
expect(getNodeAPIBaseUrl()).toBe('https://node.readest.com/api');
|
||||
});
|
||||
});
|
||||
|
||||
// ── environmentConfig default export ───────────────────────────
|
||||
describe('environmentConfig', () => {
|
||||
test('exports an object with getAppService function', async () => {
|
||||
const envConfig = await import('@/services/environment');
|
||||
expect(typeof envConfig.default.getAppService).toBe('function');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,393 @@
|
||||
import { describe, test, expect, vi, beforeEach } from 'vitest';
|
||||
import { HardcoverClient } from '@/services/hardcover/HardcoverClient';
|
||||
import type { HardcoverSyncMapStore } from '@/services/hardcover/HardcoverSyncMapStore';
|
||||
import type { Book, BookConfig, BookNote } from '@/types/book';
|
||||
|
||||
type MockFetchResponse = {
|
||||
ok: boolean;
|
||||
status?: number;
|
||||
statusText?: string;
|
||||
json: () => Promise<unknown>;
|
||||
};
|
||||
|
||||
type MockFetch = ReturnType<typeof vi.fn<(...args: unknown[]) => Promise<MockFetchResponse>>>;
|
||||
|
||||
type TestBookContext = {
|
||||
editionId: number;
|
||||
pages: number | null;
|
||||
bookId: number;
|
||||
bookPages: number | null;
|
||||
userBook: {
|
||||
id: number;
|
||||
status_id: number;
|
||||
user_book_reads: Array<{ id: number; started_at?: string | null }>;
|
||||
} | null;
|
||||
};
|
||||
|
||||
type HardcoverClientTestApi = {
|
||||
token: string;
|
||||
extractISBN: (book: Book) => string | null;
|
||||
request: <TVariables, TData>(query: string, variables: TVariables) => Promise<TData>;
|
||||
buildJournalPayload: (
|
||||
note: BookNote,
|
||||
config: BookConfig,
|
||||
context: TestBookContext,
|
||||
) => { action_at: string; entry: string; event: string };
|
||||
ensureBookInLibrary: (book: Book, isReading?: boolean) => Promise<TestBookContext | null>;
|
||||
pushProgress: (book: Book, config: BookConfig) => Promise<void>;
|
||||
};
|
||||
|
||||
type RequestSpyCall = [query: string, variables?: unknown];
|
||||
type FetchMockCall = [input: unknown, init?: { body?: string }];
|
||||
|
||||
describe('HardcoverClient', () => {
|
||||
let mockMapStore: HardcoverSyncMapStore;
|
||||
let client: HardcoverClient;
|
||||
let clientApi: HardcoverClientTestApi;
|
||||
let fetchMock: MockFetch;
|
||||
const mockSettings = { accessToken: 'test-token' };
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
|
||||
// Mock HardcoverSyncMapStore
|
||||
mockMapStore = {
|
||||
getMapping: vi.fn().mockResolvedValue(null),
|
||||
getMappingByPayloadHash: vi.fn().mockResolvedValue(null),
|
||||
upsertMapping: vi.fn().mockResolvedValue(undefined),
|
||||
flush: vi.fn().mockResolvedValue(undefined),
|
||||
loadForBook: vi.fn().mockResolvedValue(undefined),
|
||||
} as unknown as HardcoverSyncMapStore;
|
||||
|
||||
// Mock global fetch
|
||||
fetchMock = vi.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
status: 200,
|
||||
json: () => Promise.resolve({ data: { me: { id: 1 } } }),
|
||||
});
|
||||
vi.stubGlobal('fetch', fetchMock);
|
||||
|
||||
client = new HardcoverClient(mockSettings, mockMapStore);
|
||||
clientApi = client as unknown as HardcoverClientTestApi;
|
||||
});
|
||||
|
||||
test('should normalize accessToken correctly', () => {
|
||||
const rawClient = new HardcoverClient({ accessToken: 'raw-jwt' }, mockMapStore);
|
||||
expect((rawClient as unknown as HardcoverClientTestApi).token).toBe('Bearer raw-jwt');
|
||||
|
||||
const bearClient = new HardcoverClient({ accessToken: 'Bearer already-has' }, mockMapStore);
|
||||
expect((bearClient as unknown as HardcoverClientTestApi).token).toBe('Bearer already-has');
|
||||
});
|
||||
|
||||
test('should extract ISBN from metadata', () => {
|
||||
const book = {
|
||||
metadata: {
|
||||
isbn: '0743273567',
|
||||
},
|
||||
} as unknown as Book;
|
||||
|
||||
const isbn = clientApi.extractISBN(book);
|
||||
expect(isbn).toBe('0743273567');
|
||||
});
|
||||
|
||||
test('should extract ISBN from alternative identifiers', () => {
|
||||
const book = {
|
||||
metadata: {
|
||||
identifier: [{ scheme: 'ISBN', value: '9780679783268' }, 'urn:isbn:0679783261'],
|
||||
},
|
||||
} as unknown as Book;
|
||||
|
||||
const isbn = clientApi.extractISBN(book);
|
||||
expect(isbn).toBe('9780679783268');
|
||||
});
|
||||
|
||||
test('should deduplicate notes correctly in syncBookNotes', async () => {
|
||||
const book = {
|
||||
hash: 'book-hash',
|
||||
title: 'Test Book',
|
||||
author: 'Test',
|
||||
metadata: { isbn: '1234567890' }, // Add ISBN to trigger QUERY_GET_EDITION
|
||||
} as unknown as Book;
|
||||
|
||||
const config = {
|
||||
booknotes: [
|
||||
{
|
||||
id: 'note-1',
|
||||
type: 'annotation',
|
||||
text: 'Shared Text',
|
||||
note: 'Some note',
|
||||
cfi: 'epubcfi(/6/4[chap1]!/4/2,/1:10,/1:22)',
|
||||
},
|
||||
{
|
||||
id: 'note-2',
|
||||
type: 'excerpt',
|
||||
text: 'Shared Text',
|
||||
cfi: 'epubcfi(/6/4[chap1]!/4/2,/1:10,/1:23)', // Slightly different end offset only
|
||||
},
|
||||
{
|
||||
id: 'note-3',
|
||||
type: 'annotation',
|
||||
text: 'Other Text',
|
||||
note: '',
|
||||
},
|
||||
] as BookNote[],
|
||||
} as BookConfig;
|
||||
|
||||
// Setup mocks for authenticate & fetch context & insert
|
||||
fetchMock.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve({ data: { me: { id: 1 } } }), // authenticate
|
||||
});
|
||||
fetchMock.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
data: {
|
||||
editions: [
|
||||
{
|
||||
id: 101,
|
||||
book: {
|
||||
id: 202,
|
||||
user_books: [
|
||||
{
|
||||
id: 303,
|
||||
user_book_reads: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}), // fetchContext (QUERY_GET_EDITION)
|
||||
});
|
||||
fetchMock.mockResolvedValue({
|
||||
ok: true,
|
||||
json: () => Promise.resolve({ data: { insert_reading_journal: { id: 999 } } }), // generic inserts
|
||||
});
|
||||
|
||||
const results = await client.syncBookNotes(book, config);
|
||||
|
||||
// note-1: kept (annotation with note)
|
||||
// note-2: skipped (excerpt at same location/text as note-1)
|
||||
// note-3: kept (annotation with no note, but no conflicts)
|
||||
expect(results.inserted).toBe(2);
|
||||
expect(results.skipped).toBe(0);
|
||||
expect(fetchMock).toHaveBeenCalledTimes(4);
|
||||
expect(mockMapStore.flush).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('should handle rate limiting with retries', async () => {
|
||||
// request() does NOT call authenticate() so only 2 mock values are needed
|
||||
vi.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
|
||||
// First request fails with 429 then succeeds
|
||||
fetchMock.mockResolvedValueOnce({
|
||||
ok: false,
|
||||
status: 429,
|
||||
statusText: 'Too Many Requests',
|
||||
json: async () => ({}),
|
||||
});
|
||||
fetchMock.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve({ data: { result: 'ok' } }),
|
||||
});
|
||||
|
||||
// Speed up sleep for test
|
||||
vi.useFakeTimers();
|
||||
const requestPromise = clientApi.request<{ var: number }, { result: string }>('query', {
|
||||
var: 1,
|
||||
});
|
||||
|
||||
// Wait for the 429 retry
|
||||
await vi.runAllTimersAsync();
|
||||
const result = await requestPromise;
|
||||
|
||||
expect(result).toEqual({ result: 'ok' });
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
test('should produce the expected date formats for journal and progress payloads', async () => {
|
||||
const note = {
|
||||
updatedAt: 1711737600000, // 2026-03-29 ...
|
||||
type: 'annotation',
|
||||
text: 'Test',
|
||||
id: '1',
|
||||
} as BookNote;
|
||||
const config = { progress: [5, 100] } as BookConfig;
|
||||
const context: TestBookContext = {
|
||||
editionId: 2,
|
||||
pages: 100,
|
||||
bookId: 1,
|
||||
bookPages: 100,
|
||||
userBook: null,
|
||||
};
|
||||
|
||||
// Test journal payload
|
||||
const payload = clientApi.buildJournalPayload(note, config, context);
|
||||
// Should be full ISO (e.g. 2026-03-29T16:00:00.000Z), length > 20
|
||||
expect(payload.action_at.length).toBeGreaterThan(10);
|
||||
expect(payload.action_at).toMatch(/^\d{4}-\d{2}-\d{2}T/);
|
||||
|
||||
// Test progress payload (started_at)
|
||||
const book = { createdAt: 1711737600000 } as Book;
|
||||
vi.spyOn(clientApi, 'ensureBookInLibrary').mockResolvedValue({
|
||||
editionId: 2,
|
||||
pages: 100,
|
||||
bookId: 1,
|
||||
bookPages: 100,
|
||||
userBook: {
|
||||
id: 3,
|
||||
status_id: 2,
|
||||
user_book_reads: [],
|
||||
},
|
||||
});
|
||||
const requestSpy = vi.spyOn(clientApi, 'request').mockResolvedValue({});
|
||||
await clientApi.pushProgress(book, config);
|
||||
|
||||
const requestCalls = requestSpy.mock.calls as RequestSpyCall[];
|
||||
const progressCall = requestCalls.find((call) => {
|
||||
const query = call[0];
|
||||
return typeof query === 'string' && query.includes('mutation InsertRead');
|
||||
});
|
||||
expect(progressCall).toBeDefined();
|
||||
const variables = progressCall?.[1] as { started_at?: string } | undefined;
|
||||
expect(variables?.started_at).toMatch(/^\d{4}-\d{2}-\d{2}$/);
|
||||
});
|
||||
|
||||
test('should format multiline quote text with a short divider before the note', () => {
|
||||
const note = {
|
||||
id: '1',
|
||||
type: 'annotation',
|
||||
text: "She smiled. 'Are you, Overseer? Still?'\n\n'What do you mean?'",
|
||||
note: 'Follow-up note',
|
||||
} as BookNote;
|
||||
const config = { progress: [5, 100] } as BookConfig;
|
||||
const context: TestBookContext = {
|
||||
editionId: 2,
|
||||
pages: 100,
|
||||
bookId: 1,
|
||||
bookPages: 100,
|
||||
userBook: null,
|
||||
};
|
||||
|
||||
const payload = clientApi.buildJournalPayload(note, config, context);
|
||||
|
||||
expect(payload.event).toBe('note');
|
||||
expect(payload.entry).toBe(
|
||||
"She smiled. 'Are you, Overseer? Still?'\n\n'What do you mean?'\n\n━━━\n\nFollow-up note",
|
||||
);
|
||||
});
|
||||
|
||||
test('should promote an existing user book to currently reading before syncing progress', async () => {
|
||||
const book = {
|
||||
createdAt: 1711737600000,
|
||||
metadata: { isbn: '1234567890' },
|
||||
} as Book;
|
||||
const config = { progress: [25, 100] } as BookConfig;
|
||||
|
||||
vi.spyOn(clientApi, 'ensureBookInLibrary').mockResolvedValue({
|
||||
editionId: 101,
|
||||
pages: 100,
|
||||
bookId: 202,
|
||||
bookPages: 100,
|
||||
userBook: {
|
||||
id: 303,
|
||||
status_id: 1,
|
||||
user_book_reads: [],
|
||||
},
|
||||
});
|
||||
const requestSpy = vi.spyOn(clientApi, 'request').mockResolvedValue({});
|
||||
|
||||
await client.pushProgress(book, config);
|
||||
|
||||
const requestCalls = requestSpy.mock.calls as RequestSpyCall[];
|
||||
const calls = requestCalls.map((call) => {
|
||||
return {
|
||||
query: String(call[0]),
|
||||
variables: call[1] as Record<string, unknown> | undefined,
|
||||
};
|
||||
});
|
||||
const firstCall = calls[0];
|
||||
const secondCall = calls[1];
|
||||
if (!firstCall || !secondCall) {
|
||||
throw new Error('Expected both UpdateUserBook and InsertRead calls');
|
||||
}
|
||||
|
||||
expect(firstCall.query).toContain('mutation UpdateUserBook');
|
||||
expect(firstCall.variables).toEqual({
|
||||
user_book_id: 303,
|
||||
object: { status_id: 2 },
|
||||
});
|
||||
expect(secondCall.query).toContain('mutation InsertRead');
|
||||
expect(secondCall.variables).toMatchObject({
|
||||
user_book_id: 303,
|
||||
progress_pages: 25,
|
||||
edition_id: 101,
|
||||
started_at: '2024-03-29',
|
||||
});
|
||||
});
|
||||
|
||||
test('should not promote an existing user book when syncing notes only', async () => {
|
||||
const book = {
|
||||
hash: 'book-hash',
|
||||
title: 'Test Book',
|
||||
author: 'Test Author',
|
||||
metadata: { isbn: '1234567890' },
|
||||
} as unknown as Book;
|
||||
const config = {
|
||||
progress: [25, 100],
|
||||
booknotes: [
|
||||
{
|
||||
id: 'note-1',
|
||||
type: 'annotation',
|
||||
text: 'Shared Text',
|
||||
note: 'Some note',
|
||||
cfi: 'epubcfi(/6/4[chap1]!/4/2,10/10)',
|
||||
},
|
||||
] as BookNote[],
|
||||
} as BookConfig;
|
||||
|
||||
fetchMock.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve({ data: { me: { id: 1 } } }),
|
||||
});
|
||||
fetchMock.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
data: {
|
||||
editions: [
|
||||
{
|
||||
id: 101,
|
||||
pages: 100,
|
||||
book: {
|
||||
id: 202,
|
||||
pages: 100,
|
||||
user_books: [
|
||||
{
|
||||
id: 303,
|
||||
status_id: 3,
|
||||
user_book_reads: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
});
|
||||
fetchMock.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: () => Promise.resolve({ data: { insert_reading_journal: { id: 999 } } }),
|
||||
});
|
||||
|
||||
const result = await client.syncBookNotes(book, config);
|
||||
const fetchCalls = fetchMock.mock.calls as FetchMockCall[];
|
||||
const calls = fetchCalls.map((call) => JSON.parse(call[1]?.body ?? '{}'));
|
||||
|
||||
expect(result.inserted).toBe(1);
|
||||
expect(
|
||||
calls.some((call: { query: string }) => call.query.includes('mutation UpdateUserBook')),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,174 @@
|
||||
import { describe, test, expect, vi, beforeEach } from 'vitest';
|
||||
import { HardcoverSyncMapStore } from '@/services/hardcover/HardcoverSyncMapStore';
|
||||
import type { AppService } from '@/types/system';
|
||||
|
||||
type MockDb = {
|
||||
select: ReturnType<typeof vi.fn>;
|
||||
execute: ReturnType<typeof vi.fn>;
|
||||
close: ReturnType<typeof vi.fn>;
|
||||
};
|
||||
|
||||
describe('HardcoverSyncMapStore', () => {
|
||||
let mockAppService: AppService;
|
||||
let mockDb: MockDb;
|
||||
let store: HardcoverSyncMapStore;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
|
||||
// Mock Database
|
||||
mockDb = {
|
||||
select: vi.fn().mockResolvedValue([]),
|
||||
execute: vi.fn().mockResolvedValue({}),
|
||||
close: vi.fn().mockResolvedValue({}),
|
||||
};
|
||||
|
||||
// Mock AppService
|
||||
mockAppService = {
|
||||
openDatabase: vi.fn().mockResolvedValue(mockDb),
|
||||
} as unknown as AppService;
|
||||
|
||||
// Mock localStorage
|
||||
const localStorageMock = (() => {
|
||||
let store: Record<string, string> = {};
|
||||
return {
|
||||
getItem: vi.fn((key: string) => store[key] || null),
|
||||
setItem: vi.fn((key: string, value: string) => {
|
||||
store[key] = value.toString();
|
||||
}),
|
||||
key: vi.fn((index: number) => Object.keys(store)[index] || null),
|
||||
removeItem: vi.fn((key: string) => {
|
||||
delete store[key];
|
||||
}),
|
||||
clear: vi.fn(() => {
|
||||
store = {};
|
||||
}),
|
||||
get length() {
|
||||
return Object.keys(store).length;
|
||||
},
|
||||
};
|
||||
})();
|
||||
|
||||
vi.stubGlobal('localStorage', localStorageMock);
|
||||
vi.stubGlobal('window', { localStorage: localStorageMock });
|
||||
|
||||
store = new HardcoverSyncMapStore(mockAppService);
|
||||
});
|
||||
|
||||
test('should load from localStorage on web', async () => {
|
||||
const bookHash = 'test-book-hash';
|
||||
const noteId = 'note-1';
|
||||
const mapping = {
|
||||
book_hash: bookHash,
|
||||
note_id: noteId,
|
||||
hardcover_journal_id: 123,
|
||||
payload_hash: 'abc',
|
||||
synced_at: Date.now(),
|
||||
};
|
||||
|
||||
window.localStorage.setItem(
|
||||
`hardcover-note-mapping:${bookHash}:${noteId}`,
|
||||
JSON.stringify(mapping),
|
||||
);
|
||||
|
||||
await store.loadForBook(bookHash);
|
||||
const result = await store.getMapping(bookHash, noteId);
|
||||
|
||||
expect(result).toEqual(mapping);
|
||||
expect(mockAppService.openDatabase).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('should load from SQLite on native', async () => {
|
||||
// Force native path by removing window.localStorage
|
||||
vi.stubGlobal('window', {});
|
||||
|
||||
const bookHash = 'test-book-hash';
|
||||
const noteId = 'note-1';
|
||||
const mapping = {
|
||||
book_hash: bookHash,
|
||||
note_id: noteId,
|
||||
hardcover_journal_id: 123,
|
||||
payload_hash: 'abc',
|
||||
synced_at: Date.now(),
|
||||
};
|
||||
|
||||
mockDb.select.mockResolvedValueOnce([mapping]);
|
||||
|
||||
await store.loadForBook(bookHash);
|
||||
const result = await store.getMapping(bookHash, noteId);
|
||||
|
||||
expect(result).toEqual(mapping);
|
||||
expect(mockAppService.openDatabase).toHaveBeenCalledWith(
|
||||
'hardcover-sync',
|
||||
'hardcover-sync.db',
|
||||
'Data',
|
||||
);
|
||||
});
|
||||
|
||||
test('upsertMapping should mark as modified and flush should save to localStorage', async () => {
|
||||
const bookHash = 'test-book-hash';
|
||||
const noteId = 'note-1';
|
||||
|
||||
await store.upsertMapping(bookHash, noteId, 456, 'def');
|
||||
await store.flush();
|
||||
|
||||
const stored = JSON.parse(
|
||||
window.localStorage.getItem(`hardcover-note-mapping:${bookHash}:${noteId}`)!,
|
||||
);
|
||||
expect(stored.hardcover_journal_id).toBe(456);
|
||||
expect(stored.payload_hash).toBe('def');
|
||||
});
|
||||
|
||||
test('flush should persist mappings to SQLite on native', async () => {
|
||||
vi.stubGlobal('window', {});
|
||||
|
||||
const bookHash = 'test-book-hash';
|
||||
const noteId = 'note-1';
|
||||
|
||||
await store.upsertMapping(bookHash, noteId, 456, 'def');
|
||||
await store.flush();
|
||||
|
||||
expect(mockAppService.openDatabase).toHaveBeenCalledWith(
|
||||
'hardcover-sync',
|
||||
'hardcover-sync.db',
|
||||
'Data',
|
||||
);
|
||||
expect(mockDb.execute).toHaveBeenCalledTimes(1);
|
||||
expect(mockDb.execute).toHaveBeenCalledWith(
|
||||
expect.stringContaining('INSERT INTO hardcover_note_mappings'),
|
||||
expect.arrayContaining([bookHash, noteId, 456, 'def']),
|
||||
);
|
||||
});
|
||||
|
||||
test('getMappingByPayloadHash should return the latest mapping', async () => {
|
||||
const bookHash = 'test-book-hash';
|
||||
const payloadHash = 'shared-payload';
|
||||
|
||||
const mapping1 = {
|
||||
book_hash: bookHash,
|
||||
note_id: 'note-1',
|
||||
hardcover_journal_id: 101,
|
||||
payload_hash: payloadHash,
|
||||
synced_at: 1000,
|
||||
};
|
||||
const mapping2 = {
|
||||
book_hash: bookHash,
|
||||
note_id: 'note-2',
|
||||
hardcover_journal_id: 102,
|
||||
payload_hash: payloadHash,
|
||||
synced_at: 2000,
|
||||
};
|
||||
|
||||
window.localStorage.setItem(
|
||||
`hardcover-note-mapping:${bookHash}:note-1`,
|
||||
JSON.stringify(mapping1),
|
||||
);
|
||||
window.localStorage.setItem(
|
||||
`hardcover-note-mapping:${bookHash}:note-2`,
|
||||
JSON.stringify(mapping2),
|
||||
);
|
||||
|
||||
const result = await store.getMappingByPayloadHash(bookHash, payloadHash);
|
||||
expect(result!.note_id).toBe('note-2');
|
||||
});
|
||||
});
|
||||
@@ -245,6 +245,26 @@ describe('importBook metaHash deduplication', () => {
|
||||
// Should create a new entry, not override existing
|
||||
expect(result).not.toBe(existingBook);
|
||||
});
|
||||
|
||||
it('should promote extracted ISBN into metadata.isbn during import', async () => {
|
||||
const books: Book[] = [];
|
||||
|
||||
mockPartialMD5.mockResolvedValue('new-hash-456');
|
||||
setupMockBookDoc({
|
||||
...TEST_METADATA,
|
||||
identifier: 'calibre:abc123',
|
||||
altIdentifier: ['urn:isbn:9780316033664', 'mobi-asin:B004J4XGN6'],
|
||||
});
|
||||
|
||||
const mockFile = new File(['new content'], 'test.epub', { type: 'application/epub+zip' });
|
||||
const result = await service.importBook(mockFile, books);
|
||||
expect(result).not.toBeNull();
|
||||
if (!result) {
|
||||
throw new Error('Expected importBook to return an imported book');
|
||||
}
|
||||
|
||||
expect(result.metadata?.isbn).toBe('9780316033664');
|
||||
});
|
||||
});
|
||||
|
||||
describe('importBook metaHash aggregation', () => {
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
import { describe, test, expect, vi } from 'vitest';
|
||||
import { RSVPController } from '@/services/rsvp/RSVPController';
|
||||
import { FoliateView } from '@/types/view';
|
||||
|
||||
function makeTextNode(text: string): Text {
|
||||
return { nodeType: Node.TEXT_NODE, textContent: text } as unknown as Text;
|
||||
}
|
||||
|
||||
function makeDoc(text: string): Document {
|
||||
const textNode = makeTextNode(text);
|
||||
const body = {
|
||||
nodeType: Node.ELEMENT_NODE,
|
||||
tagName: 'BODY',
|
||||
childNodes: [textNode],
|
||||
ownerDocument: null as unknown as Document,
|
||||
} as unknown as HTMLElement;
|
||||
|
||||
const doc = {
|
||||
body,
|
||||
createRange: vi.fn().mockReturnValue({
|
||||
setStart: vi.fn(),
|
||||
setEnd: vi.fn(),
|
||||
}),
|
||||
defaultView: {
|
||||
getComputedStyle: vi.fn().mockReturnValue({ display: 'block', visibility: 'visible' }),
|
||||
},
|
||||
} as unknown as Document;
|
||||
|
||||
(body as unknown as { ownerDocument: Document }).ownerDocument = doc;
|
||||
(textNode as unknown as { ownerDocument: Document }).ownerDocument = doc;
|
||||
return doc;
|
||||
}
|
||||
|
||||
function createMockView(primaryIndex: number, docs: Document[]): FoliateView {
|
||||
return {
|
||||
renderer: {
|
||||
primaryIndex,
|
||||
getContents: vi.fn().mockReturnValue(docs.map((doc, i) => ({ doc, index: i }))),
|
||||
},
|
||||
book: { toc: [] },
|
||||
language: { isCJK: false },
|
||||
tts: null,
|
||||
getCFI: vi.fn().mockReturnValue('epubcfi(/6/4!/4/2/1:0)'),
|
||||
resolveCFI: vi.fn().mockReturnValue({ anchor: vi.fn().mockReturnValue(new Range()) }),
|
||||
} as unknown as FoliateView;
|
||||
}
|
||||
|
||||
describe('RSVPController', () => {
|
||||
describe('start()', () => {
|
||||
test('extracts words from primary spine document only', () => {
|
||||
const ch1Doc = makeDoc('Hello world');
|
||||
const ch2Doc = makeDoc('Foo bar baz');
|
||||
const view = createMockView(0, [ch1Doc, ch2Doc]);
|
||||
const controller = new RSVPController(view, 'test-book-abc123');
|
||||
|
||||
controller.start();
|
||||
|
||||
// Should only have words from doc at primaryIndex 0
|
||||
expect(controller.currentState.words.length).toBe(2);
|
||||
expect(controller.currentState.words[0]!.text).toBe('Hello');
|
||||
expect(controller.currentState.words[1]!.text).toBe('world');
|
||||
});
|
||||
|
||||
test('sets active state after start', () => {
|
||||
const doc = makeDoc('one two three');
|
||||
const view = createMockView(0, [doc]);
|
||||
const controller = new RSVPController(view, 'test-book-abc123');
|
||||
|
||||
controller.start();
|
||||
|
||||
expect(controller.currentState.active).toBe(true);
|
||||
expect(controller.currentState.currentIndex).toBe(0);
|
||||
});
|
||||
|
||||
test('uses secondary doc when primaryIndex is 1', () => {
|
||||
const ch1Doc = makeDoc('Hello world');
|
||||
const ch2Doc = makeDoc('Foo bar');
|
||||
const view = createMockView(1, [ch1Doc, ch2Doc]);
|
||||
const controller = new RSVPController(view, 'test-book-abc123');
|
||||
|
||||
controller.start();
|
||||
|
||||
expect(controller.currentState.words.length).toBe(2);
|
||||
expect(controller.currentState.words[0]!.text).toBe('Foo');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,278 @@
|
||||
import { describe, test, expect } from 'vitest';
|
||||
import {
|
||||
isCJK,
|
||||
containsCJK,
|
||||
isCJKPunctuation,
|
||||
getSegmenterLocale,
|
||||
segmentCJKText,
|
||||
splitTextIntoWords,
|
||||
getHyphenParts,
|
||||
} from '@/services/rsvp/utils';
|
||||
|
||||
describe('rsvp/utils', () => {
|
||||
describe('isCJK', () => {
|
||||
test('returns true for CJK Unified Ideographs', () => {
|
||||
expect(isCJK('\u4e00')).toBe(true); // first CJK character
|
||||
expect(isCJK('\u9fff')).toBe(true); // last CJK character
|
||||
expect(isCJK('\u5f00')).toBe(true); // 开
|
||||
});
|
||||
|
||||
test('returns true for Hiragana', () => {
|
||||
expect(isCJK('\u3042')).toBe(true); // あ
|
||||
});
|
||||
|
||||
test('returns true for Katakana', () => {
|
||||
expect(isCJK('\u30A2')).toBe(true); // ア
|
||||
});
|
||||
|
||||
test('returns true for Hangul', () => {
|
||||
expect(isCJK('\uAC00')).toBe(true); // 가
|
||||
});
|
||||
|
||||
test('returns true for CJK Extension A', () => {
|
||||
expect(isCJK('\u3400')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true for CJK Compatibility Ideographs', () => {
|
||||
expect(isCJK('\uF900')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns false for Latin characters', () => {
|
||||
expect(isCJK('a')).toBe(false);
|
||||
expect(isCJK('Z')).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false for digits', () => {
|
||||
expect(isCJK('1')).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false for spaces', () => {
|
||||
expect(isCJK(' ')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('containsCJK', () => {
|
||||
test('returns true for text with CJK characters', () => {
|
||||
expect(containsCJK('Hello 你好')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true for pure CJK text', () => {
|
||||
expect(containsCJK('你好世界')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns false for pure Latin text', () => {
|
||||
expect(containsCJK('Hello World')).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false for empty string', () => {
|
||||
expect(containsCJK('')).toBe(false);
|
||||
});
|
||||
|
||||
test('returns true for Japanese hiragana', () => {
|
||||
expect(containsCJK('こんにちは')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true for Korean', () => {
|
||||
expect(containsCJK('안녕하세요')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isCJKPunctuation', () => {
|
||||
test('returns true for Chinese period', () => {
|
||||
expect(isCJKPunctuation('。')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true for Chinese comma', () => {
|
||||
expect(isCJKPunctuation(',')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true for full-width exclamation', () => {
|
||||
expect(isCJKPunctuation('!')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true for full-width question mark', () => {
|
||||
expect(isCJKPunctuation('?')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true for brackets', () => {
|
||||
expect(isCJKPunctuation('【')).toBe(true);
|
||||
expect(isCJKPunctuation('】')).toBe(true);
|
||||
expect(isCJKPunctuation('「')).toBe(true);
|
||||
expect(isCJKPunctuation('」')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns true for ellipsis', () => {
|
||||
expect(isCJKPunctuation('…')).toBe(true);
|
||||
});
|
||||
|
||||
test('returns false for standard Latin comma', () => {
|
||||
expect(isCJKPunctuation(',')).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false for Latin period', () => {
|
||||
expect(isCJKPunctuation('.')).toBe(false);
|
||||
});
|
||||
|
||||
test('returns false for a letter', () => {
|
||||
expect(isCJKPunctuation('A')).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getSegmenterLocale', () => {
|
||||
test('returns ja for Japanese hiragana text', () => {
|
||||
expect(getSegmenterLocale('こんにちは')).toBe('ja');
|
||||
});
|
||||
|
||||
test('returns ja for Katakana text', () => {
|
||||
expect(getSegmenterLocale('アイウ')).toBe('ja');
|
||||
});
|
||||
|
||||
test('returns ko for Korean text', () => {
|
||||
expect(getSegmenterLocale('안녕하세요')).toBe('ko');
|
||||
});
|
||||
|
||||
test('returns zh for Chinese text', () => {
|
||||
expect(getSegmenterLocale('你好世界')).toBe('zh');
|
||||
});
|
||||
|
||||
test('returns null for pure Latin text', () => {
|
||||
expect(getSegmenterLocale('Hello World')).toBeNull();
|
||||
});
|
||||
|
||||
test('returns null for empty string', () => {
|
||||
expect(getSegmenterLocale('')).toBeNull();
|
||||
});
|
||||
|
||||
test('detects first CJK script in mixed text', () => {
|
||||
// Japanese hiragana appears first
|
||||
expect(getSegmenterLocale('あ你好')).toBe('ja');
|
||||
});
|
||||
});
|
||||
|
||||
describe('segmentCJKText', () => {
|
||||
test('segments Chinese text into words', () => {
|
||||
const words = segmentCJKText('你好世界');
|
||||
expect(words.length).toBeGreaterThan(0);
|
||||
expect(words.join('')).toContain('你好');
|
||||
});
|
||||
|
||||
test('segments Japanese text', () => {
|
||||
const words = segmentCJKText('こんにちは');
|
||||
expect(words.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('handles text with punctuation', () => {
|
||||
const words = segmentCJKText('你好。世界!');
|
||||
expect(words.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('handles empty text', () => {
|
||||
const words = segmentCJKText('');
|
||||
expect(words).toEqual([]);
|
||||
});
|
||||
|
||||
test('handles single character', () => {
|
||||
const words = segmentCJKText('你');
|
||||
expect(words.length).toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
|
||||
test('attaches trailing CJK punctuation', () => {
|
||||
const words = segmentCJKText('你好!');
|
||||
// The punctuation should be attached to a word
|
||||
const hasWordWithPunct = words.some((w) => w.includes('!'));
|
||||
expect(hasWordWithPunct).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('splitTextIntoWords', () => {
|
||||
test('splits English text by spaces', () => {
|
||||
const words = splitTextIntoWords('Hello World');
|
||||
expect(words).toEqual(['Hello', 'World']);
|
||||
});
|
||||
|
||||
test('splits multi-word English text', () => {
|
||||
const words = splitTextIntoWords('The quick brown fox');
|
||||
expect(words).toEqual(['The', 'quick', 'brown', 'fox']);
|
||||
});
|
||||
|
||||
test('filters empty words', () => {
|
||||
const words = splitTextIntoWords(' Hello World ');
|
||||
expect(words.every((w) => w.trim().length > 0)).toBe(true);
|
||||
});
|
||||
|
||||
test('handles CJK text', () => {
|
||||
const words = splitTextIntoWords('你好世界');
|
||||
expect(words.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('handles mixed CJK and Latin text', () => {
|
||||
const words = splitTextIntoWords('Hello 你好 World');
|
||||
expect(words.length).toBeGreaterThan(0);
|
||||
// Should contain both CJK and Latin segments
|
||||
});
|
||||
|
||||
test('handles empty string', () => {
|
||||
const words = splitTextIntoWords('');
|
||||
expect(words).toEqual([]);
|
||||
});
|
||||
|
||||
test('handles CJK text with punctuation', () => {
|
||||
const words = splitTextIntoWords('你好。世界!');
|
||||
expect(words.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('handles CJK followed immediately by non-CJK', () => {
|
||||
const words = splitTextIntoWords('你好Hello');
|
||||
expect(words.length).toBeGreaterThanOrEqual(1);
|
||||
});
|
||||
|
||||
test('handles standalone CJK punctuation at start', () => {
|
||||
const words = splitTextIntoWords('。Hello');
|
||||
expect(words.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('handles non-CJK text followed by CJK punctuation', () => {
|
||||
const words = splitTextIntoWords('Hello。');
|
||||
expect(words.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test('handles whitespace between CJK segments', () => {
|
||||
const words = splitTextIntoWords('你好 世界');
|
||||
expect(words.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getHyphenParts', () => {
|
||||
test('splits a hyphenated word into two parts with trailing hyphen on first', () => {
|
||||
expect(getHyphenParts('well-known')).toEqual(['well-', 'known']);
|
||||
});
|
||||
|
||||
test('splits multiple letter-hyphens keeping trailing hyphen on each non-last part', () => {
|
||||
expect(getHyphenParts('one-two-three')).toEqual(['one-', 'two-', 'three']);
|
||||
});
|
||||
|
||||
test('returns word unchanged when no letter-hyphen-letter pattern', () => {
|
||||
expect(getHyphenParts('hello')).toEqual(['hello']);
|
||||
});
|
||||
|
||||
test('returns double-hyphen unchanged (em-dash style)', () => {
|
||||
expect(getHyphenParts('--')).toEqual(['--']);
|
||||
});
|
||||
|
||||
test('returns lone hyphen unchanged', () => {
|
||||
expect(getHyphenParts('-')).toEqual(['-']);
|
||||
});
|
||||
|
||||
test('returns consecutive-hyphen word unchanged', () => {
|
||||
expect(getHyphenParts('foo--bar')).toEqual(['foo--bar']);
|
||||
});
|
||||
|
||||
test('returns leading-hyphen word unchanged', () => {
|
||||
expect(getHyphenParts('-word')).toEqual(['-word']);
|
||||
});
|
||||
|
||||
test('returns trailing-hyphen word unchanged', () => {
|
||||
expect(getHyphenParts('word-')).toEqual(['word-']);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,96 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { migrateHighlightColorPrefs } from '@/services/settingsService';
|
||||
import type { ReadSettings } from '@/types/settings';
|
||||
|
||||
const baseRead = (): ReadSettings =>
|
||||
({
|
||||
customHighlightColors: {},
|
||||
userHighlightColors: [],
|
||||
defaultHighlightLabels: {},
|
||||
}) as unknown as ReadSettings;
|
||||
|
||||
describe('migrateHighlightColorPrefs', () => {
|
||||
it('lifts legacy string[] userHighlightColors into {hex} entries', () => {
|
||||
const read = baseRead();
|
||||
(read as unknown as { userHighlightColors: unknown }).userHighlightColors = [
|
||||
'#AABBCC',
|
||||
'#112233',
|
||||
];
|
||||
|
||||
migrateHighlightColorPrefs(read);
|
||||
|
||||
expect(read.userHighlightColors).toEqual([{ hex: '#aabbcc' }, { hex: '#112233' }]);
|
||||
});
|
||||
|
||||
it('preserves already-migrated entries', () => {
|
||||
const read = baseRead();
|
||||
read.userHighlightColors = [{ hex: '#abcdef', label: 'Keep me' }, { hex: '#123456' }];
|
||||
|
||||
migrateHighlightColorPrefs(read);
|
||||
|
||||
expect(read.userHighlightColors).toEqual([
|
||||
{ hex: '#abcdef', label: 'Keep me' },
|
||||
{ hex: '#123456' },
|
||||
]);
|
||||
});
|
||||
|
||||
it('filters out entries with malformed hex values', () => {
|
||||
const read = baseRead();
|
||||
(read as unknown as { userHighlightColors: unknown }).userHighlightColors = [
|
||||
'#abcdef',
|
||||
'not-a-hex',
|
||||
'',
|
||||
null,
|
||||
];
|
||||
|
||||
migrateHighlightColorPrefs(read);
|
||||
|
||||
expect(read.userHighlightColors).toEqual([{ hex: '#abcdef' }]);
|
||||
});
|
||||
|
||||
it('folds draft highlightColorLabels hex entries into matching user colors', () => {
|
||||
const read = baseRead();
|
||||
(read as unknown as { userHighlightColors: unknown }).userHighlightColors = ['#aabbcc'];
|
||||
(read as unknown as { highlightColorLabels: unknown }).highlightColorLabels = {
|
||||
'#aabbcc': 'Romance',
|
||||
};
|
||||
|
||||
migrateHighlightColorPrefs(read);
|
||||
|
||||
expect(read.userHighlightColors).toEqual([{ hex: '#aabbcc', label: 'Romance' }]);
|
||||
expect(
|
||||
(read as unknown as { highlightColorLabels?: unknown }).highlightColorLabels,
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it('folds draft highlightColorLabels named entries into defaultHighlightLabels', () => {
|
||||
const read = baseRead();
|
||||
(read as unknown as { highlightColorLabels: unknown }).highlightColorLabels = {
|
||||
yellow: 'Foreshadowing',
|
||||
red: 'Questions',
|
||||
noise: 'Ignored',
|
||||
};
|
||||
|
||||
migrateHighlightColorPrefs(read);
|
||||
|
||||
expect(read.defaultHighlightLabels).toEqual({
|
||||
yellow: 'Foreshadowing',
|
||||
red: 'Questions',
|
||||
});
|
||||
expect(
|
||||
(read as unknown as { highlightColorLabels?: unknown }).highlightColorLabels,
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it('does not overwrite an already-set defaultHighlightLabel', () => {
|
||||
const read = baseRead();
|
||||
read.defaultHighlightLabels = { yellow: 'Existing' };
|
||||
(read as unknown as { highlightColorLabels: unknown }).highlightColorLabels = {
|
||||
yellow: 'Legacy',
|
||||
};
|
||||
|
||||
migrateHighlightColorPrefs(read);
|
||||
|
||||
expect(read.defaultHighlightLabels).toEqual({ yellow: 'Existing' });
|
||||
});
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user