Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Tranlate occurences of 'kcal' and 'g'

Roland Geider38711ecd3e21
diff --git a/wger/core/templates/index.html b/wger/core/templates/index.html
index 0e0dc5dab..a06a65a8e 100644
--- a/wger/core/templates/index.html
+++ b/wger/core/templates/index.html
@@ -108,16 +108,16 @@ day in your current workout:{% endblocktrans %} <strong>{{current_workout}}</str
– {{ plan.creation_date }}
<ul>
<li>
- {% trans "Energy" %}: {{nutritional_info.total.energy|floatformat}} kcal
+ {% trans "Energy" %}: {{nutritional_info.total.energy|floatformat}} {% trans "kcal" %}
</li>
<li>
- {% trans "Protein" %}: {{nutritional_info.total.protein|floatformat}} g
+ {% trans "Protein" %}: {{nutritional_info.total.protein|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}
</li>
<li>
- {% trans "Carbohydrates" %}: {{nutritional_info.total.carbohydrates|floatformat}} g
+ {% trans "Carbohydrates" %}: {{nutritional_info.total.carbohydrates|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}
</li>
<li>
- {% trans "Fat" %}: {{nutritional_info.total.fat|floatformat}} g
+ {% trans "Fat" %}: {{nutritional_info.total.fat|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}
</li>
</ul>
@@ -130,7 +130,7 @@ day in your current workout:{% endblocktrans %} <strong>{{current_workout}}</str
{% endif %}
{% if weight %}
<p>
- {% trans "Your current weight is: "%} <strong>{{weight.weight|floatformat}} kg.</strong>
+ {% trans "Your current weight is: "%} <strong>{{weight.weight|floatformat}} {% trans "kg" %}</strong>
</p>
{% endif %}
</div>
diff --git a/wger/core/templates/mobile/index.html b/wger/core/templates/mobile/index.html
index 81a0c01ce..1a4ab7e96 100644
--- a/wger/core/templates/mobile/index.html
+++ b/wger/core/templates/mobile/index.html
@@ -56,22 +56,22 @@
{% if plan %}
<ul class="list-group">
<li class="list-group-item">
- {% trans "Energy" %}: {{nutritional_info.total.energy|floatformat}} kcal
+ {% trans "Energy" %}: {{nutritional_info.total.energy|floatformat}} {% trans "kcal" %}
</li>
<li class="list-group-item">
- {% trans "Protein" %}: {{nutritional_info.total.protein|floatformat}} g
+ {% trans "Protein" %}: {{nutritional_info.total.protein|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}
</li>
<li class="list-group-item">
- {% trans "Carbohydrates" %}: {{nutritional_info.total.carbohydrates|floatformat}} g
+ {% trans "Carbohydrates" %}: {{nutritional_info.total.carbohydrates|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}
</li>
<li class="list-group-item">
- {% trans "Fat" %}: {{nutritional_info.total.fat|floatformat}} g
+ {% trans "Fat" %}: {{nutritional_info.total.fat|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}
</li>
</ul>
{% if weight %}
<p>
- {% trans "Your current weight is: "%} <strong>{{weight.weight|floatformat}} kg.</strong>
+ {% trans "Your current weight is: "%} <strong>{{weight.weight|floatformat}} {% trans "kg" %}</strong>
</p>
{% endif %}
diff --git a/wger/core/templates/user/overview.html b/wger/core/templates/user/overview.html
index 891864acf..04a7d1d47 100644
--- a/wger/core/templates/user/overview.html
+++ b/wger/core/templates/user/overview.html
@@ -152,16 +152,16 @@
<a href="{{trainer_login}}?next={% url 'nutrition:plan:view' nutrition_plan.id %}">{{nutrition_plan.description}}</a>
</td>
<td>
- {{nutrition_plan.get_nutritional_values.total.energy|floatformat}}kcal
+ {{nutrition_plan.get_nutritional_values.total.energy|floatformat}} {% trans "kcal" %}
</td>
<td>
- {{nutrition_plan.get_nutritional_values.total.protein|floatformat}}g
+ {{nutrition_plan.get_nutritional_values.total.protein|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}
</td>
<td>
- {{nutrition_plan.get_nutritional_values.total.carbohydrates|floatformat}}g
+ {{nutrition_plan.get_nutritional_values.total.carbohydrates|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}
</td>
<td>
- {{nutrition_plan.get_nutritional_values.total.fat|floatformat}}g
+ {{nutrition_plan.get_nutritional_values.total.fat|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}
</td>
</tr>
{% endfor %}
diff --git a/wger/nutrition/templates/ingredient/view.html b/wger/nutrition/templates/ingredient/view.html
index e1ed0035d..89cb2bc42 100644
--- a/wger/nutrition/templates/ingredient/view.html
+++ b/wger/nutrition/templates/ingredient/view.html
@@ -93,26 +93,26 @@ the search.{% endblocktrans %}
<tr>
<td style="width:80%;">{% trans "Energy" %}</td>
<td itemprop="calories">
- <span id="value-energy">{{ingredient.energy}}</span> kcal
+ <span id="value-energy">{{ingredient.energy}}</span> {% trans "kcal" %}
</td>
</tr>
<tr>
<td>{% trans "Protein" %}</td>
<td itemprop="proteinContent">
- <span id="value-protein">{{ingredient.protein}}</span> g
+ <span id="value-protein">{{ingredient.protein}}</span> {% trans "g" context "weight unit, i.e. grams" %}
</td>
</tr>
<tr>
<td>{% trans "Carbohydrates" %}</td>
<td itemprop="carbohydrateContent">
- <span id="value-carbohydrates">{{ingredient.carbohydrates}}</span> g
+ <span id="value-carbohydrates">{{ingredient.carbohydrates}}</span> {% trans "g" context "weight unit, i.e. grams" %}
</td>
</tr>
<tr>
<td style="padding-left: 3em;">{% trans "Sugar content in carbohydrates" %}</td>
<td itemprop="sugarContent">
{% if ingredient.carbohydrates_sugar %}
- <span id="value-carbohydrates-sugar">{{ingredient.carbohydrates_sugar}}</span> g
+ <span id="value-carbohydrates-sugar">{{ingredient.carbohydrates_sugar}}</span> {% trans "g" context "weight unit, i.e. grams" %}
{% else %}
{% trans "n.A." %}
{% endif %}
@@ -121,14 +121,14 @@ the search.{% endblocktrans %}
<tr>
<td>{% trans "Fat" %}</td>
<td itemprop="fatContent">
- <span id="value-fat">{{ingredient.fat}}</span> g
+ <span id="value-fat">{{ingredient.fat}}</span> {% trans "g" context "weight unit, i.e. grams" %}
</td>
</tr>
<tr>
<td style="padding-left: 3em;">{% trans "Saturated fat content in fats" %}</td>
<td itemprop="saturatedFatContent">
{% if ingredient.fat_saturated %}
- <span id="value-fat-saturated">{{ingredient.fat_saturated}}</span> g
+ <span id="value-fat-saturated">{{ingredient.fat_saturated}}</span> {% trans "g" context "weight unit, i.e. grams" %}
{% else %}
{% trans "n.A." %}
{% endif %}
@@ -150,7 +150,7 @@ the search.{% endblocktrans %}
<td style="width:80%;">{% trans "Fibres" %}</td>
<td itemprop="fiberContent" id="value-fibres">
{% if ingredient.fibres %}
- <span id="value-fibres">{{ingredient.fibres}}</span> g
+ <span id="value-fibres">{{ingredient.fibres}}</span> {% trans "g" context "weight unit, i.e. grams" %}
{% else %}
{% trans "n.A." %}
{% endif %}
@@ -160,7 +160,7 @@ the search.{% endblocktrans %}
<td>{% trans "Sodium" %}</td>
<td itemprop="sodiumContent" id="value-sodium">
{% if ingredient.sodium %}
- <span id="value-fibres">{{ingredient.sodium}}</span> g
+ <span id="value-fibres">{{ingredient.sodium}}</span> {% trans "g" context "weight unit, i.e. grams" %}
{% else %}
{% trans "n.A." %}
{% endif %}
diff --git a/wger/nutrition/templates/mobile/plan/overview.html b/wger/nutrition/templates/mobile/plan/overview.html
index 3f9de6b7d..8a1c20cc0 100644
--- a/wger/nutrition/templates/mobile/plan/overview.html
+++ b/wger/nutrition/templates/mobile/plan/overview.html
@@ -13,7 +13,7 @@
<h3 class="list-group-item-heading">{{plan}}</h3>
<p class="list-group-item-text">
{{ plan.creation_date }} –
- {{ plan.get_nutritional_values.total.energy|floatformat }} kcal
+ {{ plan.get_nutritional_values.total.energy|floatformat }} {% trans "kcal" %}
</p>
</a>
{% empty %}
diff --git a/wger/nutrition/templates/mobile/plan/view.html b/wger/nutrition/templates/mobile/plan/view.html
index 6214afa60..a47b24743 100644
--- a/wger/nutrition/templates/mobile/plan/view.html
+++ b/wger/nutrition/templates/mobile/plan/view.html
@@ -102,19 +102,19 @@ $(document).ready(function() {
<tbody>
<tr>
<td>{% trans "Energy" %}</td>
- <td class="align-right">{{item.get_nutritional_values.energy|floatformat}} kcal</td>
+ <td class="align-right">{{item.get_nutritional_values.energy|floatformat}} {% trans "kcal" %}</td>
</tr>
<tr>
<td>{% trans "Protein" %}</td>
- <td class="align-right">{{item.get_nutritional_values.protein|floatformat}} g</td>
+ <td class="align-right">{{item.get_nutritional_values.protein|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
</tr>
<tr>
<td>{% trans "Carbohydrates" %}</td>
- <td class="align-right">{{item.get_nutritional_values.carbohydrates|floatformat}} g</td>
+ <td class="align-right">{{item.get_nutritional_values.carbohydrates|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
</tr>
<tr>
<td>{% trans "Fat" %}</td>
- <td class="align-right">{{item.get_nutritional_values.fat|floatformat}} g</td>
+ <td class="align-right">{{item.get_nutritional_values.fat|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
</tr>
</tbody>
</table>
@@ -229,7 +229,7 @@ $(document).ready(function() {
<thead>
<tr>
<th>{% trans "Energy" %}</th>
- <th class="align-right">{{nutritional_data.total.energy|floatformat:"0"}} kcal</th>
+ <th class="align-right">{{nutritional_data.total.energy|floatformat:"0"}} {% trans "kcal" %}</th>
</tr>
</thead>
<tbody>
@@ -238,7 +238,7 @@ $(document).ready(function() {
<tr style="background-color:{% if total == 1 %}#8ae234;{% elif total == 2 %}#fce94f;{% elif total == 3 %}#fcaf3e;{% elif total > 3 %}#ef2929;{% endif %}">
<td>{% trans "Goal" %}</td>
<td class="align-right">
- <strong>{{user.userprofile.calories|floatformat:"0"}} kcal</strong>
+ <strong>{{user.userprofile.calories|floatformat:"0"}} {% trans "kcal" %}</strong>
</td>
</tr>
{% endwith %}
@@ -267,37 +267,37 @@ $(document).ready(function() {
<tbody>
<tr>
<td>{% trans "Energy" %}</td>
- <td class="align-right">{{nutritional_data.total.energy|floatformat}} kcal</td>
+ <td class="align-right">{{nutritional_data.total.energy|floatformat}} {% trans "kcal" %}</td>
<td></td>
<td></td>
</tr>
<tr>
<td>{% trans "Protein" %}</td>
- <td class="align-right">{{nutritional_data.total.protein|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.protein|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td class="align-right">{{nutritional_data.percent.protein|floatformat}} %</td>
<td class="align-right">{{nutritional_data.per_kg.protein|floatformat}}</td>
</tr>
<tr>
<td>{% trans "Carbohydrates" %}</td>
- <td class="align-right">{{nutritional_data.total.carbohydrates|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.carbohydrates|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td class="align-right">{{nutritional_data.percent.carbohydrates|floatformat}} %</td>
<td class="align-right">{{nutritional_data.per_kg.carbohydrates|floatformat}}</td>
</tr>
<tr>
<td style="padding-left: 2em;">{% trans "Sugar content in carbohydrates" %}</td>
- <td class="align-right">{{nutritional_data.total.carbohydrates_sugar|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.carbohydrates_sugar|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td></td>
<td></td>
</tr>
<tr>
<td>{% trans "Fat" %}</td>
- <td class="align-right">{{nutritional_data.total.fat|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.fat|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td class="align-right">{{nutritional_data.percent.fat|floatformat}} %</td>
<td class="align-right">{{nutritional_data.per_kg.fat|floatformat}}</td>
</tr>
<tr>
<td style="padding-left: 2em;">{% trans "Saturated fat content in fats" %}</td>
- <td class="align-right">{{nutritional_data.total.fat_saturated|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.fat_saturated|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td></td>
<td></td>
</tr>
@@ -308,13 +308,13 @@ $(document).ready(function() {
</tr>
<tr>
<td>{% trans "Fibres" %}</td>
- <td class="align-right">{{nutritional_data.total.fibres|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.fibres|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td></td>
<td></td>
</tr>
<tr>
<td>{% trans "Sodium" %}</td>
- <td class="align-right">{{nutritional_data.total.sodium|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.sodium|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td></td>
<td></td>
</tr>
diff --git a/wger/nutrition/templates/plan/overview.html b/wger/nutrition/templates/plan/overview.html
index 513581511..8b29bace4 100644
--- a/wger/nutrition/templates/plan/overview.html
+++ b/wger/nutrition/templates/plan/overview.html
@@ -31,7 +31,7 @@
{{ plan.creation_date }}
</td>
<td>
- {{ plan.get_nutritional_values.total.energy|floatformat }} kcal
+ {{ plan.get_nutritional_values.total.energy|floatformat }} {% trans "kcal" %}
</td>
</tr>
{% endfor %}
diff --git a/wger/nutrition/templates/plan/view.html b/wger/nutrition/templates/plan/view.html
index f3ad09600..9ed53ee53 100644
--- a/wger/nutrition/templates/plan/view.html
+++ b/wger/nutrition/templates/plan/view.html
@@ -166,37 +166,37 @@ function custom_modal_init()
<tbody>
<tr>
<td>{% trans "Energy" %}</td>
- <td class="align-right">{{nutritional_data.total.energy|floatformat}} kcal</td>
+ <td class="align-right">{{nutritional_data.total.energy|floatformat}} {% trans "kcal" %}</td>
<td></td>
<td></td>
</tr>
<tr>
<td>{% trans "Protein" %}</td>
- <td class="align-right">{{nutritional_data.total.protein|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.protein|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td class="align-right">{{nutritional_data.percent.protein|floatformat}} %</td>
<td class="align-right">{{nutritional_data.per_kg.protein|floatformat}}</td>
</tr>
<tr>
<td>{% trans "Carbohydrates" %}</td>
- <td class="align-right">{{nutritional_data.total.carbohydrates|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.carbohydrates|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td class="align-right">{{nutritional_data.percent.carbohydrates|floatformat}} %</td>
<td class="align-right">{{nutritional_data.per_kg.carbohydrates|floatformat}}</td>
</tr>
<tr>
<td style="padding-left: 2em;">{% trans "Sugar content in carbohydrates" %}</td>
- <td class="align-right">{{nutritional_data.total.carbohydrates_sugar|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.carbohydrates_sugar|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td></td>
<td></td>
</tr>
<tr>
<td>{% trans "Fat" %}</td>
- <td class="align-right">{{nutritional_data.total.fat|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.fat|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td class="align-right">{{nutritional_data.percent.fat|floatformat}} %</td>
<td class="align-right">{{nutritional_data.per_kg.fat|floatformat}}</td>
</tr>
<tr>
<td style="padding-left: 2em;">{% trans "Saturated fat content in fats" %}</td>
- <td class="align-right">{{nutritional_data.total.fat_saturated|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.fat_saturated|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td></td>
<td></td>
</tr>
@@ -207,13 +207,13 @@ function custom_modal_init()
</tr>
<tr>
<td>{% trans "Fibres" %}</td>
- <td class="align-right">{{nutritional_data.total.fibres|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.fibres|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td></td>
<td></td>
</tr>
<tr>
<td>{% trans "Sodium" %}</td>
- <td class="align-right">{{nutritional_data.total.sodium|floatformat}} g</td>
+ <td class="align-right">{{nutritional_data.total.sodium|floatformat}} {% trans "g" context "weight unit, i.e. grams" %}</td>
<td></td>
<td></td>
</tr>
@@ -229,7 +229,7 @@ function custom_modal_init()
<thead>
<tr>
<th>{% trans "Energy" %}</th>
- <th class="align-right">{{nutritional_data.total.energy|floatformat}} kcal</th>
+ <th class="align-right">{{nutritional_data.total.energy|floatformat}} {% trans "kcal" %}</th>
</tr>
</thead>
<tbody>
@@ -239,7 +239,7 @@ function custom_modal_init()
<tr style="background-color:{% if total == 1 %}#8ae234;{% elif total == 2 %}#fce94f;{% elif total == 3 %}#fcaf3e;{% elif total > 3 %}#ef2929;{% endif %}">
<td>{% trans "Goal" %}</td>
<td class="align-right">
- <strong>{{user.userprofile.calories}} kcal</strong></td>
+ <strong>{{user.userprofile.calories}} {% trans "kcal" %}</strong></td>
</tr>
{% endwith %}
{% endif %}