From 5013d35e97e20ba15ea0355bcce8b7d936efe9e0 Mon Sep 17 00:00:00 2001 From: M-ZubairAhmed Date: Thu, 26 Oct 2023 14:10:52 +0530 Subject: [PATCH] [MM-54876] Deprecate all custom translation functions and components (#25069) --- webapp/channels/src/components/localized_icon.tsx | 3 +++ webapp/channels/src/utils/i18n.tsx | 3 +++ webapp/channels/src/utils/utils.tsx | 3 +++ 3 files changed, 9 insertions(+) diff --git a/webapp/channels/src/components/localized_icon.tsx b/webapp/channels/src/components/localized_icon.tsx index 20c112a84e..aafabea7df 100644 --- a/webapp/channels/src/components/localized_icon.tsx +++ b/webapp/channels/src/components/localized_icon.tsx @@ -17,6 +17,9 @@ type Props = Omit, 'title' | 'comp }; } +/** + * @deprecated Use react-intl for title and aria-label instead and make revelant i or span tags for the icon + */ const LocalizedIcon = React.forwardRef((props: Props, ref?: React.Ref) => { const { component = 'i', diff --git a/webapp/channels/src/utils/i18n.tsx b/webapp/channels/src/utils/i18n.tsx index 11c17f30a6..90d082ea4b 100644 --- a/webapp/channels/src/utils/i18n.tsx +++ b/webapp/channels/src/utils/i18n.tsx @@ -10,6 +10,9 @@ export function getMonthLong(locale: string): 'short' | 'long' { return 'long'; } +/** + * @deprecated Use react-intl methods such as formatMessage, FormattedMessage, defineMessage, defineMessages. + */ export function t(v: string): string { return v; } diff --git a/webapp/channels/src/utils/utils.tsx b/webapp/channels/src/utils/utils.tsx index 84e5515ce0..a9448a2b2d 100644 --- a/webapp/channels/src/utils/utils.tsx +++ b/webapp/channels/src/utils/utils.tsx @@ -1186,6 +1186,9 @@ export function clearFileInput(elm: HTMLInputElement) { } } +/** + * @deprecated Use react-intl instead, only place its usage can be justified is in the redux actions + */ export function localizeMessage(id: string, defaultMessage?: string) { const state = store.getState();