i18n: Migrate hard strings (#2353)

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
Still Hsu
2022-03-09 09:42:08 +08:00
committed by GitHub
parent d88515abcd
commit a05952829c
30 changed files with 209 additions and 74 deletions

View File

@@ -57,10 +57,18 @@ export const SettingsServicesPanel: React.FC = () => {
try {
if (enableDisable) {
await enableDLNA(input);
Toast.success({ content: "Enabled DLNA temporarily" });
Toast.success({
content: intl.formatMessage({
id: "config.dlna.enabled_dlna_temporarily",
}),
});
} else {
await disableDLNA(input);
Toast.success({ content: "Disabled DLNA temporarily" });
Toast.success({
content: intl.formatMessage({
id: "config.dlna.disabled_dlna_temporarily",
}),
});
}
} catch (e) {
Toast.error(e);
@@ -86,7 +94,11 @@ export const SettingsServicesPanel: React.FC = () => {
try {
await addTempDLANIP(input);
Toast.success({ content: "Allowed IP temporarily" });
Toast.success({
content: intl.formatMessage({
id: "config.dlna.allowed_ip_temporarily",
}),
});
} catch (e) {
Toast.error(e);
} finally {
@@ -106,7 +118,9 @@ export const SettingsServicesPanel: React.FC = () => {
try {
await removeTempDLNAIP(input);
Toast.success({ content: "Disallowed IP" });
Toast.success({
content: intl.formatMessage({ id: "config.dlna.disallowed_ip" }),
});
} catch (e) {
Toast.error(e);
} finally {
@@ -184,7 +198,11 @@ export const SettingsServicesPanel: React.FC = () => {
} else {
await disableDLNA(input);
}
Toast.success({ content: "Successfully cancelled temporary behaviour" });
Toast.success({
content: intl.formatMessage({
id: "config.dlna.successfully_cancelled_temporary_behaviour",
}),
});
} catch (e) {
Toast.error(e);
} finally {