feat: Rename to Toju and add translation
Some checks failed
Deploy Web Apps / deploy (push) Successful in 5m52s
Build Android APK / build-android-apk (push) Failing after 23m15s
Queue Release Build / prepare (push) Successful in 1m42s
Queue Release Build / build-linux (push) Failing after 9m33s
Queue Release Build / build-windows (push) Successful in 26m5s
Queue Release Build / finalize (push) Has been skipped
Some checks failed
Deploy Web Apps / deploy (push) Successful in 5m52s
Build Android APK / build-android-apk (push) Failing after 23m15s
Queue Release Build / prepare (push) Successful in 1m42s
Queue Release Build / build-linux (push) Failing after 9m33s
Queue Release Build / build-windows (push) Successful in 26m5s
Queue Release Build / finalize (push) Has been skipped
This commit is contained in:
43
electron/app/desktop-branding.rules.ts
Normal file
43
electron/app/desktop-branding.rules.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
export const DESKTOP_APP_DISPLAY_NAME = 'Toju';
|
||||
export const DESKTOP_EXECUTABLE_NAME = 'toju';
|
||||
|
||||
export const LEGACY_APP_REGISTRY_NAMES = [
|
||||
'MetoYou',
|
||||
'MeToYou',
|
||||
'metoyou'
|
||||
] as const;
|
||||
|
||||
function normalizeAutostartBaseName(fileName: string): string {
|
||||
return fileName.replace(/\.desktop$/iu, '').replace(/\.exe$/iu, '');
|
||||
}
|
||||
|
||||
export function isLegacyLinuxAutostartEntry(
|
||||
fileName: string,
|
||||
currentLaunchBaseName: string
|
||||
): boolean {
|
||||
const entryBaseName = normalizeAutostartBaseName(fileName);
|
||||
const currentBaseName = normalizeAutostartBaseName(currentLaunchBaseName);
|
||||
|
||||
if (entryBaseName === currentBaseName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const normalizedEntry = entryBaseName.toLowerCase();
|
||||
|
||||
if (LEGACY_APP_REGISTRY_NAMES.some((legacyName) => normalizedEntry === legacyName.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return /^metoyou[-.]/iu.test(entryBaseName);
|
||||
}
|
||||
|
||||
export function patchLinuxAutostartDesktopEntryNameField(
|
||||
desktopEntry: string,
|
||||
displayName: string = DESKTOP_APP_DISPLAY_NAME
|
||||
): string {
|
||||
if (/^Name=.*$/m.test(desktopEntry)) {
|
||||
return desktopEntry.replace(/^Name=.*$/m, `Name=${displayName}`);
|
||||
}
|
||||
|
||||
return desktopEntry;
|
||||
}
|
||||
Reference in New Issue
Block a user