Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.
C# audio-converteravaloniabatch-conversionconvertercsharpdocument-converterdocx-to-pdfdotnetdrag-and-dropfile-conversionfile-converterheic-converterhwphwpximage-converterlinuxmacospdf-convertervideo-converterwindows
Rotate and flip: names that say what they do, short ones on the ring
SeoJCalivee492a66875d4
diff --git a/src/Filee.App/Assets/i18n/en.json b/src/Filee.App/Assets/i18n/en.jsonindex 8471bd7c..59e474c3 100644--- a/src/Filee.App/Assets/i18n/en.json+++ b/src/Filee.App/Assets/i18n/en.json@@ -108,12 +108,17 @@"preset.grayscale": "Grayscale","preset.remove_background": "Remove background","preset.group_rotate": "Rotate",- "preset.rotate_left": "Left 90°",- "preset.rotate_right": "Right 90°",- "preset.rotate_180": "180°",+ "preset.rotate_left": "Rotate left",+ "preset.rotate_left.short": "Left",+ "preset.rotate_right": "Rotate right",+ "preset.rotate_right.short": "Right",+ "preset.rotate_180": "Rotate 180°",+ "preset.rotate_180.short": "180°","preset.group_flip": "Flip",- "preset.flip_horizontal": "Mirror",- "preset.flip_vertical": "Upside down",+ "preset.flip_horizontal": "Flip horizontal",+ "preset.flip_horizontal.short": "Horizontal",+ "preset.flip_vertical": "Flip vertical",+ "preset.flip_vertical.short": "Vertical","preset.merge_pdf": "Merge PDF","preset.split_pdf": "Split PDF","preset.long_image": "Long image",diff --git a/src/Filee.App/Assets/i18n/ko.json b/src/Filee.App/Assets/i18n/ko.jsonindex 496118ef..cbeaca32 100644--- a/src/Filee.App/Assets/i18n/ko.json+++ b/src/Filee.App/Assets/i18n/ko.json@@ -108,12 +108,17 @@"preset.grayscale": "흑백","preset.remove_background": "배경 제거","preset.group_rotate": "회전",- "preset.rotate_left": "왼쪽 90°",- "preset.rotate_right": "오른쪽 90°",- "preset.rotate_180": "180°",+ "preset.rotate_left": "왼쪽으로 회전",+ "preset.rotate_left.short": "왼쪽",+ "preset.rotate_right": "오른쪽으로 회전",+ "preset.rotate_right.short": "오른쪽",+ "preset.rotate_180": "180° 회전",+ "preset.rotate_180.short": "180°","preset.group_flip": "뒤집기","preset.flip_horizontal": "좌우 반전",+ "preset.flip_horizontal.short": "좌우","preset.flip_vertical": "상하 반전",+ "preset.flip_vertical.short": "상하","preset.merge_pdf": "PDF 병합","preset.split_pdf": "PDF 분할","preset.long_image": "긴 이미지",diff --git a/src/Filee.App/Assets/i18n/zh-CN.json b/src/Filee.App/Assets/i18n/zh-CN.jsonindex 31ec027c..b251349c 100644--- a/src/Filee.App/Assets/i18n/zh-CN.json+++ b/src/Filee.App/Assets/i18n/zh-CN.json@@ -108,12 +108,17 @@"preset.grayscale": "灰度","preset.remove_background": "去除背景","preset.group_rotate": "旋转",- "preset.rotate_left": "向左 90°",- "preset.rotate_right": "向右 90°",- "preset.rotate_180": "180°",+ "preset.rotate_left": "向左旋转",+ "preset.rotate_left.short": "向左",+ "preset.rotate_right": "向右旋转",+ "preset.rotate_right.short": "向右",+ "preset.rotate_180": "旋转 180°",+ "preset.rotate_180.short": "180°","preset.group_flip": "翻转","preset.flip_horizontal": "水平翻转",+ "preset.flip_horizontal.short": "水平","preset.flip_vertical": "垂直翻转",+ "preset.flip_vertical.short": "垂直","preset.merge_pdf": "合并 PDF","preset.split_pdf": "拆分 PDF","preset.long_image": "长图",diff --git a/src/Filee.App/ViewModels/RadialViewModel.cs b/src/Filee.App/ViewModels/RadialViewModel.csindex 4bd83616..37f25c5b 100644--- a/src/Filee.App/ViewModels/RadialViewModel.cs+++ b/src/Filee.App/ViewModels/RadialViewModel.cs@@ -118,7 +118,8 @@ public sealed partial class RadialViewModel(UserDataStore store, ILocalizer loc,return new DonutItem{Id = p.Id,- Label = loc.DisplayName(p),+ // On a group's ring the group's name gives the context: "Rotate" → Left / Right / 180°.+ Label = caption ? loc.DisplayName(p) : loc.RingName(p),Caption = !caption ? null: p.TargetFormat == BuiltInData.SameAsSource? string.Join("/", formats.Select(f => f.DisplayName).Take(2))diff --git a/src/Filee.Core/Localization/ILocalizer.cs b/src/Filee.Core/Localization/ILocalizer.csindex 4bbca446..d1186b88 100644--- a/src/Filee.Core/Localization/ILocalizer.cs+++ b/src/Filee.Core/Localization/ILocalizer.cs@@ -30,6 +30,20 @@ public static class LocalizerExtensions: preset.NameKey is not null ? loc[preset.NameKey]: preset.TargetFormat.ToUpperInvariant();+ /// <summary>+ /// The name on a slice of a group's ring, where the group's name already says what it is about: a built-in+ /// preset's short name (its <see cref="Preset.NameKey"/> + <c>.short</c>, "Left" for "Rotate left") when it has one,+ /// otherwise <see cref="DisplayName(ILocalizer, Preset)"/>.+ /// </summary>+ public static string RingName(this ILocalizer loc, Preset preset)+ {+ if (!string.IsNullOrWhiteSpace(preset.Name) || preset.NameKey is null)+ return loc.DisplayName(preset);+ var key = preset.NameKey + ".short";+ var text = loc[key];+ return text == key ? loc.DisplayName(preset) : text;+ }+public static string DisplayName(this ILocalizer loc, ToolbarProfile profile) =>!string.IsNullOrWhiteSpace(profile.Name) ? profile.Name: profile.NameKey is not null ? loc[profile.NameKey]diff --git a/tests/Filee.App.Tests/RenderTests.cs b/tests/Filee.App.Tests/RenderTests.csindex a03e3652..f70c09db 100644--- a/tests/Filee.App.Tests/RenderTests.cs+++ b/tests/Filee.App.Tests/RenderTests.cs@@ -335,6 +335,53 @@ public class RenderTestswindow.Close();}+ /// <summary>+ /// The built-in "Rotate" and "Flip" groups put on a full image donut (as a user would; they are on no donut by+ /// default): their presets' names fit their ring slices, in every language.+ /// </summary>+ [AvaloniaTheory]+ [InlineData("ko")]+ [InlineData("en")]+ [InlineData("zh-CN")]+ public void The_rotate_and_flip_groups_fan_out_names_that_fit(string language)+ {+ TestServices.EnsureInitialized(language);+ var store = AppHost.Get<UserDataStore>();+ var images = store.Profiles.Single(p => p.Id == "images");+ var before = images.PresetIds.ToList();+ try+ {+ images.PresetIds.AddRange(["rotate", "flip"]);+ var vm = AppHost.Get<RadialViewModel>();+ vm.Load([@"C:\photos\a.jpg"], clickMode: true);+ vm.FitToThisDonut();+ var rotate = vm.Items.Count - 2;+ Assert.Equal(3, vm.Items[rotate].Children!.Count);+ Assert.All(vm.Items[rotate].Children!, item => Assert.True(item.IsEnabled, item.Label));+ // Short names on the ring ("Rotate" → "Left"), the full one ("Rotate left") everywhere else.+ var loc = AppHost.Get<Filee.Core.Localization.ILocalizer>();+ var left = store.FindPreset("rotate-left")!;+ Assert.Equal(loc["preset.rotate_left.short"], vm.Items[rotate].Children![0].Label);+ Assert.NotEqual(loc.DisplayName(left), vm.Items[rotate].Children![0].Label);++ var window = new RadialWindow { DataContext = vm };+ window.Show();+ var donut = window.DonutControl;+ donut.SetExternalHit(new DonutHit(DonutHitKind.Segment, rotate));+ donut.ExpandPendingGroup();+ donut.SetExternalHit(new DonutHit(DonutHitKind.SubSegment, rotate, 1));+ vm.ShowHint(rotate, donut.ActiveSubIndex, centerHot: false);+ Pump();+ Save(window, $"donut-rotate-{language}.png");+ window.Close();+ }+ finally+ {+ images.PresetIds.Clear();+ images.PresetIds.AddRange(before);+ }+ }+/// <summary>/// A group of three formats on the image donut: hovering it fans PNG / JPG / WEBP out outside it, and the slice/// under the pointer there is what a drop or click converts with.