diff --git a/app/locale.ts b/app/locale.ts index 330105d4b..b388aabf3 100644 --- a/app/locale.ts +++ b/app/locale.ts @@ -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, diff --git a/debug_log_preload.js b/debug_log_preload.js index be3db5a1f..845e89c24 100644 --- a/debug_log_preload.js +++ b/debug_log_preload.js @@ -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; diff --git a/js/modules/i18n.d.ts b/js/modules/i18n.d.ts deleted file mode 100644 index 191c65ea4..000000000 --- a/js/modules/i18n.d.ts +++ /dev/null @@ -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 -) => LocalizerType; diff --git a/preload.js b/preload.js index a568a7e94..f1b2f8b2b 100644 --- a/preload.js +++ b/preload.js @@ -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'), diff --git a/ts/components/AddGroupMemberErrorDialog.stories.tsx b/ts/components/AddGroupMemberErrorDialog.stories.tsx index 31730ae2f..fde85eed7 100644 --- a/ts/components/AddGroupMemberErrorDialog.stories.tsx +++ b/ts/components/AddGroupMemberErrorDialog.stories.tsx @@ -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, diff --git a/ts/components/Alert.stories.tsx b/ts/components/Alert.stories.tsx index 38989e387..2ff277c7f 100644 --- a/ts/components/Alert.stories.tsx +++ b/ts/components/Alert.stories.tsx @@ -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'; diff --git a/ts/components/Avatar.stories.tsx b/ts/components/Avatar.stories.tsx index 2d9bd9503..863baa256 100644 --- a/ts/components/Avatar.stories.tsx +++ b/ts/components/Avatar.stories.tsx @@ -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'; diff --git a/ts/components/AvatarColorPicker.stories.tsx b/ts/components/AvatarColorPicker.stories.tsx index ca9142a0e..e5085a870 100644 --- a/ts/components/AvatarColorPicker.stories.tsx +++ b/ts/components/AvatarColorPicker.stories.tsx @@ -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'; diff --git a/ts/components/AvatarEditor.stories.tsx b/ts/components/AvatarEditor.stories.tsx index 6c757f25f..04b77082b 100644 --- a/ts/components/AvatarEditor.stories.tsx +++ b/ts/components/AvatarEditor.stories.tsx @@ -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'; diff --git a/ts/components/AvatarIconEditor.stories.tsx b/ts/components/AvatarIconEditor.stories.tsx index 48e019ac2..06cc1219d 100644 --- a/ts/components/AvatarIconEditor.stories.tsx +++ b/ts/components/AvatarIconEditor.stories.tsx @@ -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'; diff --git a/ts/components/AvatarLightbox.stories.tsx b/ts/components/AvatarLightbox.stories.tsx index 406fe0628..8ef9f10a3 100644 --- a/ts/components/AvatarLightbox.stories.tsx +++ b/ts/components/AvatarLightbox.stories.tsx @@ -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); diff --git a/ts/components/AvatarModalButtons.stories.tsx b/ts/components/AvatarModalButtons.stories.tsx index 5320148c2..24d28dea2 100644 --- a/ts/components/AvatarModalButtons.stories.tsx +++ b/ts/components/AvatarModalButtons.stories.tsx @@ -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); diff --git a/ts/components/AvatarPopup.stories.tsx b/ts/components/AvatarPopup.stories.tsx index 55d207ef1..029a7354e 100644 --- a/ts/components/AvatarPopup.stories.tsx +++ b/ts/components/AvatarPopup.stories.tsx @@ -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); diff --git a/ts/components/AvatarPreview.stories.tsx b/ts/components/AvatarPreview.stories.tsx index afea1fa71..40f46ed57 100644 --- a/ts/components/AvatarPreview.stories.tsx +++ b/ts/components/AvatarPreview.stories.tsx @@ -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); diff --git a/ts/components/AvatarTextEditor.stories.tsx b/ts/components/AvatarTextEditor.stories.tsx index 2519a0ded..e33d64291 100644 --- a/ts/components/AvatarTextEditor.stories.tsx +++ b/ts/components/AvatarTextEditor.stories.tsx @@ -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'; diff --git a/ts/components/AvatarUploadButton.stories.tsx b/ts/components/AvatarUploadButton.stories.tsx index 9a10cf938..0c9a2fa06 100644 --- a/ts/components/AvatarUploadButton.stories.tsx +++ b/ts/components/AvatarUploadButton.stories.tsx @@ -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'; diff --git a/ts/components/BetterAvatar.stories.tsx b/ts/components/BetterAvatar.stories.tsx index 1ee3eeaf0..8682a74d0 100644 --- a/ts/components/BetterAvatar.stories.tsx +++ b/ts/components/BetterAvatar.stories.tsx @@ -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); diff --git a/ts/components/BetterAvatarBubble.stories.tsx b/ts/components/BetterAvatarBubble.stories.tsx index f93472124..625561353 100644 --- a/ts/components/BetterAvatarBubble.stories.tsx +++ b/ts/components/BetterAvatarBubble.stories.tsx @@ -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); diff --git a/ts/components/CallManager.stories.tsx b/ts/components/CallManager.stories.tsx index f972df0d1..af988bf2e 100644 --- a/ts/components/CallManager.stories.tsx +++ b/ts/components/CallManager.stories.tsx @@ -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'; diff --git a/ts/components/CallScreen.stories.tsx b/ts/components/CallScreen.stories.tsx index effbf8c5e..b9fdfd5ce 100644 --- a/ts/components/CallScreen.stories.tsx +++ b/ts/components/CallScreen.stories.tsx @@ -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'; diff --git a/ts/components/CallingButton.stories.tsx b/ts/components/CallingButton.stories.tsx index d2f381e57..47cb681c0 100644 --- a/ts/components/CallingButton.stories.tsx +++ b/ts/components/CallingButton.stories.tsx @@ -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); diff --git a/ts/components/CallingDeviceSelection.stories.tsx b/ts/components/CallingDeviceSelection.stories.tsx index af123760c..dae62b60b 100644 --- a/ts/components/CallingDeviceSelection.stories.tsx +++ b/ts/components/CallingDeviceSelection.stories.tsx @@ -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); diff --git a/ts/components/CallingHeader.stories.tsx b/ts/components/CallingHeader.stories.tsx index 332c60513..0cec05840 100644 --- a/ts/components/CallingHeader.stories.tsx +++ b/ts/components/CallingHeader.stories.tsx @@ -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); diff --git a/ts/components/CallingLobby.stories.tsx b/ts/components/CallingLobby.stories.tsx index 7707dcead..8d5b399e4 100644 --- a/ts/components/CallingLobby.stories.tsx +++ b/ts/components/CallingLobby.stories.tsx @@ -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'; diff --git a/ts/components/CallingParticipantsList.stories.tsx b/ts/components/CallingParticipantsList.stories.tsx index 7d3207a50..b0346007b 100644 --- a/ts/components/CallingParticipantsList.stories.tsx +++ b/ts/components/CallingParticipantsList.stories.tsx @@ -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); diff --git a/ts/components/CallingPip.stories.tsx b/ts/components/CallingPip.stories.tsx index 102ef8d0b..427e2cef5 100644 --- a/ts/components/CallingPip.stories.tsx +++ b/ts/components/CallingPip.stories.tsx @@ -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); diff --git a/ts/components/CallingPreCallInfo.stories.tsx b/ts/components/CallingPreCallInfo.stories.tsx index 3896a5eb7..9a16ff0be 100644 --- a/ts/components/CallingPreCallInfo.stories.tsx +++ b/ts/components/CallingPreCallInfo.stories.tsx @@ -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'; diff --git a/ts/components/CallingScreenSharingController.stories.tsx b/ts/components/CallingScreenSharingController.stories.tsx index 1c318bd80..6ccf73d63 100644 --- a/ts/components/CallingScreenSharingController.stories.tsx +++ b/ts/components/CallingScreenSharingController.stories.tsx @@ -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); diff --git a/ts/components/CallingSelectPresentingSourcesModal.stories.tsx b/ts/components/CallingSelectPresentingSourcesModal.stories.tsx index 08c1d19ec..30bdd5300 100644 --- a/ts/components/CallingSelectPresentingSourcesModal.stories.tsx +++ b/ts/components/CallingSelectPresentingSourcesModal.stories.tsx @@ -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); diff --git a/ts/components/CaptchaDialog.stories.tsx b/ts/components/CaptchaDialog.stories.tsx index 116d56d34..f9bf885c9 100644 --- a/ts/components/CaptchaDialog.stories.tsx +++ b/ts/components/CaptchaDialog.stories.tsx @@ -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); diff --git a/ts/components/CaptionEditor.stories.tsx b/ts/components/CaptionEditor.stories.tsx index 69d7153ff..301de696c 100644 --- a/ts/components/CaptionEditor.stories.tsx +++ b/ts/components/CaptionEditor.stories.tsx @@ -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); diff --git a/ts/components/ChatColorPicker.stories.tsx b/ts/components/ChatColorPicker.stories.tsx index 9dd148997..05c8af28a 100644 --- a/ts/components/ChatColorPicker.stories.tsx +++ b/ts/components/ChatColorPicker.stories.tsx @@ -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); diff --git a/ts/components/ClearingData.stories.tsx b/ts/components/ClearingData.stories.tsx index c3a1783d6..ea0288454 100644 --- a/ts/components/ClearingData.stories.tsx +++ b/ts/components/ClearingData.stories.tsx @@ -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'; diff --git a/ts/components/CompositionArea.stories.tsx b/ts/components/CompositionArea.stories.tsx index 27b16e283..5d976c0cf 100644 --- a/ts/components/CompositionArea.stories.tsx +++ b/ts/components/CompositionArea.stories.tsx @@ -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); diff --git a/ts/components/CompositionInput.stories.tsx b/ts/components/CompositionInput.stories.tsx index 6b3585a93..c1202ce8f 100644 --- a/ts/components/CompositionInput.stories.tsx +++ b/ts/components/CompositionInput.stories.tsx @@ -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); diff --git a/ts/components/ConfirmDiscardDialog.stories.tsx b/ts/components/ConfirmDiscardDialog.stories.tsx index e8b6cec78..1063b4fe0 100644 --- a/ts/components/ConfirmDiscardDialog.stories.tsx +++ b/ts/components/ConfirmDiscardDialog.stories.tsx @@ -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'; diff --git a/ts/components/ConfirmationDialog.stories.tsx b/ts/components/ConfirmationDialog.stories.tsx index 1abee0f5e..83c712d3c 100644 --- a/ts/components/ConfirmationDialog.stories.tsx +++ b/ts/components/ConfirmationDialog.stories.tsx @@ -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); diff --git a/ts/components/ContactListItem.stories.tsx b/ts/components/ContactListItem.stories.tsx index b8b3bdc84..0f218bc7c 100644 --- a/ts/components/ContactListItem.stories.tsx +++ b/ts/components/ContactListItem.stories.tsx @@ -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'; diff --git a/ts/components/ContactPills.stories.tsx b/ts/components/ContactPills.stories.tsx index c50d28335..eb3c0904e 100644 --- a/ts/components/ContactPills.stories.tsx +++ b/ts/components/ContactPills.stories.tsx @@ -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'; diff --git a/ts/components/ConversationList.stories.tsx b/ts/components/ConversationList.stories.tsx index ddb40f05f..9d4009bce 100644 --- a/ts/components/ConversationList.stories.tsx +++ b/ts/components/ConversationList.stories.tsx @@ -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); diff --git a/ts/components/CustomColorEditor.stories.tsx b/ts/components/CustomColorEditor.stories.tsx index 074f57d60..040be88cd 100644 --- a/ts/components/CustomColorEditor.stories.tsx +++ b/ts/components/CustomColorEditor.stories.tsx @@ -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); diff --git a/ts/components/CustomizingPreferredReactionsModal.stories.tsx b/ts/components/CustomizingPreferredReactionsModal.stories.tsx index a82663e20..92709864a 100644 --- a/ts/components/CustomizingPreferredReactionsModal.stories.tsx +++ b/ts/components/CustomizingPreferredReactionsModal.stories.tsx @@ -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'; diff --git a/ts/components/DialogExpiredBuild.stories.tsx b/ts/components/DialogExpiredBuild.stories.tsx index dce27058f..3079b6f7b 100644 --- a/ts/components/DialogExpiredBuild.stories.tsx +++ b/ts/components/DialogExpiredBuild.stories.tsx @@ -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); diff --git a/ts/components/DialogNetworkStatus.stories.tsx b/ts/components/DialogNetworkStatus.stories.tsx index 6dd39116a..9fefe22a0 100644 --- a/ts/components/DialogNetworkStatus.stories.tsx +++ b/ts/components/DialogNetworkStatus.stories.tsx @@ -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); diff --git a/ts/components/DialogRelink.stories.tsx b/ts/components/DialogRelink.stories.tsx index c5f4db6ec..28822d6ab 100644 --- a/ts/components/DialogRelink.stories.tsx +++ b/ts/components/DialogRelink.stories.tsx @@ -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); diff --git a/ts/components/DialogUpdate.stories.tsx b/ts/components/DialogUpdate.stories.tsx index 66c5d2eac..f86e4583e 100644 --- a/ts/components/DialogUpdate.stories.tsx +++ b/ts/components/DialogUpdate.stories.tsx @@ -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); diff --git a/ts/components/DisappearingTimeDialog.stories.tsx b/ts/components/DisappearingTimeDialog.stories.tsx index 48e2a537d..a3347eea7 100644 --- a/ts/components/DisappearingTimeDialog.stories.tsx +++ b/ts/components/DisappearingTimeDialog.stories.tsx @@ -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'; diff --git a/ts/components/DisappearingTimerSelect.stories.tsx b/ts/components/DisappearingTimerSelect.stories.tsx index 72a6e2673..e2f498966 100644 --- a/ts/components/DisappearingTimerSelect.stories.tsx +++ b/ts/components/DisappearingTimerSelect.stories.tsx @@ -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); diff --git a/ts/components/ErrorModal.stories.tsx b/ts/components/ErrorModal.stories.tsx index 49bd7c6b7..8ca687012 100644 --- a/ts/components/ErrorModal.stories.tsx +++ b/ts/components/ErrorModal.stories.tsx @@ -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); diff --git a/ts/components/ForwardMessageModal.stories.tsx b/ts/components/ForwardMessageModal.stories.tsx index e1b813848..a8d628bc9 100644 --- a/ts/components/ForwardMessageModal.stories.tsx +++ b/ts/components/ForwardMessageModal.stories.tsx @@ -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 = {} diff --git a/ts/components/GroupCallOverflowArea.stories.tsx b/ts/components/GroupCallOverflowArea.stories.tsx index 99415d7c6..cd83e275c 100644 --- a/ts/components/GroupCallOverflowArea.stories.tsx +++ b/ts/components/GroupCallOverflowArea.stories.tsx @@ -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'; diff --git a/ts/components/GroupCallRemoteParticipant.stories.tsx b/ts/components/GroupCallRemoteParticipant.stories.tsx index 77027fe66..f03490318 100644 --- a/ts/components/GroupCallRemoteParticipant.stories.tsx +++ b/ts/components/GroupCallRemoteParticipant.stories.tsx @@ -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); diff --git a/ts/components/GroupDescriptionInput.stories.tsx b/ts/components/GroupDescriptionInput.stories.tsx index 50bd574eb..99fea4dfd 100644 --- a/ts/components/GroupDescriptionInput.stories.tsx +++ b/ts/components/GroupDescriptionInput.stories.tsx @@ -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'; diff --git a/ts/components/GroupTitleInput.stories.tsx b/ts/components/GroupTitleInput.stories.tsx index 5ee5cbe66..9be2b5572 100644 --- a/ts/components/GroupTitleInput.stories.tsx +++ b/ts/components/GroupTitleInput.stories.tsx @@ -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'; diff --git a/ts/components/GroupV1MigrationDialog.stories.tsx b/ts/components/GroupV1MigrationDialog.stories.tsx index bac6f6f3b..4c5207ee8 100644 --- a/ts/components/GroupV1MigrationDialog.stories.tsx +++ b/ts/components/GroupV1MigrationDialog.stories.tsx @@ -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'; diff --git a/ts/components/GroupV2JoinDialog.stories.tsx b/ts/components/GroupV2JoinDialog.stories.tsx index 9b3dd24ca..71b72144e 100644 --- a/ts/components/GroupV2JoinDialog.stories.tsx +++ b/ts/components/GroupV2JoinDialog.stories.tsx @@ -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); diff --git a/ts/components/InContactsIcon.stories.tsx b/ts/components/InContactsIcon.stories.tsx index 612dab3df..d43a68f2f 100644 --- a/ts/components/InContactsIcon.stories.tsx +++ b/ts/components/InContactsIcon.stories.tsx @@ -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'; diff --git a/ts/components/IncomingCallBar.stories.tsx b/ts/components/IncomingCallBar.stories.tsx index 5efb6446c..fb8ea49c7 100644 --- a/ts/components/IncomingCallBar.stories.tsx +++ b/ts/components/IncomingCallBar.stories.tsx @@ -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'; diff --git a/ts/components/Input.stories.tsx b/ts/components/Input.stories.tsx index bf42fbc30..9f04f5896 100644 --- a/ts/components/Input.stories.tsx +++ b/ts/components/Input.stories.tsx @@ -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); diff --git a/ts/components/Intl.stories.tsx b/ts/components/Intl.stories.tsx index 9a3e45cf1..af60254ba 100644 --- a/ts/components/Intl.stories.tsx +++ b/ts/components/Intl.stories.tsx @@ -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); diff --git a/ts/components/LeftPane.stories.tsx b/ts/components/LeftPane.stories.tsx index 165445232..617971044 100644 --- a/ts/components/LeftPane.stories.tsx +++ b/ts/components/LeftPane.stories.tsx @@ -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'; diff --git a/ts/components/Lightbox.stories.tsx b/ts/components/Lightbox.stories.tsx index 9e5c080a5..4891f4460 100644 --- a/ts/components/Lightbox.stories.tsx +++ b/ts/components/Lightbox.stories.tsx @@ -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, diff --git a/ts/components/MainHeader.stories.tsx b/ts/components/MainHeader.stories.tsx index f3fed291d..c1c27893a 100644 --- a/ts/components/MainHeader.stories.tsx +++ b/ts/components/MainHeader.stories.tsx @@ -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'; diff --git a/ts/components/MediaQualitySelector.stories.tsx b/ts/components/MediaQualitySelector.stories.tsx index 9991a9eb4..aa9084d76 100644 --- a/ts/components/MediaQualitySelector.stories.tsx +++ b/ts/components/MediaQualitySelector.stories.tsx @@ -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); diff --git a/ts/components/Modal.stories.tsx b/ts/components/Modal.stories.tsx index 54e0bdbf6..8785d856a 100644 --- a/ts/components/Modal.stories.tsx +++ b/ts/components/Modal.stories.tsx @@ -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'; diff --git a/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx b/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx index d97510af5..0c9143f00 100644 --- a/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx +++ b/ts/components/NewlyCreatedGroupInvitedContactsDialog.stories.tsx @@ -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'; diff --git a/ts/components/Preferences.stories.tsx b/ts/components/Preferences.stories.tsx index 980921c04..1b72b451c 100644 --- a/ts/components/Preferences.stories.tsx +++ b/ts/components/Preferences.stories.tsx @@ -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'; diff --git a/ts/components/ProfileEditor.stories.tsx b/ts/components/ProfileEditor.stories.tsx index 9ab8c3355..9d32ef17f 100644 --- a/ts/components/ProfileEditor.stories.tsx +++ b/ts/components/ProfileEditor.stories.tsx @@ -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, diff --git a/ts/components/ProgressDialog.stories.tsx b/ts/components/ProgressDialog.stories.tsx index f2be1a3d5..e0d0bbc01 100644 --- a/ts/components/ProgressDialog.stories.tsx +++ b/ts/components/ProgressDialog.stories.tsx @@ -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'; diff --git a/ts/components/ProgressModal.stories.tsx b/ts/components/ProgressModal.stories.tsx index f1cd951a3..243eef871 100644 --- a/ts/components/ProgressModal.stories.tsx +++ b/ts/components/ProgressModal.stories.tsx @@ -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); diff --git a/ts/components/SafetyNumberChangeDialog.stories.tsx b/ts/components/SafetyNumberChangeDialog.stories.tsx index bd383f916..feaf9a67f 100644 --- a/ts/components/SafetyNumberChangeDialog.stories.tsx +++ b/ts/components/SafetyNumberChangeDialog.stories.tsx @@ -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); diff --git a/ts/components/SafetyNumberViewer.stories.tsx b/ts/components/SafetyNumberViewer.stories.tsx index 8448bb223..c166932f7 100644 --- a/ts/components/SafetyNumberViewer.stories.tsx +++ b/ts/components/SafetyNumberViewer.stories.tsx @@ -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'; diff --git a/ts/components/ShortcutGuide.stories.tsx b/ts/components/ShortcutGuide.stories.tsx index 9bf14b554..4798ed080 100644 --- a/ts/components/ShortcutGuide.stories.tsx +++ b/ts/components/ShortcutGuide.stories.tsx @@ -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'; diff --git a/ts/components/conversation/AttachmentList.stories.tsx b/ts/components/conversation/AttachmentList.stories.tsx index 935f9a1ad..3bd6481ad 100644 --- a/ts/components/conversation/AttachmentList.stories.tsx +++ b/ts/components/conversation/AttachmentList.stories.tsx @@ -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); diff --git a/ts/components/conversation/CallingNotification.stories.tsx b/ts/components/conversation/CallingNotification.stories.tsx index a522cdaf7..a65b06eb9 100644 --- a/ts/components/conversation/CallingNotification.stories.tsx +++ b/ts/components/conversation/CallingNotification.stories.tsx @@ -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'; diff --git a/ts/components/conversation/ChangeNumberNotification.stories.tsx b/ts/components/conversation/ChangeNumberNotification.stories.tsx index e744c2c0d..9e0bc69b1 100644 --- a/ts/components/conversation/ChangeNumberNotification.stories.tsx +++ b/ts/components/conversation/ChangeNumberNotification.stories.tsx @@ -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'; diff --git a/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx b/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx index b08bad13b..eacbdec7f 100644 --- a/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx +++ b/ts/components/conversation/ChatSessionRefreshedDialog.stories.tsx @@ -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'; diff --git a/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx b/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx index 80c14cb5e..ed5005311 100644 --- a/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx +++ b/ts/components/conversation/ChatSessionRefreshedNotification.stories.tsx @@ -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'; diff --git a/ts/components/conversation/ContactDetail.stories.tsx b/ts/components/conversation/ContactDetail.stories.tsx index 8225d3285..c2c8be8ce 100644 --- a/ts/components/conversation/ContactDetail.stories.tsx +++ b/ts/components/conversation/ContactDetail.stories.tsx @@ -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'; diff --git a/ts/components/conversation/ContactModal.stories.tsx b/ts/components/conversation/ContactModal.stories.tsx index 8c1e59f42..c0ef57733 100644 --- a/ts/components/conversation/ContactModal.stories.tsx +++ b/ts/components/conversation/ContactModal.stories.tsx @@ -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'; diff --git a/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx b/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx index eefab614c..57952dd71 100644 --- a/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx +++ b/ts/components/conversation/ContactSpoofingReviewDialog.stories.tsx @@ -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'; diff --git a/ts/components/conversation/ConversationHeader.stories.tsx b/ts/components/conversation/ConversationHeader.stories.tsx index 427d089f3..fc1499b84 100644 --- a/ts/components/conversation/ConversationHeader.stories.tsx +++ b/ts/components/conversation/ConversationHeader.stories.tsx @@ -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, diff --git a/ts/components/conversation/ConversationHero.stories.tsx b/ts/components/conversation/ConversationHero.stories.tsx index 91c1a64de..890993e59 100644 --- a/ts/components/conversation/ConversationHero.stories.tsx +++ b/ts/components/conversation/ConversationHero.stories.tsx @@ -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); diff --git a/ts/components/conversation/DeliveryIssueDialog.stories.tsx b/ts/components/conversation/DeliveryIssueDialog.stories.tsx index 6c68051b9..d34acb52f 100644 --- a/ts/components/conversation/DeliveryIssueDialog.stories.tsx +++ b/ts/components/conversation/DeliveryIssueDialog.stories.tsx @@ -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'; diff --git a/ts/components/conversation/DeliveryIssueNotification.stories.tsx b/ts/components/conversation/DeliveryIssueNotification.stories.tsx index 3504d8a60..5ead83e4c 100644 --- a/ts/components/conversation/DeliveryIssueNotification.stories.tsx +++ b/ts/components/conversation/DeliveryIssueNotification.stories.tsx @@ -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'; diff --git a/ts/components/conversation/EmbeddedContact.stories.tsx b/ts/components/conversation/EmbeddedContact.stories.tsx index b361b6eae..bbe4c4c16 100644 --- a/ts/components/conversation/EmbeddedContact.stories.tsx +++ b/ts/components/conversation/EmbeddedContact.stories.tsx @@ -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'; diff --git a/ts/components/conversation/ErrorBoundary.stories.tsx b/ts/components/conversation/ErrorBoundary.stories.tsx index 5aca72bca..ae581a891 100644 --- a/ts/components/conversation/ErrorBoundary.stories.tsx +++ b/ts/components/conversation/ErrorBoundary.stories.tsx @@ -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'; diff --git a/ts/components/conversation/GroupDescription.stories.tsx b/ts/components/conversation/GroupDescription.stories.tsx index 7817b8823..c584c2149 100644 --- a/ts/components/conversation/GroupDescription.stories.tsx +++ b/ts/components/conversation/GroupDescription.stories.tsx @@ -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); diff --git a/ts/components/conversation/GroupNotification.stories.tsx b/ts/components/conversation/GroupNotification.stories.tsx index ef813b7fd..b6c27de44 100644 --- a/ts/components/conversation/GroupNotification.stories.tsx +++ b/ts/components/conversation/GroupNotification.stories.tsx @@ -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'; diff --git a/ts/components/conversation/GroupV1DisabledActions.stories.tsx b/ts/components/conversation/GroupV1DisabledActions.stories.tsx index 79c4fae9b..ec05023d7 100644 --- a/ts/components/conversation/GroupV1DisabledActions.stories.tsx +++ b/ts/components/conversation/GroupV1DisabledActions.stories.tsx @@ -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); diff --git a/ts/components/conversation/GroupV1Migration.stories.tsx b/ts/components/conversation/GroupV1Migration.stories.tsx index 1d58745db..86a263b04 100644 --- a/ts/components/conversation/GroupV1Migration.stories.tsx +++ b/ts/components/conversation/GroupV1Migration.stories.tsx @@ -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'; diff --git a/ts/components/conversation/GroupV2Change.stories.tsx b/ts/components/conversation/GroupV2Change.stories.tsx index 64bcb398c..676e714d7 100644 --- a/ts/components/conversation/GroupV2Change.stories.tsx +++ b/ts/components/conversation/GroupV2Change.stories.tsx @@ -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'; diff --git a/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx b/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx index 377c88313..be8819859 100644 --- a/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx +++ b/ts/components/conversation/GroupV2PendingApprovalActions.stories.tsx @@ -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); diff --git a/ts/components/conversation/Image.stories.tsx b/ts/components/conversation/Image.stories.tsx index ce31b1e46..071e5a87a 100644 --- a/ts/components/conversation/Image.stories.tsx +++ b/ts/components/conversation/Image.stories.tsx @@ -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); diff --git a/ts/components/conversation/ImageGrid.stories.tsx b/ts/components/conversation/ImageGrid.stories.tsx index d7d3f4320..ff4866baa 100644 --- a/ts/components/conversation/ImageGrid.stories.tsx +++ b/ts/components/conversation/ImageGrid.stories.tsx @@ -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'; diff --git a/ts/components/conversation/LastSeenIndicator.stories.tsx b/ts/components/conversation/LastSeenIndicator.stories.tsx index 171730725..198128ece 100644 --- a/ts/components/conversation/LastSeenIndicator.stories.tsx +++ b/ts/components/conversation/LastSeenIndicator.stories.tsx @@ -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); diff --git a/ts/components/conversation/LinkNotification.stories.tsx b/ts/components/conversation/LinkNotification.stories.tsx index fa769ea41..10476ca4b 100644 --- a/ts/components/conversation/LinkNotification.stories.tsx +++ b/ts/components/conversation/LinkNotification.stories.tsx @@ -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'; diff --git a/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx b/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx index 3917a5558..286476e45 100644 --- a/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx +++ b/ts/components/conversation/MandatoryProfileSharingActions.stories.tsx @@ -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); diff --git a/ts/components/conversation/Message.stories.tsx b/ts/components/conversation/Message.stories.tsx index bf62479fd..4a2dac659 100644 --- a/ts/components/conversation/Message.stories.tsx +++ b/ts/components/conversation/Message.stories.tsx @@ -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'; diff --git a/ts/components/conversation/MessageBody.stories.tsx b/ts/components/conversation/MessageBody.stories.tsx index 43473c111..329a29b67 100644 --- a/ts/components/conversation/MessageBody.stories.tsx +++ b/ts/components/conversation/MessageBody.stories.tsx @@ -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); diff --git a/ts/components/conversation/MessageDetail.stories.tsx b/ts/components/conversation/MessageDetail.stories.tsx index 1bcc4ee77..674a802c0 100644 --- a/ts/components/conversation/MessageDetail.stories.tsx +++ b/ts/components/conversation/MessageDetail.stories.tsx @@ -12,7 +12,7 @@ import { MessageDetail, Props } from './MessageDetail'; import { SendStatus } from '../../messages/MessageSendState'; import { ReadStatus } from '../../messages/MessageReadStatus'; 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); diff --git a/ts/components/conversation/MessageRequestActions.stories.tsx b/ts/components/conversation/MessageRequestActions.stories.tsx index db060d09d..e5f844993 100644 --- a/ts/components/conversation/MessageRequestActions.stories.tsx +++ b/ts/components/conversation/MessageRequestActions.stories.tsx @@ -10,7 +10,7 @@ import { MessageRequestActions, Props as MessageRequestActionsProps, } from './MessageRequestActions'; -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); diff --git a/ts/components/conversation/ProfileChangeNotification.stories.tsx b/ts/components/conversation/ProfileChangeNotification.stories.tsx index 062b425cf..c8162faaf 100644 --- a/ts/components/conversation/ProfileChangeNotification.stories.tsx +++ b/ts/components/conversation/ProfileChangeNotification.stories.tsx @@ -6,7 +6,7 @@ import * as React from 'react'; import { storiesOf } from '@storybook/react'; 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 { ProfileChangeNotification } from './ProfileChangeNotification'; diff --git a/ts/components/conversation/Quote.stories.tsx b/ts/components/conversation/Quote.stories.tsx index 4ca2df596..c57ddc84f 100644 --- a/ts/components/conversation/Quote.stories.tsx +++ b/ts/components/conversation/Quote.stories.tsx @@ -20,7 +20,7 @@ import { } from '../../types/MIME'; import { Props, Quote } from './Quote'; import { ReadStatus } from '../../messages/MessageReadStatus'; -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'; diff --git a/ts/components/conversation/ReactionPicker.stories.tsx b/ts/components/conversation/ReactionPicker.stories.tsx index 4a4ed00ed..a06aedb0b 100644 --- a/ts/components/conversation/ReactionPicker.stories.tsx +++ b/ts/components/conversation/ReactionPicker.stories.tsx @@ -6,7 +6,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 { Props as ReactionPickerProps, ReactionPicker } from './ReactionPicker'; import { EmojiPicker } from '../emoji/EmojiPicker'; diff --git a/ts/components/conversation/ReactionViewer.stories.tsx b/ts/components/conversation/ReactionViewer.stories.tsx index 69ba55ada..3109d8528 100644 --- a/ts/components/conversation/ReactionViewer.stories.tsx +++ b/ts/components/conversation/ReactionViewer.stories.tsx @@ -7,7 +7,7 @@ import { action } from '@storybook/addon-actions'; import { storiesOf } from '@storybook/react'; import { Props, ReactionViewer } from './ReactionViewer'; -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'; diff --git a/ts/components/conversation/ResetSessionNotification.stories.tsx b/ts/components/conversation/ResetSessionNotification.stories.tsx index 0a21a5c50..7bed04212 100644 --- a/ts/components/conversation/ResetSessionNotification.stories.tsx +++ b/ts/components/conversation/ResetSessionNotification.stories.tsx @@ -6,7 +6,7 @@ import * as React from 'react'; import { storiesOf } from '@storybook/react'; import { ResetSessionNotification } from './ResetSessionNotification'; -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); diff --git a/ts/components/conversation/SafetyNumberNotification.stories.tsx b/ts/components/conversation/SafetyNumberNotification.stories.tsx index d10e30bac..a3a802191 100644 --- a/ts/components/conversation/SafetyNumberNotification.stories.tsx +++ b/ts/components/conversation/SafetyNumberNotification.stories.tsx @@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { boolean, text } 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 { ContactType, diff --git a/ts/components/conversation/ScrollDownButton.stories.tsx b/ts/components/conversation/ScrollDownButton.stories.tsx index 2d588c782..c26a5b17f 100644 --- a/ts/components/conversation/ScrollDownButton.stories.tsx +++ b/ts/components/conversation/ScrollDownButton.stories.tsx @@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { boolean } 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, ScrollDownButton } from './ScrollDownButton'; diff --git a/ts/components/conversation/StagedGenericAttachment.stories.tsx b/ts/components/conversation/StagedGenericAttachment.stories.tsx index 5fb0f7dfa..c96fd4715 100644 --- a/ts/components/conversation/StagedGenericAttachment.stories.tsx +++ b/ts/components/conversation/StagedGenericAttachment.stories.tsx @@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions'; import { AttachmentType } from '../../types/Attachment'; import { 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 { Props, StagedGenericAttachment } from './StagedGenericAttachment'; diff --git a/ts/components/conversation/StagedLinkPreview.stories.tsx b/ts/components/conversation/StagedLinkPreview.stories.tsx index f64e9dcf8..b009c0da5 100644 --- a/ts/components/conversation/StagedLinkPreview.stories.tsx +++ b/ts/components/conversation/StagedLinkPreview.stories.tsx @@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions'; import { AttachmentType } from '../../types/Attachment'; import { 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 { Props, StagedLinkPreview } from './StagedLinkPreview'; diff --git a/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx b/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx index cac3d0c52..c7f81e189 100644 --- a/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx +++ b/ts/components/conversation/StagedPlaceholderAttachment.stories.tsx @@ -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 { StagedPlaceholderAttachment } from './StagedPlaceholderAttachment'; diff --git a/ts/components/conversation/Timeline.stories.tsx b/ts/components/conversation/Timeline.stories.tsx index bb7fa5385..c5917b50d 100644 --- a/ts/components/conversation/Timeline.stories.tsx +++ b/ts/components/conversation/Timeline.stories.tsx @@ -9,7 +9,7 @@ import { storiesOf } from '@storybook/react'; import { text, boolean, number } 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 { PropsType, Timeline } from './Timeline'; import { TimelineItem, TimelineItemType } from './TimelineItem'; diff --git a/ts/components/conversation/TimelineItem.stories.tsx b/ts/components/conversation/TimelineItem.stories.tsx index e9e2a60ac..781effbc1 100644 --- a/ts/components/conversation/TimelineItem.stories.tsx +++ b/ts/components/conversation/TimelineItem.stories.tsx @@ -7,7 +7,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { EmojiPicker } from '../emoji/EmojiPicker'; -import { setup as setupI18n } from '../../../js/modules/i18n'; +import { setupI18n } from '../../util/setupI18n'; import enMessages from '../../../_locales/en/messages.json'; import { PropsType as TimelineItemProps, TimelineItem } from './TimelineItem'; import { UniversalTimerNotification } from './UniversalTimerNotification'; diff --git a/ts/components/conversation/TimerNotification.stories.tsx b/ts/components/conversation/TimerNotification.stories.tsx index 271615ae8..ec64e8a26 100644 --- a/ts/components/conversation/TimerNotification.stories.tsx +++ b/ts/components/conversation/TimerNotification.stories.tsx @@ -6,7 +6,7 @@ import * as moment from 'moment'; import { storiesOf } from '@storybook/react'; import { boolean, number, select, text } 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, TimerNotification } from './TimerNotification'; diff --git a/ts/components/conversation/Timestamp.stories.tsx b/ts/components/conversation/Timestamp.stories.tsx index e67b27975..147174464 100644 --- a/ts/components/conversation/Timestamp.stories.tsx +++ b/ts/components/conversation/Timestamp.stories.tsx @@ -5,7 +5,7 @@ import * as React from 'react'; import { storiesOf } from '@storybook/react'; import { boolean, date, select, text } 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, Timestamp } from './Timestamp'; diff --git a/ts/components/conversation/TypingAnimation.stories.tsx b/ts/components/conversation/TypingAnimation.stories.tsx index 893f99378..2ed7ea76c 100644 --- a/ts/components/conversation/TypingAnimation.stories.tsx +++ b/ts/components/conversation/TypingAnimation.stories.tsx @@ -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 { Props, TypingAnimation } from './TypingAnimation'; diff --git a/ts/components/conversation/TypingBubble.stories.tsx b/ts/components/conversation/TypingBubble.stories.tsx index a20564778..8ba2e20a0 100644 --- a/ts/components/conversation/TypingBubble.stories.tsx +++ b/ts/components/conversation/TypingBubble.stories.tsx @@ -5,7 +5,7 @@ import * as React from 'react'; import { storiesOf } from '@storybook/react'; import { select, text } 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, TypingBubble } from './TypingBubble'; import { AvatarColors } from '../../types/Colors'; diff --git a/ts/components/conversation/UniversalTimerNotification.stories.tsx b/ts/components/conversation/UniversalTimerNotification.stories.tsx index 6dc7ea528..0b792bd86 100644 --- a/ts/components/conversation/UniversalTimerNotification.stories.tsx +++ b/ts/components/conversation/UniversalTimerNotification.stories.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; import { UniversalTimerNotification } from './UniversalTimerNotification'; -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'; diff --git a/ts/components/conversation/UnsupportedMessage.stories.tsx b/ts/components/conversation/UnsupportedMessage.stories.tsx index beb1dc7e8..d7aaeef28 100644 --- a/ts/components/conversation/UnsupportedMessage.stories.tsx +++ b/ts/components/conversation/UnsupportedMessage.stories.tsx @@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react'; import { boolean, text } 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 { ContactType, Props, UnsupportedMessage } from './UnsupportedMessage'; diff --git a/ts/components/conversation/VerificationNotification.stories.tsx b/ts/components/conversation/VerificationNotification.stories.tsx index ff63d0776..5ba9f9f35 100644 --- a/ts/components/conversation/VerificationNotification.stories.tsx +++ b/ts/components/conversation/VerificationNotification.stories.tsx @@ -5,7 +5,7 @@ import * as React from 'react'; import { boolean } from '@storybook/addon-knobs'; 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 { Props, VerificationNotification } from './VerificationNotification'; diff --git a/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx b/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx index c068d4471..741b2e1f4 100644 --- a/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx +++ b/ts/components/conversation/conversation-details/AddGroupMembersModal.stories.tsx @@ -8,7 +8,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { sleep } from '../../../util/sleep'; -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'; import { AddGroupMembersModal } from './AddGroupMembersModal'; diff --git a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx index 30e26444c..8c3db3022 100644 --- a/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetails.stories.tsx @@ -7,7 +7,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { times } from 'lodash'; -import { setup as setupI18n } from '../../../../js/modules/i18n'; +import { setupI18n } from '../../../util/setupI18n'; import enMessages from '../../../../_locales/en/messages.json'; import { ConversationDetails, Props } from './ConversationDetails'; import { ConversationType } from '../../../state/ducks/conversations'; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx index 63936032e..419387864 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsActions.stories.tsx @@ -7,7 +7,7 @@ import { isBoolean } 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 { ConversationDetailsActions, diff --git a/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx index 64e5da073..a454326f8 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsHeader.stories.tsx @@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions'; import { number, text } 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 { ConversationType } from '../../../state/ducks/conversations'; diff --git a/ts/components/conversation/conversation-details/ConversationDetailsMediaList.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsMediaList.stories.tsx index d93253ed5..622f69b6a 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsMediaList.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsMediaList.stories.tsx @@ -6,7 +6,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 { diff --git a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx index 1bd3a5b94..ed744ce52 100644 --- a/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationDetailsMembershipList.stories.tsx @@ -8,7 +8,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { number } 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 { getDefaultConversation } from '../../../test-both/helpers/getDefaultConversation'; diff --git a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx index 4d7392e68..6cff167aa 100644 --- a/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx +++ b/ts/components/conversation/conversation-details/ConversationNotificationsSettings.stories.tsx @@ -6,7 +6,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 { ConversationNotificationsSettings } from './ConversationNotificationsSettings'; diff --git a/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx b/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx index a49160e17..92eba6f87 100644 --- a/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx +++ b/ts/components/conversation/conversation-details/EditConversationAttributesModal.stories.tsx @@ -6,7 +6,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 { EditConversationAttributesModal } from './EditConversationAttributesModal'; import { RequestState } from './util'; diff --git a/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx b/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx index ef5fae2b1..14f5e5eca 100644 --- a/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx +++ b/ts/components/conversation/conversation-details/GroupLinkManagement.stories.tsx @@ -6,7 +6,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 { GroupLinkManagement, PropsType } from './GroupLinkManagement'; import { SignalService as Proto } from '../../../protobuf'; diff --git a/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx b/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx index 2dfea7caf..95253795c 100644 --- a/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx +++ b/ts/components/conversation/conversation-details/GroupV2Permissions.stories.tsx @@ -6,7 +6,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 { GroupV2Permissions, PropsType } from './GroupV2Permissions'; import { ConversationType } from '../../../state/ducks/conversations'; diff --git a/ts/components/conversation/conversation-details/PendingInvites.stories.tsx b/ts/components/conversation/conversation-details/PendingInvites.stories.tsx index b166d7710..0a9faf3ad 100644 --- a/ts/components/conversation/conversation-details/PendingInvites.stories.tsx +++ b/ts/components/conversation/conversation-details/PendingInvites.stories.tsx @@ -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 { PendingInvites, PropsType } from './PendingInvites'; import { ConversationType } from '../../../state/ducks/conversations'; diff --git a/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx b/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx index 3ab6b0f70..99fbdfd5e 100644 --- a/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx +++ b/ts/components/conversation/media-gallery/AttachmentSection.stories.tsx @@ -8,7 +8,7 @@ import { storiesOf } from '@storybook/react'; import { select, text, withKnobs } from '@storybook/addon-knobs'; import { random, range, sample, sortBy } from 'lodash'; -import { setup as setupI18n } from '../../../../js/modules/i18n'; +import { setupI18n } from '../../../util/setupI18n'; import enMessages from '../../../../_locales/en/messages.json'; import { MIMEType } from '../../../types/MIME'; import { MediaItemType } from '../../../types/MediaItem'; diff --git a/ts/components/conversation/media-gallery/MediaGallery.stories.tsx b/ts/components/conversation/media-gallery/MediaGallery.stories.tsx index 8abec825f..22e14a221 100644 --- a/ts/components/conversation/media-gallery/MediaGallery.stories.tsx +++ b/ts/components/conversation/media-gallery/MediaGallery.stories.tsx @@ -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 { diff --git a/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx b/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx index fb6684c7e..a9a5d4eee 100644 --- a/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx +++ b/ts/components/conversation/media-gallery/MediaGridItem.stories.tsx @@ -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 { MediaItemType } from '../../../types/MediaItem'; import { AttachmentType } from '../../../types/Attachment'; diff --git a/ts/components/conversationList/MessageBodyHighlight.stories.tsx b/ts/components/conversationList/MessageBodyHighlight.stories.tsx index 96a74014b..81389aadb 100644 --- a/ts/components/conversationList/MessageBodyHighlight.stories.tsx +++ b/ts/components/conversationList/MessageBodyHighlight.stories.tsx @@ -5,7 +5,7 @@ import * as React from 'react'; import { storiesOf } from '@storybook/react'; import { text, withKnobs } 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 { MessageBodyHighlight, Props } from './MessageBodyHighlight'; diff --git a/ts/components/conversationList/MessageSearchResult.stories.tsx b/ts/components/conversationList/MessageSearchResult.stories.tsx index 7bd61c36a..e278692eb 100644 --- a/ts/components/conversationList/MessageSearchResult.stories.tsx +++ b/ts/components/conversationList/MessageSearchResult.stories.tsx @@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { boolean, text, withKnobs } 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 { MessageSearchResult, PropsType } from './MessageSearchResult'; import { getDefaultConversation } from '../../test-both/helpers/getDefaultConversation'; diff --git a/ts/components/emoji/EmojiButton.stories.tsx b/ts/components/emoji/EmojiButton.stories.tsx index b87595dd3..ea20bff09 100644 --- a/ts/components/emoji/EmojiButton.stories.tsx +++ b/ts/components/emoji/EmojiButton.stories.tsx @@ -6,7 +6,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 { EmojiButton } from './EmojiButton'; diff --git a/ts/components/emoji/EmojiPicker.stories.tsx b/ts/components/emoji/EmojiPicker.stories.tsx index b40ff905e..762e4efe5 100644 --- a/ts/components/emoji/EmojiPicker.stories.tsx +++ b/ts/components/emoji/EmojiPicker.stories.tsx @@ -6,7 +6,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 { EmojiPicker } from './EmojiPicker'; diff --git a/ts/components/stickers/StickerButton.stories.tsx b/ts/components/stickers/StickerButton.stories.tsx index 6d0e6ae79..b504f7bf3 100644 --- a/ts/components/stickers/StickerButton.stories.tsx +++ b/ts/components/stickers/StickerButton.stories.tsx @@ -6,7 +6,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { boolean } 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, StickerButton } from './StickerButton'; import { diff --git a/ts/components/stickers/StickerManager.stories.tsx b/ts/components/stickers/StickerManager.stories.tsx index a9bd79d56..eaffa7968 100644 --- a/ts/components/stickers/StickerManager.stories.tsx +++ b/ts/components/stickers/StickerManager.stories.tsx @@ -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 { Props, StickerManager } from './StickerManager'; import { createPack, sticker1, sticker2 } from './StickerPicker.stories'; diff --git a/ts/components/stickers/StickerPicker.stories.tsx b/ts/components/stickers/StickerPicker.stories.tsx index 6a6d0f710..9c0a9e811 100644 --- a/ts/components/stickers/StickerPicker.stories.tsx +++ b/ts/components/stickers/StickerPicker.stories.tsx @@ -7,7 +7,7 @@ import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { boolean } 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, StickerPicker } from './StickerPicker'; import { StickerPackType, StickerType } from '../../state/ducks/stickers'; diff --git a/ts/components/stickers/StickerPreviewModal.stories.tsx b/ts/components/stickers/StickerPreviewModal.stories.tsx index 89c734819..e5b35b41c 100644 --- a/ts/components/stickers/StickerPreviewModal.stories.tsx +++ b/ts/components/stickers/StickerPreviewModal.stories.tsx @@ -7,7 +7,7 @@ import { text } from '@storybook/addon-knobs'; import { action } from '@storybook/addon-actions'; import { StickerPreviewModal } from './StickerPreviewModal'; -import { setup as setupI18n } from '../../../js/modules/i18n'; +import { setupI18n } from '../../util/setupI18n'; import enMessages from '../../../_locales/en/messages.json'; import { landscapeGreenUrl, diff --git a/ts/models/messages.ts b/ts/models/messages.ts index 32f77565d..51fd049f0 100644 --- a/ts/models/messages.ts +++ b/ts/models/messages.ts @@ -673,7 +673,7 @@ export class MessageModel extends window.Backbone.Model { const conversation = window.ConversationController.get(identifier); return { text: window.i18n('safetyNumberChangedGroup', [ - conversation ? conversation.getTitle() : null, + conversation ? conversation.getTitle() : '', ]), }; } diff --git a/ts/test-both/state/selectors/conversations_test.ts b/ts/test-both/state/selectors/conversations_test.ts index b2a842fb0..d82c916f6 100644 --- a/ts/test-both/state/selectors/conversations_test.ts +++ b/ts/test-both/state/selectors/conversations_test.ts @@ -44,7 +44,7 @@ import { } from '../../../state/selectors/conversations'; import { noopAction } from '../../../state/ducks/noop'; import { StateType, reducer as rootReducer } from '../../../state/reducer'; -import { setup as setupI18n } from '../../../../js/modules/i18n'; +import { setupI18n } from '../../../util/setupI18n'; import enMessages from '../../../../_locales/en/messages.json'; import { getDefaultConversation } from '../../helpers/getDefaultConversation'; import { diff --git a/ts/test-both/util/callingNotification_test.ts b/ts/test-both/util/callingNotification_test.ts index aebe9ba45..a38faedca 100644 --- a/ts/test-both/util/callingNotification_test.ts +++ b/ts/test-both/util/callingNotification_test.ts @@ -4,7 +4,7 @@ import { assert } from 'chai'; import { getCallingNotificationText } from '../../util/callingNotification'; 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'; describe('calling notification helpers', () => { diff --git a/ts/test-both/util/expirationTimer_test.ts b/ts/test-both/util/expirationTimer_test.ts index 454ce8695..352d43dc8 100644 --- a/ts/test-both/util/expirationTimer_test.ts +++ b/ts/test-both/util/expirationTimer_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; import * as moment from 'moment'; -import { setup as setupI18n } from '../../../js/modules/i18n'; +import { setupI18n } from '../../util/setupI18n'; import enMessages from '../../../_locales/en/messages.json'; import esMessages from '../../../_locales/es/messages.json'; import nbMessages from '../../../_locales/nb/messages.json'; diff --git a/ts/test-both/util/getMuteOptions_test.ts b/ts/test-both/util/getMuteOptions_test.ts index 88205ffe5..dd1f0ece4 100644 --- a/ts/test-both/util/getMuteOptions_test.ts +++ b/ts/test-both/util/getMuteOptions_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { setup as setupI18n } from '../../../js/modules/i18n'; +import { setupI18n } from '../../util/setupI18n'; import enMessages from '../../../_locales/en/messages.json'; import { getMuteOptions } from '../../util/getMuteOptions'; diff --git a/ts/test-both/util/getMutedUntilText_test.ts b/ts/test-both/util/getMutedUntilText_test.ts index 89c8dac98..39d8492df 100644 --- a/ts/test-both/util/getMutedUntilText_test.ts +++ b/ts/test-both/util/getMutedUntilText_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { setup as setupI18n } from '../../../js/modules/i18n'; +import { setupI18n } from '../../util/setupI18n'; import enMessages from '../../../_locales/en/messages.json'; import { getMutedUntilText } from '../../util/getMutedUntilText'; diff --git a/ts/test-electron/models/messages_test.ts b/ts/test-electron/models/messages_test.ts index fc05cb5e2..696cf12fb 100644 --- a/ts/test-electron/models/messages_test.ts +++ b/ts/test-electron/models/messages_test.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; import * as sinon from 'sinon'; -import { setup as setupI18n } from '../../../js/modules/i18n'; +import { setupI18n } from '../../util/setupI18n'; import enMessages from '../../../_locales/en/messages.json'; import { SendStatus } from '../../messages/MessageSendState'; import MessageSender from '../../textsecure/SendMessage'; diff --git a/ts/types/I18N.ts b/ts/types/I18N.ts index 39ad57748..eaf254226 100644 --- a/ts/types/I18N.ts +++ b/ts/types/I18N.ts @@ -1,6 +1,8 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only +import { LocalizerType } from './Util'; + export type LocaleMessagesType = { [key: string]: { message: string; @@ -12,11 +14,6 @@ export type ReplacementValuesType = { [key: string]: T; }; -export type LocalizerType = ( - key: string, - placeholders: Array | ReplacementValuesType -) => string; - export type LocaleType = { i18n: LocalizerType; messages: LocaleMessagesType; diff --git a/ts/types/Util.ts b/ts/types/Util.ts index 04707933d..97829ed57 100644 --- a/ts/types/Util.ts +++ b/ts/types/Util.ts @@ -21,7 +21,7 @@ export type ReplacementValuesType = { }; export type LocalizerType = { - (key: string, values?: Array | ReplacementValuesType): string; + (key: string, values?: Array | ReplacementValuesType): string; getLocale(): string; }; diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index 1fbb13167..d430d4dbf 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -137,13 +137,6 @@ "reasonCategory": "falseMatch", "updated": "2019-10-31T17:28:08.684Z" }, - { - "rule": "jQuery-$(", - "path": "js/modules/i18n.js", - "line": " const FIND_REPLACEMENTS = /\\$([^$]+)\\$/g;", - "reasonCategory": "falseMatch", - "updated": "2020-07-21T18:34:59.251Z" - }, { "rule": "jQuery-$(", "path": "js/views/key_verification_view.js", @@ -13233,6 +13226,20 @@ "updated": "2021-08-18T18:22:55.307Z", "reasonDetail": "Legacy code" }, + { + "rule": "jQuery-$(", + "path": "ts/util/setupI18n.js", + "line": " const FIND_REPLACEMENTS = /\\$([^$]+)\\$/g;", + "reasonCategory": "falseMatch", + "updated": "2021-09-17T21:51:57.475Z" + }, + { + "rule": "jQuery-$(", + "path": "ts/util/setupI18n.ts", + "line": " const FIND_REPLACEMENTS = /\\$([^$]+)\\$/g;", + "reasonCategory": "falseMatch", + "updated": "2021-09-17T21:51:57.475Z" + }, { "rule": "jQuery-$(", "path": "ts/views/debug_log_view.js", diff --git a/js/modules/i18n.js b/ts/util/setupI18n.ts similarity index 88% rename from js/modules/i18n.js rename to ts/util/setupI18n.ts index 67093a8fb..7bebcc582 100644 --- a/js/modules/i18n.js +++ b/ts/util/setupI18n.ts @@ -1,9 +1,13 @@ // Copyright 2018-2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -/* eslint-env node, browser */ +import { LocaleMessagesType } from '../types/I18N'; +import { LocalizerType } from '../types/Util'; -exports.setup = (locale, messages) => { +export function setupI18n( + locale: string, + messages: LocaleMessagesType +): LocalizerType { if (!locale) { throw new Error('i18n: locale parameter is required'); } @@ -11,7 +15,7 @@ exports.setup = (locale, messages) => { throw new Error('i18n: messages parameter is required'); } - function getMessage(key, substitutions) { + const getMessage: LocalizerType = (key, substitutions) => { // eslint-disable-next-line no-console const log = typeof window !== 'undefined' ? window.SignalWindow.log : console; @@ -75,9 +79,9 @@ exports.setup = (locale, messages) => { } return builder; - } + }; getMessage.getLocale = () => locale; return getMessage; -}; +} diff --git a/ts/windows/configure.ts b/ts/windows/configure.ts index e73d34d01..7835e02aa 100644 --- a/ts/windows/configure.ts +++ b/ts/windows/configure.ts @@ -4,7 +4,7 @@ import url from 'url'; import { ipcRenderer } from 'electron'; -import i18n from '../../js/modules/i18n'; +import { setupI18n } from '../util/setupI18n'; import { getEnvironment, parseEnvironment, @@ -33,5 +33,5 @@ export const SignalWindow = { config.appInstance ? String(config.appInstance) : undefined, getEnvironment, getVersion: (): string => String(config.version), - i18n: i18n.setup(locale, localeMessages), + i18n: setupI18n(locale, localeMessages), };