Update EditInstanceDetails admin component to support localization (#4439)

* Initial plan

* Update EditInstanceDetails component to support localization

Co-authored-by: gabek <414923+gabek@users.noreply.github.com>

* chore: update extracted translations

* Update web/types/localization.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add EditInstanceDetails namespace to localization keys

Co-authored-by: gabek <414923+gabek@users.noreply.github.com>

* chore: update extracted translations

---------

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: Owncast default web localizations <owncast@owncast.online>
Co-authored-by: Gabe Kangas <gabek@real-ity.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot
2025-07-13 13:34:30 -07:00
committed by GitHub
co-authored by gabek Copilot copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Owncast default web localizations Gabe Kangas
parent fb2905b082
commit eafcf9148c
3 changed files with 27 additions and 16 deletions
@@ -28,6 +28,8 @@ import { ToggleSwitch } from '../../ToggleSwitch';
import { EditLogo } from '../../EditLogo'; import { EditLogo } from '../../EditLogo';
import FormStatusIndicator from '../../FormStatusIndicator'; import FormStatusIndicator from '../../FormStatusIndicator';
import { createInputStatus, STATUS_SUCCESS } from '../../../../utils/input-statuses'; import { createInputStatus, STATUS_SUCCESS } from '../../../../utils/input-statuses';
import { Translation } from '../../../ui/Translation/Translation';
import { Localization } from '../../../../types/localization';
const { Title } = Typography; const { Title } = Typography;
@@ -248,8 +250,10 @@ export default function EditInstanceDetails() {
/> />
</div> </div>
<div className="field-tip"> <div className="field-tip">
The offline message is displayed to your page visitors when you&apos;re not streaming. <Translation
Markdown is supported. translationKey={Localization.Admin.EditInstanceDetails.offlineMessageDescription}
defaultText="The offline message is displayed to your page visitors when you're not streaming. Markdown is supported."
/>
</div> </div>
<Button <Button
@@ -283,23 +287,17 @@ export default function EditInstanceDetails() {
<br /> <br />
<p className="description"> <p className="description">
Increase your audience by appearing in the{' '} <Translation
<a href="https://directory.owncast.online" target="_blank" rel="noreferrer"> translationKey={Localization.Admin.EditInstanceDetails.directoryDescription}
<strong>Owncast Directory</strong> defaultText='Increase your audience by appearing in the <a href="https://directory.owncast.online" target="_blank" rel="noreferrer"><strong>Owncast Directory</strong></a>. This is an external service run by the Owncast project. <a href="https://owncast.online/docs/directory/?source=admin" target="_blank" rel="noopener noreferrer">Learn more</a>.'
</a> />
. This is an external service run by the Owncast project.{' '}
<a
href="https://owncast.online/docs/directory/?source=admin"
target="_blank"
rel="noopener noreferrer"
>
Learn more
</a>
.
</p> </p>
{!yp.instanceUrl && ( {!yp.instanceUrl && (
<p className="description"> <p className="description">
You must set your <strong>Server URL</strong> above to enable the directory. <Translation
translationKey={Localization.Admin.EditInstanceDetails.serverUrlRequiredForDirectory}
defaultText="You must set your <strong>Server URL</strong> above to enable the directory."
/>
</p> </p>
)} )}
+6
View File
@@ -1,5 +1,11 @@
{ {
"Add your Owncast instance to the Fediverse": "Add your Owncast instance to the Fediverse", "Add your Owncast instance to the Fediverse": "Add your Owncast instance to the Fediverse",
"Admin.directoryDescription": "Increase your audience by appearing in the <a href=\"https://directory.owncast.online\" target=\"_blank\" rel=\"noreferrer\"><strong>Owncast Directory</strong></a>. This is an external service run by the Owncast project. <a href=\"https://owncast.online/docs/directory/?source=admin\" target=\"_blank\" rel=\"noopener noreferrer\">Learn more</a>.",
"Admin.EditInstanceDetails.directoryDescription": "Increase your audience by appearing in the <a href=\"https://directory.owncast.online\" target=\"_blank\" rel=\"noreferrer\"><strong>Owncast Directory</strong></a>. This is an external service run by the Owncast project. <a href=\"https://owncast.online/docs/directory/?source=admin\" target=\"_blank\" rel=\"noopener noreferrer\">Learn more</a>.",
"Admin.EditInstanceDetails.offlineMessageDescription": "The offline message is displayed to your page visitors when you're not streaming. Markdown is supported.",
"Admin.EditInstanceDetails.serverUrlRequiredForDirectory": "You must set your <strong>Server URL</strong> above to enable the directory.",
"Admin.offlineMessageDescription": "The offline message is displayed to your page visitors when you're not streaming. Markdown is supported.",
"Admin.serverUrlRequiredForDirectory": "You must set your <strong>Server URL</strong> above to enable the directory.",
"Banned Users": "Banned Users", "Banned Users": "Banned Users",
"Bring in moderators to help keep your chat in order": "Bring in moderators to help keep your chat in order.", "Bring in moderators to help keep your chat in order": "Bring in moderators to help keep your chat in order.",
"Chat is disabled": "Chat is disabled", "Chat is disabled": "Chat is disabled",
+7
View File
@@ -72,6 +72,13 @@ export const Localization = {
settings: 'settings', settings: 'settings',
overriddenViaCommandLine: 'Overridden via command line', overriddenViaCommandLine: 'Overridden via command line',
// EditInstanceDetails component specific keys
EditInstanceDetails: {
offlineMessageDescription: 'Admin.EditInstanceDetails.offlineMessageDescription',
directoryDescription: 'Admin.EditInstanceDetails.directoryDescription',
serverUrlRequiredForDirectory: 'Admin.EditInstanceDetails.serverUrlRequiredForDirectory',
},
// Logging and monitoring // Logging and monitoring
info: 'Info', info: 'Info',
warning: 'Warning', warning: 'Warning',