mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 10:19:08 +00:00
Fix reference to build-localized-display-names script
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
@@ -8,7 +8,7 @@ import * as Errors from '../ts/types/errors.std.js';
|
|||||||
import { redactAll } from '../ts/util/privacy.node.js';
|
import { redactAll } from '../ts/util/privacy.node.js';
|
||||||
import { createLogger } from '../ts/logging/log.std.js';
|
import { createLogger } from '../ts/logging/log.std.js';
|
||||||
import { reallyJsonStringify } from '../ts/util/reallyJsonStringify.std.js';
|
import { reallyJsonStringify } from '../ts/util/reallyJsonStringify.std.js';
|
||||||
import type { LocaleType } from './locale.main.js';
|
import type { LocaleType } from './locale.node.js';
|
||||||
|
|
||||||
const log = createLogger('global_errors');
|
const log = createLogger('global_errors');
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
import { readFileSync } from 'node:fs';
|
import { readFileSync } from 'node:fs';
|
||||||
import { app } from 'electron';
|
|
||||||
import lodash from 'lodash';
|
import lodash from 'lodash';
|
||||||
import * as LocaleMatcher from '@formatjs/intl-localematcher';
|
import * as LocaleMatcher from '@formatjs/intl-localematcher';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
@@ -124,17 +123,19 @@ export function _getAvailableLocales(): Array<string> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function load({
|
export function load({
|
||||||
preferredSystemLocales,
|
|
||||||
localeOverride,
|
|
||||||
localeDirectionTestingOverride,
|
|
||||||
hourCyclePreference,
|
hourCyclePreference,
|
||||||
|
isPackaged,
|
||||||
|
localeDirectionTestingOverride,
|
||||||
|
localeOverride,
|
||||||
logger,
|
logger,
|
||||||
|
preferredSystemLocales,
|
||||||
}: {
|
}: {
|
||||||
preferredSystemLocales: Array<string>;
|
|
||||||
localeOverride: string | null;
|
|
||||||
localeDirectionTestingOverride: LocaleDirection | null;
|
|
||||||
hourCyclePreference: HourCyclePreference;
|
hourCyclePreference: HourCyclePreference;
|
||||||
|
isPackaged: boolean;
|
||||||
|
localeDirectionTestingOverride: LocaleDirection | null;
|
||||||
|
localeOverride: string | null;
|
||||||
logger: LoggerType;
|
logger: LoggerType;
|
||||||
|
preferredSystemLocales: Array<string>;
|
||||||
}): LocaleType {
|
}): LocaleType {
|
||||||
if (preferredSystemLocales == null) {
|
if (preferredSystemLocales == null) {
|
||||||
throw new TypeError('locale: `preferredSystemLocales` is required');
|
throw new TypeError('locale: `preferredSystemLocales` is required');
|
||||||
@@ -163,7 +164,7 @@ export function load({
|
|||||||
const countryDisplayNames = getCountryDisplayNames();
|
const countryDisplayNames = getCountryDisplayNames();
|
||||||
|
|
||||||
let finalMessages: LocaleMessagesType;
|
let finalMessages: LocaleMessagesType;
|
||||||
if (app.isPackaged) {
|
if (isPackaged) {
|
||||||
const matchedLocaleMessages = getCompactLocaleValues(matchedLocale);
|
const matchedLocaleMessages = getCompactLocaleValues(matchedLocale);
|
||||||
const englishMessages = getCompactLocaleValues('en');
|
const englishMessages = getCompactLocaleValues('en');
|
||||||
const keys = getCompactLocaleKeys();
|
const keys = getCompactLocaleKeys();
|
||||||
@@ -119,8 +119,8 @@ import { SettingsChannel } from '../ts/main/settingsChannel.main.js';
|
|||||||
import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url.std.js';
|
import { maybeParseUrl, setUrlSearchParams } from '../ts/util/url.std.js';
|
||||||
import { getHeicConverter } from '../ts/workers/heicConverterMain.main.js';
|
import { getHeicConverter } from '../ts/workers/heicConverterMain.main.js';
|
||||||
|
|
||||||
import type { LocaleDirection, LocaleType } from './locale.main.js';
|
import type { LocaleDirection, LocaleType } from './locale.node.js';
|
||||||
import { load as loadLocale } from './locale.main.js';
|
import { load as loadLocale } from './locale.node.js';
|
||||||
|
|
||||||
import { HourCyclePreference } from '../ts/types/I18N.std.js';
|
import { HourCyclePreference } from '../ts/types/I18N.std.js';
|
||||||
import { ScreenShareStatus } from '../ts/types/Calling.std.js';
|
import { ScreenShareStatus } from '../ts/types/Calling.std.js';
|
||||||
@@ -2075,11 +2075,12 @@ app.on('ready', async () => {
|
|||||||
|
|
||||||
log.info('app.ready: preferred system locales:', preferredSystemLocales);
|
log.info('app.ready: preferred system locales:', preferredSystemLocales);
|
||||||
resolvedTranslationsLocale = loadLocale({
|
resolvedTranslationsLocale = loadLocale({
|
||||||
preferredSystemLocales,
|
|
||||||
localeOverride,
|
|
||||||
localeDirectionTestingOverride,
|
|
||||||
hourCyclePreference,
|
hourCyclePreference,
|
||||||
|
isPackaged: app.isPackaged,
|
||||||
|
localeDirectionTestingOverride,
|
||||||
|
localeOverride,
|
||||||
logger: log,
|
logger: log,
|
||||||
|
preferredSystemLocales,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import { parse } from 'csv-parse';
|
import { parse } from 'csv-parse';
|
||||||
import fs from 'node:fs/promises';
|
import fs from 'node:fs/promises';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { _getAvailableLocales } from '../../app/locale.main.js';
|
import { _getAvailableLocales } from '../../app/locale.node.js';
|
||||||
import { parseUnknown } from '../util/schemas.std.js';
|
import { parseUnknown } from '../util/schemas.std.js';
|
||||||
|
|
||||||
const type = process.argv[2];
|
const type = process.argv[2];
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
import { assert } from 'chai';
|
import { assert } from 'chai';
|
||||||
import { stub } from 'sinon';
|
import { stub } from 'sinon';
|
||||||
import * as LocaleMatcher from '@formatjs/intl-localematcher';
|
import * as LocaleMatcher from '@formatjs/intl-localematcher';
|
||||||
import { load, _getAvailableLocales } from '../../../app/locale.main.js';
|
import { load, _getAvailableLocales } from '../../../app/locale.node.js';
|
||||||
import { FAKE_DEFAULT_LOCALE } from '../../../app/spell_check.main.js';
|
import { FAKE_DEFAULT_LOCALE } from '../../../app/spell_check.main.js';
|
||||||
import { HourCyclePreference } from '../../types/I18N.std.js';
|
import { HourCyclePreference } from '../../types/I18N.std.js';
|
||||||
|
|
||||||
@@ -26,11 +26,12 @@ describe('locale', async () => {
|
|||||||
expectedLocale: string
|
expectedLocale: string
|
||||||
) {
|
) {
|
||||||
const actualLocale = await load({
|
const actualLocale = await load({
|
||||||
preferredSystemLocales,
|
|
||||||
localeOverride: null,
|
|
||||||
localeDirectionTestingOverride: null,
|
|
||||||
hourCyclePreference: HourCyclePreference.UnknownPreference,
|
hourCyclePreference: HourCyclePreference.UnknownPreference,
|
||||||
|
isPackaged: false,
|
||||||
|
localeDirectionTestingOverride: null,
|
||||||
|
localeOverride: null,
|
||||||
logger,
|
logger,
|
||||||
|
preferredSystemLocales,
|
||||||
});
|
});
|
||||||
assert.strictEqual(actualLocale.name, expectedLocale);
|
assert.strictEqual(actualLocale.name, expectedLocale);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import type pino from 'pino';
|
|||||||
|
|
||||||
import type { CreateTemplateOptionsType } from '../../../app/menu.std.js';
|
import type { CreateTemplateOptionsType } from '../../../app/menu.std.js';
|
||||||
import { createTemplate } from '../../../app/menu.std.js';
|
import { createTemplate } from '../../../app/menu.std.js';
|
||||||
import { load as loadLocale } from '../../../app/locale.main.js';
|
import { load as loadLocale } from '../../../app/locale.node.js';
|
||||||
import type { MenuListType } from '../../types/menu.std.js';
|
import type { MenuListType } from '../../types/menu.std.js';
|
||||||
import type { LoggerType } from '../../types/Logging.std.js';
|
import type { LoggerType } from '../../types/Logging.std.js';
|
||||||
import { HourCyclePreference } from '../../types/I18N.std.js';
|
import { HourCyclePreference } from '../../types/I18N.std.js';
|
||||||
@@ -216,11 +216,12 @@ describe('createTemplate', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const { i18n } = loadLocale({
|
const { i18n } = loadLocale({
|
||||||
preferredSystemLocales: ['en'],
|
|
||||||
localeOverride: null,
|
|
||||||
localeDirectionTestingOverride: null,
|
|
||||||
hourCyclePreference: HourCyclePreference.UnknownPreference,
|
hourCyclePreference: HourCyclePreference.UnknownPreference,
|
||||||
|
isPackaged: false,
|
||||||
|
localeDirectionTestingOverride: null,
|
||||||
|
localeOverride: null,
|
||||||
logger,
|
logger,
|
||||||
|
preferredSystemLocales: ['en'],
|
||||||
});
|
});
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import type { IntlShape } from 'react-intl';
|
import type { IntlShape } from 'react-intl';
|
||||||
import type { AciString } from './ServiceId.std.js';
|
import type { AciString } from './ServiceId.std.js';
|
||||||
import type { LocaleDirection } from '../../app/locale.main.js';
|
import type { LocaleDirection } from '../../app/locale.node.js';
|
||||||
import type {
|
import type {
|
||||||
ICUJSXMessageParamsByKeyType,
|
ICUJSXMessageParamsByKeyType,
|
||||||
ICUStringMessageParamsByKeyType,
|
ICUStringMessageParamsByKeyType,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright 2021 Signal Messenger, LLC
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
// SPDX-License-Identifier: AGPL-3.0-only
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
import type { LocaleDirection } from '../../app/locale.main.js';
|
import type { LocaleDirection } from '../../app/locale.node.js';
|
||||||
|
|
||||||
export type LogicalDirection = 'start' | 'end';
|
export type LogicalDirection = 'start' | 'end';
|
||||||
export type HorizontalArrowKey = 'ArrowLeft' | 'ArrowRight';
|
export type HorizontalArrowKey = 'ArrowLeft' | 'ArrowRight';
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { Bytes } from '../context/Bytes.std.js';
|
|||||||
import { Crypto } from '../context/Crypto.node.js';
|
import { Crypto } from '../context/Crypto.node.js';
|
||||||
import { Timers } from '../context/Timers.node.js';
|
import { Timers } from '../context/Timers.node.js';
|
||||||
|
|
||||||
import type { LocaleDirection } from '../../app/locale.main.js';
|
import type { LocaleDirection } from '../../app/locale.node.js';
|
||||||
import { i18n } from '../context/i18n.preload.js';
|
import { i18n } from '../context/i18n.preload.js';
|
||||||
import type { ActiveWindowServiceType } from '../services/ActiveWindowService.std.js';
|
import type { ActiveWindowServiceType } from '../services/ActiveWindowService.std.js';
|
||||||
import type { LocaleEmojiListType } from '../types/emoji.std.js';
|
import type { LocaleEmojiListType } from '../types/emoji.std.js';
|
||||||
|
|||||||
Reference in New Issue
Block a user