Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Localize the appearance plugin-styling notice and swatch badges

Gabe Kangas34dd7f31e993
diff --git a/web/components/admin/config/general/AppearanceConfig.tsx b/web/components/admin/config/general/AppearanceConfig.tsx
index 8e1b1c5113..3711d850d1 100644
--- a/web/components/admin/config/general/AppearanceConfig.tsx
+++ b/web/components/admin/config/general/AppearanceConfig.tsx
@@ -94,31 +94,34 @@ const ColorPicker = React.memo(
description: string;
alsoSetBy?: string[];
onChange: (name: string, value: string, description: string) => void;
- }) => (
- <Col span={3} key={name}>
- <input
- type="color"
- id={name}
- name={description}
- title={description}
- value={value}
- className={s.colorPicker}
- onChange={e => onChange(name, e.target.value, description)}
- />
- <div style={{ padding: '2px' }}>{description}</div>
- {alsoSetBy && alsoSetBy.length > 0 && (
- <Tooltip
- title={`Your value takes priority here. Use “Reset to Defaults” to fall back to ${alsoSetBy.join(
- ', ',
- )}'s color.`}
- >
- <div style={{ padding: '2px', fontSize: 11, opacity: 0.7 }}>
- also set by {alsoSetBy.join(', ')}
- </div>
- </Tooltip>
- )}
- </Col>
- ),
+ }) => {
+ const { t } = useTranslation();
+ return (
+ <Col span={3} key={name}>
+ <input
+ type="color"
+ id={name}
+ name={description}
+ title={description}
+ value={value}
+ className={s.colorPicker}
+ onChange={e => onChange(name, e.target.value, description)}
+ />
+ <div style={{ padding: '2px' }}>{description}</div>
+ {alsoSetBy && alsoSetBy.length > 0 && (
+ <Tooltip
+ title={t(Localization.Admin.Appearance.alsoSetByPluginTooltip, {
+ plugins: alsoSetBy.join(', '),
+ })}
+ >
+ <div style={{ padding: '2px', fontSize: 11, opacity: 0.7 }}>
+ {t(Localization.Admin.Appearance.alsoSetByPlugin, { plugins: alsoSetBy.join(', ') })}
+ </div>
+ </Tooltip>
+ )}
+ </Col>
+ );
+ },
);
const ColorCollection: FC<ColorCollectionProps> = ({ variables, overrides, updateColor }) => {
@@ -284,12 +287,10 @@ export default function Appearance() {
<Alert
type="info"
showIcon
- message="A plugin is styling your site"
- description={`${styleContributors.map(p => p.name).join(', ')} ${
- styleContributors.length === 1
- ? 'is applying its own styles'
- : 'are applying their own styles'
- } to your site, combined with the colors you set here. Your settings are applied on top, so they win where they overlap. If the page doesn't look the way you expect, use “Reset to Defaults” below to let the plugin styling show through, or disable the plugin from the Plugins page.`}
+ message={t(Localization.Admin.Appearance.pluginStylingActive)}
+ description={t(Localization.Admin.Appearance.pluginStylingDescription, {
+ plugins: styleContributors.map(p => p.name).join(', '),
+ })}
/>
)}
<div>
diff --git a/web/i18n/en/translation.json b/web/i18n/en/translation.json
index d4a99df83f..ce8d549400 100644
--- a/web/i18n/en/translation.json
+++ b/web/i18n/en/translation.json
@@ -1,5 +1,11 @@
{
"Admin": {
+ "Appearance": {
+ "pluginStylingActive": "Plugin styling is active",
+ "pluginStylingDescription": "These plugins are applying their own styles to your site, combined with the colors you set here: {{plugins}}. Your settings are applied on top, so they win where they overlap. If the page doesn't look the way you expect, use Reset to Defaults below to let the plugin styling show through, or disable the plugin from the Plugins page.",
+ "alsoSetByPlugin": "also set by {{plugins}}",
+ "alsoSetByPluginTooltip": "Your value takes priority here. Use Reset to Defaults to fall back to the color from {{plugins}}."
+ },
"AccessTokens": {
"createNewAccessToken": "Create New Access token",
"nameDescription": "The name will be displayed as the chat user when sending messages with this access token.",
diff --git a/web/types/localization.ts b/web/types/localization.ts
index 4184b11f34..9176002851 100644
--- a/web/types/localization.ts
+++ b/web/types/localization.ts
@@ -156,6 +156,14 @@ export const Localization = {
settings: 'Admin.settings',
overriddenViaCommandLine: 'Admin.overriddenViaCommandLine',
+ // Appearance page
+ Appearance: {
+ pluginStylingActive: 'Admin.Appearance.pluginStylingActive',
+ pluginStylingDescription: 'Admin.Appearance.pluginStylingDescription',
+ alsoSetByPlugin: 'Admin.Appearance.alsoSetByPlugin',
+ alsoSetByPluginTooltip: 'Admin.Appearance.alsoSetByPluginTooltip',
+ },
+
Chat: {
moderationMessagesSent: 'Admin.Chat.moderationMessagesSent',
moderationMessagesSent_one: 'Admin.Chat.moderationMessagesSent_one',