Skip to content
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
2 changes: 1 addition & 1 deletion src/Capture/Recorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2268,7 +2268,7 @@ void MakeCine(double seconds)
string dest = output;
if (!v.Passed)
{
dest = ShotStack.Unique(Path.ChangeExtension(output, null) + " (sin verificar)" + Cine.Extension);
dest = ShotStack.Unique(Path.ChangeExtension(output, null) + I18n.Own(" (sin verificar)", " (unverified)", " (ungepr\u00FCft)", " (\uBBF8\uAC80\uC99D)") + Cine.Extension);
warning = watch.Cancelled ? I18n.Fmt("Has cancelado la comprobaci\u00F3n: el archivo se ha guardado sin verificar como \u00AB{0}\u00BB.",
"You cancelled the check: the file was saved unverified as \u201C{0}\u201D.", Path.GetFileName(dest))
: I18n.Fmt("La comprobaci\u00F3n ha encontrado diferencias: el archivo se ha guardado como \u00AB{0}\u00BB.",
Expand Down
4 changes: 2 additions & 2 deletions src/Editor/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1870,7 +1870,7 @@ void ExportVideo()
// Next to a saved video (kept like it), else with the temporary captures.
string dir = owner != null ? owner.ExportFolder(path) : Path.GetDirectoryName(path);
string ext = toGif ? ".gif" : ".mp4";
string suffix = IsMaster && !bg && !marks && !cropped && !trimmed && !cuts && !joined ? " (para compartir)" : " (editado)";
string suffix = IsMaster && !bg && !marks && !cropped && !trimmed && !cuts && !joined ? ExportName.ForSharing : ExportName.Edited;
exportOut = ShotStack.Reserve(Path.Combine(dir, Path.GetFileNameWithoutExtension(path) + suffix + ext));

ExportSpec spec = new ExportSpec();
Expand Down Expand Up @@ -2124,7 +2124,7 @@ void CheckDone(ExportAbort ab, ShareReport rep)
string kept = exportOut;
try
{
kept = ShotStack.Unique(Path.Combine(Path.GetDirectoryName(exportOut), Path.GetFileNameWithoutExtension(exportOut) + " (sin validar)" + Path.GetExtension(exportOut)));
kept = ShotStack.Unique(Path.Combine(Path.GetDirectoryName(exportOut), Path.GetFileNameWithoutExtension(exportOut) + ExportName.Unverified + Path.GetExtension(exportOut)));
File.Move(exportOut, kept);
exportOut = kept;
}
Expand Down
3 changes: 3 additions & 0 deletions src/Editor/PlayerKit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ internal static class PlayerKit
public static readonly string[] EditorFormats = ShotStack.VideoExtensions;
public static string CineDir = Path.Combine(Settings.DataDir, "cine"); // tests point it elsewhere

// The button that picks the audio track: "Audio" in Spanish, English and German, "\uC624\uB514\uC624" in Korean.
public static string AudioLabel { get { return I18n.T("Audio", "Audio", "Audio"); } }

static string Dec(double v, string f) { return v.ToString(f, I18n.Culture); }

// 1:07 or 1:02:03.
Expand Down
4 changes: 2 additions & 2 deletions src/Editor/PlayerWindow.PieceGif.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void ExportGif()
try
{
Directory.CreateDirectory(dir);
output = ShotStack.Reserve(Path.Combine(dir, Path.GetFileNameWithoutExtension(path) + " (tramo).gif"));
output = ShotStack.Reserve(Path.Combine(dir, Path.GetFileNameWithoutExtension(path) + ExportName.Clip + ".gif"));
}
catch (Exception ex)
{
Expand Down Expand Up @@ -261,7 +261,7 @@ void GifDone(ExportAbort ab, string output, int code, string err, ShareReport re
string kept = output;
try
{
kept = ShotStack.Unique(Path.Combine(Path.GetDirectoryName(output), Path.GetFileNameWithoutExtension(output) + " (sin validar)" + Path.GetExtension(output)));
kept = ShotStack.Unique(Path.Combine(Path.GetDirectoryName(output), Path.GetFileNameWithoutExtension(output) + ExportName.Unverified + Path.GetExtension(output)));
File.Move(output, kept);
}
catch (Exception ex) { kept = output; ShotStack.Log("Reproductor: no se pudo renombrar: " + ex.Message); }
Expand Down
6 changes: 3 additions & 3 deletions src/Editor/PlayerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ void ExportMp4()
try
{
Directory.CreateDirectory(dir);
output = ShotStack.Reserve(Path.Combine(dir, Path.GetFileNameWithoutExtension(path) + (HasRange ? " (tramo).mp4" : " (para compartir).mp4")));
output = ShotStack.Reserve(Path.Combine(dir, Path.GetFileNameWithoutExtension(path) + (HasRange ? ExportName.Clip : ExportName.ForSharing) + ".mp4"));
}
catch (Exception ex)
{
Expand Down Expand Up @@ -756,7 +756,7 @@ void ExportDone(ExportAbort ab, string output, int code, string err, ShareReport
string kept = output;
try
{
kept = ShotStack.Unique(Path.Combine(Path.GetDirectoryName(output), Path.GetFileNameWithoutExtension(output) + " (sin validar)" + Path.GetExtension(output)));
kept = ShotStack.Unique(Path.Combine(Path.GetDirectoryName(output), Path.GetFileNameWithoutExtension(output) + ExportName.Unverified + Path.GetExtension(output)));
File.Move(output, kept);
}
catch (Exception ex) { kept = output; ShotStack.Log("Reproductor: no se pudo renombrar: " + ex.Message); }
Expand Down Expand Up @@ -1279,7 +1279,7 @@ void LayoutBar(Graphics g)
Font pf = Face(true, 12);
List<Btn> right = new List<Btn>();
right.Add(Make("full", fullscreen ? "restore" : "maximize", null, I18n.T("Pantalla completa (F)", "Full screen (F)"), P(34), false, false));
if (info.Audio.Count > 1) right.Add(Make("tracks", null, "Audio", I18n.T("Pista de audio", "Audio track"), Math.Max(P(52), TextKit.Measure(g, "Audio", pf, Size.Empty, TextFormatFlags.NoPadding).Width + P(24)), false, true));
if (info.Audio.Count > 1) right.Add(Make("tracks", null, PlayerKit.AudioLabel, I18n.T("Pista de audio", "Audio track"), Math.Max(P(52), TextKit.Measure(g, PlayerKit.AudioLabel, pf, Size.Empty, TextFormatFlags.NoPadding).Width + P(24)), false, true));
right.Add(Make("speed", null, PlayerKit.SpeedText(speed), I18n.T("Velocidad", "Speed"), Math.Max(P(48), TextKit.Measure(g, PlayerKit.SpeedText(speed), pf, Size.Empty, TextFormatFlags.NoPadding).Width + P(20)), speed != 1, true));
right.Add(Make("loop", "update", null, I18n.T("Repetir al terminar", "Loop playback"), P(34), loop, false));
right.Add(Make("menu", "gear", null, I18n.T("M\u00E1s opciones", "More options"), P(34), false, false));
Expand Down
18 changes: 18 additions & 0 deletions src/ExportName.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Stackshot - The words an exported file adds to the name of the video it comes from ("Cine A (editado).mp4"), in the
// interface language. Nothing reads them back (recordings are told by their "V\u00EDdeo", "GIF" and "Cine" prefixes), so they
// can follow the language; the other languages' previews use the English ones.
// MIT License - https://github.com/rubenitx/stackshot
namespace Stackshot
{
internal static class ExportName
{
// A clip marked with E and S.
public static string Clip { get { return I18n.Own(" (tramo)", " (clip)", " (Ausschnitt)", " (\uAD6C\uAC04)"); } }
// Exported with a backdrop, annotations, a trim or cuts.
public static string Edited { get { return I18n.Own(" (editado)", " (edited)", " (bearbeitet)", " (\uD3B8\uC9D1\uB428)"); } }
// A lossless master compressed for sending as it is.
public static string ForSharing { get { return I18n.Own(" (para compartir)", " (for sharing)", " (zum Teilen)", " (\uACF5\uC720\uC6A9)"); } }
// The file the check could not vouch for, kept beside the one that was expected.
public static string Unverified { get { return I18n.Own(" (sin validar)", " (unverified)", " (ungepr\u00FCft)", " (\uBBF8\uAC80\uC99D)"); } }
}
}
14 changes: 5 additions & 9 deletions src/Home/HomeViews.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void BuildHomeMinimal()

if (settings.MascotOn)
{
MacButton chips = new MacButton(I18n.Fmt("Jugar con {0}", "Play with {0}", settings.MascotName), ButtonKind.Plain, "play", null, 26);
MacButton chips = new MacButton(MascotTalk.PlayWith(settings.MascotName), ButtonKind.Plain, "play", null, 26);
chips.ToolTip = I18n.Fmt("P\u00EDdele algo a {0}", "Ask {0} something", settings.MascotName);
chips.HorizontalAlignment = HorizontalAlignment.Center;
chips.Margin = new Thickness(0, 12, 0, 0);
Expand Down Expand Up @@ -734,7 +734,7 @@ FrameworkElement HomeNameTag(Typeface face, double size, Color color, bool centr

TextBox box = new TextBox
{
MaxLength = 16, MinWidth = 60, Visibility = Visibility.Collapsed, VerticalAlignment = VerticalAlignment.Center,
MinWidth = 60, Visibility = Visibility.Collapsed, VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = centred ? HorizontalAlignment.Center : HorizontalAlignment.Left,
FontFamily = face.FontFamily, FontWeight = face.Weight, FontSize = size, Padding = new Thickness(4, 0, 4, 1),
Margin = new Thickness(0),
Expand All @@ -743,6 +743,7 @@ FrameworkElement HomeNameTag(Typeface face, double size, Color color, bool centr
Background = Ds.Brush(pal.Control), BorderBrush = Ds.Brush(Ds.WithAlpha(pal.Accent, 0.85)), BorderThickness = new Thickness(0, 0, 0, 1.5),
Template = HomeFieldTemplate()
};
MascotName.Guard(box);
slot.Children.Add(box);
System.Windows.Automation.AutomationProperties.SetName(box, I18n.T("Nombre de la mascota", "Mascot name"));

Expand Down Expand Up @@ -810,12 +811,7 @@ FrameworkElement HomeNameTag(Typeface face, double size, Color color, bool centr
// Saves the new name (empty means Pixel) and lets the mascot say it.
void HomeRename(string typed, TextBlock shown)
{
System.Text.StringBuilder b = new System.Text.StringBuilder();
foreach (char c in typed ?? "") if (!char.IsControl(c)) b.Append(c);
string v = b.ToString().Trim();
if (v.Length > 16) v = v.Substring(0, 16);
if (v.Length > 0 && char.IsHighSurrogate(v[v.Length - 1])) v = v.Substring(0, v.Length - 1); // never half an emoji
v = v.Trim();
string v = MascotName.Clean(typed);
if (v.Length == 0) v = "Pixel";
if (shown != null) shown.Text = v;
if (v == settings.MascotName) return;
Expand Down Expand Up @@ -1417,7 +1413,7 @@ void BuildHomeScene()
host.Margin = new Thickness(left, 0, 0, bottom);
stage.Children.Add(host);
UseMascot(host);
MacButton play = new MacButton(I18n.Fmt("Jugar con {0}", "Play with {0}", settings.MascotName), ButtonKind.Plain, "play", null, 26);
MacButton play = new MacButton(MascotTalk.PlayWith(settings.MascotName), ButtonKind.Plain, "play", null, 26);
play.ToolTip = I18n.Fmt("P\u00EDdele algo a {0}", "Ask {0} something", settings.MascotName);
play.Click += delegate { CommandMenu(play); };
play.HorizontalAlignment = HorizontalAlignment.Left;
Expand Down
6 changes: 3 additions & 3 deletions src/Home/MascotAnime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public static partial class MascotParts
"Nezuko", "Spider-Man", "Batman", "Flash", "Superman", "Iron Man",
"Ritter", "Astronaut", "Weiser Magier", "Superheld", "Kero", "Kamina",
"Ohnezahn", "Lichtfurie", "Sturmschwinge", "Hakenzahn", "Fleischkloß",
"Stitch", "Kirby", "Grogu", "Eevee", "Charmander",
"Bulbasaur", "Squirtle", "Jigglypuff", "Snorlax", "Gengar", "Mew",
"Psyduck", "Togepi", "Meowth", "Piplup", "Mimikyu", "Lucario", "Dragonite", "Ditto", "Mewtwo",
"Stitch", "Kirby", "Grogu", "Evoli", "Glumanda",
"Bisasam", "Schiggy", "Pummeluff", "Relaxo", "Gengar", "Mew",
"Enton", "Togepi", "Mauzi", "Plinfa", "Mimigma", "Lucario", "Dragoran", "Ditto", "Mewtu",
"No-Face", "Calcifer", "Kodama", "Yoshi", "Pac-Man", "Creeper", "Crewmate", "Blinky", "Slime",
"Snoopy", "Hello Kitty", "Baby Groot", "Rilakkuma", "Pusheen", "Pochacco",
"Pinky", "Inky", "Clyde", "Space Invader", "Goomba", "Boo", "Toad", "Superpilz", "Bob-omb", "Kettenhund",
Expand Down
18 changes: 9 additions & 9 deletions src/Home/MascotArcadePowers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,23 +185,23 @@ static string[] OwnLinesDe(int kind)
case KindStitch: return new string[] { "Ohana!", "Ohana hei\u00DFt Familie.", "Meega nala kweesta!" };
case KindKirby: return new string[] { "Poyo!", "Hai!", "Ich habe Hunger\u2026 poyo!" };
case KindGrogu: return new string[] { "Mmm\u2026", "Ein blaues Pl\u00E4tzchen?" };
case KindEevee: return new string[] { "Vee!", "Eevee!" };
case KindCharmander: return new string[] { "Char!", "Charmander!" };
case KindEevee: return new string[] { "Voli!", "Evoli!" };
case KindCharmander: return new string[] { "Glum!", "Glumanda!" };
case KindPikachu: return new string[] { "Pika pika!", "Pikachu!", "Pika!" };
case KindBmo: return new string[] { "Wer will Videospiele spielen?", "Piep bop, ich bin BMO.", "BMO sagt: Schnappschuss!" };
case KindDoraemon: return new string[] { "Daf\u00FCr habe ich ein Gadget!", "Hat jemand Dorayaki?" };
case KindTotoro: return new string[] { "Grooaar!", "Warten wir auf den Bus?" };
case KindBulbasaur: return new string[] { "Bulba!", "Bulbasaur!" };
case KindSquirtle: return new string[] { "Squirtle!", "Alle mal chillen!" };
case KindJigglypuff: return new string[] { "Jiggly\u2026 puuuff \u266A", "Eingeschlafen? Dann mal ich dir ins Gesicht!" };
case KindBulbasaur: return new string[] { "Bisa!", "Bisasam!" };
case KindSquirtle: return new string[] { "Schiggy!", "Alle mal chillen!" };
case KindJigglypuff: return new string[] { "Pummel\u2026 puuuff \u266A", "Eingeschlafen? Dann mal ich dir ins Gesicht!" };
case KindSnorlax: return new string[] { "Zzz\u2026", "Ist es schon Zeit zum Essen?", "Nur noch f\u00FCnf Minuten\u2026" };
case KindGengar: return new string[] { "Gen\u2026 gar\u2026 hihihi", "Ich bin in deinem Schatten." };
case KindMew: return new string[] { "Mew!", "Mew mew \u266A" };
case KindPsyduck: return new string[] { "Psy\u2026?", "Mein Kopf tut so weh\u2026", "Psyduck?" };
case KindPsyduck: return new string[] { "Ent\u2026?", "Mein Kopf tut so weh\u2026", "Enton?" };
case KindTogepi: return new string[] { "Toge toge priii!", "Togepi!" };
case KindMeowth: return new string[] { "Meowth, genau so ist es!", "Gl\u00E4nzt das? Dann geh\u00F6rt es mir!" };
case KindPiplup: return new string[] { "Piplup!", "Pip pip!" };
case KindMimikyu: return new string[] { "Ich will doch nur einen Freund\u2026", "Mimiky\u2026" };
case KindMeowth: return new string[] { "Mauzi, genau so ist es!", "Gl\u00E4nzt das? Dann geh\u00F6rt es mir!" };
case KindPiplup: return new string[] { "Plinfa!", "Plin plin!" };
case KindMimikyu: return new string[] { "Ich will doch nur einen Freund\u2026", "Mimigma\u2026" };
case KindLucario: return new string[] { "Ich sp\u00FCre deine Aura.", "Aurasph\u00E4re!" };
case KindDragonite: return new string[] { "Drago!", "Soll ich dich irgendwohin fliegen?" };
case KindDitto: return new string[] { "Ditto!", "Ich kann alles sein, was du willst." };
Expand Down
13 changes: 10 additions & 3 deletions src/Home/MascotTalk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ public static class MascotTalk
static readonly Random rnd = new Random();
static readonly List<string> recent = new List<string>();

// The label that opens the mascot's menu: "Jugar con Pixel". Korean says it with \uD558\uACE0, which needs no particle
// chosen by how the name ends, so every name reads the same way, in any script.
public static string PlayWith(string name)
{
return I18n.Fmt("Jugar con {0}", "Play with {0}", name);
}

static string Pick(string[] lines)
{
string line = null;
Expand Down Expand Up @@ -452,9 +459,9 @@ public static string WellToday(Settings s, int kind)
if (I18n.IsKorean)
{
string whatEn = I18n.Localize(kind == WellKind.Water ? "water reminders" : kind == WellKind.Eyes ? "eye rest reminders" : kind == WellKind.Move ? "movement breaks" : "breathing breaks");
if (!s.MascotTalks) return string.Format(I18n.Localize("No more {0} today."), whatEn);
return By(s.MascotPersonality, new string[] { string.Format(I18n.Localize("Got it! No more {0} today."), whatEn) }, new string[] { string.Format(I18n.Localize("Alright, no more {0} for today."), whatEn) },
new string[] { string.Format(I18n.Localize("Fine, you're off the hook for {0} today."), whatEn) });
if (!s.MascotTalks) return I18n.KoreanFormat(I18n.Localize("No more {0} today."), whatEn);
return By(s.MascotPersonality, new string[] { I18n.KoreanFormat(I18n.Localize("Got it! No more {0} today."), whatEn) }, new string[] { I18n.KoreanFormat(I18n.Localize("Alright, no more {0} for today."), whatEn) },
new string[] { I18n.KoreanFormat(I18n.Localize("Fine, you're off the hook for {0} today."), whatEn) });
}
string what = kind == WellKind.Water ? I18n.T("lo del agua", "water reminders", "Wasser-Erinnerungen")
: kind == WellKind.Eyes ? I18n.T("lo de la vista", "eye rest reminders", "Augenpausen")
Expand Down
10 changes: 9 additions & 1 deletion src/Home/Wellness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ public static class WellKind
public static readonly string[] Glyphs = { "drop", "eye", "walk", "wind" };
// Choices for each interval, in minutes (0: off).
public static readonly int[] Minutes = { 0, 20, 30, 45, 60, 90, 120 };
public static string[] MinuteNames { get { return new string[] { I18n.T("No", "Off"), "20 min", "30 min", "45 min", "1 h", "1 h 30", "2 h" }; } }
public static string[] MinuteNames
{
get
{
// Korean says its own units ("20\uBD84", "1\uC2DC\uAC04 30\uBD84"), as everywhere else a duration is shown.
if (I18n.IsKorean) return new string[] { I18n.T("No", "Off"), FocusClock.Minutes(20), FocusClock.Minutes(30), FocusClock.Minutes(45), FocusClock.Minutes(60), FocusClock.Minutes(90), FocusClock.Minutes(120) };
return new string[] { I18n.T("No", "Off"), "20 min", "30 min", "45 min", "1 h", "1 h 30", "2 h" };
}
}

public static int IndexOf(int minutes)
{
Expand Down
Loading
Loading