Skip to content

Commit

Permalink
add translations for new tempo slider
Browse files Browse the repository at this point in the history
  • Loading branch information
waozixyz committed Jul 22, 2024
1 parent 81eacfa commit a78112e
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 15 deletions.
8 changes: 7 additions & 1 deletion lib/i18n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@

"sessions": "Sitzungen",
"graph": "Grafik",
"breath_hold": "Atem anhalten"
"breath_hold": "Atem anhalten",

"breathing_tempo_label": "Atemrhythmus (Sekunden pro Atemzug)",
"tempo_very_fast": "Sehr Schnell",
"tempo_fast": "Schnell",
"tempo_medium": "Mittel",
"tempo_slow": "Langsam"

}
7 changes: 6 additions & 1 deletion lib/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@

"sessions": "Sessions",
"graph": "Graph",
"breath_hold": "Breath hold"
"breath_hold": "Breath hold",

"breathing_tempo_label": "Breathing Tempo (Seconds per Breath)",
"tempo_very_fast": "Very Fast",
"tempo_fast": "Fast",
"tempo_medium": "Medium",
"tempo_slow": "Slow"
}

8 changes: 7 additions & 1 deletion lib/i18n/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@

"sessions": "Sesiones",
"graph": "Gráfica",
"breath_hold": "Retención de la respiración"
"breath_hold": "Retención de la respiración",

"breathing_tempo_label": "Ritmo de Respiración (Segundos por Respiración)",
"tempo_very_fast": "Muy Rápido",
"tempo_fast": "Rápido",
"tempo_medium": "Medio",
"tempo_slow": "Lento"

}
8 changes: 7 additions & 1 deletion lib/i18n/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@

"sessions": "Sessions",
"graph": "Graph",
"breath_hold": "Breath hold"
"breath_hold": "Breath hold",

"breathing_tempo_label": "Rythme Respiratoire (Secondes par Respiration)",
"tempo_very_fast": "Très Rapide",
"tempo_fast": "Rapide",
"tempo_medium": "Moyen",
"tempo_slow": "Lent"

}
8 changes: 7 additions & 1 deletion lib/i18n/id_ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@

"sessions": "Sesi",
"graph": "Grafik",
"breath_hold": "Tahan napas"
"breath_hold": "Tahan napas",

"breathing_tempo_label": "Tempo Pernapasan (Detik per Napas)",
"tempo_very_fast": "Sangat Cepat",
"tempo_fast": "Cepat",
"tempo_medium": "Sedang",
"tempo_slow": "Lambat"

}

8 changes: 7 additions & 1 deletion lib/i18n/it_IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@

"sessions": "Sessioni",
"graph": "Grafico",
"breath_hold": "Trattenimento del respiro"
"breath_hold": "Trattenimento del respiro",

"breathing_tempo_label": "Ritmo Respiratorio (Secondi per Respiro)",
"tempo_very_fast": "Molto Veloce",
"tempo_fast": "Veloce",
"tempo_medium": "Medio",
"tempo_slow": "Lento"

}

9 changes: 8 additions & 1 deletion lib/i18n/ru_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@

"sessions": "Сессии",
"graph": "График",
"breath_hold": "Задержка дыхания"
"breath_hold": "Задержка дыхания",


"breathing_tempo_label": "Темп Дыхания (Секунд на Вдох)",
"tempo_very_fast": "Очень Быстро",
"tempo_fast": "Быстро",
"tempo_medium": "Средне",
"tempo_slow": "Медленно"

}

8 changes: 7 additions & 1 deletion lib/i18n/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,11 @@

"sessions": "练习次数",
"graph": "图表",
"breath_hold": "屏息时间"
"breath_hold": "屏息时间",

"breathing_tempo_label": "呼吸节奏(每次呼吸的秒数)",
"tempo_very_fast": "非常快",
"tempo_fast": "",
"tempo_medium": "中等",
"tempo_slow": ""
}
13 changes: 6 additions & 7 deletions lib/widgets/breathing_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,11 @@ class BreathingConfigurationState extends State<BreathingConfiguration> {
});
_updateUser();
}

String _getTempoLabel(double seconds) {
if (seconds < 1) return 'Very Fast';
if (seconds < 1.5) return 'Fast';
if (seconds < 2) return 'Medium';
return 'Slow';
if (seconds < 1) return 'tempo_very_fast'.i18n();
if (seconds < 1.5) return 'tempo_fast'.i18n();
if (seconds < 2) return 'tempo_medium'.i18n();
return 'tempo_slow'.i18n();
}

@override
Expand All @@ -90,7 +89,7 @@ class BreathingConfigurationState extends State<BreathingConfiguration> {
),
SizedBox(height: 90),
Text(
'Breathing Tempo (Seconds per Breath)',
'breathing_tempo_label'.i18n(),
style: TextStyle(
fontSize: 22.0,
fontWeight: FontWeight.bold,
Expand All @@ -99,7 +98,7 @@ class BreathingConfigurationState extends State<BreathingConfiguration> {
Slider(
min: 0.5,
max: 3.0,
divisions: 25, // This gives steps of 0.1 seconds
divisions: 25,
value: secondsPerBreath,
label: '${secondsPerBreath.toStringAsFixed(1)}s (${_getTempoLabel(secondsPerBreath)})',
onChanged: (value) {
Expand Down

0 comments on commit a78112e

Please sign in to comment.