fix(tours): read a run pace the way runners write it, and keep it

A pace typed as "5.30" or "5,45" is now read as 5:30 and 5:45, the way
it is written in much of Europe, instead of quietly becoming 5:18 and
5:27. One digit after the point stays a tenth of a minute ("5,5" is
5:30); anything else is marked as no pace.

The pace field no longer flashes the out-of-bounds error while a pace
is still being typed: the first digit of "12:30" reads as 1:00, so a
pace outside the bounds now reaches the planner only on leaving the
field or pressing Enter, like text that is no pace already did.

The pace unit is translated ("мин/км", "分/km" and so on) in the field,
the sum the running time is and the pace pills, so what is shown
matches what assistive tech reads out.

A run planned over in place again keeps the pace it holds, so the
runner need not type it again before Save.
This commit is contained in:
Maurice
2026-10-20 12:58:19 +02:00
parent c83eb42730
commit 1d9b9bf838
40 changed files with 164 additions and 41 deletions
+1
View File
@@ -426,6 +426,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'كيف يُحسب وقت الجري',
'tours.run.paceInfo':
'وتيرتك الخاصة لكل كيلومتر. وقت الجري هو المسافة × الوتيرة؛ ولا تُحتسب الصعودات والنزولات ولا الصعوبة التقنية.',
'tours.run.paceUnit': 'دقيقة/كم',
'tours.run.paceInvalid': 'أدخل الوتيرة بصيغة دقيقة:ثانية لكل كم، من {fastest} إلى {slowest}.',
'tours.run.paceNeeded': 'أدخل وتيرتك لتخطيط وقت الجري وحفظ هذا الجري.',
'tours.run.timeEstimated': 'وقت الجري (مخطط)',
+1
View File
@@ -416,6 +416,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Qaçış vaxtı necə hesablanır',
'tours.run.paceInfo':
'Kilometr başına öz tempiniz. Qaçış vaxtı məsafə × tempdir; yoxuşlar, enişlər və texniki çətinlik nəzərə alınmır.',
'tours.run.paceUnit': 'dəq/km',
'tours.run.paceInvalid': 'Tempi km başına dəq:san kimi, {fastest} ilə {slowest} arasında daxil edin.',
'tours.run.paceNeeded': 'Qaçış vaxtını planlaşdırmaq və bu qaçışı saxlamaq üçün tempinizi daxil edin.',
'tours.run.timeEstimated': 'Qaçış vaxtı (planlaşdırılan)',
+1
View File
@@ -422,6 +422,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Como o tempo de corrida é calculado',
'tours.run.paceInfo':
'Seu próprio ritmo por quilômetro. O tempo de corrida é distância × ritmo; subidas, descidas e dificuldade técnica não entram.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Informe o ritmo como min:s por km, de {fastest} a {slowest}.',
'tours.run.paceNeeded': 'Informe seu ritmo para planejar o tempo de corrida e salvar esta corrida.',
'tours.run.timeEstimated': 'Tempo de corrida (planejado)',
+1
View File
@@ -423,6 +423,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Com es calcula el temps de cursa',
'tours.run.paceInfo':
'El teu ritme per quilòmetre. El temps de cursa és distància × ritme; el desnivell i la dificultat tècnica no hi compten.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Introdueix el ritme com a min:s per km, de {fastest} a {slowest}.',
'tours.run.paceNeeded': 'Introdueix el teu ritme per planificar el temps de cursa i desar aquesta cursa.',
'tours.run.timeEstimated': 'Temps de cursa (previst)',
+1
View File
@@ -415,6 +415,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Jak se počítá čas běhu',
'tours.run.paceInfo':
'Vaše vlastní tempo na kilometr. Čas běhu je vzdálenost × tempo; převýšení a technická obtížnost se nezapočítávají.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Zadejte tempo jako min:s na km, od {fastest} do {slowest}.',
'tours.run.paceNeeded': 'Zadejte své tempo, aby se naplánoval čas běhu a běh šel uložit.',
'tours.run.timeEstimated': 'Čas běhu (plánovaný)',
+1
View File
@@ -425,6 +425,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Wie die Laufzeit berechnet wird',
'tours.run.paceInfo':
'Deine eigene Pace pro Kilometer. Die Laufzeit ist Distanz × Pace; Höhenmeter und technische Schwierigkeit gehen nicht ein.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Gib die Pace als Min:Sek pro km ein, von {fastest} bis {slowest}.',
'tours.run.paceNeeded': 'Gib deine Pace ein, um die Laufzeit zu planen und diesen Lauf zu speichern.',
'tours.run.timeEstimated': 'Laufzeit (geplant)',
+1
View File
@@ -414,6 +414,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'How the running time is worked out',
'tours.run.paceInfo':
'Your own pace per kilometre. The running time is distance × pace; climbs, descents and how technical the way is are not included.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Enter the pace as min:sec per km, from {fastest} to {slowest}.',
'tours.run.paceNeeded': 'Enter your pace to plan the running time and save this run.',
'tours.run.timeEstimated': 'Running time (planned)',
+1
View File
@@ -422,6 +422,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Cómo se calcula el tiempo de carrera',
'tours.run.paceInfo':
'Tu propio ritmo por kilómetro. El tiempo de carrera es distancia × ritmo; el desnivel y la dificultad técnica no se tienen en cuenta.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Introduce el ritmo como min:s por km, de {fastest} a {slowest}.',
'tours.run.paceNeeded': 'Introduce tu ritmo para planificar el tiempo de carrera y guardar esta carrera.',
'tours.run.timeEstimated': 'Tiempo de carrera (previsto)',
+1
View File
@@ -417,6 +417,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Kuidas jooksuaeg arvutatakse',
'tours.run.paceInfo':
'Sinu enda tempo kilomeetri kohta. Jooksuaeg on vahemaa × tempo; tõusud, langused ja tehniline raskus ei lähe arvesse.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Sisesta tempo kujul min:s kilomeetri kohta, vahemikus {fastest} kuni {slowest}.',
'tours.run.paceNeeded': 'Sisesta oma tempo, et jooksuaeg planeerida ja see jooks salvestada.',
'tours.run.timeEstimated': 'Jooksuaeg (planeeritud)',
+1
View File
@@ -428,6 +428,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Comment le temps de course est calculé',
'tours.run.paceInfo':
'Ton allure à toi, par kilomètre. Le temps de course est distance × allure ; dénivelé et difficulté technique ne sont pas pris en compte.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Saisis l’allure en min:s par km, de {fastest} à {slowest}.',
'tours.run.paceNeeded': 'Saisis ton allure pour planifier le temps de course et enregistrer cette course.',
'tours.run.timeEstimated': 'Temps de course (prévu)',
+1
View File
@@ -430,6 +430,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Πώς υπολογίζεται ο χρόνος τρεξίματος',
'tours.run.paceInfo':
'Ο δικός σου ρυθμός ανά χιλιόμετρο. Ο χρόνος τρεξίματος είναι απόσταση × ρυθμός· ανηφόρες, κατηφόρες και τεχνική δυσκολία δεν λαμβάνονται υπόψη.',
'tours.run.paceUnit': 'λεπ/km',
'tours.run.paceInvalid': 'Δώσε τον ρυθμό ως λεπ:δευτ ανά km, από {fastest} έως {slowest}.',
'tours.run.paceNeeded':
'Δώσε τον ρυθμό σου για να προγραμματιστεί ο χρόνος τρεξίματος και να αποθηκευτεί αυτό το τρέξιμο.',
+1
View File
@@ -422,6 +422,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Hogyan számoljuk a futásidőt',
'tours.run.paceInfo':
'A saját tempód kilométerenként. A futásidő távolság × tempó; a szintemelkedés és a technikai nehézség nem számít bele.',
'tours.run.paceUnit': 'perc/km',
'tours.run.paceInvalid': 'Add meg a tempót perc:mp/km formában, {fastest} és {slowest} között.',
'tours.run.paceNeeded': 'Add meg a tempódat a futásidő tervezéséhez és a futás mentéséhez.',
'tours.run.timeEstimated': 'Futásidő (tervezett)',
+1
View File
@@ -417,6 +417,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Cara waktu lari dihitung',
'tours.run.paceInfo':
'Pace milikmu sendiri per kilometer. Waktu lari adalah jarak × pace; tanjakan, turunan, dan tingkat kesulitan teknis tidak dihitung.',
'tours.run.paceUnit': 'mnt/km',
'tours.run.paceInvalid': 'Masukkan pace sebagai mnt:dtk per km, dari {fastest} sampai {slowest}.',
'tours.run.paceNeeded': 'Masukkan pace-mu untuk merencanakan waktu lari dan menyimpan lari ini.',
'tours.run.timeEstimated': 'Waktu lari (rencana)',
+1
View File
@@ -425,6 +425,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Come si calcola il tempo di corsa',
'tours.run.paceInfo':
'Il tuo passo al chilometro. Il tempo di corsa è distanza × passo; dislivello e difficoltà tecnica non sono considerati.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Inserisci il passo come min:s al km, da {fastest} a {slowest}.',
'tours.run.paceNeeded': 'Inserisci il tuo passo per pianificare il tempo di corsa e salvare questa corsa.',
'tours.run.timeEstimated': 'Tempo di corsa (previsto)',
+1
View File
@@ -405,6 +405,7 @@ const tours: TranslationStrings = {
'tours.run.pace': '予定ペース',
'tours.run.paceInfoLabel': '走行時間の計算方法',
'tours.run.paceInfo': '1 kmあたりのあなた自身のペースです。走行時間は距離 × ペースで、登り、下り、技術的な難しさは含みません。',
'tours.run.paceUnit': '分/km',
'tours.run.paceInvalid': 'ペースは km あたり 分:秒 で、{fastest} から {slowest} の間で入力してください。',
'tours.run.paceNeeded': '走行時間を計画してこのランを保存するには、ペースを入力してください。',
'tours.run.timeEstimated': '走行時間 (予定)',
+1
View File
@@ -403,6 +403,7 @@ const tours: TranslationStrings = {
'tours.run.pace': '계획 페이스',
'tours.run.paceInfoLabel': '달리기 시간 계산 방법',
'tours.run.paceInfo': '킬로미터당 나만의 페이스입니다. 달리기 시간은 거리 × 페이스이며, 오르막, 내리막, 기술적 난이도는 포함되지 않습니다.',
'tours.run.paceUnit': '분/km',
'tours.run.paceInvalid': '페이스를 km당 분:초로, {fastest}에서 {slowest} 사이로 입력하세요.',
'tours.run.paceNeeded': '달리기 시간을 계획하고 이 달리기를 저장하려면 페이스를 입력하세요.',
'tours.run.timeEstimated': '달리기 시간 (계획)',
+1
View File
@@ -424,6 +424,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Hoe de looptijd wordt berekend',
'tours.run.paceInfo':
'Je eigen tempo per kilometer. De looptijd is afstand × tempo; hoogtemeters en technische moeilijkheid tellen niet mee.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Vul het tempo in als min:sec per km, van {fastest} tot {slowest}.',
'tours.run.paceNeeded': 'Vul je tempo in om de looptijd te plannen en deze looptocht op te slaan.',
'tours.run.timeEstimated': 'Looptijd (gepland)',
+1
View File
@@ -431,6 +431,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Jak liczony jest czas biegu',
'tours.run.paceInfo':
'Twoje własne tempo na kilometr. Czas biegu to dystans × tempo; przewyższenia i trudność techniczna nie są uwzględniane.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Wpisz tempo jako min:s na km, od {fastest} do {slowest}.',
'tours.run.paceNeeded': 'Wpisz swoje tempo, aby zaplanować czas biegu i zapisać ten bieg.',
'tours.run.timeEstimated': 'Czas biegu (planowany)',
+1
View File
@@ -435,6 +435,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Как считается время бега',
'tours.run.paceInfo':
'Ваш собственный темп на километр. Время бега равно расстоянию × темп; набор высоты и техническая сложность не учитываются.',
'tours.run.paceUnit': 'мин/км',
'tours.run.paceInvalid': 'Введите темп как мин:с на км, от {fastest} до {slowest}.',
'tours.run.paceNeeded': 'Введите свой темп, чтобы рассчитать время бега и сохранить эту пробежку.',
'tours.run.timeEstimated': 'Время бега (план)',
+1
View File
@@ -416,6 +416,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Ako sa počíta čas behu',
'tours.run.paceInfo':
'Vaše vlastné tempo na kilometer. Čas behu je vzdialenosť × tempo; prevýšenie a technická náročnosť sa nezapočítavajú.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Zadajte tempo ako min:s na km, od {fastest} do {slowest}.',
'tours.run.paceNeeded': 'Zadajte svoje tempo, aby sa naplánoval čas behu a beh sa dal uložiť.',
'tours.run.timeEstimated': 'Čas behu (plánovaný)',
+1
View File
@@ -413,6 +413,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Så räknas löptiden ut',
'tours.run.paceInfo':
'Ditt eget tempo per kilometer. Löptiden är sträcka × tempo; stigningar och teknisk svårighet räknas inte in.',
'tours.run.paceUnit': 'min/km',
'tours.run.paceInvalid': 'Ange tempot som min:sek per km, från {fastest} till {slowest}.',
'tours.run.paceNeeded': 'Ange ditt tempo för att planera löptiden och spara löpturen.',
'tours.run.timeEstimated': 'Löptid (planerad)',
+1
View File
@@ -394,6 +394,7 @@ const tours: TranslationStrings = {
'tours.run.pace': 'เพซที่วางแผนไว้',
'tours.run.paceInfoLabel': 'วิธีคำนวณเวลาวิ่ง',
'tours.run.paceInfo': 'เพซของคุณเองต่อกิโลเมตร เวลาวิ่งคือระยะทาง × เพซ ไม่รวมทางขึ้น ทางลง และความยากทางเทคนิค',
'tours.run.paceUnit': 'นาที/km',
'tours.run.paceInvalid': 'ใส่เพซในรูปแบบ นาที:วินาที ต่อ km ตั้งแต่ {fastest} ถึง {slowest}',
'tours.run.paceNeeded': 'ใส่เพซของคุณเพื่อวางแผนเวลาวิ่งและบันทึกการวิ่งนี้',
'tours.run.timeEstimated': 'เวลาวิ่ง (ตามแผน)',
+1 -1
View File
@@ -20,7 +20,7 @@ const tokens = (value: string) => [...value.matchAll(/\{[^{}]+\}/g)].map((match)
// placeholder spec; here only the general keys are.
const groups = pluralGroups(Object.keys(english));
const generalKeys = (keys: string[]) => keys.filter((key) => !pluralFormOf(key, groups));
const GENERAL_KEY_COUNT = 848;
const GENERAL_KEY_COUNT = 849;
function literalKeys(source: string): string[] {
const tree = ts.createSourceFile('locale.ts', source, ts.ScriptTarget.Latest, true);
+1
View File
@@ -416,6 +416,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Koşu süresi nasıl hesaplanır',
'tours.run.paceInfo':
'Kilometre başına kendi tempon. Koşu süresi mesafe × tempodur; tırmanışlar, inişler ve teknik zorluk hesaba katılmaz.',
'tours.run.paceUnit': 'dk/km',
'tours.run.paceInvalid': 'Tempoyu km başına dk:sn olarak, {fastest} ile {slowest} arasında gir.',
'tours.run.paceNeeded': 'Koşu süresini planlamak ve bu koşuyu kaydetmek için temponu gir.',
'tours.run.timeEstimated': 'Koşu süresi (planlanan)',
+1
View File
@@ -430,6 +430,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Як рахується час бігу',
'tours.run.paceInfo':
'Ваш власний темп на кілометр. Час бігу дорівнює відстані × темп; набір висоти й технічна складність не враховуються.',
'tours.run.paceUnit': 'хв/км',
'tours.run.paceInvalid': 'Введіть темп як хв:с на км, від {fastest} до {slowest}.',
'tours.run.paceNeeded': 'Введіть свій темп, щоб розрахувати час бігу й зберегти цю пробіжку.',
'tours.run.timeEstimated': 'Час бігу (план)',
+1
View File
@@ -414,6 +414,7 @@ const tours: TranslationStrings = {
'tours.run.paceInfoLabel': 'Cách tính thời gian chạy',
'tours.run.paceInfo':
'Nhịp chạy của riêng bạn trên mỗi kilômét. Thời gian chạy là quãng đường × nhịp chạy; độ dốc lên xuống và độ khó kỹ thuật không được tính.',
'tours.run.paceUnit': 'phút/km',
'tours.run.paceInvalid': 'Nhập nhịp chạy dạng phút:giây mỗi km, từ {fastest} đến {slowest}.',
'tours.run.paceNeeded': 'Nhập nhịp chạy của bạn để lên kế hoạch thời gian chạy và lưu buổi chạy này.',
'tours.run.timeEstimated': 'Thời gian chạy (dự kiến)',
+1
View File
@@ -376,6 +376,7 @@ const tours: TranslationStrings = {
'tours.run.pace': '計畫配速',
'tours.run.paceInfoLabel': '跑步時間如何計算',
'tours.run.paceInfo': '你自己的每公里配速。跑步時間等於距離 × 配速;爬升、下降與技術難度不計入。',
'tours.run.paceUnit': '分/公里',
'tours.run.paceInvalid': '請以每公里 分:秒 輸入配速,範圍 {fastest} 至 {slowest}。',
'tours.run.paceNeeded': '輸入你的配速,以規劃跑步時間並儲存這次跑步。',
'tours.run.timeEstimated': '跑步時間(計畫)',
+1
View File
@@ -377,6 +377,7 @@ const tours: TranslationStrings = {
'tours.run.pace': '计划配速',
'tours.run.paceInfoLabel': '跑步时间如何计算',
'tours.run.paceInfo': '你自己的每公里配速。跑步时间等于距离 × 配速;爬升、下降和技术难度不计入。',
'tours.run.paceUnit': '分/公里',
'tours.run.paceInvalid': '请按每公里 分:秒 输入配速,范围 {fastest} 至 {slowest}。',
'tours.run.paceNeeded': '输入你的配速,以计划跑步时间并保存这次跑步。',
'tours.run.timeEstimated': '跑步时间(计划)',