Skip to content

Commit

Permalink
[i18n] Localize missed spots
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed Apr 3, 2024
1 parent 01f573d commit 082e9b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/core/i18n/default.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/core/ui/components/PluginCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
});
});
},
Expand All @@ -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"));
}
},
{
Expand Down
10 changes: 5 additions & 5 deletions src/lib/ui/safeMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const styles = createThemedStyleSheet({

interface Tab {
id: string;
title: string;
title: () => string;
trimWhitespace?: boolean;
}

Expand All @@ -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) {
Expand Down Expand Up @@ -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 }); }}
/>
Expand Down

0 comments on commit 082e9b2

Please sign in to comment.