From bb0f7662eb12a838cbd339dd8b60476a73ec161b Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 15 Apr 2013 11:03:56 +0200 Subject: [PATCH] i18n, l10n-pl, minor gitignore fix --- .gitignore | 2 + MANIFEST.in | 3 +- cas_provider/forms.py | 9 +- cas_provider/locale/pl/LC_MESSAGES/django.mo | Bin 0 -> 873 bytes cas_provider/locale/pl/LC_MESSAGES/django.po | 98 +++++++++++++++++++ cas_provider/views.py | 5 +- 6 files changed, 111 insertions(+), 6 deletions(-) create mode 100644 cas_provider/locale/pl/LC_MESSAGES/django.mo create mode 100644 cas_provider/locale/pl/LC_MESSAGES/django.po diff --git a/.gitignore b/.gitignore index 6152084..2bed7fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Python garbage *.pyc *.egg-info +/build +/dist # Mac OS X garbage .DS_Store diff --git a/MANIFEST.in b/MANIFEST.in index a87457c..d02b852 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,6 @@ recursive-include cas_provider/templates *.html recursive-include cas_provider/fixtures * +recursive-include cas_provider/locale *.po *.mo include AUTHORS.txt include README.rst -include LICENSE \ No newline at end of file +include LICENSE diff --git a/cas_provider/forms.py b/cas_provider/forms.py index 44b47b4..7f3d5b6 100644 --- a/cas_provider/forms.py +++ b/cas_provider/forms.py @@ -1,10 +1,12 @@ from django import forms +from django.utils.translation import ugettext_lazy as _ class LoginForm(forms.Form): username = forms.CharField(widget=forms.TextInput(attrs={'autofocus': 'autofocus', - 'max_length': '255'})) - password = forms.CharField(widget=forms.PasswordInput()) + 'max_length': '255'}), + label=_('Username')) + password = forms.CharField(widget=forms.PasswordInput(), label=_('Password')) service = forms.CharField(widget=forms.HiddenInput, required=False) def __init__(self, *args, **kwargs): @@ -16,4 +18,5 @@ class LoginForm(forms.Form): class MergeLoginForm(LoginForm): - username = forms.CharField(max_length=255, widget=forms.HiddenInput) + username = forms.CharField(max_length=255, widget=forms.HiddenInput, + label=_('Username')) diff --git a/cas_provider/locale/pl/LC_MESSAGES/django.mo b/cas_provider/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..7701b542f1e664d4a0cd654484874fe06943fed4 GIT binary patch literal 873 zcmZva&2G~`5XToN9|||Pau^j+wJLV)w3RA1DQ(lVM5Jw$COyGnVsDdeoLy^ojY-r~ zFTewEKs*CiPCcRK6*%%9+!(tRxv>sjk$+CNlJtp&xEJ^;YIr1pPNLKV_4H+t} zd1xUuTuU5rKpCwl4G9{PDIK}2b?dRtKp4OM&z7wZG@5mw03H5b`I)rT5q2; zj*m)ho+xddL(>j0Lq@f>Ue98zYe|^tozGe+4D%~ zwE26H7yrMmyzKd;Yof7EN24?`TBQSMW5kD0o8b8np`tNTbdtGY5!jY0Q{jXgiHVBM z5M8DFZW3=%9obK@&z%m(Q2@=Iql0cfPo>%1jzun;X=ska#$kOnyzhFY8a*hNbeC~L zLs|a8t|T$N+a`nq)P~z?x3lkT%yjvk&$xE#^j#w%`vGk9ge|q=RAcPyD?Ks+$fVes z>gp!kxYb2jt@`i^JfPzjzPD8^!@@%0R;p{cyO@W)itoY2MG?<6-V){blv7^XEV13` z<@MJ{jv<|1jqOlnQVcg%Itqp~nu2p~EJ(p|Xvdl4^e1U$#ApmR r0t&w*&GcI=AkA=kg=PZND-Maugp>*<%2>Sq2t~fikV>%btULP)^|1hn literal 0 HcmV?d00001 diff --git a/cas_provider/locale/pl/LC_MESSAGES/django.po b/cas_provider/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000..241d1c8 --- /dev/null +++ b/cas_provider/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,98 @@ +# 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 , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-04-15 10:51+0200\n" +"PO-Revision-Date: 2013-04-15 10:52+0100\n" +"Last-Translator: Radek Czajka \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: forms.py:8 +#: forms.py:22 +msgid "Username" +msgstr "Użytkownik" + +#: forms.py:9 +msgid "Password" +msgstr "Hasło" + +#: models.py:18 +msgid "ticket" +msgstr "" + +#: models.py:19 +msgid "created" +msgstr "" + +#: models.py:38 +msgid "user" +msgstr "" + +#: models.py:39 +msgid "service" +msgstr "" + +#: models.py:44 +msgid "Service Ticket" +msgstr "" + +#: models.py:45 +msgid "Service Tickets" +msgstr "" + +#: models.py:62 +msgid "Login Ticket" +msgstr "" + +#: models.py:63 +msgid "Login Tickets" +msgstr "" + +#: models.py:68 +msgid "PGTiou" +msgstr "" + +#: models.py:77 +#: models.py:82 +#: models.py:92 +msgid "Proxy Granting Ticket" +msgstr "" + +#: models.py:78 +msgid "Proxy Granting Tickets" +msgstr "" + +#: models.py:87 +msgid "Proxy Ticket" +msgstr "" + +#: models.py:88 +msgid "Proxy Tickets" +msgstr "" + +#: models.py:97 +msgid "Proxy Granting Ticket IOU" +msgstr "" + +#: models.py:98 +msgid "Proxy Granting Tickets IOU" +msgstr "" + +#: views.py:128 +msgid "Incorrect username and/or password." +msgstr "Błędny użytkownik i/lub hasło." + +#: views.py:142 +msgid "This account is disabled. Please contact us if you feel it should be enabled again." +msgstr "To konto jest nieaktywne. Prosimy o kontakt, jeśli uważasz że powinno zostać aktywowane." + diff --git a/cas_provider/views.py b/cas_provider/views.py index 1160882..6cc322a 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -18,6 +18,7 @@ from django.conf import settings from django.contrib.auth import login as auth_login, logout as auth_logout from django.core.urlresolvers import get_callable from django.shortcuts import render_to_response +from django.utils.translation import ugettext as _ from django.template import RequestContext from django.contrib.auth import authenticate from django.core.urlresolvers import reverse @@ -124,7 +125,7 @@ def login(request, template_name='cas/login.html', return HttpResponseRedirect(url) if user is None: - errors.append('Incorrect username and/or password.') + errors.append(_('Incorrect username and/or password.')) else: if user.is_active: auth_login(request, user) @@ -138,7 +139,7 @@ def login(request, template_name='cas/login.html', if user is not None and user.is_authenticated(): # We have an authenticated user. if not user.is_active: - errors.append('This account is disabled. Please contact us if you feel it should be enabled again.') + errors.append(_('This account is disabled. Please contact us if you feel it should be enabled again.')) else: # Send the on_cas_login signal. If we get an HttpResponse, return that. for receiver, response in signals.on_cas_login.send(sender=login, request=request, **kwargs): -- 2.20.1