Fully migrate to ICU

This commit is contained in:
Jamie Kyle 2023-03-29 17:03:25 -07:00 committed by GitHub
parent d4e7177ba6
commit 5e647c55d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
274 changed files with 7948 additions and 1944 deletions

View file

@ -155,7 +155,7 @@ export class SystemTrayService {
id: 'toggleWindowVisibility',
...(browserWindow?.isVisible()
? {
label: this.i18n('hide'),
label: this.i18n('icu:hide'),
click: () => {
log.info(
'System tray service: hiding the window from the context menu'
@ -167,7 +167,7 @@ export class SystemTrayService {
},
}
: {
label: this.i18n('show'),
label: this.i18n('icu:show'),
click: () => {
log.info(
'System tray service: showing the window from the context menu'
@ -181,7 +181,7 @@ export class SystemTrayService {
},
{
id: 'quit',
label: this.i18n('quit'),
label: this.i18n('icu:quit'),
click: () => {
log.info(
'System tray service: quitting the app from the context menu'
@ -227,7 +227,7 @@ export class SystemTrayService {
}
});
result.setToolTip(this.i18n('signalDesktop'));
result.setToolTip(this.i18n('icu:signalDesktop'));
return result;
}

View file

@ -41,8 +41,8 @@ function handleError(prefix: string, error: Error): void {
}
export const updateLocale = (locale: LocaleType): void => {
quitText = locale.i18n('quit');
copyErrorAndQuitText = locale.i18n('copyErrorAndQuit');
quitText = locale.i18n('icu:quit');
copyErrorAndQuitText = locale.i18n('icu:copyErrorAndQuit');
};
function _getError(reason: unknown): Error {

View file

@ -930,10 +930,10 @@ async function createWindow() {
const n = new Notification({
title: getResolvedMessagesLocale().i18n(
'minimizeToTrayNotification--title'
'icu:minimizeToTrayNotification--title'
),
body: getResolvedMessagesLocale().i18n(
'minimizeToTrayNotification--body'
'icu:minimizeToTrayNotification--body'
),
});
@ -1199,7 +1199,7 @@ async function showScreenShareWindow(sourceName: string) {
minimizable: false,
resizable: false,
show: false,
title: getResolvedMessagesLocale().i18n('screenShareWindow'),
title: getResolvedMessagesLocale().i18n('icu:screenShareWindow'),
titleBarStyle: nonMainTitleBarStyle,
width,
webPreferences: {
@ -1251,7 +1251,7 @@ async function showAbout() {
width: 500,
height: 500,
resizable: false,
title: getResolvedMessagesLocale().i18n('aboutSignalDesktop'),
title: getResolvedMessagesLocale().i18n('icu:aboutSignalDesktop'),
titleBarStyle: nonMainTitleBarStyle,
titleBarOverlay,
autoHideMenuBar: true,
@ -1302,7 +1302,7 @@ async function showSettingsWindow() {
height: 700,
frame: true,
resizable: false,
title: getResolvedMessagesLocale().i18n('signalDesktopPreferences'),
title: getResolvedMessagesLocale().i18n('icu:signalDesktopPreferences'),
titleBarStyle: mainTitleBarStyle,
titleBarOverlay,
autoHideMenuBar: true,
@ -1384,7 +1384,7 @@ async function showDebugLogWindow() {
width: 700,
height: 500,
resizable: false,
title: getResolvedMessagesLocale().i18n('debugLog'),
title: getResolvedMessagesLocale().i18n('icu:debugLog'),
titleBarStyle: nonMainTitleBarStyle,
titleBarOverlay,
autoHideMenuBar: true,
@ -1449,7 +1449,7 @@ function showPermissionsPopupWindow(forCalling: boolean, forCamera: boolean) {
width: Math.min(400, size[0]),
height: Math.min(150, size[1]),
resizable: false,
title: getResolvedMessagesLocale().i18n('allowAccess'),
title: getResolvedMessagesLocale().i18n('icu:allowAccess'),
titleBarStyle: nonMainTitleBarStyle,
autoHideMenuBar: true,
backgroundColor: await getBackgroundColor(),
@ -1587,13 +1587,13 @@ const onDatabaseError = async (error: string) => {
const buttonIndex = dialog.showMessageBoxSync({
buttons: [
getResolvedMessagesLocale().i18n('deleteAndRestart'),
getResolvedMessagesLocale().i18n('copyErrorAndQuit'),
getResolvedMessagesLocale().i18n('icu:deleteAndRestart'),
getResolvedMessagesLocale().i18n('icu:copyErrorAndQuit'),
],
defaultId: 1,
cancelId: 1,
detail: redactAll(error),
message: getResolvedMessagesLocale().i18n('databaseError'),
message: getResolvedMessagesLocale().i18n('icu:databaseError'),
noLink: true,
type: 'error',
});

View file

@ -42,14 +42,14 @@ export const createTemplate = (
const template: MenuListType = [
{
label: i18n('mainMenuFile'),
label: i18n('icu:mainMenuFile'),
submenu: [
{
label: i18n('mainMenuCreateStickers'),
label: i18n('icu:mainMenuCreateStickers'),
click: openArtCreator,
},
{
label: i18n('mainMenuSettings'),
label: i18n('icu:mainMenuSettings'),
accelerator: 'CommandOrControl+,',
click: showSettings,
},
@ -58,78 +58,78 @@ export const createTemplate = (
},
{
role: 'quit',
label: i18n('appMenuQuit'),
label: i18n('icu:appMenuQuit'),
},
],
},
{
label: i18n('mainMenuEdit'),
label: i18n('icu:mainMenuEdit'),
submenu: [
{
role: 'undo',
label: i18n('editMenuUndo'),
label: i18n('icu:editMenuUndo'),
},
{
role: 'redo',
label: i18n('editMenuRedo'),
label: i18n('icu:editMenuRedo'),
},
{
type: 'separator',
},
{
role: 'cut',
label: i18n('editMenuCut'),
label: i18n('icu:editMenuCut'),
},
{
role: 'copy',
label: i18n('editMenuCopy'),
label: i18n('icu:editMenuCopy'),
},
{
role: 'paste',
label: i18n('editMenuPaste'),
label: i18n('icu:editMenuPaste'),
},
{
role: 'pasteAndMatchStyle',
label: i18n('editMenuPasteAndMatchStyle'),
label: i18n('icu:editMenuPasteAndMatchStyle'),
},
{
role: 'delete',
label: i18n('editMenuDelete'),
label: i18n('icu:editMenuDelete'),
},
{
role: 'selectAll',
label: i18n('editMenuSelectAll'),
label: i18n('icu:editMenuSelectAll'),
},
],
},
{
label: i18n('mainMenuView'),
label: i18n('icu:mainMenuView'),
submenu: [
{
role: 'resetZoom',
label: i18n('viewMenuResetZoom'),
label: i18n('icu:viewMenuResetZoom'),
},
{
accelerator: 'CmdOrCtrl+=',
role: 'zoomIn',
label: i18n('viewMenuZoomIn'),
label: i18n('icu:viewMenuZoomIn'),
},
{
role: 'zoomOut',
label: i18n('viewMenuZoomOut'),
label: i18n('icu:viewMenuZoomOut'),
},
{
type: 'separator',
},
{
role: 'togglefullscreen',
label: i18n('viewMenuToggleFullScreen'),
label: i18n('icu:viewMenuToggleFullScreen'),
},
{
type: 'separator',
},
{
label: i18n('debugLog'),
label: i18n('icu:debugLog'),
click: showDebugLog,
},
...(devTools
@ -139,14 +139,14 @@ export const createTemplate = (
},
{
role: 'toggleDevTools' as const,
label: i18n('viewMenuToggleDevTools'),
label: i18n('icu:viewMenuToggleDevTools'),
},
]
: []),
...(devTools && platform !== 'linux'
? [
{
label: i18n('forceUpdate'),
label: i18n('icu:forceUpdate'),
click: forceUpdate,
},
]
@ -154,21 +154,21 @@ export const createTemplate = (
],
},
{
label: i18n('mainMenuWindow'),
label: i18n('icu:mainMenuWindow'),
role: 'window',
submenu: [
{
role: 'minimize',
label: i18n('windowMenuMinimize'),
label: i18n('icu:windowMenuMinimize'),
},
],
},
{
label: i18n('mainMenuHelp'),
label: i18n('icu:mainMenuHelp'),
role: 'help',
submenu: [
{
label: i18n('helpMenuShowKeyboardShortcuts'),
label: i18n('icu:helpMenuShowKeyboardShortcuts'),
accelerator: 'CmdOrCtrl+/',
click: showKeyboardShortcuts,
},
@ -176,25 +176,25 @@ export const createTemplate = (
type: 'separator',
},
{
label: i18n('contactUs'),
label: i18n('icu:contactUs'),
click: openContactUs,
},
{
label: i18n('goToReleaseNotes'),
label: i18n('icu:goToReleaseNotes'),
click: openReleaseNotes,
},
{
label: i18n('goToForums'),
label: i18n('icu:goToForums'),
click: openForums,
},
{
label: i18n('goToSupportPage'),
label: i18n('icu:goToSupportPage'),
click: openSupportPage,
},
...(isProduction
? [
{
label: i18n('joinTheBeta'),
label: i18n('icu:joinTheBeta'),
click: openJoinTheBeta,
},
]
@ -203,7 +203,7 @@ export const createTemplate = (
type: 'separator',
},
{
label: i18n('aboutSignalDesktop'),
label: i18n('icu:aboutSignalDesktop'),
click: showAbout,
},
],
@ -217,7 +217,7 @@ export const createTemplate = (
// These are in reverse order, since we're prepending them one at a time
if (options.development) {
fileMenu.submenu.unshift({
label: i18n('menuSetupAsStandalone'),
label: i18n('icu:menuSetupAsStandalone'),
click: setupAsStandalone,
});
}
@ -226,7 +226,7 @@ export const createTemplate = (
type: 'separator',
});
fileMenu.submenu.unshift({
label: i18n('menuSetupAsNewDevice'),
label: i18n('icu:menuSetupAsNewDevice'),
click: setupAsNewDevice,
});
} else {
@ -270,7 +270,7 @@ function updateForMac(
type: 'separator',
},
{
label: i18n('windowMenuClose'),
label: i18n('icu:windowMenuClose'),
accelerator: 'CmdOrCtrl+W',
role: 'close',
}
@ -281,17 +281,17 @@ function updateForMac(
// Add the OSX-specific Signal Desktop menu at the far left
template.unshift({
label: i18n('signalDesktop'),
label: i18n('icu:signalDesktop'),
submenu: [
{
label: i18n('aboutSignalDesktop'),
label: i18n('icu:aboutSignalDesktop'),
click: showAbout,
},
{
type: 'separator',
},
{
label: i18n('mainMenuSettings'),
label: i18n('icu:mainMenuSettings'),
accelerator: 'CommandOrControl+,',
click: showSettings,
},
@ -299,29 +299,29 @@ function updateForMac(
type: 'separator',
},
{
label: i18n('appMenuServices'),
label: i18n('icu:appMenuServices'),
role: 'services',
},
{
type: 'separator',
},
{
label: i18n('appMenuHide'),
label: i18n('icu:appMenuHide'),
role: 'hide',
},
{
label: i18n('appMenuHideOthers'),
label: i18n('icu:appMenuHideOthers'),
role: 'hideOthers',
},
{
label: i18n('appMenuUnhide'),
label: i18n('icu:appMenuUnhide'),
role: 'unhide',
},
{
type: 'separator',
},
{
label: i18n('appMenuQuit'),
label: i18n('icu:appMenuQuit'),
role: 'quit',
},
],
@ -334,15 +334,15 @@ function updateForMac(
type: 'separator',
},
{
label: i18n('speech'),
label: i18n('icu:speech'),
submenu: [
{
role: 'startSpeaking',
label: i18n('editMenuStartSpeaking'),
label: i18n('icu:editMenuStartSpeaking'),
},
{
role: 'stopSpeaking',
label: i18n('editMenuStopSpeaking'),
label: i18n('icu:editMenuStopSpeaking'),
},
],
}
@ -355,16 +355,16 @@ function updateForMac(
// eslint-disable-next-line no-param-reassign
template[4].submenu = [
{
label: i18n('windowMenuMinimize'),
label: i18n('icu:windowMenuMinimize'),
accelerator: 'CmdOrCtrl+M',
role: 'minimize',
},
{
label: i18n('windowMenuZoom'),
label: i18n('icu:windowMenuZoom'),
role: 'zoom',
},
{
label: i18n('show'),
label: i18n('icu:show'),
accelerator: 'CmdOrCtrl+Shift+0',
click: showWindow,
},
@ -373,7 +373,7 @@ function updateForMac(
},
{
role: 'front',
label: i18n('windowMenuBringAllToFront'),
label: i18n('icu:windowMenuBringAllToFront'),
},
];

View file

@ -68,7 +68,7 @@ export const setup = (
);
} else {
template.push({
label: i18n('contextMenuNoSuggestions'),
label: i18n('icu:contextMenuNoSuggestions'),
enabled: false,
});
}
@ -77,18 +77,18 @@ export const setup = (
if (params.isEditable) {
if (editFlags.canUndo) {
template.push({ label: i18n('editMenuUndo'), role: 'undo' });
template.push({ label: i18n('icu:editMenuUndo'), role: 'undo' });
}
// This is only ever `true` if undo was triggered via the context menu
// (not ctrl/cmd+z)
if (editFlags.canRedo) {
template.push({ label: i18n('editMenuRedo'), role: 'redo' });
template.push({ label: i18n('icu:editMenuRedo'), role: 'redo' });
}
if (editFlags.canUndo || editFlags.canRedo) {
template.push({ type: 'separator' });
}
if (editFlags.canCut) {
template.push({ label: i18n('editMenuCut'), role: 'cut' });
template.push({ label: i18n('icu:editMenuCut'), role: 'cut' });
}
}
@ -100,7 +100,7 @@ export const setup = (
click = () => {
clipboard.writeText(params.linkURL);
};
label = i18n('contextMenuCopyLink');
label = i18n('icu:contextMenuCopyLink');
} else if (isImage) {
click = () => {
const parsedSrcUrl = maybeParseUrl(params.srcURL);
@ -113,9 +113,9 @@ export const setup = (
);
clipboard.writeImage(image);
};
label = i18n('contextMenuCopyImage');
label = i18n('icu:contextMenuCopyImage');
} else {
label = i18n('editMenuCopy');
label = i18n('icu:editMenuCopy');
}
template.push({
@ -126,12 +126,12 @@ export const setup = (
}
if (editFlags.canPaste && !isImage) {
template.push({ label: i18n('editMenuPaste'), role: 'paste' });
template.push({ label: i18n('icu:editMenuPaste'), role: 'paste' });
}
if (editFlags.canPaste && !isImage) {
template.push({
label: i18n('editMenuPasteAndMatchStyle'),
label: i18n('icu:editMenuPasteAndMatchStyle'),
role: 'pasteAndMatchStyle',
});
}
@ -140,7 +140,7 @@ export const setup = (
// results in all the UI being selected
if (editFlags.canSelectAll && params.isEditable) {
template.push({
label: i18n('editMenuSelectAll'),
label: i18n('icu:editMenuSelectAll'),
role: 'selectAll',
});
}