mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-15 08:02:54 +11:00
Language support!
This commit is contained in:
parent
030556ea05
commit
ea27bf9e0f
8 changed files with 47 additions and 20 deletions
Binary file not shown.
|
@ -8,7 +8,7 @@ msgstr ""
|
|||
"Project-Id-Version: dpaste\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-10-25 10:06+0000\n"
|
||||
"PO-Revision-Date: 2014-10-25 12:07+0100\n"
|
||||
"PO-Revision-Date: 2014-10-28 11:20+0100\n"
|
||||
"Last-Translator: Martin Mahner <martin@mahner.org>\n"
|
||||
"Language-Team: DE <LL@li.org>\n"
|
||||
"Language: de\n"
|
||||
|
@ -219,7 +219,7 @@ msgid ""
|
|||
"No snippets saved. Either all your snippets are expired or your cookie has "
|
||||
"changed."
|
||||
msgstr ""
|
||||
"Keine Snippets gespeichert. Entweder alle deine Snippets sind erloschen oder "
|
||||
"Keine Snippets gespeichert. Entweder sind alle deine Snippets erloschen oder "
|
||||
"dein Cookie hat sich geändert."
|
||||
|
||||
#, fuzzy
|
||||
|
|
BIN
dpaste/locale/en/LC_MESSAGES/django.mo
Normal file
BIN
dpaste/locale/en/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
BIN
dpaste/locale/es/LC_MESSAGES/django.mo
Normal file
BIN
dpaste/locale/es/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
BIN
dpaste/locale/pt_BR/LC_MESSAGES/django.mo
Normal file
BIN
dpaste/locale/pt_BR/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
|
@ -1,6 +1,25 @@
|
|||
# Import global settings to make it easier to extend settings.
|
||||
from django.conf.global_settings import *
|
||||
|
||||
|
||||
#==============================================================================
|
||||
# Calculation of directories relative to the module location
|
||||
#==============================================================================
|
||||
import os
|
||||
import sys
|
||||
import dpaste
|
||||
|
||||
PROJECT_DIR, PROJECT_MODULE_NAME = os.path.split(
|
||||
os.path.dirname(os.path.realpath(dpaste.__file__))
|
||||
)
|
||||
|
||||
# Set the variable root to $VIRTUALENV/var.
|
||||
PYTHON_BIN = os.path.dirname(sys.executable)
|
||||
|
||||
VAR_ROOT = os.path.join(os.path.dirname(PYTHON_BIN), 'var')
|
||||
if not os.path.exists(VAR_ROOT):
|
||||
os.mkdir(VAR_ROOT)
|
||||
|
||||
#==============================================================================
|
||||
# Generic Django project settings
|
||||
#==============================================================================
|
||||
|
@ -30,32 +49,21 @@ SECRET_KEY = 'CHANGE_ME'
|
|||
# I18N
|
||||
#==============================================================================
|
||||
|
||||
USE_I18N = False
|
||||
USE_I18N = True
|
||||
USE_L10N = False
|
||||
|
||||
LANGUAGE_CODE = 'en'
|
||||
LANGUAGES = (
|
||||
('en', 'English'),
|
||||
('de', 'German'),
|
||||
('es', 'Spanish'),
|
||||
('pt-br', 'Portugese (Brasil)'),
|
||||
)
|
||||
|
||||
#==============================================================================
|
||||
# Calculation of directories relative to the module location
|
||||
#==============================================================================
|
||||
import os
|
||||
import sys
|
||||
import dpaste
|
||||
|
||||
PROJECT_DIR, PROJECT_MODULE_NAME = os.path.split(
|
||||
os.path.dirname(os.path.realpath(dpaste.__file__))
|
||||
LOCALE_PATHS = (
|
||||
os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'locale')),
|
||||
)
|
||||
|
||||
# Set the variable root to $VIRTUALENV/var.
|
||||
PYTHON_BIN = os.path.dirname(sys.executable)
|
||||
|
||||
VAR_ROOT = os.path.join(os.path.dirname(PYTHON_BIN), 'var')
|
||||
if not os.path.exists(VAR_ROOT):
|
||||
os.mkdir(VAR_ROOT)
|
||||
|
||||
#==============================================================================
|
||||
# Static files
|
||||
#==============================================================================
|
||||
|
@ -84,13 +92,15 @@ LOGIN_REDIRECT_URL = '/'
|
|||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.locale.LocaleMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
)
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS += (
|
||||
'django.core.context_processors.request',
|
||||
'django.core.context_processors.i18n',
|
||||
)
|
||||
|
||||
INSTALLED_APPS = (
|
||||
|
|
|
@ -17,6 +17,21 @@
|
|||
<a href="https://github.com/bartTC/dpaste">github.com/bartTC/dpaste</a>
|
||||
</p>
|
||||
|
||||
<form action="{% url 'set_language' %}" method="post">
|
||||
{% csrf_token %}
|
||||
Change the language:
|
||||
<input name="next" type="hidden" value="{{ redirect_to }}" />
|
||||
<select name="language">
|
||||
{% get_language_info_list for LANGUAGES as languages %}
|
||||
{% for language in languages %}
|
||||
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
|
||||
{{ language.name_local }} ({{ language.code }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
|
||||
<h3>API</h3>
|
||||
|
||||
<p>dpaste provides a simple API documented in detail <a href="http://dpaste.readthedocs.org/en/latest/api.html">
|
||||
|
|
|
@ -4,6 +4,8 @@ urlpatterns = patterns(
|
|||
'',
|
||||
url(r'^', include('dpaste.urls.dpaste_api')),
|
||||
url(r'^', include('dpaste.urls.dpaste')),
|
||||
|
||||
(r'^i18n/', include('django.conf.urls.i18n')),
|
||||
)
|
||||
|
||||
# Custom error handlers which load `dpaste/<code>.html` instead of `<code>.html`
|
||||
|
|
Loading…
Reference in a new issue