mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-09 04:07:07 +00:00
Merge pull request #1170 from vrtmrz/fix/issue-1164-readable-path-warning
Keep active-file path compatibility warnings readable
This commit is contained in:
@@ -4213,7 +4213,7 @@ export const allMessages: Readonly<Record<string, Readonly<Record<string, string
|
|||||||
"zh-tw": "正在等待就緒⋯",
|
"zh-tw": "正在等待就緒⋯",
|
||||||
},
|
},
|
||||||
"moduleLog.pathComponentTooLong": {
|
"moduleLog.pathComponentTooLong": {
|
||||||
def: "A file or folder name exceeds ${maxBytes} UTF-8 bytes and may not work on some Android and Linux file systems: ${components}",
|
def: "This path contains a file or folder name longer than ${maxBytes} UTF-8 bytes. It may not work on some Android and Linux file systems.",
|
||||||
},
|
},
|
||||||
"moduleLog.showLog": {
|
"moduleLog.showLog": {
|
||||||
def: "Show Log",
|
def: "Show Log",
|
||||||
|
|||||||
@@ -483,7 +483,7 @@
|
|||||||
"moduleLiveSyncMain.optionResumeAndRestart": "Resume and restart Obsidian",
|
"moduleLiveSyncMain.optionResumeAndRestart": "Resume and restart Obsidian",
|
||||||
"moduleLiveSyncMain.titleScramEnabled": "Scram Enabled",
|
"moduleLiveSyncMain.titleScramEnabled": "Scram Enabled",
|
||||||
"moduleLocalDatabase.logWaitingForReady": "Waiting for ready...",
|
"moduleLocalDatabase.logWaitingForReady": "Waiting for ready...",
|
||||||
"moduleLog.pathComponentTooLong": "A file or folder name exceeds ${maxBytes} UTF-8 bytes and may not work on some Android and Linux file systems: ${components}",
|
"moduleLog.pathComponentTooLong": "This path contains a file or folder name longer than ${maxBytes} UTF-8 bytes. It may not work on some Android and Linux file systems.",
|
||||||
"moduleLog.showLog": "Show Log",
|
"moduleLog.showLog": "Show Log",
|
||||||
"moduleMigration.fix0256.buttons.checkItLater": "Check it later",
|
"moduleMigration.fix0256.buttons.checkItLater": "Check it later",
|
||||||
"moduleMigration.fix0256.buttons.DismissForever": "I have fixed it, and do not ask again",
|
"moduleMigration.fix0256.buttons.DismissForever": "I have fixed it, and do not ask again",
|
||||||
|
|||||||
@@ -733,8 +733,8 @@ moduleLocalDatabase:
|
|||||||
logWaitingForReady: Waiting for ready...
|
logWaitingForReady: Waiting for ready...
|
||||||
moduleLog:
|
moduleLog:
|
||||||
pathComponentTooLong: >-
|
pathComponentTooLong: >-
|
||||||
A file or folder name exceeds ${maxBytes} UTF-8 bytes and may not work on
|
This path contains a file or folder name longer than ${maxBytes} UTF-8
|
||||||
some Android and Linux file systems: ${components}
|
bytes. It may not work on some Android and Linux file systems.
|
||||||
showLog: Show Log
|
showLog: Show Log
|
||||||
moduleMigration:
|
moduleMigration:
|
||||||
fix0256:
|
fix0256:
|
||||||
|
|||||||
@@ -21,6 +21,23 @@ describe("LiveSync-owned translation catalogue", () => {
|
|||||||
expect($msg("moduleCheckRemoteSize.optionIncreaseLimit", { newMax: "800" }, "def")).toBe("increase to 800MB");
|
expect($msg("moduleCheckRemoteSize.optionIncreaseLimit", { newMax: "800" }, "def")).toBe("increase to 800MB");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("keeps the active-file path compatibility warning concise", () => {
|
||||||
|
const oversizedComponent = `${"界".repeat(86)} (258 bytes)`;
|
||||||
|
|
||||||
|
expect(
|
||||||
|
$msg(
|
||||||
|
"moduleLog.pathComponentTooLong",
|
||||||
|
{
|
||||||
|
maxBytes: "255",
|
||||||
|
components: oversizedComponent,
|
||||||
|
},
|
||||||
|
"def"
|
||||||
|
)
|
||||||
|
).toBe(
|
||||||
|
"This path contains a file or folder name longer than 255 UTF-8 bytes. It may not work on some Android and Linux file systems."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("uses Commonlib's canonical English when the application catalogue has no translation", () => {
|
it("uses Commonlib's canonical English when the application catalogue has no translation", () => {
|
||||||
setLang("es");
|
setLang("es");
|
||||||
|
|
||||||
|
|||||||
@@ -299,13 +299,9 @@ export class ModuleLog extends AbstractObsidianModule {
|
|||||||
}
|
}
|
||||||
const oversizedPathComponents = findPathComponentsExceedingUtf8Limit(thisFile.path);
|
const oversizedPathComponents = findPathComponentsExceedingUtf8Limit(thisFile.path);
|
||||||
if (oversizedPathComponents.length > 0) {
|
if (oversizedPathComponents.length > 0) {
|
||||||
const components = oversizedPathComponents
|
|
||||||
.map(({ component, utf8Bytes }) => `${component} (${utf8Bytes} bytes)`)
|
|
||||||
.join(", ");
|
|
||||||
reasonWarn.push(
|
reasonWarn.push(
|
||||||
$msg("moduleLog.pathComponentTooLong", {
|
$msg("moduleLog.pathComponentTooLong", {
|
||||||
maxBytes: `${ANDROID_LINUX_PATH_COMPONENT_UTF8_WARNING_BOUNDARY}`,
|
maxBytes: `${ANDROID_LINUX_PATH_COMPONENT_UTF8_WARNING_BOUNDARY}`,
|
||||||
components,
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ Earlier releases remain available in the 1.0 release history, the 1.0 preview hi
|
|||||||
#### Improved
|
#### Improved
|
||||||
|
|
||||||
- Start-up now keeps unconfigured Vaults on the onboarding path without running configured-only checks or accepting Config Doctor and incomplete-document repair requests. Returning a configured Vault to an unconfigured state also retires those requests for the current plug-in process, so completing setup admits them only after the requested restart.
|
- Start-up now keeps unconfigured Vaults on the onboarding path without running configured-only checks or accepting Config Doctor and incomplete-document repair requests. Returning a configured Vault to an unconfigured state also retires those requests for the current plug-in process, so completing setup admits them only after the requested restart.
|
||||||
- The active-file warning now identifies file or folder names longer than 255 UTF-8 bytes as an Android and Linux compatibility risk, without rejecting or changing the path.
|
- The active-file warning now concisely identifies file or folder names longer than 255 UTF-8 bytes as an Android and Linux compatibility risk, without rejecting or changing the path.
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user