Skip to content

Remove obsolete TranslationConverter & project reference in Explorer plugin #3595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions Flow.Launcher.Core/Resource/TranslationConverter.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.DependencyInjection;
using Flow.Launcher.Plugin;

namespace Flow.Launcher.Infrastructure.UserSettings
{
Expand Down Expand Up @@ -53,6 +55,12 @@ public class BaseBuiltinShortcutModel : ShortcutBaseModel
{
public string Description { get; set; }

public string LocalizedDescription => API.GetTranslation(Description);

// We should not initialize API in static constructor because it will create another API instance
private static IPublicAPI api = null;
private static IPublicAPI API => api ??= Ioc.Default.GetRequiredService<IPublicAPI>();

public BaseBuiltinShortcutModel(string key, string description)
{
Key = key;
Expand Down
1 change: 0 additions & 1 deletion Flow.Launcher/Resources/SettingWindowStyle.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<converters:BorderClipConverter x:Key="BorderClipConverter" />
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
<converters:TextConverter x:Key="TextConverter" />
<core:TranslationConverter x:Key="TranslationConverter" />

<!-- Icon for Theme Type Label -->
<Geometry x:Key="circle_half_stroke_solid">F1 M512,512z M0,0z M448,256C448,150,362,64,256,64L256,448C362,448,448,362,448,256z M0,256A256,256,0,1,1,512,256A256,256,0,1,1,0,256z</Geometry>
Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
<GridViewColumn Width="430" Header="{DynamicResource builtinShortcutDescription}">
<GridViewColumn.CellTemplate>
<DataTemplate DataType="{x:Type userSettings:BuiltinShortcutModel}">
<TextBlock Text="{Binding Description, Converter={StaticResource TranslationConverter}}" />
<TextBlock Text="{Binding LocalizedDescription}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Droplex" Version="1.7.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was it working without this reference?
I think it wasn't added here because flow core/infrastructure project already references Droplex. Do we need this reference?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok nvm I didn't read below those two projects are removed, so I guess it needs direct reference now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In EverythingDownloadHelper.cs we need this project reference

Copy link
Member

@jjw24 jjw24 Jun 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I suppose we didn't need to add direct reference before because either core or infrastructure project had the reference?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I suppose we didn't need to add direct reference before because either core or infrastructure project had the reference?

I think so

<!-- Do not upgrade System.Data.OleDb since we are .Net7.0 -->
<PackageReference Include="System.Data.OleDb" Version="8.0.1" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="tlbimp-Microsoft.Search.Interop" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Flow.Launcher.Core\Flow.Launcher.Core.csproj" />
<ProjectReference Include="..\..\Flow.Launcher.Infrastructure\Flow.Launcher.Infrastructure.csproj" />
<ProjectReference Include="..\..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ internal ActionKeywordModel(Settings.ActionKeyword actionKeyword, string descrip

public string Description { get; private init; }

public string LocalizedDescription => Main.Context.API.GetTranslation(Description);

internal Settings.ActionKeyword KeywordProperty { get; }

private void OnPropertyChanged([CallerMemberName] string propertyName = "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Flow.Launcher.Plugin.Explorer.Views.Converters"
xmlns:core="clr-namespace:Flow.Launcher.Core.Resource;assembly=Flow.Launcher.Core"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:qa="clr-namespace:Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks"
Expand All @@ -24,7 +23,7 @@
<TextBlock
Margin="0 5 0 0"
IsEnabled="{Binding Enabled}"
Text="{Binding Description, Mode=OneTime, Converter={StaticResource TranslationConverter}}">
Text="{Binding LocalizedDescription, Mode=OneTime}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Style.Triggers>
Expand Down Expand Up @@ -76,7 +75,6 @@
</Grid>
</DataTemplate>

<core:TranslationConverter x:Key="TranslationConverter" />
<converters:EnumNameConverter x:Key="EnumNameConverter" />

<Style x:Key="CustomExpanderStyle" TargetType="Expander">
Expand Down Expand Up @@ -504,22 +502,22 @@
Content="{DynamicResource plugin_explorer_previewpanel_display_file_size_checkbox}"
IsChecked="{Binding ShowFileSizeInPreviewPanel}" />
<CheckBox
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"

Check warning on line 505 in Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`previewpanel` is not a recognized word. (unrecognized-spelling)
Content="{DynamicResource plugin_explorer_previewpanel_display_file_creation_checkbox}"
IsChecked="{Binding ShowCreatedDateInPreviewPanel}" />
<CheckBox
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
Content="{DynamicResource plugin_explorer_previewpanel_display_file_modification_checkbox}"
IsChecked="{Binding ShowModifiedDateInPreviewPanel}" />
<CheckBox

Check warning on line 512 in Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`previewpanel` is not a recognized word. (unrecognized-spelling)
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
Content="{DynamicResource plugin_explorer_previewpanel_display_file_age_checkbox}"
IsChecked="{Binding ShowFileAgeInPreviewPanel}" />
</WrapPanel>

Check warning on line 516 in Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`previewpanel` is not a recognized word. (unrecognized-spelling)
</DockPanel>

<DockPanel
Grid.Row="1"

Check warning on line 520 in Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`previewpanel` is not a recognized word. (unrecognized-spelling)
Grid.Column="0"
Grid.ColumnSpan="2"
HorizontalAlignment="Stretch"
Expand Down Expand Up @@ -742,12 +740,12 @@

<StackPanel
Grid.Row="1"
Grid.Column="0"

Check warning on line 743 in Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`lbx` is not a recognized word. (unrecognized-spelling)
Grid.ColumnSpan="2"
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
HorizontalAlignment="Right"

Check warning on line 746 in Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`lbx` is not a recognized word. (unrecognized-spelling)
Orientation="Horizontal">
<Button

Check warning on line 748 in Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`lbx` is not a recognized word. (unrecognized-spelling)
MinWidth="100"
Command="{Binding RemoveLinkCommand}"
CommandParameter="QuickAccessLink"
Expand Down Expand Up @@ -823,11 +821,11 @@
MinWidth="100"
Margin="{StaticResource SettingPanelItemLeftMargin}"
Command="{Binding EditLinkCommand}"
CommandParameter="IndexSearchExcludedPaths"

Check warning on line 824 in Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`lbx` is not a recognized word. (unrecognized-spelling)
Content="{DynamicResource plugin_explorer_edit}" />
<Button
MinWidth="100"
Margin="{StaticResource SettingPanelItemLeftMargin}"

Check warning on line 828 in Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`Lbx` is not a recognized word. (unrecognized-spelling)
Command="{Binding AddLinkCommand}"
CommandParameter="IndexSearchExcludedPaths"
Content="{DynamicResource plugin_explorer_add}" />
Expand Down
Loading