Skip to content
This repository was archived by the owner on Jan 13, 2019. It is now read-only.

Commit

Permalink
Added German Translations (allianceauth#406)
Browse files Browse the repository at this point in the history
* Added German Translations

Translated using
https://docs.djangoproject.com/en/1.9/topics/i18n/translation/

Added language drop down menu's for base.html, registration & login
pages

Known issues:
* Translated items in whtracker>create signature remain translated when
posted
* No date/time localisation for Fleet/Structure timers

* Added time locale

Added date/time locale to
*Structure Timers
*Fleet Timers
*Fleet timer form datetimepicker.js

Fixed a bug where the bootstrap label didn't show up when making a
structure timer using the translated form

Missed some base.html translations

* Small translation error

Some obscure SRP strings went unnoticed for context review

* FAT & Fleet-up German Translations

+ a fix in settings.py.example

The only small thing not done is German Date/Time locale for Fleet-up

* Compiled de/django.po
  • Loading branch information
iAddz authored and Adarnof committed Jun 16, 2016
1 parent e0693e7 commit c9e490a
Show file tree
Hide file tree
Showing 76 changed files with 3,243 additions and 787 deletions.
11 changes: 11 additions & 0 deletions alliance_auth/settings.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ MIDDLEWARE_CLASSES = (
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.locale.LocaleMiddleware',
)

LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale/'),
)

ugettext = lambda s: s
LANGUAGES = (
('en', ugettext('English')),
('de', ugettext('German')),
)

ROOT_URLCONF = 'alliance_auth.urls'
Expand Down
255 changes: 143 additions & 112 deletions alliance_auth/urls.py

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions authentication/forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django import forms
from django.utils.translation import ugettext_lazy as _


class LoginForm(forms.Form):
username = forms.CharField(max_length=32, required=True)
password = forms.CharField(widget=forms.PasswordInput())
username = forms.CharField(label=_('Username'), max_length=32, required=True)
password = forms.CharField(label=_('Password'), widget=forms.PasswordInput())
5 changes: 3 additions & 2 deletions authentication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils import translation

from forms import LoginForm

Expand All @@ -23,7 +24,7 @@ def login_user(request):
if user.is_active:
logger.info("Successful login attempt from user %s" % user)
login(request, user)
return HttpResponseRedirect("/dashboard")
return HttpResponseRedirect("/dashboard/")
else:
logger.info("Login attempt failed for user %s: user marked inactive." % user)
else:
Expand All @@ -43,4 +44,4 @@ def logout_user(request):
logoutUser = request.user
logout(request)
logger.info("Successful logout for user %s" % logoutUser)
return HttpResponseRedirect("/")
return HttpResponseRedirect("/")
3 changes: 2 additions & 1 deletion corputils/forms.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from eveonline.models import EveCorporationInfo
from eveonline.models import EveAllianceInfo

class CorputilsSearchForm(forms.Form):
search_string = forms.CharField(max_length=254, required=True, label="", widget=forms.TextInput(attrs={'placeholder': 'Search characters...'}))
search_string = forms.CharField(max_length=254, required=True, label="", widget=forms.TextInput(attrs={'placeholder': _('Search characters...')}))
4 changes: 2 additions & 2 deletions eveonline/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def main_character_change(request, char_id):
if EveManager.check_if_character_owned_by_user(char_id, request.user):
AuthServicesInfoManager.update_main_char_Id(char_id, request.user)
set_state(request.user)
return HttpResponseRedirect("/characters")
return HttpResponseRedirect("/characters")
return HttpResponseRedirect("/characters/")
return HttpResponseRedirect("/characters/")



Expand Down
7 changes: 4 additions & 3 deletions fleetactivitytracking/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django import forms
from optimer.models import optimer
from django.utils.translation import ugettext_lazy as _

def get_fleet_list():
fleets = optimer.objects.all()
Expand All @@ -11,6 +12,6 @@ def get_fleet_list():


class FatlinkForm(forms.Form):
fatname = forms.CharField(label='Name of fat-link', required=True)
duration = forms.IntegerField(label="Duration of fat-link", required=True, initial=30, min_value=1, max_value=2147483647)
fleet = forms.ModelChoiceField(label="Fleet", queryset=optimer.objects.all().order_by('operation_name'))
fatname = forms.CharField(label=_('Name of fat-link'), required=True)
duration = forms.IntegerField(label=_("Duration of fat-link"), required=True, initial=30, min_value=1, max_value=2147483647)
fleet = forms.ModelChoiceField(label=_("Fleet"), queryset=optimer.objects.all().order_by('operation_name'))
5 changes: 3 additions & 2 deletions groupmanagement/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from models import OpenGroup
from authentication.managers import AuthServicesInfoManager
from eveonline.managers import EveManager
from django.utils.translation import ugettext_lazy as _

import logging

Expand Down Expand Up @@ -159,7 +160,7 @@ def group_request_add(request, group_id):
return HttpResponseRedirect("/groups")
auth_info = AuthServicesInfoManager.get_auth_service_info(request.user)
grouprequest = GroupRequest()
grouprequest.status = 'pending'
grouprequest.status = _('Pending')
grouprequest.group = group
grouprequest.user = request.user
grouprequest.main_char = EveManager.get_character_by_id(auth_info.main_char_id)
Expand All @@ -179,7 +180,7 @@ def group_request_leave(request, group_id):
return HttpResponseRedirect("/groups")
auth_info = AuthServicesInfoManager.get_auth_service_info(request.user)
grouprequest = GroupRequest()
grouprequest.status = 'pending'
grouprequest.status = _('Pending')
grouprequest.group = group
grouprequest.user = request.user
grouprequest.main_char = EveManager.get_character_by_id(auth_info.main_char_id)
Expand Down
5 changes: 3 additions & 2 deletions hrapplications/forms.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from django import forms
from django.utils.translation import ugettext_lazy as _

class HRApplicationCommentForm(forms.Form):
comment = forms.CharField(widget=forms.Textarea, required=False, label="Comment", max_length=254)
comment = forms.CharField(widget=forms.Textarea, required=False, label=_("Comment"), max_length=254)

class HRApplicationSearchForm(forms.Form):
search_string = forms.CharField(max_length=254, required=True, label="Search String")
search_string = forms.CharField(max_length=254, required=True, label=_("Search String"))
Binary file added locale/de/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit c9e490a

Please sign in to comment.