[i18n] Localize missed spots

This commit is contained in:
amsyarasyiq 2024-04-03 15:22:40 +08:00
parent 01f573d52d
commit 082e9b2cf9
3 changed files with 11 additions and 8 deletions

View file

@ -1,5 +1,7 @@
{
"ABOUT": "About",
"PLUGIN_REFETCH_SUCCESSFUL": "Successfully refetched plugin!",
"PLUGIN_REFETCH_FAILED": "Failed to refetch plugin!",
"ACTIONS": "Actions",
"ARE_YOU_SURE_TO_CLEAR_DATA": "Are you sure you wish to clear the data of {name}?",
"ARE_YOU_SURE_TO_DELETE_PLUGIN": "Are you sure you wish to delete {name}? This will clear all of the plugin's data.",
@ -63,6 +65,7 @@
"OPEN_IN_BROWSER": "Open in Browser",
"OPERATING_SYSTEM": "Operating System",
"OVERFLOW_PLUGIN_SETTINGS": "Plugin settings",
"TOASTS_PLUGIN_UPDATE": "{update, select, true {Enabled} false {Disabled}} updates for {name}.",
"PLATFORM": "Platform",
"PLUGINS": "Plugins",
"REFETCH": "Refetch",

View file

@ -66,9 +66,9 @@ export default function PluginCard({ item: plugin, index }: CardWrapper<BunnyPlu
onPress: async () => {
stopThenStart(plugin, () => {
fetchPlugin(plugin.id).then(async () => {
showToast("Successfully refetched plugin.", getAssetIDByName("toast_image_saved"));
showToast(Strings.PLUGIN_REFETCH_SUCCESSFUL, getAssetIDByName("toast_image_saved"));
}).catch(() => {
showToast("Failed to refetch plugin!", getAssetIDByName("Small"));
showToast(Strings.PLUGIN_REFETCH_FAILED, getAssetIDByName("Small"));
});
});
},
@ -86,7 +86,7 @@ export default function PluginCard({ item: plugin, index }: CardWrapper<BunnyPlu
label: plugin.update ? Strings.DISABLE_UPDATES : Strings.ENABLE_UPDATES,
onPress: () => {
plugin.update = !plugin.update;
showToast(`${plugin.update ? "Enabled" : "Disabled"} updates for ${plugin.manifest.name}.`, getAssetIDByName("toast_image_saved"));
showToast(formatString("TOASTS_PLUGIN_UPDATE", { update: plugin.update, name: plugin.manifest.name }), getAssetIDByName("toast_image_saved"));
}
},
{

View file

@ -49,7 +49,7 @@ const styles = createThemedStyleSheet({
interface Tab {
id: string;
title: string;
title: () => string;
trimWhitespace?: boolean;
}
@ -62,9 +62,9 @@ interface Button {
}
const tabs: Tab[] = [
{ id: "message", title: Strings.MESSAGE },
{ id: "stack", title: Strings.STACK_TRACE },
{ id: "componentStack", title: Strings.COMPONENT, trimWhitespace: true },
{ id: "message", title: () => Strings.MESSAGE },
{ id: "stack", title: () => Strings.STACK_TRACE },
{ id: "componentStack", title: () => Strings.COMPONENT, trimWhitespace: true },
];
export default () => after("render", ErrorBoundary.prototype, function (this: any, _, ret) {
@ -96,7 +96,7 @@ export default () => after("render", ErrorBoundary.prototype, function (this: an
<View style={{ paddingBottom: 8 }}>
{/* Are errors caught by ErrorBoundary guaranteed to have the component stack? */}
<BadgableTabBar
tabs={tabs}
tabs={tabs.map(t => ({ ...t, title: t.title() }))}
activeTab={this.state.activeTab}
onTabSelected={(tab: string) => { this.setState({ activeTab: tab }); }}
/>