Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Rename translation helper

Roland Geideracb8ffaafdf1
diff --git a/wger/core/management/commands/extract-i18n.py b/wger/core/management/commands/extract-i18n.py
index fcaac296d..968c83eda 100644
--- a/wger/core/management/commands/extract-i18n.py
+++ b/wger/core/management/commands/extract-i18n.py
@@ -117,20 +117,19 @@ class Command(BaseCommand):
/// 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:wger/l10n/generated/app_localizations.dart';
import 'package:logging/logging.dart';
+ import 'package:wger/l10n/generated/app_localizations.dart';
- String getTranslation(String value, BuildContext context) {
- final logger = Logger('getTranslation');
+ String getServerStringTranslation(String value, BuildContext context) {
+ final logger = Logger('getServerStringTranslation');
+ final i18n = AppLocalizations.of(context);
switch (value) {"""
for i in data:
out += f"""
case '{i}':
- return AppLocalizations.of(context).{cleanup_name(i.__str__())};
+ return i18n.{cleanup_name(i.__str__())};
"""
out += """