Add localization support to admin status and error messages (#4631)
* Initial plan * Add localization support to admin form status and error messages Co-authored-by: gabek <414923+gabek@users.noreply.github.com> * Format updated files with prettier Co-authored-by: gabek <414923+gabek@users.noreply.github.com> * Replace t() with Translation component in admin page JSX Co-authored-by: gabek <414923+gabek@users.noreply.github.com> * update package-lock.json * Update web/i18n/en/translation.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gabek <414923+gabek@users.noreply.github.com> Co-authored-by: Gabe Kangas <gabek@real-ity.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
gabek
Copilot
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Gabe Kangas
parent
fd89c6e8f2
commit
383b80851b
@@ -1,5 +1,6 @@
|
||||
import { Popconfirm, Select, Typography } from 'antd';
|
||||
import React, { FC, useContext, useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'next-export-i18n';
|
||||
import { AlertMessageContext } from '../../utils/alert-message-context';
|
||||
import {
|
||||
API_VIDEO_CODEC,
|
||||
@@ -13,11 +14,13 @@ import {
|
||||
STATUS_SUCCESS,
|
||||
} from '../../utils/input-statuses';
|
||||
import { ServerStatusContext } from '../../utils/server-status-context';
|
||||
import { Localization } from '../../types/localization';
|
||||
import { FormStatusIndicator } from './FormStatusIndicator';
|
||||
|
||||
export type CodecSelectorProps = {};
|
||||
|
||||
export const CodecSelector: FC<CodecSelectorProps> = () => {
|
||||
const { t } = useTranslation();
|
||||
const serverStatusData = useContext(ServerStatusContext);
|
||||
const { serverConfig, setFieldInConfigState } = serverStatusData || {};
|
||||
const { videoCodec, supportedCodecs } = serverConfig || {};
|
||||
@@ -60,7 +63,9 @@ export const CodecSelector: FC<CodecSelectorProps> = () => {
|
||||
value: pendingSaveCodec,
|
||||
path: 'videoSettings',
|
||||
});
|
||||
setSubmitStatus(createInputStatus(STATUS_SUCCESS, 'Video codec updated.'));
|
||||
setSubmitStatus(
|
||||
createInputStatus(STATUS_SUCCESS, t(Localization.Admin.StatusMessages.videoCodecUpdated)),
|
||||
);
|
||||
|
||||
resetTimer = setTimeout(resetStates, RESET_TIMEOUT);
|
||||
if (serverStatusData.online) {
|
||||
|
||||
Reference in New Issue
Block a user