Skip to content

Commit

Permalink
Fixed some translations and minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersSeverinsen committed Jul 27, 2024
1 parent 0f62e79 commit 7aae055
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 108 deletions.
31 changes: 12 additions & 19 deletions items/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.0.6 on 2020-10-06 13:45
# Generated by Django 3.2.4 on 2024-07-27 17:32

import django.db.models.deletion
import django.utils.timezone
Expand All @@ -25,6 +25,7 @@ class Migration(migrations.Migration):
),
),
("name", models.CharField(max_length=140)),
("name_dk", models.CharField(blank=True, max_length=140, null=True)),
("description", models.TextField(blank=True)),
("link", models.CharField(blank=True, max_length=255)),
],
Expand Down Expand Up @@ -77,27 +78,19 @@ class Migration(migrations.Migration):
),
),
("name", models.CharField(max_length=140)),
("name_dk", models.CharField(blank=True, max_length=140, null=True)),
("description", models.TextField(blank=True)),
("country", models.CharField(blank=True, max_length=140)),
("priceInDKK", models.DecimalField(decimal_places=2, max_digits=11)),
("priceInDKK", models.DecimalField(decimal_places=0, max_digits=11)),
("abv", models.FloatField(blank=True, null=True)),
("container", models.CharField(blank=True, max_length=140, null=True)),
(
"container",
models.CharField(
blank=True,
choices=[
("DRAFT", "Fad"),
("BOTTLE", "Flaske"),
("SHOT", "Shot"),
("FOOD", "Madvare"),
("OTHER", "Andet"),
],
max_length=140,
),
"container_dk",
models.CharField(blank=True, max_length=140, null=True),
),
("volumeInCentiliters", models.IntegerField(blank=True, null=True)),
("inStock", models.BooleanField(default=True)),
("imageUrl", models.CharField(blank=True, max_length=255)),
("image", models.ImageField(blank=True, null=True, upload_to="items")),
(
"barcode",
models.CharField(
Expand All @@ -113,7 +106,7 @@ class Migration(migrations.Migration):
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="items.Brewery",
to="items.brewery",
),
),
(
Expand All @@ -122,7 +115,7 @@ class Migration(migrations.Migration):
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="items.BeerType",
to="items.beertype",
),
),
],
Expand All @@ -148,15 +141,15 @@ class Migration(migrations.Migration):
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="entries",
to="items.Item",
to="items.item",
),
),
(
"snapshot",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="entries",
to="items.InventorySnapshot",
to="items.inventorysnapshot",
),
),
],
Expand Down
42 changes: 0 additions & 42 deletions items/migrations/0002_auto_20240727_0123.py

This file was deleted.

6 changes: 3 additions & 3 deletions items/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class Item(models.Model):
name_dk = models.CharField(max_length=140, null=True, blank=True)
description = models.TextField(blank=True)
country = models.CharField(blank=True, max_length=140)
priceInDKK = models.DecimalField(max_digits=9 + 2, decimal_places=2)
priceInDKK = models.DecimalField(max_digits=9 + 2, decimal_places=0)
abv = models.FloatField(null=True, blank=True)
container = models.CharField(blank=True, max_length=140)
container_dk = models.CharField(blank=True, max_length=140)
container = models.CharField(null=True, blank=True, max_length=140)
container_dk = models.CharField(null=True, blank=True, max_length=140)
volumeInCentiliters = models.IntegerField(null=True, blank=True)
inStock = models.BooleanField(default=True)
image = models.ImageField(upload_to="items", blank=True, null=True)
Expand Down
14 changes: 12 additions & 2 deletions items/templates/items.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@

{% load static %}
{% load i18n %}

<p>
{% blocktrans %}
Her kan du se Fredagscaféens faste sortiment, og mange af de ting vi er kendte for at sælge.
Men derudover finder du altid et stort sortiment af spændende og nye specialøl, for enhver smag, i baren.
Vi har i Fredagscaféen et stort fokus på at have noget for alle, så derfor finder du også flere
glutenfrie og alkoholfrie øl.
{% endblocktrans %}
</p>

<div class="row" id="sortiment-row">
<div class="col-sm-6">
<h2>
{% translate "Standardsortiment" %}
{% translate "Fast sortiment" %}
{% if items_data %}
<div id="sortiment-count">
({{ items_data | length }})
Expand Down Expand Up @@ -52,7 +62,7 @@ <h2>
<tr class="{% if not item.inStock %}danger{% endif %}">
<td>{% if item.brewery_url %}<a href="{{ item.brewery_url }}" target="_blank">{% endif %}{{ item.brewery|default_if_none:"" }}{% if item.brewery_url %} <span class="glyphicon glyphicon-new-window"></span></a>{% endif %}</td>
<td>{% if LANGUAGE_CODE == 'da' %}{{ item.name_dk|default_if_none:item.name }}{% else %}{{ item.name|default_if_none:"" }}{% endif %}</td>
<td class="hidden-xs">{% if LANGUAGE_CODE == 'da' %}{{ item.type.name_dk|default_if_none:item.type }}{% else %}{{ item.type|default_if_none:"" }}{% endif %}</td>
<td class="hidden-xs">{% if LANGUAGE_CODE == 'da' %}{{ item.type.name_dk|default_if_none:item.type.name }}{% else %}{{ item.type|default_if_none:"" }}{% endif %}</td>
<td class="hidden-xs">{% if LANGUAGE_CODE == 'da' %}{{ item.container_dk|default_if_none:item.container }}{% else %}{{ item.container|default_if_none:"" }}{% endif %}</td>
<td>{{ item.price|floatformat:-2 }},-</td>
<td class="hidden-xs">{% if item.inStock %}{% translate "På lager" %}{% else %}{% translate "Ikke på lager" %}{% endif %}</td>
Expand Down
47 changes: 30 additions & 17 deletions locale/da/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-27 01:21+0200\n"
"POT-Creation-Date: 2024-07-27 19:16+0200\n"
"PO-Revision-Date: 2024-07-27 00:47+0050\n"
"Last-Translator: <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -88,7 +88,7 @@ msgid "Result"
msgstr "Resultat"

#: bartab/templates/bartab/consumption.html:15 events/templates/events.html:69
#: items/templates/items.html:38
#: items/templates/items.html:48
msgid "Navn"
msgstr ""

Expand Down Expand Up @@ -170,7 +170,7 @@ msgid "Bartender's first shift"
msgstr "Bartenderens første vagt"

#: bartenders/templates/barplan.html:38 bartenders/templates/barplan.html:78
#: bartenders/templates/board.html:34 items/templates/items.html:67
#: bartenders/templates/board.html:34 items/templates/items.html:77
msgid "Edit"
msgstr "Rediger"

Expand Down Expand Up @@ -516,55 +516,68 @@ msgid ""
"virkeligheden fuldt ud."
msgstr ""

#: items/templates/items.html:10
msgid "Standardsortiment"
#: items/templates/items.html:9
msgid ""
"\n"
"\tHer kan du se Fredagscaféens faste sortiment, og mange af de ting vi er "
"kendte for at sælge. \n"
"\tMen derudover finder du altid et stort sortiment af spændende og nye "
"specialøl, for enhver smag, i baren. \n"
"\tVi har i Fredagscaféen et stort fokus på at have noget for alle, så derfor "
"finder du også flere \n"
"\tglutenfrie og alkoholfrie øl.\n"
"\t"
msgstr ""

#: items/templates/items.html:20
msgid "Fast sortiment"
msgstr ""

#: items/templates/items.html:21
#: items/templates/items.html:31
msgid "Søg"
msgstr ""

#: items/templates/items.html:27
#: items/templates/items.html:37
msgid "Vis kun ting på lager"
msgstr ""

#: items/templates/items.html:29
#: items/templates/items.html:39
msgid "Vis også ting ikke på lager"
msgstr ""

#: items/templates/items.html:37
#: items/templates/items.html:47
msgid "Bryghus"
msgstr ""

#: items/templates/items.html:39
#: items/templates/items.html:49
msgid "Type"
msgstr ""

#: items/templates/items.html:40
#: items/templates/items.html:50
msgid "Container"
msgstr "Beholder"

#: items/templates/items.html:41
#: items/templates/items.html:51
msgid "Pris"
msgstr ""

#: items/templates/items.html:42
#: items/templates/items.html:52
msgid "Status"
msgstr ""

#: items/templates/items.html:43
#: items/templates/items.html:53
msgid "Image"
msgstr "Billede"

#: items/templates/items.html:58
#: items/templates/items.html:68
msgid "På lager"
msgstr ""

#: items/templates/items.html:58
#: items/templates/items.html:68
msgid "Ikke på lager"
msgstr ""

#: items/templates/items.html:78
#: items/templates/items.html:88
msgid "Sortimentet er desværre tomt"
msgstr ""

Expand Down
Binary file modified locale/en/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 7aae055

Please sign in to comment.