Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Refactor the i18n message extract command

Roland Geiderb40363ee24d7
diff --git a/wger/core/management/commands/extract-i18n.py b/wger/core/management/commands/extract-i18n.py
index 52a153c43..157c96a58 100644
--- a/wger/core/management/commands/extract-i18n.py
+++ b/wger/core/management/commands/extract-i18n.py
@@ -33,22 +33,14 @@ class Command(BaseCommand):
def handle(self, *args, **options):
- # Exercise categories
- for category in ExerciseCategory.objects.all():
+ # Collect all translatable items
+ out = []
+ out += [i for i in ExerciseCategory.objects.all()]
+ out += [i for i in Equipment.objects.all()]
+ out += [i for i in Muscle.objects.all()]
+ out += [i for i in SettingUnit.objects.all()]
+
+ # Print the result
+ for i in out:
self.stdout.write('msgid "{0}"\n'
- 'msgstr ""\n\n'.format(category))
-
- # Equipment names
- for equipment in Equipment.objects.all():
- self.stdout.write('msgid "{0}"\n'
- 'msgstr ""\n\n'.format(equipment))
-
- # Muscles
- for muscle in Muscle.objects.all():
- self.stdout.write('msgid "{0}"\n'
- 'msgstr ""\n\n'.format(muscle))
-
- # Setting units
- for unit in SettingUnit.objects.all():
- self.stdout.write('msgid "{0}"\n'
- 'msgstr ""\n\n'.format(unit))
+ 'msgstr ""\n\n'.format(i))