diff --git a/wger/core/management/commands/extract-i18n.py b/wger/core/management/commands/extract-i18n.py index c3e1d3017..bd46424e0 100644 --- a/wger/core/management/commands/extract-i18n.py +++ b/wger/core/management/commands/extract-i18n.py @@ -114,8 +114,11 @@ def cleanup_name(text: str) -> str: /// in English and need to be translated here in the application (there are /// probably better ways to do this, but that's the way it is right now). + import 'dart:developer'; + import 'package:flutter/widgets.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + import 'package:logging/logging.dart'; String getTranslation(String value, BuildContext context) { switch (value) {''' @@ -127,8 +130,10 @@ def cleanup_name(text: str) -> str: out += ''' default: - throw FormatException('Could not translate the server string $value'); - }}''' + log('Could not translate the server string $value', level: Level.WARNING.value); + return value; + } + }''' f.write(out) self.stdout.write(self.style.SUCCESS('Wrote content to wger/i18n.dart'))