fix(i18n): texts kept by view models follow a language switch; right-to-left meta lines keep their fields
A language switch re-read computed properties only: the job bar of a running job,
the Jobs rows, the editor's chart legends and summaries, Auto chips, markers and
info line, the Archive figures and the Import session table kept the old language
until their next change. LocalizedViewModel gains OnLanguageChanged, where each of
them makes those texts again.
Meta lines joined their fields with a plain " · ": in Arabic or Hebrew a number
after a Latin field ("Canon EOS R5 · 2 h") joined the Latin run and split its own
field. Loc.Separator puts right-to-left marks around the dot in right-to-left
languages and is used for every such line. Desktop file sizes use the Common.Size
formats, as the Setup and the Uploader do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
46 files changed
+191
-58
No files matched your search
@@ -60,7 +60,7 @@ public sealed record CardActions(ImportDestinationKind Destination, bool IsKnown
|
||||
/// <summary>"4,812 verified on the card · 96.2 GB · 2 kept": the dry run in one line; empty before it ran.</summary>
|
||||
public string EraseText => Erase is null
|
||||
? string.Empty
|
||||
: string.Join(" · ", new[]
|
||||
: string.Join(Loc.Separator, new[]
|
||||
{
|
||||
Loc.Plural("Import.Erase.Verified", DeleteCount),
|
||||
Formatting.Bytes(DeleteBytes),
|
||||
|
||||
@@ -95,7 +95,7 @@ public sealed record ImportSource(string Key, SourceKind Kind, CardDevice? Devic
|
||||
/// "Known card · 128 GB · 96.2 GB used · 4,812 photos": the entry's tooltip, with what its subtitle may have to cut
|
||||
/// (a drive's subtitle already says it has no DCIM).
|
||||
/// </summary>
|
||||
public string ToolTip => Kind == SourceKind.Drive ? Subtitle : string.Join(" · ", new[] { StateText, Subtitle }.Where(t => t.Length > 0));
|
||||
public string ToolTip => Kind == SourceKind.Drive ? Subtitle : string.Join(Loc.Separator, new[] { StateText, Subtitle }.Where(t => t.Length > 0));
|
||||
|
||||
/// <summary>"Canon EOS R5 · 4,812 photos": the insertion toast's line; "not yet known to Titano" for a new card.</summary>
|
||||
public string ToastText
|
||||
@@ -106,7 +106,7 @@ public sealed record ImportSource(string Key, SourceKind Kind, CardDevice? Devic
|
||||
if ((CameraText(Card) is { Length: > 0 } known ? known : Contents?.Camera) is { } camera) parts.Add(camera);
|
||||
if (Contents is { } contents) parts.Add(Loc.Plural("Shell.Status.Photos", contents.Photos));
|
||||
if (!IsKnown) parts.Add(Loc.L("Import.Toast.Unknown"));
|
||||
return string.Join(" · ", parts);
|
||||
return string.Join(Loc.Separator, parts);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public sealed record ImportSource(string Key, SourceKind Kind, CardDevice? Devic
|
||||
var serial = Device?.SerialNumber ?? Card?.VolumeSerial;
|
||||
if (serial is { } s && Kind != SourceKind.Folder) parts.Add(Loc.L("Import.Device.Serial", BidiText.Ltr(SerialText(s))));
|
||||
if (CameraText(Card) is { Length: > 0 } camera) parts.Add(Card?.CameraSerial is { Length: > 0 } body ? Loc.L("Import.Device.Body", camera, body) : camera);
|
||||
return string.Join(" · ", parts);
|
||||
return string.Join(Loc.Separator, parts);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ public sealed record PlanTotals(int Sessions, int Photos, int CopyCount, long Co
|
||||
public bool HasEnoughSpace => FreeAfter is not < 0;
|
||||
|
||||
/// <summary>"3 sessions · 4,812 photos · 96.2 GB · about 12 min".</summary>
|
||||
public string Text => SummaryText + " · " + Loc.L("Import.Plan.About", Formatting.Duration(Estimate));
|
||||
public string Text => SummaryText + Loc.Separator + Loc.L("Import.Plan.About", Formatting.Duration(Estimate));
|
||||
|
||||
/// <summary>"3 sessions · 4,812 photos · 96.2 GB": the plan without its time estimate.</summary>
|
||||
public string SummaryText => string.Join(" · ",
|
||||
public string SummaryText => string.Join(Loc.Separator,
|
||||
Loc.Plural("Import.Plan.Sessions", Sessions),
|
||||
Loc.Plural("Shell.Status.Photos", Photos),
|
||||
Formatting.Bytes(CopyBytes));
|
||||
@@ -171,7 +171,7 @@ public static class ImportPlans
|
||||
foreach (var problem in plan.Problems) conflicts.Add(Loc.L("Import.Details.Unreadable", BidiText.Ltr(problem.RelativePath), problem.Message));
|
||||
if (totals.Duplicates > 0) conflicts.Add(totals.DuplicatesText);
|
||||
if (!totals.HasEnoughSpace) conflicts.Add(totals.SpaceText);
|
||||
var text = string.Join(" · ", new[]
|
||||
var text = string.Join(Loc.Separator, new[]
|
||||
{
|
||||
Loc.Plural("Import.Details.Files", plan.FileCount),
|
||||
Loc.L("Import.Details.Copy", Formatting.Count(plan.CopyCount), Formatting.Bytes(plan.CopyBytes)),
|
||||
@@ -210,7 +210,7 @@ public static class ImportPlans
|
||||
var folder = FolderOf(paths[i]);
|
||||
shown.Add(i > 0 && folder == FolderOf(paths[i - 1]) ? paths[i][(folder.Length == 0 ? 0 : folder.Length + 1)..] : paths[i]);
|
||||
}
|
||||
return Loc.L("Import.Names.Preview", string.Join(" · ", shown));
|
||||
return Loc.L("Import.Names.Preview", string.Join(Loc.Separator, shown));
|
||||
}
|
||||
|
||||
private static string FolderOf(string path) => path.LastIndexOf('/') is var slash and >= 0 ? path[..slash] : string.Empty;
|
||||
|
||||
@@ -83,7 +83,7 @@ public sealed class ImportResultViewModel : LocalizedViewModel
|
||||
: Loc.L("Import.Result.Partial", Formatting.Count(Outcome.Imported), Formatting.Count(Outcome.Failures.Count));
|
||||
|
||||
/// <summary>"12 skipped · 3 already there", or empty.</summary>
|
||||
public string DetailText => string.Join(" · ", new[]
|
||||
public string DetailText => string.Join(Loc.Separator, new[]
|
||||
{
|
||||
Outcome.Skipped > 0 ? Loc.Plural("Import.Result.Skipped", Outcome.Skipped) : string.Empty,
|
||||
Outcome.Duplicates > 0 ? Loc.Plural("Import.Result.AlreadyThere", Outcome.Duplicates) : string.Empty,
|
||||
|
||||
Reference in new issue
Block a user