# -*- coding: utf-8 -*-

"""Sample configuration file.

This file includes the settings that administrators will likely change.
You can find the defaults in the ``*.conf`` files for more advanced settings.
"""

from pootle.i18n.gettext import ugettext_lazy as _

#
# Base
#

# Site title
POOTLE_TITLE = _(u'Pootle Translation Server')

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'UTC'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'SECRET_KEY'

# A list of strings representing the host/domain names that this Pootle server
# can serve. This is a Django's security measure.
ALLOWED_HOSTS = [
    '127.0.0.1',
    'localhost',
    #'${your_server}',
    'pootle.sahanafoundation.org',
]

# Set this to a canonical url for your site *without trailing slash*
# This will be used when deriving urls to send out emails
# If you use the `django.contrib.sites` framework set this to blank
POOTLE_CANONICAL_URL = "https://pootle.sahanafoundation.org"

#
# Backends
#

# Database backend settings
DATABASES = {
    'default': {
        # Replace 'sqlite3' with 'postgresql' or 'mysql'.
        #'ENGINE': 'django.db.backends.sqlite3',
        'ENGINE': 'django.db.backends.postgresql',
        # Database name or path to database file if using sqlite3.
        #'NAME': working_path('dbs/pootle.db'),
        'NAME': 'pootledb',
        # Not used with sqlite3.
        'USER': 'pootle',
        # Not used with sqlite3.
        'PASSWORD': 'password',
        # Set to empty string for localhost. Not used with sqlite3.
        'HOST': '',
        # Set to empty string for default. Not used with sqlite3.
        'PORT': '',
        # See https://docs.djangoproject.com/en/1.10/topics/db/transactions/
        # required for Django + sqlite
        'ATOMIC_REQUESTS': True,
        'CONN_MAX_AGE': None,
        #'OPTIONS' : {
        #    # MySQL:
        #    # https://docs.djangoproject.com/en/1.10/ref/databases/#setting-sql-mode
        #    'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
        #},
        'TEST': {
            'NAME': 'test_pootle',
        }
    }
}


# Cache Backend settings

# For more information, check
# https://docs.djangoproject.com/en/1.10/topics/cache/#setting-up-the-cache
# and http://niwibe.github.io/django-redis/
#CACHES = {
#    'default': {
#        'BACKEND': 'django_redis.cache.RedisCache',
#        'LOCATION': 'redis://127.0.0.1:6379/1',
#        'TIMEOUT': 60,
#    },
#    'redis': {
#        'BACKEND': 'django_redis.cache.RedisCache',
#        'LOCATION': 'redis://127.0.0.1:6379/2',
#        'TIMEOUT': None,
#    },
#    'lru': {
#        'BACKEND': 'django_redis.cache.RedisCache',
#        'LOCATION': 'redis://127.0.0.1:6379/3',
#        'TIMEOUT': 604800,  # 1 week
#    },
#    'exports': {
#        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
#        'LOCATION': working_path('exports/'),
#        'TIMEOUT': 259200,  # 3 days.
#    },
#}

#
# Local Translation Memory service
#

# Setup for connection to the ElasticSearch server for translation memory based
# on the projects hosted on Pootle.
# You may want to set AMAGAMA_URL to '' (empty string) if using this service.
#
#POOTLE_TM_SERVER = {
#    'local': {
#        'ENGINE': 'pootle.core.search.backends.ElasticSearchBackend',
#        'HOST': 'localhost',
#        'PORT': 9200,
#        # Every TM server must have its own unique index.
#        'INDEX_NAME': 'translations',
#        # Provides a weighting factor to alter the final score for TM results
#        # from this TM server. Valid values are between ``0.0`` and ``1.0``,
#        # both included. Defaults to ``1.0`` if not provided.
#        'WEIGHT': 1.0,
#    },
#    'external': {
#        'ENGINE': 'pootle.core.search.backends.ElasticSearchBackend',
#        'HOST': 'localhost',
#        'PORT': 9200,
#        'INDEX_NAME': 'external-translations',
#        'WEIGHT': 0.9,
#    },
#}

#
# Logging
#

# The directory where Pootle writes its logs
POOTLE_LOG_DIRECTORY = working_path('log')


#
# Site
#

# This Pootle server admins
ADMINS = (
    #('Fran Boon', 'fran@sahanafoundation.org'),
)

# Mail settings

# Default email address to use for messages sent by Pootle.
DEFAULT_FROM_EMAIL = 'pootle@sahanafoundation.org'

# Address to receive messages sent by contact form.
POOTLE_CONTACT_EMAIL = 'admin@sahanafoundation.org'
POOTLE_CONTACT_ENABLED = True

# Email address to report string errors to, unless a report email was set for
# the project for which the string error is being reported.
# Use this as a way to forward string error reports to an address
# different from the general contact address.
#POOTLE_CONTACT_REPORT_EMAIL = 'string_errors_manager@YOUR_DOMAIN.com'

# Whether to email reviewer's feedback to suggesters.
POOTLE_EMAIL_FEEDBACK_ENABLED = False

# Mail server settings

# By default Pootle uses the SMTP server on localhost. If the server is not
# configured for sending emails, uncomment and use these settings to setup an
# external outgoing SMTP server.

# Example for Google as an external SMTP server
#EMAIL_HOST_USER = 'USER@YOUR_DOMAIN.com'
#EMAIL_HOST_PASSWORD = 'YOUR_PASSWORD'
#EMAIL_HOST = 'smtp.gmail.com'
#EMAIL_PORT = 587
#EMAIL_USE_TLS = True


#
# Translation
#

# The directory where the translation files are kept
POOTLE_TRANSLATION_DIRECTORY = working_path('translations')

# Two-tuple defining the markup filter to apply in certain textareas.
#
# - Accepted values for the first element are 'markdown' and
#   'html' (deprecated).
# - The second element should be a dictionary of keyword arguments that will be
#   passed to the markup function.
#
POOTLE_MARKUP_FILTER = ('markdown', {})

# Set the backends you want to use to enable translation suggestions through
# several online services. To disable this feature completely just comment all
# the lines to set an empty list [] to the POOTLE_MT_BACKENDS setting.
#
# The second parameter for each backend option is the API key, which will
# be used in case the service supports using an API key.
#
# Available options are:
# 'CAIGHDEAN_TRANSLATE': CaighdeÃ¡n Translate service.
#             Provides translation from Manx Gaelic (gv) and
#             Scottish Gaelic (gd), into Irish Gaelic (ga-IE)
#             See more at https://github.com/kscanne/caighdean
# 'GOOGLE_TRANSLATE': Google Translate service.
#             For this service you need to set the API key.
#             Note that Google Translate API is a paid service
#             See more at https://cloud.google.com/translate/v2/pricing
# 'WELSH_TRANSLATE': Welsh Translate service.
#             Provides translation from English (en) to Welsh (cy)
#             For this service you need an API key.
#             See more at http://techiaith.cymru/api/translation/?lang=en
# 'YANDEX_TRANSLATE': Yandex Translate service.
#             For this service you need to set the API key.
#             See more at https://tech.yandex.com/translate/
#
POOTLE_MT_BACKENDS = [
#    ('CAIGHDEAN_TRANSLATE', ''),
#    ('GOOGLE_TRANSLATE', ''),
#    ('WELSH_TRANSLATE', ''),
#    ('YANDEX_TRANSLATE', ''),
]


# Custom templates directories
#
TEMPLATES[0]['DIRS'] = [
    # working_path(os.path.join('custom', 'templates')),
]
