From 9e133e2527936792377307343f29a7bd17cf2ced Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Wed, 31 May 2023 23:43:39 +0200 Subject: [PATCH] [Glitch] Upgrade react-intl Port 44cd88adc4e2f4028dcc2b08b98368f0dc90cee4 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/actions/notifications.js | 2 +- .../flavours/glitch/components/domain.tsx | 11 +- .../flavours/glitch/components/load_gap.tsx | 10 +- .../glitch/components/relative_timestamp.tsx | 14 +- .../glitch/containers/admin_component.jsx | 9 +- .../glitch/containers/compose_container.jsx | 9 +- .../flavours/glitch/containers/mastodon.jsx | 9 +- .../glitch/containers/media_container.jsx | 9 +- app/javascript/flavours/glitch/load_locale.js | 21 + .../glitch/locales/defaultMessages.json | 1114 ----------------- .../flavours/glitch/locales/whitelist_af.json | 2 - .../flavours/glitch/locales/whitelist_an.json | 2 - .../flavours/glitch/locales/whitelist_ar.json | 2 - .../glitch/locales/whitelist_ast.json | 2 - .../flavours/glitch/locales/whitelist_be.json | 2 - .../flavours/glitch/locales/whitelist_bg.json | 2 - .../flavours/glitch/locales/whitelist_bn.json | 2 - .../flavours/glitch/locales/whitelist_br.json | 2 - .../flavours/glitch/locales/whitelist_bs.json | 2 - .../flavours/glitch/locales/whitelist_ca.json | 2 - .../glitch/locales/whitelist_ckb.json | 2 - .../flavours/glitch/locales/whitelist_co.json | 2 - .../flavours/glitch/locales/whitelist_cs.json | 2 - .../flavours/glitch/locales/whitelist_cy.json | 2 - .../flavours/glitch/locales/whitelist_da.json | 2 - .../flavours/glitch/locales/whitelist_de.json | 2 - .../flavours/glitch/locales/whitelist_el.json | 2 - .../glitch/locales/whitelist_en-GB.json | 2 - .../flavours/glitch/locales/whitelist_en.json | 2 - .../flavours/glitch/locales/whitelist_eo.json | 2 - .../glitch/locales/whitelist_es-AR.json | 2 - .../glitch/locales/whitelist_es-MX.json | 2 - .../flavours/glitch/locales/whitelist_es.json | 2 - .../flavours/glitch/locales/whitelist_et.json | 2 - .../flavours/glitch/locales/whitelist_eu.json | 2 - .../flavours/glitch/locales/whitelist_fa.json | 2 - .../flavours/glitch/locales/whitelist_fi.json | 2 - .../flavours/glitch/locales/whitelist_fo.json | 2 - .../glitch/locales/whitelist_fr-QC.json | 2 - .../flavours/glitch/locales/whitelist_fr.json | 2 - .../flavours/glitch/locales/whitelist_fy.json | 2 - .../flavours/glitch/locales/whitelist_ga.json | 2 - .../flavours/glitch/locales/whitelist_gd.json | 2 - .../flavours/glitch/locales/whitelist_gl.json | 2 - .../flavours/glitch/locales/whitelist_he.json | 2 - .../flavours/glitch/locales/whitelist_hi.json | 2 - .../flavours/glitch/locales/whitelist_hr.json | 2 - .../flavours/glitch/locales/whitelist_hu.json | 2 - .../flavours/glitch/locales/whitelist_hy.json | 2 - .../flavours/glitch/locales/whitelist_id.json | 2 - .../flavours/glitch/locales/whitelist_ig.json | 2 - .../flavours/glitch/locales/whitelist_io.json | 2 - .../flavours/glitch/locales/whitelist_is.json | 2 - .../flavours/glitch/locales/whitelist_it.json | 2 - .../flavours/glitch/locales/whitelist_ja.json | 2 - .../flavours/glitch/locales/whitelist_ka.json | 2 - .../glitch/locales/whitelist_kab.json | 2 - .../flavours/glitch/locales/whitelist_kk.json | 2 - .../flavours/glitch/locales/whitelist_kn.json | 2 - .../flavours/glitch/locales/whitelist_ko.json | 2 - .../flavours/glitch/locales/whitelist_ku.json | 2 - .../flavours/glitch/locales/whitelist_kw.json | 2 - .../flavours/glitch/locales/whitelist_la.json | 2 - .../flavours/glitch/locales/whitelist_lt.json | 2 - .../flavours/glitch/locales/whitelist_lv.json | 2 - .../flavours/glitch/locales/whitelist_mk.json | 2 - .../flavours/glitch/locales/whitelist_ml.json | 2 - .../flavours/glitch/locales/whitelist_mr.json | 2 - .../flavours/glitch/locales/whitelist_ms.json | 2 - .../flavours/glitch/locales/whitelist_my.json | 2 - .../flavours/glitch/locales/whitelist_nl.json | 2 - .../flavours/glitch/locales/whitelist_nn.json | 2 - .../flavours/glitch/locales/whitelist_no.json | 2 - .../flavours/glitch/locales/whitelist_oc.json | 2 - .../flavours/glitch/locales/whitelist_pa.json | 2 - .../flavours/glitch/locales/whitelist_pl.json | 2 - .../glitch/locales/whitelist_pt-BR.json | 2 - .../glitch/locales/whitelist_pt-PT.json | 2 - .../flavours/glitch/locales/whitelist_ro.json | 2 - .../flavours/glitch/locales/whitelist_ru.json | 2 - .../flavours/glitch/locales/whitelist_sa.json | 2 - .../flavours/glitch/locales/whitelist_sc.json | 2 - .../glitch/locales/whitelist_sco.json | 2 - .../flavours/glitch/locales/whitelist_si.json | 2 - .../flavours/glitch/locales/whitelist_sk.json | 2 - .../flavours/glitch/locales/whitelist_sl.json | 2 - .../flavours/glitch/locales/whitelist_sq.json | 2 - .../glitch/locales/whitelist_sr-Latn.json | 2 - .../flavours/glitch/locales/whitelist_sr.json | 2 - .../flavours/glitch/locales/whitelist_sv.json | 2 - .../glitch/locales/whitelist_szl.json | 2 - .../flavours/glitch/locales/whitelist_ta.json | 2 - .../glitch/locales/whitelist_tai.json | 2 - .../flavours/glitch/locales/whitelist_te.json | 2 - .../flavours/glitch/locales/whitelist_th.json | 2 - .../flavours/glitch/locales/whitelist_tr.json | 2 - .../flavours/glitch/locales/whitelist_tt.json | 2 - .../flavours/glitch/locales/whitelist_ug.json | 2 - .../flavours/glitch/locales/whitelist_uk.json | 2 - .../flavours/glitch/locales/whitelist_ur.json | 2 - .../flavours/glitch/locales/whitelist_vi.json | 2 - .../glitch/locales/whitelist_zgh.json | 2 - .../glitch/locales/whitelist_zh-CN.json | 2 - .../glitch/locales/whitelist_zh-HK.json | 2 - .../glitch/locales/whitelist_zh-TW.json | 2 - app/javascript/flavours/glitch/packs/home.js | 3 +- .../flavours/glitch/packs/public.jsx | 2 + .../flavours/glitch/packs/share.jsx | 3 +- .../glitch/polyfills/base_polyfills.ts | 2 - .../flavours/glitch/polyfills/index.ts | 4 +- .../flavours/glitch/polyfills/intl.ts | 105 ++ 111 files changed, 168 insertions(+), 1349 deletions(-) create mode 100644 app/javascript/flavours/glitch/load_locale.js delete mode 100644 app/javascript/flavours/glitch/locales/defaultMessages.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_af.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_an.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ar.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ast.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_be.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_bg.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_bn.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_br.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_bs.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ca.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ckb.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_co.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_cs.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_cy.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_da.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_de.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_el.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_en-GB.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_en.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_eo.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_es-AR.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_es-MX.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_es.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_et.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_eu.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_fa.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_fi.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_fo.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_fr-QC.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_fr.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_fy.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ga.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_gd.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_gl.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_he.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_hi.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_hr.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_hu.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_hy.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_id.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ig.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_io.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_is.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_it.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ja.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ka.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_kab.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_kk.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_kn.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ko.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ku.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_kw.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_la.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_lt.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_lv.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_mk.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ml.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_mr.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ms.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_my.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_nl.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_nn.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_no.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_oc.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_pa.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_pl.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_pt-BR.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_pt-PT.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ro.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ru.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_sa.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_sc.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_sco.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_si.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_sk.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_sl.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_sq.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_sr-Latn.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_sr.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_sv.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_szl.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ta.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_tai.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_te.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_th.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_tr.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_tt.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ug.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_uk.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_ur.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_vi.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_zgh.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_zh-CN.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_zh-HK.json delete mode 100644 app/javascript/flavours/glitch/locales/whitelist_zh-TW.json create mode 100644 app/javascript/flavours/glitch/polyfills/intl.ts diff --git a/app/javascript/flavours/glitch/actions/notifications.js b/app/javascript/flavours/glitch/actions/notifications.js index 47d45d0012..a80746b756 100644 --- a/app/javascript/flavours/glitch/actions/notifications.js +++ b/app/javascript/flavours/glitch/actions/notifications.js @@ -1,4 +1,4 @@ -import IntlMessageFormat from 'intl-messageformat'; +import { IntlMessageFormat } from 'intl-messageformat'; import { defineMessages } from 'react-intl'; import { List as ImmutableList } from 'immutable'; diff --git a/app/javascript/flavours/glitch/components/domain.tsx b/app/javascript/flavours/glitch/components/domain.tsx index d61e4074ee..50c5c256ec 100644 --- a/app/javascript/flavours/glitch/components/domain.tsx +++ b/app/javascript/flavours/glitch/components/domain.tsx @@ -1,8 +1,7 @@ import { useCallback } from 'react'; import * as React from 'react'; -import type { InjectedIntl } from 'react-intl'; -import { defineMessages, injectIntl } from 'react-intl'; +import { defineMessages, useIntl } from 'react-intl'; import { IconButton } from './icon_button'; @@ -16,9 +15,11 @@ const messages = defineMessages({ interface Props { domain: string; onUnblockDomain: (domain: string) => void; - intl: InjectedIntl; } -const _Domain: React.FC = ({ domain, onUnblockDomain, intl }) => { + +export const Domain: React.FC = ({ domain, onUnblockDomain }) => { + const intl = useIntl(); + const handleDomainUnblock = useCallback(() => { onUnblockDomain(domain); }, [domain, onUnblockDomain]); @@ -42,5 +43,3 @@ const _Domain: React.FC = ({ domain, onUnblockDomain, intl }) => { ); }; - -export const Domain = injectIntl(_Domain); diff --git a/app/javascript/flavours/glitch/components/load_gap.tsx b/app/javascript/flavours/glitch/components/load_gap.tsx index 52d701d5d5..c86e70f9fc 100644 --- a/app/javascript/flavours/glitch/components/load_gap.tsx +++ b/app/javascript/flavours/glitch/components/load_gap.tsx @@ -1,7 +1,6 @@ import { useCallback } from 'react'; -import type { InjectedIntl } from 'react-intl'; -import { injectIntl, defineMessages } from 'react-intl'; +import { useIntl, defineMessages } from 'react-intl'; import { Icon } from 'flavours/glitch/components/icon'; @@ -13,10 +12,11 @@ interface Props { disabled: boolean; maxId: string; onClick: (maxId: string) => void; - intl: InjectedIntl; } -const _LoadGap: React.FC = ({ disabled, maxId, onClick, intl }) => { +export const LoadGap: React.FC = ({ disabled, maxId, onClick }) => { + const intl = useIntl(); + const handleClick = useCallback(() => { onClick(maxId); }, [maxId, onClick]); @@ -32,5 +32,3 @@ const _LoadGap: React.FC = ({ disabled, maxId, onClick, intl }) => { ); }; - -export const LoadGap = injectIntl(_LoadGap); diff --git a/app/javascript/flavours/glitch/components/relative_timestamp.tsx b/app/javascript/flavours/glitch/components/relative_timestamp.tsx index aaa424dca6..e4a8437d0e 100644 --- a/app/javascript/flavours/glitch/components/relative_timestamp.tsx +++ b/app/javascript/flavours/glitch/components/relative_timestamp.tsx @@ -1,6 +1,6 @@ import { Component } from 'react'; -import type { InjectedIntl } from 'react-intl'; +import type { IntlShape } from 'react-intl'; import { injectIntl, defineMessages } from 'react-intl'; const messages = defineMessages({ @@ -103,7 +103,7 @@ const getUnitDelay = (units: string) => { }; export const timeAgoString = ( - intl: InjectedIntl, + intl: IntlShape, date: Date, now: number, year: number, @@ -155,7 +155,7 @@ export const timeAgoString = ( }; const timeRemainingString = ( - intl: InjectedIntl, + intl: IntlShape, date: Date, now: number, timeGiven = true @@ -190,7 +190,7 @@ const timeRemainingString = ( }; interface Props { - intl: InjectedIntl; + intl: IntlShape; timestamp: string; year: number; futureDate?: boolean; @@ -201,7 +201,7 @@ interface States { } class RelativeTimestamp extends Component { state = { - now: this.props.intl.now(), + now: Date.now(), }; static defaultProps = { @@ -223,7 +223,7 @@ class RelativeTimestamp extends Component { UNSAFE_componentWillReceiveProps(nextProps: Props) { if (this.props.timestamp !== nextProps.timestamp) { - this.setState({ now: this.props.intl.now() }); + this.setState({ now: Date.now() }); } } @@ -253,7 +253,7 @@ class RelativeTimestamp extends Component { : Math.max(updateInterval, unitRemainder); this._timer = window.setTimeout(() => { - this.setState({ now: this.props.intl.now() }); + this.setState({ now: Date.now() }); }, delay); } diff --git a/app/javascript/flavours/glitch/containers/admin_component.jsx b/app/javascript/flavours/glitch/containers/admin_component.jsx index d73189d66d..a4dbe9c439 100644 --- a/app/javascript/flavours/glitch/containers/admin_component.jsx +++ b/app/javascript/flavours/glitch/containers/admin_component.jsx @@ -1,12 +1,11 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { IntlProvider, addLocaleData } from 'react-intl'; +import { IntlProvider } from 'react-intl'; -import { getLocale } from 'mastodon/locales'; +import { getLocale, onProviderError } from 'mastodon/locales'; -const { localeData, messages } = getLocale(); -addLocaleData(localeData); +const { messages } = getLocale(); export default class AdminComponent extends PureComponent { @@ -19,7 +18,7 @@ export default class AdminComponent extends PureComponent { const { locale, children } = this.props; return ( - + {children} ); diff --git a/app/javascript/flavours/glitch/containers/compose_container.jsx b/app/javascript/flavours/glitch/containers/compose_container.jsx index a1edfb8450..f053fc6d4f 100644 --- a/app/javascript/flavours/glitch/containers/compose_container.jsx +++ b/app/javascript/flavours/glitch/containers/compose_container.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { IntlProvider, addLocaleData } from 'react-intl'; +import { IntlProvider } from 'react-intl'; import { Provider } from 'react-redux'; @@ -11,10 +11,9 @@ import Compose from 'flavours/glitch/features/standalone/compose'; import initialState from 'flavours/glitch/initial_state'; import { store } from 'flavours/glitch/store'; -import { getLocale } from 'mastodon/locales'; +import { getLocale, onProviderError } from 'mastodon/locales'; -const { localeData, messages } = getLocale(); -addLocaleData(localeData); +const { messages } = getLocale(); if (initialState) { store.dispatch(hydrateStore(initialState)); @@ -32,7 +31,7 @@ export default class TimelineContainer extends PureComponent { const { locale } = this.props; return ( - + diff --git a/app/javascript/flavours/glitch/containers/mastodon.jsx b/app/javascript/flavours/glitch/containers/mastodon.jsx index 8f46c1697c..fc09582e60 100644 --- a/app/javascript/flavours/glitch/containers/mastodon.jsx +++ b/app/javascript/flavours/glitch/containers/mastodon.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; -import { IntlProvider, addLocaleData } from 'react-intl'; +import { IntlProvider } from 'react-intl'; import { Helmet } from 'react-helmet'; import { BrowserRouter, Route } from 'react-router-dom'; @@ -18,10 +18,9 @@ import ErrorBoundary from 'flavours/glitch/components/error_boundary'; import UI from 'flavours/glitch/features/ui'; import initialState, { title as siteTitle } from 'flavours/glitch/initial_state'; import { store } from 'flavours/glitch/store'; -import { getLocale } from 'locales'; +import { getLocale, onProviderError } from 'locales'; -const { localeData, messages } = getLocale(); -addLocaleData(localeData); +const { messages } = getLocale(); const title = process.env.NODE_ENV === 'production' ? siteTitle : `${siteTitle} (Dev)`; @@ -87,7 +86,7 @@ export default class Mastodon extends PureComponent { const { locale } = this.props; return ( - + diff --git a/app/javascript/flavours/glitch/containers/media_container.jsx b/app/javascript/flavours/glitch/containers/media_container.jsx index 0d2f193daf..99447aebd1 100644 --- a/app/javascript/flavours/glitch/containers/media_container.jsx +++ b/app/javascript/flavours/glitch/containers/media_container.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import { createPortal } from 'react-dom'; -import { IntlProvider, addLocaleData } from 'react-intl'; +import { IntlProvider } from 'react-intl'; import { fromJS } from 'immutable'; @@ -16,10 +16,9 @@ import MediaModal from 'flavours/glitch/features/ui/components/media_modal'; import Video from 'flavours/glitch/features/video'; import { getScrollbarWidth } from 'flavours/glitch/utils/scrollbar'; -import { getLocale } from 'mastodon/locales'; +import { getLocale, onProviderError } from 'mastodon/locales'; -const { localeData, messages } = getLocale(); -addLocaleData(localeData); +const { messages } = getLocale(); const MEDIA_COMPONENTS = { MediaGallery, Video, Card, Poll, Hashtag, Audio }; @@ -85,7 +84,7 @@ export default class MediaContainer extends PureComponent { } return ( - + <> {[].map.call(components, (component, i) => { const componentName = component.getAttribute('data-component'); diff --git a/app/javascript/flavours/glitch/load_locale.js b/app/javascript/flavours/glitch/load_locale.js new file mode 100644 index 0000000000..1c22bfd31c --- /dev/null +++ b/app/javascript/flavours/glitch/load_locale.js @@ -0,0 +1,21 @@ +import { setLocale } from 'locales'; + +export async function loadLocale() { + const locale = document.querySelector('html').lang || 'en'; + + const upstreamLocaleData = await import( + /* webpackMode: "lazy" */ + /* webpackChunkName: "locales/vanilla/[request]" */ + /* webpackInclude: /\.json$/ */ + /* webpackPreload: true */ + `mastodon/locales/${locale}.json`); + + const localeData = await import( + /* webpackMode: "lazy" */ + /* webpackChunkName: "locales/glitch/[request]" */ + /* webpackInclude: /\.json$/ */ + /* webpackPreload: true */ + `flavours/glitch/locales/${locale}.json`); + + setLocale({ messages: {...upstreamLocaleData, ...localeData} }); +} diff --git a/app/javascript/flavours/glitch/locales/defaultMessages.json b/app/javascript/flavours/glitch/locales/defaultMessages.json deleted file mode 100644 index bf21fdef2d..0000000000 --- a/app/javascript/flavours/glitch/locales/defaultMessages.json +++ /dev/null @@ -1,1114 +0,0 @@ -[ - { - "descriptors": [ - { - "defaultMessage": "We're sorry, but something went wrong with the Mastodon app.", - "id": "web_app_crash.title" - }, - { - "defaultMessage": "You could try any of the following:", - "id": "web_app_crash.content" - }, - { - "defaultMessage": "Disable browser add-ons or built-in translation tools", - "id": "web_app_crash.disable_addons" - }, - { - "defaultMessage": "Report a bug in the {issuetracker}", - "id": "web_app_crash.report_issue" - }, - { - "defaultMessage": "issue tracker", - "id": "web_app_crash.issue_tracker" - }, - { - "defaultMessage": "Debug information", - "id": "web_app_crash.debug_info" - }, - { - "defaultMessage": "{reload} the current page", - "id": "web_app_crash.reload_page" - }, - { - "defaultMessage": "Reload", - "id": "web_app_crash.reload" - }, - { - "defaultMessage": "Change your {settings}", - "id": "web_app_crash.change_your_settings" - }, - { - "defaultMessage": "settings", - "id": "web_app_crash.settings" - } - ], - "path": "app/javascript/flavours/glitch/components/error_boundary.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Sensitive", - "id": "media_gallery.sensitive" - }, - { - "defaultMessage": "Click to view", - "id": "status.sensitive_toggle" - } - ], - "path": "app/javascript/flavours/glitch/components/media_gallery.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Select\nall", - "id": "notification_purge.btn_all" - }, - { - "defaultMessage": "Select\nnone", - "id": "notification_purge.btn_none" - }, - { - "defaultMessage": "Invert\nselection", - "id": "notification_purge.btn_invert" - }, - { - "defaultMessage": "Clear\nselected", - "id": "notification_purge.btn_apply" - } - ], - "path": "app/javascript/flavours/glitch/components/notification_purge_buttons.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Collapse", - "id": "status.collapse" - }, - { - "defaultMessage": "Uncollapse", - "id": "status.uncollapse" - }, - { - "defaultMessage": "This toot is a reply", - "id": "status.in_reply_to" - }, - { - "defaultMessage": "Features an attached preview card", - "id": "status.has_preview_card" - }, - { - "defaultMessage": "Features attached pictures", - "id": "status.has_pictures" - }, - { - "defaultMessage": "This toot is a poll", - "id": "status.is_poll" - }, - { - "defaultMessage": "Features attached videos", - "id": "status.has_video" - }, - { - "defaultMessage": "Features attached audio files", - "id": "status.has_audio" - }, - { - "defaultMessage": "Only visible from your instance", - "id": "status.local_only" - } - ], - "path": "app/javascript/flavours/glitch/components/status_icons.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Are you sure you want to permanently clear all selected notifications?", - "id": "notifications.marked_clear_confirmation" - }, - { - "defaultMessage": "Clear selected notifications", - "id": "notifications.marked_clear" - } - ], - "path": "app/javascript/flavours/glitch/containers/notification_purge_buttons_container.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Show", - "id": "confirmations.unfilter.confirm" - }, - { - "defaultMessage": "Author", - "id": "confirmations.unfilter.author" - }, - { - "defaultMessage": "Matching {count, plural, one {filter} other {filters}}", - "id": "confirmations.unfilter.filters" - }, - { - "defaultMessage": "Edit filter", - "id": "confirmations.unfilter.edit_filter" - } - ], - "path": "app/javascript/flavours/glitch/containers/status_container.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Glitch-soc is free open source software forked from Mastodon.", - "id": "about.fork_disclaimer" - } - ], - "path": "app/javascript/flavours/glitch/features/about/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "No comment provided", - "id": "account_note.glitch_placeholder" - }, - { - "defaultMessage": "Cancel", - "id": "account_note.cancel" - }, - { - "defaultMessage": "Save", - "id": "account_note.save" - }, - { - "defaultMessage": "Edit", - "id": "account_note.edit" - } - ], - "path": "app/javascript/flavours/glitch/features/account/components/account_note.json" - }, - { - "descriptors": [ - { - "defaultMessage": "This user has been suspended by a moderator.", - "id": "account.suspended_disclaimer_full" - }, - { - "defaultMessage": "Information below may reflect the user's profile incompletely.", - "id": "account.disclaimer_full" - }, - { - "defaultMessage": "View full profile", - "id": "account.view_full_profile" - }, - { - "defaultMessage": "Follows", - "id": "account.follows" - } - ], - "path": "app/javascript/flavours/glitch/features/account/components/action_bar.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Add note for @{name}", - "id": "account.add_account_note" - }, - { - "defaultMessage": "Joined {date}", - "id": "account.joined" - } - ], - "path": "app/javascript/flavours/glitch/features/account/components/header.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Profile", - "id": "column_header.profile" - } - ], - "path": "app/javascript/flavours/glitch/features/account/components/profile_column_header.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Filter out by regular expressions", - "id": "home.column_settings.filter_regex" - }, - { - "defaultMessage": "Column settings", - "id": "home.settings" - }, - { - "defaultMessage": "Advanced", - "id": "home.column_settings.advanced" - } - ], - "path": "app/javascript/flavours/glitch/features/community_timeline/components/column_settings.json" - }, - { - "descriptors": [ - { - "defaultMessage": "At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.", - "id": "confirmations.missing_media_description.message" - }, - { - "defaultMessage": "Send anyway", - "id": "confirmations.missing_media_description.confirm" - } - ], - "path": "app/javascript/flavours/glitch/features/compose/components/compose_form.json" - }, - { - "descriptors": [ - { - "defaultMessage": "App settings", - "id": "navigation_bar.app_settings" - } - ], - "path": "app/javascript/flavours/glitch/features/compose/components/header.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Advanced options", - "id": "advanced_options.icon_title" - }, - { - "defaultMessage": "Attach...", - "id": "compose.attach" - }, - { - "defaultMessage": "Content type", - "id": "content-type.change" - }, - { - "defaultMessage": "Draw something", - "id": "compose.attach.doodle" - }, - { - "defaultMessage": "HTML", - "id": "compose.content-type.html" - }, - { - "defaultMessage": "Do not post to other instances", - "id": "advanced_options.local-only.long" - }, - { - "defaultMessage": "Local-only", - "id": "advanced_options.local-only.short" - }, - { - "defaultMessage": "Markdown", - "id": "compose.content-type.markdown" - }, - { - "defaultMessage": "Plain text", - "id": "compose.content-type.plain" - }, - { - "defaultMessage": "Hide text behind warning", - "id": "compose_form.spoiler" - }, - { - "defaultMessage": "Automatically opens a reply on posting", - "id": "advanced_options.threaded_mode.long" - }, - { - "defaultMessage": "Threaded mode", - "id": "advanced_options.threaded_mode.short" - }, - { - "defaultMessage": "Upload a file", - "id": "compose.attach.upload" - } - ], - "path": "app/javascript/flavours/glitch/features/compose/components/options.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Allow one choice", - "id": "compose_form.poll.single_choice" - }, - { - "defaultMessage": "Allow multiple choices", - "id": "compose_form.poll.multiple_choices" - } - ], - "path": "app/javascript/flavours/glitch/features/compose/components/poll_form.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Simple text returns statuses you have written, favourited, boosted, or have been mentioned in, as well as matching usernames, display names, and hashtags.", - "id": "search_popout.tips.full_text" - }, - { - "defaultMessage": "Simple text returns matching display names, usernames and hashtags", - "id": "search_popout.tips.text" - }, - { - "defaultMessage": "Advanced search format", - "id": "search_popout.search_format" - }, - { - "defaultMessage": "hashtag", - "id": "search_popout.tips.hashtag" - }, - { - "defaultMessage": "user", - "id": "search_popout.tips.user" - }, - { - "defaultMessage": "status", - "id": "search_popout.tips.status" - } - ], - "path": "app/javascript/flavours/glitch/features/compose/components/search.json" - }, - { - "descriptors": [ - { - "defaultMessage": "This post is local-only", - "id": "advanced_options.local-only.tooltip" - }, - { - "defaultMessage": "Threaded mode enabled", - "id": "advanced_options.threaded_mode.tooltip" - } - ], - "path": "app/javascript/flavours/glitch/features/compose/components/textarea_icons.json" - }, - { - "descriptors": [ - { - "defaultMessage": "At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.", - "id": "confirmations.missing_media_description.message" - }, - { - "defaultMessage": "Send anyway", - "id": "confirmations.missing_media_description.confirm" - }, - { - "defaultMessage": "Edit media", - "id": "confirmations.missing_media_description.edit" - } - ], - "path": "app/javascript/flavours/glitch/features/compose/containers/compose_form_container.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Filter out by regular expressions", - "id": "home.column_settings.filter_regex" - }, - { - "defaultMessage": "Column settings", - "id": "home.settings" - }, - { - "defaultMessage": "Group by conversation", - "id": "direct.group_by_conversations" - }, - { - "defaultMessage": "Advanced", - "id": "home.column_settings.advanced" - } - ], - "path": "app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Favourited by", - "id": "column.favourited_by" - } - ], - "path": "app/javascript/flavours/glitch/features/favourites/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Follow people you'd like to see posts from! Here are some suggestions.", - "id": "follow_recommendations.heading" - }, - { - "defaultMessage": "Posts from people you follow will show up in chronological order on your home feed. Don't be afraid to make mistakes, you can unfollow people just as easily any time!", - "id": "follow_recommendations.lead" - }, - { - "defaultMessage": "Looks like no suggestions could be generated for you. You can try using search to look for people you might know or explore trending hashtags.", - "id": "empty_column.follow_recommendations" - }, - { - "defaultMessage": "Done", - "id": "follow_recommendations.done" - } - ], - "path": "app/javascript/flavours/glitch/features/follow_recommendations/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Misc", - "id": "column.heading" - }, - { - "defaultMessage": "Miscellaneous options", - "id": "column.subheading" - }, - { - "defaultMessage": "Show me around", - "id": "getting_started.onboarding" - }, - { - "defaultMessage": "Keyboard shortcuts", - "id": "navigation_bar.keyboard_shortcuts" - }, - { - "defaultMessage": "Featured users", - "id": "navigation_bar.featured_users" - } - ], - "path": "app/javascript/flavours/glitch/features/getting_started_misc/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Navigation", - "id": "column_subheading.navigation" - }, - { - "defaultMessage": "App settings", - "id": "navigation_bar.app_settings" - }, - { - "defaultMessage": "Keyboard shortcuts", - "id": "navigation_bar.keyboard_shortcuts" - }, - { - "defaultMessage": "Lists", - "id": "column_subheading.lists" - }, - { - "defaultMessage": "Misc", - "id": "navigation_bar.misc" - } - ], - "path": "app/javascript/flavours/glitch/features/getting_started/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Filter out by regular expressions", - "id": "home.column_settings.filter_regex" - }, - { - "defaultMessage": "Column settings", - "id": "home.settings" - }, - { - "defaultMessage": "Show DMs", - "id": "home.column_settings.show_direct" - }, - { - "defaultMessage": "Advanced", - "id": "home.column_settings.advanced" - } - ], - "path": "app/javascript/flavours/glitch/features/home_timeline/components/column_settings.json" - }, - { - "descriptors": [ - { - "defaultMessage": "to bookmark", - "id": "keyboard_shortcuts.bookmark" - }, - { - "defaultMessage": "to collapse/uncollapse toots", - "id": "keyboard_shortcuts.toggle_collapse" - }, - { - "defaultMessage": "to send toot using secondary privacy setting", - "id": "keyboard_shortcuts.secondary_toot" - } - ], - "path": "app/javascript/flavours/glitch/features/keyboard_shortcuts/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "General", - "id": "settings.general" - }, - { - "defaultMessage": "Compose box", - "id": "settings.compose_box_opts" - }, - { - "defaultMessage": "Content Warnings", - "id": "settings.content_warnings" - }, - { - "defaultMessage": "Collapsed toots", - "id": "settings.collapsed_statuses" - }, - { - "defaultMessage": "Media", - "id": "settings.media" - }, - { - "defaultMessage": "Preferences", - "id": "settings.preferences" - }, - { - "defaultMessage": "Close", - "id": "settings.close" - } - ], - "path": "app/javascript/flavours/glitch/features/local_settings/navigation/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Auto", - "id": "layout.auto" - }, - { - "defaultMessage": "Automatically chose layout based on “Enable advanced web interface” setting and screen size.", - "id": "layout.hint.auto" - }, - { - "defaultMessage": "Desktop", - "id": "layout.desktop" - }, - { - "defaultMessage": "Use multiple-column layout regardless of the “Enable advanced web interface” setting or screen size.", - "id": "layout.hint.desktop" - }, - { - "defaultMessage": "Mobile", - "id": "layout.single" - }, - { - "defaultMessage": "Use single-column layout regardless of the “Enable advanced web interface” setting or screen size.", - "id": "layout.hint.single" - }, - { - "defaultMessage": "None", - "id": "settings.side_arm.none" - }, - { - "defaultMessage": "Keep its set privacy", - "id": "settings.side_arm_reply_mode.keep" - }, - { - "defaultMessage": "Copy privacy setting of the toot being replied to", - "id": "settings.side_arm_reply_mode.copy" - }, - { - "defaultMessage": "Restrict privacy setting to that of the toot being replied to", - "id": "settings.side_arm_reply_mode.restrict" - }, - { - "defaultMessage": "Regular expression", - "id": "settings.content_warnings.regexp" - }, - { - "defaultMessage": "Do not rewrite mentions", - "id": "settings.rewrite_mentions_no" - }, - { - "defaultMessage": "Rewrite with username and domain (when the account is remote)", - "id": "settings.rewrite_mentions_acct" - }, - { - "defaultMessage": "Rewrite with username", - "id": "settings.rewrite_mentions_username" - }, - { - "defaultMessage": "Left", - "id": "settings.pop_in_left" - }, - { - "defaultMessage": "Right", - "id": "settings.pop_in_right" - }, - { - "defaultMessage": "General", - "id": "settings.general" - }, - { - "defaultMessage": "Display an estimate of the reply count", - "id": "settings.show_reply_counter" - }, - { - "defaultMessage": "High color privacy icons", - "id": "settings.hicolor_privacy_icons" - }, - { - "defaultMessage": "Display privacy icons in bright and easily distinguishable colors", - "id": "settings.hicolor_privacy_icons.hint" - }, - { - "defaultMessage": "Show confirmation dialog before boosting toots lacking media descriptions", - "id": "settings.confirm_boost_missing_media_description" - }, - { - "defaultMessage": "Tag misleading links", - "id": "settings.tag_misleading_links" - }, - { - "defaultMessage": "Add a visual indication with the link target host to every link not mentioning it explicitly", - "id": "settings.tag_misleading_links.hint" - }, - { - "defaultMessage": "Rewrite mentions in displayed statuses", - "id": "settings.rewrite_mentions" - }, - { - "defaultMessage": "Notifications options", - "id": "settings.notifications_opts" - }, - { - "defaultMessage": "Unread notifications badge", - "id": "settings.notifications.tab_badge" - }, - { - "defaultMessage": "Display a badge for unread notifications in the column icons when the notifications column isn't open", - "id": "settings.notifications.tab_badge.hint" - }, - { - "defaultMessage": "Unread notifications favicon badge", - "id": "settings.notifications.favicon_badge" - }, - { - "defaultMessage": "Add a badge for unread notifications to the favicon", - "id": "settings.notifications.favicon_badge.hint" - }, - { - "defaultMessage": "Toot icons", - "id": "settings.status_icons" - }, - { - "defaultMessage": "Language indicator", - "id": "settings.status_icons_language" - }, - { - "defaultMessage": "Reply indicator", - "id": "settings.status_icons_reply" - }, - { - "defaultMessage": "Local-only indicator", - "id": "settings.status_icons_local_only" - }, - { - "defaultMessage": "Media and poll indicators", - "id": "settings.status_icons_media" - }, - { - "defaultMessage": "Toot privacy indicator", - "id": "settings.status_icons_visibility" - }, - { - "defaultMessage": "Layout options", - "id": "settings.layout_opts" - }, - { - "defaultMessage": "Layout:", - "id": "settings.layout" - }, - { - "defaultMessage": "Wide view (Desktop mode only)", - "id": "settings.wide_view" - }, - { - "defaultMessage": "Stretches columns to better fill the available space.", - "id": "settings.wide_view_hint" - }, - { - "defaultMessage": "Compose box", - "id": "settings.compose_box_opts" - }, - { - "defaultMessage": "Always enable the Content Warning field", - "id": "settings.always_show_spoilers_field" - }, - { - "defaultMessage": "Prepend “re: ” to content warnings when replying", - "id": "settings.prepend_cw_re" - }, - { - "defaultMessage": "Pre-select usernames on reply", - "id": "settings.preselect_on_reply" - }, - { - "defaultMessage": "When replying to a conversation with multiple participants, pre-select usernames past the first", - "id": "settings.preselect_on_reply_hint" - }, - { - "defaultMessage": "Show confirmation dialog before sending toots lacking media descriptions", - "id": "settings.confirm_missing_media_description" - }, - { - "defaultMessage": "Show confirmation dialog before overwriting the message being composed", - "id": "settings.confirm_before_clearing_draft" - }, - { - "defaultMessage": "Show content-type choice when authoring toots", - "id": "settings.show_content_type_choice" - }, - { - "defaultMessage": "Secondary toot button:", - "id": "settings.side_arm" - }, - { - "defaultMessage": "When replying to a toot, the secondary toot button should:", - "id": "settings.side_arm_reply_mode" - }, - { - "defaultMessage": "Content warnings", - "id": "settings.content_warnings" - }, - { - "defaultMessage": "Show/hide content of all copies at once", - "id": "settings.content_warnings_shared_state" - }, - { - "defaultMessage": "Reproduce upstream Mastodon behavior by having the Content Warning button affect all copies of a post at once. This will prevent automatic collapsing of any copy of a toot with unfolded CW", - "id": "settings.content_warnings_shared_state_hint" - }, - { - "defaultMessage": "Display media attachments outside content warnings", - "id": "settings.content_warnings_media_outside" - }, - { - "defaultMessage": "Reproduce upstream Mastodon behavior by having the Content Warning toggle not affect media attachments", - "id": "settings.content_warnings_media_outside_hint" - }, - { - "defaultMessage": "Auto-unfolding options", - "id": "settings.content_warnings_unfold_opts" - }, - { - "defaultMessage": "Automatically unfold content-warnings", - "id": "settings.enable_content_warnings_auto_unfold" - }, - { - "defaultMessage": "This setting is now controlled from Mastodon's {settings_page_link}", - "id": "settings.deprecated_setting" - }, - { - "defaultMessage": "user preferences", - "id": "settings.shared_settings_link" - }, - { - "defaultMessage": "Content warnings to not automatically unfold:", - "id": "settings.content_warnings_filter" - }, - { - "defaultMessage": "Collapsed toots", - "id": "settings.collapsed_statuses" - }, - { - "defaultMessage": "Enable collapsed toots", - "id": "settings.enable_collapsed" - }, - { - "defaultMessage": "Collapsed posts have parts of their contents hidden to take up less screen space. This is distinct from the Content Warning feature", - "id": "settings.enable_collapsed_hint" - }, - { - "defaultMessage": "Show action buttons in collapsed toots", - "id": "settings.show_action_bar" - }, - { - "defaultMessage": "Automatic collapsing", - "id": "settings.auto_collapse" - }, - { - "defaultMessage": "Everything", - "id": "settings.auto_collapse_all" - }, - { - "defaultMessage": "Notifications", - "id": "settings.auto_collapse_notifications" - }, - { - "defaultMessage": "Lengthy toots", - "id": "settings.auto_collapse_lengthy" - }, - { - "defaultMessage": "Boosts", - "id": "settings.auto_collapse_reblogs" - }, - { - "defaultMessage": "Replies", - "id": "settings.auto_collapse_replies" - }, - { - "defaultMessage": "Toots with media", - "id": "settings.auto_collapse_media" - }, - { - "defaultMessage": "Height (in pixels) for a toot to be considered lengthy", - "id": "settings.auto_collapse_height" - }, - { - "defaultMessage": "Image backgrounds", - "id": "settings.image_backgrounds" - }, - { - "defaultMessage": "Give collapsed toots an image background", - "id": "settings.image_backgrounds_users" - }, - { - "defaultMessage": "Preview collapsed toot media", - "id": "settings.image_backgrounds_media" - }, - { - "defaultMessage": "If the post has any media attachment, use the first one as a background", - "id": "settings.image_backgrounds_media_hint" - }, - { - "defaultMessage": "Media", - "id": "settings.media" - }, - { - "defaultMessage": "Letterbox media", - "id": "settings.media_letterbox" - }, - { - "defaultMessage": "Scale down and letterbox media to fill the image containers instead of stretching and cropping them", - "id": "settings.media_letterbox_hint" - }, - { - "defaultMessage": "Full-width media previews", - "id": "settings.media_fullwidth" - }, - { - "defaultMessage": "Inline preview cards for external links", - "id": "settings.inline_preview_cards" - }, - { - "defaultMessage": "Reveal sensitive media behind a CW by default", - "id": "settings.media_reveal_behind_cw" - }, - { - "defaultMessage": "Enable pop-in player", - "id": "settings.pop_in_player" - }, - { - "defaultMessage": "Pop-in player position:", - "id": "settings.pop_in_position" - } - ], - "path": "app/javascript/flavours/glitch/features/local_settings/page/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Mark for deletion", - "id": "notification.markForDeletion" - } - ], - "path": "app/javascript/flavours/glitch/features/notifications/components/overlay.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Enter notification cleaning mode", - "id": "notification_purge.start" - } - ], - "path": "app/javascript/flavours/glitch/features/notifications/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Featured accounts", - "id": "endorsed_accounts_editor.endorsed_accounts" - } - ], - "path": "app/javascript/flavours/glitch/features/pinned_accounts_editor/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Filter out by regular expressions", - "id": "home.column_settings.filter_regex" - }, - { - "defaultMessage": "Show local-only toots", - "id": "community.column_settings.allow_local_only" - }, - { - "defaultMessage": "Advanced", - "id": "home.column_settings.advanced" - } - ], - "path": "app/javascript/flavours/glitch/features/public_timeline/components/column_settings.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Boosted by", - "id": "column.reblogged_by" - } - ], - "path": "app/javascript/flavours/glitch/features/reblogs/index.json" - }, - { - "descriptors": [ - { - "defaultMessage": "This toot contains some media without description", - "id": "boost_modal.missing_description" - } - ], - "path": "app/javascript/flavours/glitch/features/ui/components/boost_modal.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Do not ask for confirmation again", - "id": "confirmation_modal.do_not_ask_again" - } - ], - "path": "app/javascript/flavours/glitch/features/ui/components/confirmation_modal.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Use Mastodon preferences", - "id": "confirmations.deprecated_settings.confirm" - }, - { - "defaultMessage": "Automatically unfold content-warnings", - "id": "settings.enable_content_warnings_auto_unfold" - }, - { - "defaultMessage": "Allow swiping to change columns (Mobile only)", - "id": "settings.swipe_to_change_columns" - }, - { - "defaultMessage": "Some of the glitch-soc device-specific {app_settings} you are using have been replaced by Mastodon {preferences} and will be overriden:", - "id": "confirmations.deprecated_settings.message" - }, - { - "defaultMessage": "App settings", - "id": "navigation_bar.app_settings" - } - ], - "path": "app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.json" - }, - { - "descriptors": [ - { - "defaultMessage": "You can press {combo} to skip this next time", - "id": "favourite_modal.combo" - } - ], - "path": "app/javascript/flavours/glitch/features/ui/components/favourite_modal.json" - }, - { - "descriptors": [ - { - "defaultMessage": "App settings", - "id": "navigation_bar.app_settings" - } - ], - "path": "app/javascript/flavours/glitch/features/ui/components/navigation_panel.json" - }, - { - "descriptors": [ - { - "defaultMessage": "Welcome to {domain}!", - "id": "onboarding.page_one.welcome" - }, - { - "defaultMessage": "{domain} is an \"instance\" of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.", - "id": "onboarding.page_one.federation" - }, - { - "defaultMessage": "You are on {domain}, so your full handle is {handle}", - "id": "onboarding.page_one.handle" - }, - { - "defaultMessage": "Write posts from the compose column. You can upload images, change privacy settings, and add content warnings with the icons below.", - "id": "onboarding.page_two.compose" - }, - { - "defaultMessage": "Use the search bar to find people and look at hashtags, such as {illustration} and {introductions}. To look for a person who is not on this instance, use their full handle.", - "id": "onboarding.page_three.search" - }, - { - "defaultMessage": "Edit your profile to change your avatar, bio, and display name. There, you will also find other preferences.", - "id": "onboarding.page_three.profile" - }, - { - "defaultMessage": "The home timeline shows posts from people you follow.", - "id": "onboarding.page_four.home" - }, - { - "defaultMessage": "The notifications column shows when someone interacts with you.", - "id": "onboarding.page_four.notifications" - }, - { - "defaultMessage": "The local timeline shows public posts from everyone on {domain}. The federated timeline shows public posts from everyone who people on {domain} follow. These are the Public Timelines, a great way to discover new people.", - "id": "onboarding.page_five.public_timelines" - }, - { - "defaultMessage": "Your instance's admin is {admin}.", - "id": "onboarding.page_six.admin" - }, - { - "defaultMessage": "Please read {domain}'s {guidelines}!", - "id": "onboarding.page_six.read_guidelines" - }, - { - "defaultMessage": "community guidelines", - "id": "onboarding.page_six.guidelines" - }, - { - "defaultMessage": "Almost done...", - "id": "onboarding.page_six.almost_done" - }, - { - "defaultMessage": "{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}. Glitchsoc is fully compatible with all Mastodon apps and instances. Glitchsoc is free open-source software. You can report bugs, request features, or contribute to the code on {github}.", - "id": "onboarding.page_six.github" - }, - { - "defaultMessage": "There are {apps} available for iOS, Android and other platforms.", - "id": "onboarding.page_six.apps_available" - }, - { - "defaultMessage": "mobile apps", - "id": "onboarding.page_six.various_app" - }, - { - "defaultMessage": "Bon Appetoot!", - "id": "onboarding.page_six.appetoot" - }, - { - "defaultMessage": "Next", - "id": "onboarding.next" - }, - { - "defaultMessage": "Done", - "id": "onboarding.done" - }, - { - "defaultMessage": "Skip", - "id": "onboarding.skip" - } - ], - "path": "app/javascript/flavours/glitch/features/ui/components/onboarding_modal.json" - }, - { - "descriptors": [ - { - "defaultMessage": "This account is marked as moved to {moved_to_link}, and may thus not accept new follows.", - "id": "moved_to_warning" - } - ], - "path": "app/javascript/flavours/glitch/features/ui/index.json" - } -] \ No newline at end of file diff --git a/app/javascript/flavours/glitch/locales/whitelist_af.json b/app/javascript/flavours/glitch/locales/whitelist_af.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_af.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_an.json b/app/javascript/flavours/glitch/locales/whitelist_an.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_an.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ar.json b/app/javascript/flavours/glitch/locales/whitelist_ar.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ar.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ast.json b/app/javascript/flavours/glitch/locales/whitelist_ast.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ast.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_be.json b/app/javascript/flavours/glitch/locales/whitelist_be.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_be.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_bg.json b/app/javascript/flavours/glitch/locales/whitelist_bg.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_bg.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_bn.json b/app/javascript/flavours/glitch/locales/whitelist_bn.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_bn.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_br.json b/app/javascript/flavours/glitch/locales/whitelist_br.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_br.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_bs.json b/app/javascript/flavours/glitch/locales/whitelist_bs.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_bs.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ca.json b/app/javascript/flavours/glitch/locales/whitelist_ca.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ca.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ckb.json b/app/javascript/flavours/glitch/locales/whitelist_ckb.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ckb.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_co.json b/app/javascript/flavours/glitch/locales/whitelist_co.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_co.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_cs.json b/app/javascript/flavours/glitch/locales/whitelist_cs.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_cs.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_cy.json b/app/javascript/flavours/glitch/locales/whitelist_cy.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_cy.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_da.json b/app/javascript/flavours/glitch/locales/whitelist_da.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_da.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_de.json b/app/javascript/flavours/glitch/locales/whitelist_de.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_de.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_el.json b/app/javascript/flavours/glitch/locales/whitelist_el.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_el.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_en-GB.json b/app/javascript/flavours/glitch/locales/whitelist_en-GB.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_en-GB.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_en.json b/app/javascript/flavours/glitch/locales/whitelist_en.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_en.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_eo.json b/app/javascript/flavours/glitch/locales/whitelist_eo.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_eo.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_es-AR.json b/app/javascript/flavours/glitch/locales/whitelist_es-AR.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_es-AR.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_es-MX.json b/app/javascript/flavours/glitch/locales/whitelist_es-MX.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_es-MX.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_es.json b/app/javascript/flavours/glitch/locales/whitelist_es.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_es.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_et.json b/app/javascript/flavours/glitch/locales/whitelist_et.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_et.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_eu.json b/app/javascript/flavours/glitch/locales/whitelist_eu.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_eu.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_fa.json b/app/javascript/flavours/glitch/locales/whitelist_fa.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_fa.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_fi.json b/app/javascript/flavours/glitch/locales/whitelist_fi.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_fi.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_fo.json b/app/javascript/flavours/glitch/locales/whitelist_fo.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_fo.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_fr-QC.json b/app/javascript/flavours/glitch/locales/whitelist_fr-QC.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_fr-QC.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_fr.json b/app/javascript/flavours/glitch/locales/whitelist_fr.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_fr.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_fy.json b/app/javascript/flavours/glitch/locales/whitelist_fy.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_fy.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ga.json b/app/javascript/flavours/glitch/locales/whitelist_ga.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ga.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_gd.json b/app/javascript/flavours/glitch/locales/whitelist_gd.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_gd.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_gl.json b/app/javascript/flavours/glitch/locales/whitelist_gl.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_gl.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_he.json b/app/javascript/flavours/glitch/locales/whitelist_he.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_he.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_hi.json b/app/javascript/flavours/glitch/locales/whitelist_hi.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_hi.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_hr.json b/app/javascript/flavours/glitch/locales/whitelist_hr.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_hr.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_hu.json b/app/javascript/flavours/glitch/locales/whitelist_hu.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_hu.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_hy.json b/app/javascript/flavours/glitch/locales/whitelist_hy.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_hy.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_id.json b/app/javascript/flavours/glitch/locales/whitelist_id.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_id.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ig.json b/app/javascript/flavours/glitch/locales/whitelist_ig.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ig.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_io.json b/app/javascript/flavours/glitch/locales/whitelist_io.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_io.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_is.json b/app/javascript/flavours/glitch/locales/whitelist_is.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_is.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_it.json b/app/javascript/flavours/glitch/locales/whitelist_it.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_it.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ja.json b/app/javascript/flavours/glitch/locales/whitelist_ja.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ja.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ka.json b/app/javascript/flavours/glitch/locales/whitelist_ka.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ka.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_kab.json b/app/javascript/flavours/glitch/locales/whitelist_kab.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_kab.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_kk.json b/app/javascript/flavours/glitch/locales/whitelist_kk.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_kk.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_kn.json b/app/javascript/flavours/glitch/locales/whitelist_kn.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_kn.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ko.json b/app/javascript/flavours/glitch/locales/whitelist_ko.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ko.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ku.json b/app/javascript/flavours/glitch/locales/whitelist_ku.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ku.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_kw.json b/app/javascript/flavours/glitch/locales/whitelist_kw.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_kw.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_la.json b/app/javascript/flavours/glitch/locales/whitelist_la.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_la.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_lt.json b/app/javascript/flavours/glitch/locales/whitelist_lt.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_lt.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_lv.json b/app/javascript/flavours/glitch/locales/whitelist_lv.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_lv.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_mk.json b/app/javascript/flavours/glitch/locales/whitelist_mk.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_mk.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ml.json b/app/javascript/flavours/glitch/locales/whitelist_ml.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ml.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_mr.json b/app/javascript/flavours/glitch/locales/whitelist_mr.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_mr.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ms.json b/app/javascript/flavours/glitch/locales/whitelist_ms.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ms.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_my.json b/app/javascript/flavours/glitch/locales/whitelist_my.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_my.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_nl.json b/app/javascript/flavours/glitch/locales/whitelist_nl.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_nl.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_nn.json b/app/javascript/flavours/glitch/locales/whitelist_nn.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_nn.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_no.json b/app/javascript/flavours/glitch/locales/whitelist_no.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_no.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_oc.json b/app/javascript/flavours/glitch/locales/whitelist_oc.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_oc.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_pa.json b/app/javascript/flavours/glitch/locales/whitelist_pa.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_pa.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_pl.json b/app/javascript/flavours/glitch/locales/whitelist_pl.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_pl.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_pt-BR.json b/app/javascript/flavours/glitch/locales/whitelist_pt-BR.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_pt-BR.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_pt-PT.json b/app/javascript/flavours/glitch/locales/whitelist_pt-PT.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_pt-PT.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ro.json b/app/javascript/flavours/glitch/locales/whitelist_ro.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ro.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ru.json b/app/javascript/flavours/glitch/locales/whitelist_ru.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ru.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_sa.json b/app/javascript/flavours/glitch/locales/whitelist_sa.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_sa.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_sc.json b/app/javascript/flavours/glitch/locales/whitelist_sc.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_sc.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_sco.json b/app/javascript/flavours/glitch/locales/whitelist_sco.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_sco.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_si.json b/app/javascript/flavours/glitch/locales/whitelist_si.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_si.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_sk.json b/app/javascript/flavours/glitch/locales/whitelist_sk.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_sk.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_sl.json b/app/javascript/flavours/glitch/locales/whitelist_sl.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_sl.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_sq.json b/app/javascript/flavours/glitch/locales/whitelist_sq.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_sq.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_sr-Latn.json b/app/javascript/flavours/glitch/locales/whitelist_sr-Latn.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_sr-Latn.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_sr.json b/app/javascript/flavours/glitch/locales/whitelist_sr.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_sr.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_sv.json b/app/javascript/flavours/glitch/locales/whitelist_sv.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_sv.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_szl.json b/app/javascript/flavours/glitch/locales/whitelist_szl.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_szl.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ta.json b/app/javascript/flavours/glitch/locales/whitelist_ta.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ta.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_tai.json b/app/javascript/flavours/glitch/locales/whitelist_tai.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_tai.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_te.json b/app/javascript/flavours/glitch/locales/whitelist_te.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_te.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_th.json b/app/javascript/flavours/glitch/locales/whitelist_th.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_th.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_tr.json b/app/javascript/flavours/glitch/locales/whitelist_tr.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_tr.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_tt.json b/app/javascript/flavours/glitch/locales/whitelist_tt.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_tt.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ug.json b/app/javascript/flavours/glitch/locales/whitelist_ug.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ug.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_uk.json b/app/javascript/flavours/glitch/locales/whitelist_uk.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_uk.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_ur.json b/app/javascript/flavours/glitch/locales/whitelist_ur.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_ur.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_vi.json b/app/javascript/flavours/glitch/locales/whitelist_vi.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_vi.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_zgh.json b/app/javascript/flavours/glitch/locales/whitelist_zgh.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_zgh.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_zh-CN.json b/app/javascript/flavours/glitch/locales/whitelist_zh-CN.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_zh-CN.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_zh-HK.json b/app/javascript/flavours/glitch/locales/whitelist_zh-HK.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_zh-HK.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/locales/whitelist_zh-TW.json b/app/javascript/flavours/glitch/locales/whitelist_zh-TW.json deleted file mode 100644 index 0d4f101c7a..0000000000 --- a/app/javascript/flavours/glitch/locales/whitelist_zh-TW.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/javascript/flavours/glitch/packs/home.js b/app/javascript/flavours/glitch/packs/home.js index a28625d33b..5497ba85eb 100644 --- a/app/javascript/flavours/glitch/packs/home.js +++ b/app/javascript/flavours/glitch/packs/home.js @@ -1,7 +1,8 @@ import 'packs/public-path'; +import { loadLocale } from 'flavours/glitch/load_locale'; import { loadPolyfills } from 'flavours/glitch/polyfills'; -loadPolyfills().then(async () => { +loadPolyfills().then(loadLocale).then(async () => { const { default: main } = await import('flavours/glitch/main'); return main(); diff --git a/app/javascript/flavours/glitch/packs/public.jsx b/app/javascript/flavours/glitch/packs/public.jsx index 92e2e9e086..4edc06b385 100644 --- a/app/javascript/flavours/glitch/packs/public.jsx +++ b/app/javascript/flavours/glitch/packs/public.jsx @@ -12,6 +12,7 @@ import { throttle } from 'lodash'; import { timeAgoString } from 'flavours/glitch/components/relative_timestamp'; import emojify from 'flavours/glitch/features/emoji/emoji'; import loadKeyboardExtensions from 'flavours/glitch/load_keyboard_extensions'; +import { loadLocale } from 'flavours/glitch/load_locale'; import { loadPolyfills } from 'flavours/glitch/polyfills'; import ready from 'flavours/glitch/ready'; import { getLocale } from 'locales'; @@ -237,6 +238,7 @@ function main() { } loadPolyfills() + .then(loadLocale) .then(main) .then(loadKeyboardExtensions) .catch(error => { diff --git a/app/javascript/flavours/glitch/packs/share.jsx b/app/javascript/flavours/glitch/packs/share.jsx index 21f1da638d..1b8c837b6f 100644 --- a/app/javascript/flavours/glitch/packs/share.jsx +++ b/app/javascript/flavours/glitch/packs/share.jsx @@ -2,6 +2,7 @@ import 'packs/public-path'; import { createRoot } from 'react-dom/client'; import ComposeContainer from 'flavours/glitch/containers/compose_container'; +import { loadLocale } from 'flavours/glitch/load_locale'; import { loadPolyfills } from 'flavours/glitch/polyfills'; import ready from 'flavours/glitch/ready'; @@ -22,6 +23,6 @@ function main() { ready(loaded); } -loadPolyfills().then(main).catch(error => { +loadPolyfills().then(loadLocale).then(main).catch(error => { console.error(error); }); diff --git a/app/javascript/flavours/glitch/polyfills/base_polyfills.ts b/app/javascript/flavours/glitch/polyfills/base_polyfills.ts index e008d8f025..3cde1b1ede 100644 --- a/app/javascript/flavours/glitch/polyfills/base_polyfills.ts +++ b/app/javascript/flavours/glitch/polyfills/base_polyfills.ts @@ -1,5 +1,3 @@ -import 'intl'; -import 'intl/locale-data/jsonp/en'; import 'core-js/features/object/assign'; import 'core-js/features/object/values'; import 'core-js/features/symbol'; diff --git a/app/javascript/flavours/glitch/polyfills/index.ts b/app/javascript/flavours/glitch/polyfills/index.ts index 6d2e5426e4..b2dbfdac0a 100644 --- a/app/javascript/flavours/glitch/polyfills/index.ts +++ b/app/javascript/flavours/glitch/polyfills/index.ts @@ -2,6 +2,8 @@ // If there are no polyfills, then this is just Promise.resolve() which means // it will execute in the same tick of the event loop (i.e. near-instant). +import { loadIntlPolyfills } from './intl'; + function importBasePolyfills() { return import(/* webpackChunkName: "base_polyfills" */ './base_polyfills'); } @@ -13,7 +15,6 @@ function importExtraPolyfills() { export function loadPolyfills() { const needsBasePolyfills = !( 'toBlob' in HTMLCanvasElement.prototype && - 'Intl' in window && 'assign' in Object && 'values' in Object && 'Symbol' in window && @@ -32,6 +33,7 @@ export function loadPolyfills() { ); return Promise.all([ + loadIntlPolyfills(), needsBasePolyfills && importBasePolyfills(), needsExtraPolyfills && importExtraPolyfills(), ]); diff --git a/app/javascript/flavours/glitch/polyfills/intl.ts b/app/javascript/flavours/glitch/polyfills/intl.ts new file mode 100644 index 0000000000..4d5ee3ccf9 --- /dev/null +++ b/app/javascript/flavours/glitch/polyfills/intl.ts @@ -0,0 +1,105 @@ +// import { shouldPolyfill as shouldPolyfillCanonicalLocales } from '@formatjs/intl-getcanonicallocales/should-polyfill'; +// import { shouldPolyfill as shouldPolyfillLocale } from '@formatjs/intl-locale/should-polyfill'; +import { shouldPolyfill as shoudPolyfillPluralRules } from '@formatjs/intl-pluralrules/should-polyfill'; +// import { shouldPolyfill as shouldPolyfillNumberFormat } from '@formatjs/intl-numberformat/should-polyfill'; +// import { shouldPolyfill as shouldPolyfillIntlDateTimeFormat } from '@formatjs/intl-datetimeformat/should-polyfill'; +// import { shouldPolyfill as shouldPolyfillIntlRelativeTimeFormat } from '@formatjs/intl-relativetimeformat/should-polyfill'; + +// async function loadGetCanonicalLocalesPolyfill() { +// // This platform already supports Intl.getCanonicalLocales +// if (shouldPolyfillCanonicalLocales()) { +// await import('@formatjs/intl-getcanonicallocales/polyfill'); +// } +// } + +// async function loadLocalePolyfill() { +// // This platform already supports Intl.Locale +// if (shouldPolyfillLocale()) { +// await import('@formatjs/intl-locale/polyfill'); +// } +// } + +// async function loadIntlNumberFormatPolyfill(locale: string) { +// const unsupportedLocale = shouldPolyfillNumberFormat(locale); +// // This locale is supported +// if (!unsupportedLocale) { +// return; +// } +// // Load the polyfill 1st BEFORE loading data +// await import('@formatjs/intl-numberformat/polyfill-force'); +// await import(`@formatjs/intl-numberformat/locale-data/${unsupportedLocale}`); +// } + +// async function loadIntlDateTimeFormatPolyfill(locale: string) { +// const unsupportedLocale = shouldPolyfillIntlDateTimeFormat(locale); +// // This locale is supported +// if (!unsupportedLocale) { +// return; +// } +// // Load the polyfill 1st BEFORE loading data +// await import('@formatjs/intl-datetimeformat/polyfill-force'); + +// // Parallelize CLDR data loading +// const dataPolyfills = [ +// import('@formatjs/intl-datetimeformat/add-all-tz'), +// import(`@formatjs/intl-datetimeformat/locale-data/${unsupportedLocale}`), +// ]; +// await Promise.all(dataPolyfills); +// } + +async function loadIntlPluralRulesPolyfills(locale: string) { + const unsupportedLocale = shoudPolyfillPluralRules(locale); + // This locale is supported + if (!unsupportedLocale) { + return; + } + // Load the polyfill 1st BEFORE loading data + await import( + /* webpackChunkName: "i18n-pluralrules-polyfill" */ '@formatjs/intl-pluralrules/polyfill-force' + ); + await import( + /* webpackChunkName: "i18n-pluralrules-polyfill-[request]" */ `@formatjs/intl-pluralrules/locale-data/${unsupportedLocale}` + ); +} + +// async function loadIntlRelativeTimeFormatPolyfill(locale: string) { +// const unsupportedLocale = shouldPolyfillIntlRelativeTimeFormat(locale); +// // This locale is supported +// if (!unsupportedLocale) { +// return; +// } +// // Load the polyfill 1st BEFORE loading data +// await import( +// /* webpackChunkName: "i18n-relativetimeformat-polyfill" */ +// '@formatjs/intl-relativetimeformat/polyfill-force' +// ); +// await import( +// /* webpackChunkName: "i18n-relativetimeformat-polyfill-[request]" */ +// `@formatjs/intl-relativetimeformat/locale-data/${unsupportedLocale}` +// ); +// } + +export async function loadIntlPolyfills() { + const locale = document.querySelector('html')?.lang || 'en'; + + // order is important here + + // Supported in IE11 and most other browsers, not useful + // await loadGetCanonicalLocalesPolyfill() + + // Supported in IE11 and most other browsers, not useful + // await loadLocalePolyfill() + + // Supported in IE11 and most other browsers, not useful + // await loadIntlNumberFormatPolyfill(locale) + + // Supported in IE11 and most other browsers, not useful + // await loadIntlDateTimeFormatPolyfill(locale) + + // Supported from Safari 13+, may still be useful + await loadIntlPluralRulesPolyfills(locale); + + // This is not used yet in the codebase yet + // Supported from Safari 14+ + // await loadIntlRelativeTimeFormatPolyfill(locale); +}