AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.27k stars 2.19k forks source link

Add settings to customize the label of buttons of native file dialogs on linux or make them localizable #16455

Open JerryJian opened 1 month ago

JerryJian commented 1 month ago

Is your feature request related to a problem? Please describe.

No, it's not a problem.

Describe the solution you'd like

I read the source code here https://github.com/AvaloniaUI/Avalonia/blob/ded5caa41ef00cd08f19233cf723ebd6c6f88d62/src/Avalonia.X11/NativeDialogs/GtkNativeFileDialogs.cs#L186, and there isn't any chance to change the text of the system file dialog.

Configure the buttons text on linux via AppBuilder.With(), or provide built in localization of the buttons.

Describe alternatives you've considered

No response

Additional context

No response

maxkatz6 commented 1 month ago

Managed file picker uses StringManagedFileChooserOkText and StringManagedFileChooserCancelText resources that are optional, but defined for both Fluent and Simple, and can be redefined by user. If no better option is found, the same resources can be reused via Application.Current.TryFindResource("StringManagedFileChooserCancelText", out resource)