Move i18n setup to TypeScript

This commit is contained in:
Josh Perez 2021-09-17 20:30:08 -04:00 committed by GitHub
parent 4dcbb7352f
commit 829e42ca6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
155 changed files with 182 additions and 182 deletions

View file

@ -4,10 +4,11 @@
import { join } from 'path';
import { readFileSync } from 'fs';
import { merge } from 'lodash';
import { setup } from '../js/modules/i18n';
import { setupI18n } from '../ts/util/setupI18n';
import { LoggerType } from '../ts/types/Logging';
import { LocalizerType, LocaleMessagesType } from '../ts/types/I18N';
import { LocaleMessagesType } from '../ts/types/I18N';
import { LocalizerType } from '../ts/types/Util';
function normalizeLocaleName(locale: string): string {
if (/^en-/.test(locale)) {
@ -75,7 +76,7 @@ export function load({
messages = english;
}
const i18n = setup(appLocale, messages);
const i18n = setupI18n(appLocale, messages);
return {
i18n,

View file

@ -9,7 +9,7 @@ const url = require('url');
// It is important to call this as early as possible
require('./ts/windows/context');
const i18n = require('./js/modules/i18n');
const { setupI18n } = require('./ts/util/setupI18n');
const {
getEnvironment,
setEnvironment,
@ -23,7 +23,7 @@ setEnvironment(parseEnvironment(config.environment));
window.getVersion = () => config.version;
window.theme = config.theme;
window.i18n = i18n.setup(locale, localeMessages);
window.i18n = setupI18n(locale, localeMessages);
// got.js appears to need this to successfully submit debug logs to the cloud
window.nodeSetImmediate = setImmediate;

View file

@ -1,9 +0,0 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { LocalizerType } from '../../ts/types/Util';
export const setup: (
language: string,
messages: Record<string, unknown>
) => LocalizerType;

View file

@ -422,11 +422,11 @@ try {
window.PQueue = require('p-queue').default;
const Signal = require('./js/modules/signal');
const i18n = require('./js/modules/i18n');
const { setupI18n } = require('./ts/util/setupI18n');
const Attachments = require('./app/attachments');
const { locale } = config;
window.i18n = i18n.setup(locale, localeMessages);
window.i18n = setupI18n(locale, localeMessages);
window.moment.updateLocale(locale, {
relativeTime: {
s: window.i18n('timestamp_s'),

View file

@ -6,7 +6,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import {
AddGroupMemberErrorDialog,

View file

@ -6,7 +6,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { Alert } from './Alert';

View file

@ -9,7 +9,7 @@ import { boolean, select, text } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { Avatar, AvatarBlur, Props } from './Avatar';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { AvatarColors, AvatarColorType } from '../types/Colors';

View file

@ -5,7 +5,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { AvatarColorPicker, PropsType } from './AvatarColorPicker';

View file

@ -5,7 +5,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { AvatarColors } from '../types/Colors';

View file

@ -5,7 +5,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { AvatarIconEditor, PropsType } from './AvatarIconEditor';

View file

@ -10,7 +10,7 @@ import { select } from '@storybook/addon-knobs';
import enMessages from '../../_locales/en/messages.json';
import { AvatarColors } from '../types/Colors';
import { AvatarLightbox, PropsType } from './AvatarLightbox';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
const i18n = setupI18n('en', enMessages);

View file

@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions';
import enMessages from '../../_locales/en/messages.json';
import { AvatarModalButtons, PropsType } from './AvatarModalButtons';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
const i18n = setupI18n('en', enMessages);

View file

@ -9,7 +9,7 @@ import { boolean, select, text } from '@storybook/addon-knobs';
import { AvatarPopup, Props } from './AvatarPopup';
import { AvatarColors, AvatarColorType } from '../types/Colors';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -9,7 +9,7 @@ import { storiesOf } from '@storybook/react';
import { AvatarPreview, PropsType } from './AvatarPreview';
import { AvatarColors } from '../types/Colors';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -5,7 +5,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { AvatarTextEditor, PropsType } from './AvatarTextEditor';

View file

@ -5,7 +5,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { AvatarUploadButton, PropsType } from './AvatarUploadButton';

View file

@ -11,7 +11,7 @@ import { AvatarColors } from '../types/Colors';
import { GroupAvatarIcons, PersonalAvatarIcons } from '../types/Avatar';
import { BetterAvatar, PropsType } from './BetterAvatar';
import { createAvatarData } from '../util/createAvatarData';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
const i18n = setupI18n('en', enMessages);

View file

@ -9,7 +9,7 @@ import { action } from '@storybook/addon-actions';
import enMessages from '../../_locales/en/messages.json';
import { AvatarColors } from '../types/Colors';
import { BetterAvatarBubble, PropsType } from './BetterAvatarBubble';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
const i18n = setupI18n('en', enMessages);

View file

@ -18,7 +18,7 @@ import { ConversationTypeType } from '../state/ducks/conversations';
import { AvatarColors, AvatarColorType } from '../types/Colors';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import { Props as SafetyNumberViewerProps } from '../state/smart/SafetyNumberViewer';
import enMessages from '../../_locales/en/messages.json';

View file

@ -18,7 +18,7 @@ import {
import { ConversationType } from '../state/ducks/conversations';
import { AvatarColors } from '../types/Colors';
import { CallScreen, PropsType } from './CallScreen';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import { missingCaseError } from '../util/missingCaseError';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';

View file

@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions';
import { CallingButton, CallingButtonType, PropsType } from './CallingButton';
import { TooltipPlacement } from './Tooltip';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -6,7 +6,7 @@ import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react';
import { CallingDeviceSelection, Props } from './CallingDeviceSelection';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -7,7 +7,7 @@ import { boolean, number } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { CallingHeader, PropsType } from './CallingHeader';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -11,7 +11,7 @@ import { v4 as generateUuid } from 'uuid';
import { AvatarColors } from '../types/Colors';
import { ConversationType } from '../state/ducks/conversations';
import { CallingLobby, PropsType } from './CallingLobby';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';

View file

@ -11,7 +11,7 @@ import { CallingParticipantsList, PropsType } from './CallingParticipantsList';
import { AvatarColors } from '../types/Colors';
import { GroupCallRemoteParticipantType } from '../types/Calling';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -19,7 +19,7 @@ import {
} from '../types/Calling';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -4,7 +4,7 @@
import React from 'react';
import { times, range } from 'lodash';
import { storiesOf } from '@storybook/react';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';

View file

@ -10,7 +10,7 @@ import {
PropsType,
} from './CallingScreenSharingController';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -10,7 +10,7 @@ import {
PropsType,
} from './CallingSelectPresentingSourcesModal';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -8,7 +8,7 @@ import { storiesOf } from '@storybook/react';
import { CaptchaDialog } from './CaptchaDialog';
import { Button } from './Button';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const story = storiesOf('Components/CaptchaDialog', module);

View file

@ -9,7 +9,7 @@ import { action } from '@storybook/addon-actions';
import { CaptionEditor, Props } from './CaptionEditor';
import { AUDIO_MP3, IMAGE_JPEG, VIDEO_MP4 } from '../types/MIME';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -10,7 +10,7 @@ import { select } from '@storybook/addon-knobs';
import enMessages from '../../_locales/en/messages.json';
import { ChatColorPicker, PropsType } from './ChatColorPicker';
import { ConversationColors } from '../types/Colors';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
const story = storiesOf('Components/ChatColorPicker', module);

View file

@ -5,7 +5,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { ClearingData } from './ClearingData';

View file

@ -9,7 +9,7 @@ import { boolean } from '@storybook/addon-knobs';
import { IMAGE_JPEG } from '../types/MIME';
import { CompositionArea, Props } from './CompositionArea';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -10,7 +10,7 @@ import { action } from '@storybook/addon-actions';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { CompositionInput, Props } from './CompositionInput';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -5,7 +5,7 @@ import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { ConfirmDiscardDialog, PropsType } from './ConfirmDiscardDialog';

View file

@ -7,7 +7,7 @@ import { action } from '@storybook/addon-actions';
import { text } from '@storybook/addon-knobs';
import { ConfirmationDialog } from './ConfirmationDialog';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -7,7 +7,7 @@ import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { gifUrl } from '../storybook/Fixtures';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { ContactListItem } from './ContactListItem';
import { getRandomColor } from '../test-both/helpers/getRandomColor';

View file

@ -7,7 +7,7 @@ import { times } from 'lodash';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { ContactPills } from './ContactPills';
import { ContactPill, PropsType as ContactPillPropsType } from './ContactPill';

View file

@ -16,7 +16,7 @@ import {
} from './conversationList/ConversationListItem';
import { ContactCheckboxDisabledReason } from './conversationList/ContactCheckbox';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions';
import enMessages from '../../_locales/en/messages.json';
import { CustomColorEditor, PropsType } from './CustomColorEditor';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
const story = storiesOf('Components/CustomColorEditor', module);

View file

@ -5,7 +5,7 @@ import React, { ComponentProps } from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { CustomizingPreferredReactionsModal } from './CustomizingPreferredReactionsModal';

View file

@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react';
import { boolean } from '@storybook/addon-knobs';
import { DialogExpiredBuild } from './DialogExpiredBuild';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions';
import { DialogNetworkStatus } from './DialogNetworkStatus';
import { SocketStatus } from '../types/SocketStatus';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -7,7 +7,7 @@ import { boolean } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { DialogRelink } from './DialogRelink';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions';
import { DialogUpdate } from './DialogUpdate';
import { DialogType } from '../types/Dialogs';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -6,7 +6,7 @@ import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react';
import { DisappearingTimeDialog } from './DisappearingTimeDialog';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { EXPIRE_TIMERS } from '../test-both/util/expireTimers';

View file

@ -5,7 +5,7 @@ import React, { useState } from 'react';
import { storiesOf } from '@storybook/react';
import { DisappearingTimerSelect } from './DisappearingTimerSelect';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const story = storiesOf('Components/DisappearingTimerSelect', module);

View file

@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions';
import { PropsType, ErrorModal } from './ErrorModal';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -12,7 +12,7 @@ import { AttachmentType } from '../types/Attachment';
import { ForwardMessageModal, PropsType } from './ForwardMessageModal';
import { IMAGE_JPEG, VIDEO_MP4, stringToMIMEType } from '../types/MIME';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
const createAttachment = (
props: Partial<AttachmentType> = {}

View file

@ -8,7 +8,7 @@ import { storiesOf } from '@storybook/react';
import { number } from '@storybook/addon-knobs';
import { GroupCallOverflowArea } from './GroupCallOverflowArea';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';
import { FRAME_BUFFER_SIZE } from '../calling/constants';

View file

@ -11,7 +11,7 @@ import {
} from './GroupCallRemoteParticipant';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { FRAME_BUFFER_SIZE } from '../calling/constants';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -5,7 +5,7 @@ import React, { useState } from 'react';
import { storiesOf } from '@storybook/react';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { GroupDescriptionInput } from './GroupDescriptionInput';

View file

@ -5,7 +5,7 @@ import React, { useState } from 'react';
import { storiesOf } from '@storybook/react';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { GroupTitleInput } from './GroupTitleInput';

View file

@ -9,7 +9,7 @@ import { action } from '@storybook/addon-actions';
import { GroupV1MigrationDialog, PropsType } from './GroupV1MigrationDialog';
import { ConversationType } from '../state/ducks/conversations';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';

View file

@ -7,7 +7,7 @@ import { boolean, number, text } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { GroupV2JoinDialog, PropsType } from './GroupV2JoinDialog';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -5,7 +5,7 @@ import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { InContactsIcon } from './InContactsIcon';

View file

@ -7,7 +7,7 @@ import { action } from '@storybook/addon-actions';
import { IncomingCallBar } from './IncomingCallBar';
import { CallMode } from '../types/Calling';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';

View file

@ -8,7 +8,7 @@ import { text } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { Input, PropsType } from './Input';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -7,7 +7,7 @@ import { text } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import { Intl, Props } from './Intl';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -11,7 +11,7 @@ import { LeftPane, LeftPaneMode, PropsType } from './LeftPane';
import { CaptchaDialog } from './CaptchaDialog';
import { ConversationType } from '../state/ducks/conversations';
import { MessageSearchResult } from './conversationList/MessageSearchResult';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';

View file

@ -10,7 +10,7 @@ import { number } from '@storybook/addon-knobs';
import enMessages from '../../_locales/en/messages.json';
import { Lightbox, PropsType } from './Lightbox';
import { MediaItemType } from '../types/MediaItem';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import {
AUDIO_MP3,
IMAGE_JPEG,

View file

@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react';
import { text, withKnobs } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { MainHeader, PropsType } from './MainHeader';

View file

@ -9,7 +9,7 @@ import { boolean } from '@storybook/addon-knobs';
import enMessages from '../../_locales/en/messages.json';
import { MediaQualitySelector, PropsType } from './MediaQualitySelector';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
const story = storiesOf('Components/MediaQualitySelector', module);

View file

@ -7,7 +7,7 @@ import { noop } from 'lodash';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { Button } from './Button';
import { Modal } from './Modal';

View file

@ -7,7 +7,7 @@ import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { NewlyCreatedGroupInvitedContactsDialog } from './NewlyCreatedGroupInvitedContactsDialog';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { ConversationType } from '../state/ducks/conversations';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';

View file

@ -7,7 +7,7 @@ import { storiesOf } from '@storybook/react';
import enMessages from '../../_locales/en/messages.json';
import { Preferences, PropsType } from './Preferences';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import { DEFAULT_CONVERSATION_COLOR } from '../types/Colors';
import { ThemeType } from '../types/Util';
import { PhoneNumberSharingMode } from '../util/phoneNumberSharingMode';

View file

@ -8,7 +8,7 @@ import { text } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { ProfileEditor, PropsType } from './ProfileEditor';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import {
getFirstName,

View file

@ -5,7 +5,7 @@ import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { ProgressDialog, PropsType } from './ProgressDialog';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';

View file

@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react';
import { ProgressModal } from './ProgressModal';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -7,7 +7,7 @@ import { storiesOf } from '@storybook/react';
import { SafetyNumberChangeDialog } from './SafetyNumberChangeDialog';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -7,7 +7,7 @@ import { boolean, text } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import { PropsType, SafetyNumberViewer } from './SafetyNumberViewer';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';

View file

@ -6,7 +6,7 @@ import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react';
import { boolean, select } from '@storybook/addon-knobs';
import { setup as setupI18n } from '../../js/modules/i18n';
import { setupI18n } from '../util/setupI18n';
import enMessages from '../../_locales/en/messages.json';
import { Props, ShortcutGuide } from './ShortcutGuide';

View file

@ -14,7 +14,7 @@ import {
VIDEO_MP4,
stringToMIMEType,
} from '../../types/MIME';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -5,7 +5,7 @@ import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { CallMode } from '../../types/Calling';
import { CallingNotification } from './CallingNotification';

View file

@ -4,7 +4,7 @@
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';

View file

@ -5,7 +5,7 @@ import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { ChatSessionRefreshedDialog } from './ChatSessionRefreshedDialog';

View file

@ -5,7 +5,7 @@ import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { ChatSessionRefreshedNotification } from './ChatSessionRefreshedNotification';

View file

@ -9,7 +9,7 @@ import { storiesOf } from '@storybook/react';
import { ContactDetail, Props } from './ContactDetail';
import { AddressType, ContactFormType } from '../../types/EmbeddedContact';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { IMAGE_GIF } from '../../types/MIME';

View file

@ -9,7 +9,7 @@ import { storiesOf } from '@storybook/react';
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';
import { ContactModal, PropsType } from './ContactModal';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { ConversationType } from '../../state/ducks/conversations';

View file

@ -5,7 +5,7 @@ import React from 'react';
import { times } from 'lodash';
import { action } from '@storybook/addon-actions';
import { storiesOf } from '@storybook/react';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';

View file

@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions';
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';
import { getRandomColor } from '../../test-both/helpers/getRandomColor';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import {
ConversationHeader,

View file

@ -7,7 +7,7 @@ import { number as numberKnob, text } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import { ConversationHero } from './ConversationHero';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -5,7 +5,7 @@ import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { DeliveryIssueDialog } from './DeliveryIssueDialog';
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';

View file

@ -5,7 +5,7 @@ import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { DeliveryIssueNotification } from './DeliveryIssueNotification';
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';

View file

@ -8,7 +8,7 @@ import { boolean, number } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import { EmbeddedContact, Props } from './EmbeddedContact';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { ContactFormType } from '../../types/EmbeddedContact';
import { IMAGE_GIF } from '../../types/MIME';

View file

@ -5,7 +5,7 @@ import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { ErrorBoundary } from './ErrorBoundary';

View file

@ -7,7 +7,7 @@ import { text } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import { GroupDescription, PropsType } from './GroupDescription';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -5,7 +5,7 @@ import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { GroupNotification, Props } from './GroupNotification';
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';

View file

@ -9,7 +9,7 @@ import {
GroupV1DisabledActions,
PropsType as GroupV1DisabledActionsPropsType,
} from './GroupV1DisabledActions';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -8,7 +8,7 @@ import { isBoolean } from 'lodash';
import { boolean } from '@storybook/addon-knobs';
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { GroupV1Migration, PropsType } from './GroupV1Migration';

View file

@ -5,7 +5,7 @@
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { GroupV2ChangeType } from '../../groups';
import { SignalService as Proto } from '../../protobuf';

View file

@ -9,7 +9,7 @@ import {
GroupV2PendingApprovalActions,
PropsType as GroupV2PendingApprovalActionsPropsType,
} from './GroupV2PendingApprovalActions';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -11,7 +11,7 @@ import { pngUrl } from '../../storybook/Fixtures';
import { Image, Props } from './Image';
import { IMAGE_PNG } from '../../types/MIME';
import { ThemeType } from '../../types/Util';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -16,7 +16,7 @@ import {
VIDEO_MP4,
stringToMIMEType,
} from '../../types/MIME';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { pngUrl, squareStickerUrl } from '../../storybook/Fixtures';

View file

@ -7,7 +7,7 @@ import { number } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import { LastSeenIndicator, Props } from './LastSeenIndicator';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -4,7 +4,7 @@
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { LinkNotification } from './LinkNotification';

View file

@ -10,7 +10,7 @@ import {
MandatoryProfileSharingActions,
Props as MandatoryProfileSharingActionsProps,
} from './MandatoryProfileSharingActions';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

View file

@ -23,7 +23,7 @@ import {
import { ReadStatus } from '../../messages/MessageReadStatus';
import { MessageAudio } from './MessageAudio';
import { computePeaks } from '../GlobalAudioContext';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { pngUrl } from '../../storybook/Fixtures';
import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation';

View file

@ -7,7 +7,7 @@ import { boolean, text } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import { MessageBody, Props } from './MessageBody';
import { setup as setupI18n } from '../../../js/modules/i18n';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
const i18n = setupI18n('en', enMessages);

Some files were not shown because too many files have changed in this diff Show more