Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization #214

Merged
merged 4 commits into from
Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions TEMPLATE.env
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ DJANGO_SECRET_KEY=random_string
# For better security, set this to your deployment's domain. Comma separated.
ALLOWED_HOSTS=*

# Localization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE=en-us

# Set to True (capitalized) if you want people to be able to sign up for your Shynet instance (not recommended)
ACCOUNT_SIGNUPS_ENABLED=False

Expand Down
29 changes: 29 additions & 0 deletions shynet/a17t/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-24 13:20+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: a17t/templates/a17t/includes/pagination.html:5
#: a17t/templates/a17t/includes/pagination.html:7
msgid "Previous"
msgstr "Zurück"

#: a17t/templates/a17t/includes/pagination.html:10
#: a17t/templates/a17t/includes/pagination.html:12
msgid "Next"
msgstr "Vor"
3 changes: 2 additions & 1 deletion shynet/a17t/templates/a17t/includes/label.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<label class="label" for="{{field.auto_id}}">{{ field.label }} {% if not field.field.required %}<span class="badge ~neutral">Optional</span>{% endif %}</label>
{% load i18n %}
<label class="label" for="{{field.auto_id}}">{% trans field.label %} {% if not field.field.required %}<span class="badge ~neutral">Optional</span>{% endif %}</label>
9 changes: 5 additions & 4 deletions shynet/a17t/templates/a17t/includes/pagination.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{% load i18n %}
<nav class="flex w-full flex-wrap items-center justify-between" role="navigation" aria-label="pagination">
<div class="w-full md:w-auto mb-2">
{% if page.has_previous %}
<a href="?page={{ page.previous_page_number }}&{{url_parameters}}" class="button field !low bg-neutral-000 w-auto mr-1">Previous</a>
<a href="?page={{ page.previous_page_number }}&{{url_parameters}}" class="button field !low bg-neutral-000 w-auto mr-1">{% trans 'Previous' %}</a>
{% else %}
<a class="button field !low bg-neutral-000 w-auto mr-1" disabled>Previous</a>
<a class="button field !low bg-neutral-000 w-auto mr-1" disabled>{% trans 'Previous' %}</a>
{% endif %}
{% if page.has_next %}
<a href="?page={{ page.next_page_number }}&{{url_parameters}}" class="button field !low bg-neutral-000 w-auto">Next</a>
<a href="?page={{ page.next_page_number }}&{{url_parameters}}" class="button field !low bg-neutral-000 w-auto">{% trans 'Next' %}</a>
{% else %}
<a class="button field !low bg-neutral-000 w-auto" disabled>Next</a>
<a class="button field !low bg-neutral-000 w-auto" disabled>{% trans 'Next' %}</a>
{% endif %}
</div>

Expand Down
118 changes: 118 additions & 0 deletions shynet/analytics/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-06-24 13:20+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: analytics/models.py:18
msgid "Service"
msgstr "Dienst"

#: analytics/models.py:24
msgid "Identifier"
msgstr "Kennung"

#: analytics/models.py:29
msgid "Start time"
msgstr "Startzeit"

#: analytics/models.py:32
msgid "Last seen"
msgstr "Zuletzt gesehen"

#: analytics/models.py:36
msgid "User agent"
msgstr ""

#: analytics/models.py:37
msgid "Browser"
msgstr ""

#: analytics/models.py:38
msgid "Device"
msgstr "Gerät"

#: analytics/models.py:42
msgid "Phone"
msgstr ""

#: analytics/models.py:43
msgid "Tablet"
msgstr ""

#: analytics/models.py:44
msgid "Desktop"
msgstr ""

#: analytics/models.py:45
msgid "Robot"
msgstr ""

#: analytics/models.py:46
msgid "Other"
msgstr "Andere"

#: analytics/models.py:49
msgid "Device type"
msgstr "Gerätetyp"

#: analytics/models.py:51
msgid "OS"
msgstr "Betriessystem"

#: analytics/models.py:52
msgid "IP"
msgstr ""

#: analytics/models.py:55
msgid "Asn"
msgstr ""

#: analytics/models.py:56
msgid "Country"
msgstr "Land"

#: analytics/models.py:57
msgid "Longitude"
msgstr "Längengrad"

#: analytics/models.py:58
msgid "Latitude"
msgstr "Breitengrad"

#: analytics/models.py:59
msgid "Time zone"
msgstr "Zeitzone"

#: analytics/models.py:61
msgid "Is bounce"
msgstr "Absprung"

#: analytics/models.py:64 analytics/models.py:100
msgid "Session"
msgstr "Sitzung"

#: analytics/models.py:65
msgid "Sessions"
msgstr "Sitzungen"

#: analytics/models.py:122
msgid "Hit"
msgstr "Besuch"

#: analytics/models.py:123
msgid "Hits"
msgstr "Besuche"
114 changes: 114 additions & 0 deletions shynet/analytics/migrations/0010_auto_20220624_0744.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Generated by Django 3.2.12 on 2022-06-24 11:44

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('core', '0009_auto_20220624_0744'),
('analytics', '0009_auto_20210329_1100'),
]

operations = [
migrations.AlterModelOptions(
name='hit',
options={'ordering': ['-start_time'], 'verbose_name': 'Hit', 'verbose_name_plural': 'Hits'},
),
migrations.AlterModelOptions(
name='session',
options={'ordering': ['-start_time'], 'verbose_name': 'Session', 'verbose_name_plural': 'Sessions'},
),
migrations.AlterField(
model_name='hit',
name='id',
field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='hit',
name='session',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='analytics.session', verbose_name='Session'),
),
migrations.AlterField(
model_name='session',
name='asn',
field=models.TextField(blank=True, verbose_name='Asn'),
),
migrations.AlterField(
model_name='session',
name='browser',
field=models.TextField(verbose_name='Browser'),
),
migrations.AlterField(
model_name='session',
name='country',
field=models.TextField(blank=True, verbose_name='Country'),
),
migrations.AlterField(
model_name='session',
name='device',
field=models.TextField(verbose_name='Device'),
),
migrations.AlterField(
model_name='session',
name='device_type',
field=models.CharField(choices=[('PHONE', 'Phone'), ('TABLET', 'Tablet'), ('DESKTOP', 'Desktop'), ('ROBOT', 'Robot'), ('OTHER', 'Other')], default='OTHER', max_length=7, verbose_name='Device type'),
),
migrations.AlterField(
model_name='session',
name='identifier',
field=models.TextField(blank=True, db_index=True, verbose_name='Identifier'),
),
migrations.AlterField(
model_name='session',
name='ip',
field=models.GenericIPAddressField(db_index=True, null=True, verbose_name='IP'),
),
migrations.AlterField(
model_name='session',
name='is_bounce',
field=models.BooleanField(db_index=True, default=True, verbose_name='Is bounce'),
),
migrations.AlterField(
model_name='session',
name='last_seen',
field=models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='Last seen'),
),
migrations.AlterField(
model_name='session',
name='latitude',
field=models.FloatField(null=True, verbose_name='Latitude'),
),
migrations.AlterField(
model_name='session',
name='longitude',
field=models.FloatField(null=True, verbose_name='Longitude'),
),
migrations.AlterField(
model_name='session',
name='os',
field=models.TextField(verbose_name='OS'),
),
migrations.AlterField(
model_name='session',
name='service',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.service', verbose_name='Service'),
),
migrations.AlterField(
milesmcc marked this conversation as resolved.
Show resolved Hide resolved
model_name='session',
name='start_time',
field=models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='Start time'),
),
migrations.AlterField(
model_name='session',
name='time_zone',
field=models.TextField(blank=True, verbose_name='Time zone'),
),
migrations.AlterField(
model_name='session',
name='user_agent',
field=models.TextField(verbose_name='User agent'),
),
]
Loading