Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Mark strings with _() format to indicate need for translation

koenbfa565d643680
diff --git a/wger/nutrition/forms.py b/wger/nutrition/forms.py
index aac1e42dd..71a84068e 100644
--- a/wger/nutrition/forms.py
+++ b/wger/nutrition/forms.py
@@ -111,8 +111,8 @@ class BmiForm(forms.ModelForm):
super(BmiForm, self).__init__(*args, **kwargs)
if 'initial' in kwargs: #if the form is rendering for the first time
- self['height'].label = 'Height (cm)' if kwargs['initial']['use_metric'] else 'Height (in)'
- self['weight'].label = 'Weight (kg)' if kwargs['initial']['use_metric'] else 'Weight (lbs)'
+ self['height'].label = _('Height (cm)') if kwargs['initial']['use_metric'] else _('Height (in)')
+ self['weight'].label = _('Weight (kg)') if kwargs['initial']['use_metric'] else _('Weight (lbs)')
self.helper = FormHelper()
self.helper.form_action = reverse('nutrition:bmi:calculate')
diff --git a/wger/nutrition/views/bmi.py b/wger/nutrition/views/bmi.py
index 3c9a8d2f7..bd5ff9ce3 100644
--- a/wger/nutrition/views/bmi.py
+++ b/wger/nutrition/views/bmi.py
@@ -87,12 +87,12 @@ def calculate(request):
response = HttpResponse(data, 'application/json')
else:
help_message = {
- 'error': 'Please make sure your height is within the appropriate range.',
+ _('error'): _('Please make sure your height is within the appropriate range.'),
}
if request.user.userprofile.use_metric:
- help_message['cm_range'] = '140 to 230'
+ help_message['cm_range'] = _('140 to 230')
else:
- help_message['in_range'] = '56 to 90'
+ help_message['in_range'] = _('56 to 90')
data = json.dumps(help_message)
response = HttpResponse(data, 'application/json')
response.status_code = 406