Skip to content

Commit

Permalink
Fix missing lingui stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Dec 21, 2024
1 parent d160e35 commit 02238d8
Show file tree
Hide file tree
Showing 5 changed files with 286 additions and 126 deletions.
6 changes: 5 additions & 1 deletion src/components/account-info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ function RelatedActions({
onProfileUpdate = () => {},
}) {
if (!info) return null;
const { _ } = useLingui();
const { _, t } = useLingui();
const {
masto: currentMasto,
instance: currentInstance,
Expand Down Expand Up @@ -1793,6 +1793,7 @@ function niceAccountURL(url) {
}

function TranslatedBioSheet({ note, fields, onClose }) {
const { t } = useLingui();
const fieldsText =
fields
?.map(({ name, value }) => `${name}\n${getHTMLText(value)}`)
Expand Down Expand Up @@ -1827,6 +1828,7 @@ function TranslatedBioSheet({ note, fields, onClose }) {
}

function AddRemoveListsSheet({ accountID, onClose }) {
const { t } = useLingui();
const { masto } = api();
const [uiState, setUIState] = useState('default');
const [lists, setLists] = useState([]);
Expand Down Expand Up @@ -1971,6 +1973,7 @@ function PrivateNoteSheet({
onRelationshipChange = () => {},
onClose = () => {},
}) {
const { t } = useLingui();
const { masto } = api();
const [uiState, setUIState] = useState('default');
const textareaRef = useRef(null);
Expand Down Expand Up @@ -2065,6 +2068,7 @@ function PrivateNoteSheet({
}

function EditProfileSheet({ onClose = () => {} }) {
const { t } = useLingui();
const { masto } = api();
const [uiState, setUIState] = useState('loading');
const [account, setAccount] = useState(null);
Expand Down
7 changes: 5 additions & 2 deletions src/components/compose.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,7 @@ const detectLangs = async (text) => {
};

const Textarea = forwardRef((props, ref) => {
const { t } = useLingui();
const { masto, instance } = api();
const [text, setText] = useState(ref.current?.value || '');
const {
Expand Down Expand Up @@ -2725,7 +2726,7 @@ function Poll({
minExpiration,
maxCharactersPerOption,
}) {
const { _ } = useLingui();
const { t } = useLingui();
const { options, expiresIn, multiple } = poll;

return (
Expand Down Expand Up @@ -2880,6 +2881,7 @@ function MentionModal({
onSelect = () => {},
defaultSearchTerm,
}) {
const { t } = useLingui();
const { masto } = api();
const [uiState, setUIState] = useState('default');
const [accounts, setAccounts] = useState([]);
Expand Down Expand Up @@ -3104,6 +3106,7 @@ function CustomEmojisModal({
onSelect = () => {},
defaultSearchTerm,
}) {
const { t } = useLingui();
const [uiState, setUIState] = useState('default');
const customEmojisList = useRef([]);
const [customEmojis, setCustomEmojis] = useState([]);
Expand Down Expand Up @@ -3399,7 +3402,7 @@ const CustomEmojiButton = memo(({ emoji, onClick, showCode }) => {

const GIFS_PER_PAGE = 20;
function GIFPickerModal({ onClose = () => {}, onSelect = () => {} }) {
const { i18n } = useLingui();
const { i18n, t } = useLingui();
const [uiState, setUIState] = useState('default');
const [results, setResults] = useState([]);
const formRef = useRef(null);
Expand Down
1 change: 1 addition & 0 deletions src/components/drafts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ function Drafts({ onClose }) {
}

function MiniDraft({ draft }) {
const { t } = useLingui();
const { draftStatus, replyTo } = draft;
const { status, spoilerText, poll, mediaAttachments } = draftStatus;
const hasPoll = poll?.options?.length > 0;
Expand Down
1 change: 1 addition & 0 deletions src/components/poll.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { i18n } from '@lingui/core';
import { plural } from '@lingui/core/macro';
import { Plural, Trans, useLingui } from '@lingui/react/macro';
import { useState } from 'preact/hooks';
Expand Down
Loading

0 comments on commit 02238d8

Please sign in to comment.