mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
Fix reference to build-localized-display-names script
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 { createLogger } from '../ts/logging/log.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');
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
import { join } from 'node:path';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { app } from 'electron';
|
||||
import lodash from 'lodash';
|
||||
import * as LocaleMatcher from '@formatjs/intl-localematcher';
|
||||
import { z } from 'zod';
|
||||
@@ -124,17 +123,19 @@ export function _getAvailableLocales(): Array<string> {
|
||||
}
|
||||
|
||||
export function load({
|
||||
preferredSystemLocales,
|
||||
localeOverride,
|
||||
localeDirectionTestingOverride,
|
||||
hourCyclePreference,
|
||||
isPackaged,
|
||||
localeDirectionTestingOverride,
|
||||
localeOverride,
|
||||
logger,
|
||||
preferredSystemLocales,
|
||||
}: {
|
||||
preferredSystemLocales: Array<string>;
|
||||
localeOverride: string | null;
|
||||
localeDirectionTestingOverride: LocaleDirection | null;
|
||||
hourCyclePreference: HourCyclePreference;
|
||||
isPackaged: boolean;
|
||||
localeDirectionTestingOverride: LocaleDirection | null;
|
||||
localeOverride: string | null;
|
||||
logger: LoggerType;
|
||||
preferredSystemLocales: Array<string>;
|
||||
}): LocaleType {
|
||||
if (preferredSystemLocales == null) {
|
||||
throw new TypeError('locale: `preferredSystemLocales` is required');
|
||||
@@ -163,7 +164,7 @@ export function load({
|
||||
const countryDisplayNames = getCountryDisplayNames();
|
||||
|
||||
let finalMessages: LocaleMessagesType;
|
||||
if (app.isPackaged) {
|
||||
if (isPackaged) {
|
||||
const matchedLocaleMessages = getCompactLocaleValues(matchedLocale);
|
||||
const englishMessages = getCompactLocaleValues('en');
|
||||
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 { getHeicConverter } from '../ts/workers/heicConverterMain.main.js';
|
||||
|
||||
import type { LocaleDirection, LocaleType } from './locale.main.js';
|
||||
import { load as loadLocale } from './locale.main.js';
|
||||
import type { LocaleDirection, LocaleType } from './locale.node.js';
|
||||
import { load as loadLocale } from './locale.node.js';
|
||||
|
||||
import { HourCyclePreference } from '../ts/types/I18N.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);
|
||||
resolvedTranslationsLocale = loadLocale({
|
||||
preferredSystemLocales,
|
||||
localeOverride,
|
||||
localeDirectionTestingOverride,
|
||||
hourCyclePreference,
|
||||
isPackaged: app.isPackaged,
|
||||
localeDirectionTestingOverride,
|
||||
localeOverride,
|
||||
logger: log,
|
||||
preferredSystemLocales,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { parse } from 'csv-parse';
|
||||
import fs from 'node:fs/promises';
|
||||
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';
|
||||
|
||||
const type = process.argv[2];
|
||||
@@ -4,7 +4,7 @@
|
||||
import { assert } from 'chai';
|
||||
import { stub } from 'sinon';
|
||||
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 { HourCyclePreference } from '../../types/I18N.std.js';
|
||||
|
||||
@@ -26,11 +26,12 @@ describe('locale', async () => {
|
||||
expectedLocale: string
|
||||
) {
|
||||
const actualLocale = await load({
|
||||
preferredSystemLocales,
|
||||
localeOverride: null,
|
||||
localeDirectionTestingOverride: null,
|
||||
hourCyclePreference: HourCyclePreference.UnknownPreference,
|
||||
isPackaged: false,
|
||||
localeDirectionTestingOverride: null,
|
||||
localeOverride: null,
|
||||
logger,
|
||||
preferredSystemLocales,
|
||||
});
|
||||
assert.strictEqual(actualLocale.name, expectedLocale);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import type pino from 'pino';
|
||||
|
||||
import type { CreateTemplateOptionsType } 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 { LoggerType } from '../../types/Logging.std.js';
|
||||
import { HourCyclePreference } from '../../types/I18N.std.js';
|
||||
@@ -216,11 +216,12 @@ describe('createTemplate', () => {
|
||||
};
|
||||
|
||||
const { i18n } = loadLocale({
|
||||
preferredSystemLocales: ['en'],
|
||||
localeOverride: null,
|
||||
localeDirectionTestingOverride: null,
|
||||
hourCyclePreference: HourCyclePreference.UnknownPreference,
|
||||
isPackaged: false,
|
||||
localeDirectionTestingOverride: null,
|
||||
localeOverride: null,
|
||||
logger,
|
||||
preferredSystemLocales: ['en'],
|
||||
});
|
||||
|
||||
const actions = {
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { IntlShape } from 'react-intl';
|
||||
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 {
|
||||
ICUJSXMessageParamsByKeyType,
|
||||
ICUStringMessageParamsByKeyType,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// 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 HorizontalArrowKey = 'ArrowLeft' | 'ArrowRight';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { Bytes } from '../context/Bytes.std.js';
|
||||
import { Crypto } from '../context/Crypto.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 type { ActiveWindowServiceType } from '../services/ActiveWindowService.std.js';
|
||||
import type { LocaleEmojiListType } from '../types/emoji.std.js';
|
||||
|
||||
Reference in New Issue
Block a user