# Our Translation Handler choices.
TRANS_CHOICES = {'POT': 'PO files',
                 'INTLTOOL': 'PO files using intltool',
                 'PUBLICAN': 'Publican like docs',}


# The classes which implement the TransHandler support. The full "path"
# to the class is the concatenation of the BASE and the NAME of the class.
TRANS_CLASS_BASE = 'projects.handlers.types'
TRANS_CLASS_NAMES = {'POT': 'pot.POTHandler',
                     'INTLTOOL': 'intltool.IntltoolHandler',
                     'PUBLICAN': 'publican.PublicanHandler',}

#####################
# msgmerge settings
# WARNING: Kept only for migration purposes. It will be removed in 1.1.
MSGMERGE_DIR = os.path.join(SCRATCH_DIR, 'msgmerge_files')


#######################
# Resource i18n options
I18N_METHODS = {'PO': {
                    'description': 'PO File',
                    'mimetype': 'text/x-po, application/x-gettext, application/x-po',
                    'file-extensions': '.po'
                },
                'POT': {
                    'description': 'POT File',
                    'mimetype': 'text/x-po, application/x-gettext, application/x-po',
                    'file-extensions': '.pot'
                },
                'QT': {
                    'description': 'Qt File',
                    'mimetype': 'application/xml',
                    'file-extensions': '.ts'
                },
                'INI': {
                    'description': 'Joomla INI File',
                    'mimetype': 'text/plain',
                    'file-extensions': '.ini'
                },
                'PROPERTIES': {
                    'description': 'Java PROPERTIES File',
                    'mimetype': 'text/plain',
                    'file-extensions': '.properties',
                },
                'DESKTOP': {
                    'description': 'Desktop Entry File',
                    'mimetype': 'application/x-desktop',
                    'file-extensions': '.desktop'
                },
                'STRINGS': {
                    'description': 'Apple Strings File',
                    'mimetype': 'text/plain',
                    'file-extensions': '.strings'
                },
                'XLIFF': {
                    'description': 'XLIFF file',
                    'mimetype': 'text/xml',
                    'file-extensions': '.xlf, .xliff, .xml'
                },
                'DTD': {
                    'description': 'Mozilla DTD File',
                    'mimetype': 'text/xml',
                    'file-extensions': '.dtd'
                },
                'WIKI': {
                    'description': 'WIKI file',
                    'mimetype': 'text/plain',
                    'file-extensions': '.wiki'
                },
                'MOZILLAPROPERTIES': {
                    'description': 'Mozilla PROPERTIES file',
                    'mimetype': 'text/plain',
                    'file-extensions': '.properties'
                },
                'UNICODEPROPERTIES': {
                    'description': 'Unicode PROPERTIES file',
                    'mimetype': 'text/plain',
                    'file-extensions': '.properties'
                },
}

I18N_HANDLER_CLASS_NAMES = {
    'PO': 'transifex.resources.formats.pofile.POHandler',
    'POT': 'transifex.resources.formats.pofile.POTHandler',
    'QT': 'transifex.resources.formats.qt.LinguistHandler',
    'INI': 'transifex.resources.formats.joomla.JoomlaINIHandler',
    'PROPERTIES':'transifex.resources.formats.javaproperties.JavaPropertiesHandler',
    'DESKTOP': 'transifex.resources.formats.desktop.DesktopHandler',
    'STRINGS': 'transifex.resources.formats.strings.AppleStringsHandler',
    'XLIFF': 'transifex.resources.formats.xliff.XliffHandler',
    'DTD': 'transifex.resources.formats.dtd.DTDHandler',
    'WIKI': 'transifex.resources.formats.wiki.WikiHandler',
    'MOZILLAPROPERTIES': 'transifex.resources.formats.mozillaproperties.MozillaPropertiesHandler',
    'UNICODEPROPERTIES': 'transifex.resources.formats.unicodeproperties.UnicodePropertiesHandler',
}

######################
# Pseudo Translations

# Pseudo types supported
PSEUDO_TYPES = {
#    'XXX': 'Prepends and appends xxx to strings.',
#    'BRACKETS': 'Prepends and appends brackets to strings.',
#    'UNICODE': 'Converts all chars of strings into accented chars or chars '
#        'that look alike.',
#    'PLANGUAGE': 'Increases the size of the strings by 30%-50% and replaces '
#        'vowels with accented chars.',
#    'EXTEND': 'Increases the size of the strings by 20%-700%.',
    'MIXED': 'Increases the size of the strings by 20%-700%, replaces '
        'chars that look alike and adds brackets around the strings.',
    }


# Mapping of pseudo types and theirs classes
PSEUDO_TYPE_CLASSES = {
    'XXX': 'transifex.resources.formats.pseudo.types.XxxPseudoType',
    'BRACKETS': 'transifex.resources.formats.pseudo.types.BracketsPseudoType',
    'UNICODE': 'transifex.resources.formats.pseudo.types.UnicodePseudoType',
    'PLANGUAGE': 'transifex.resources.formats.pseudo.types.PLanguagePseudoType',
    'EXTEND': 'transifex.resources.formats.pseudo.types.ExtendPseudoType',
    'MIXED': 'transifex.resources.formats.pseudo.types.MixedPseudoTypes'
    }


######################
# Lotte validations

I18N_ERROR_VALIDATORS = {
    'DEFAULT': [
        'transifex.resources.formats.validators.PrintfFormatNumberValidator',
        'transifex.resources.formats.validators.PrintfFormatSourceValidator',
    ],
    'QT': [
        'transifex.resources.formats.validators.PrintfFormatPluralizedNumberValidator',
        'transifex.resources.formats.validators.PrintfFormatPluralizedSourceValidator',
    ],
    'PO': [
        'transifex.resources.formats.validators.PrintfFormatNumberValidator',
        'transifex.resources.formats.validators.PrintfFormatSourceValidator',
        'transifex.resources.formats.validators.NewLineAtBeginningValidator',
        'transifex.resources.formats.validators.NewLineAtEndValidator',
    ],
}

I18N_WARNING_VALIDATORS = {
    'DEFAULT': [
        'transifex.resources.formats.validators.SpaceValidator',
        'transifex.resources.formats.validators.MatchingBracketsValidator',
        'transifex.resources.formats.validators.UrlsValidator',
        'transifex.resources.formats.validators.EmailAddressesValidator',
        'transifex.resources.formats.validators.NewLineAtBeginningValidator',
        'transifex.resources.formats.validators.NewLineAtEndValidator',
        'transifex.resources.formats.validators.NumbersValidator',
        'transifex.resources.formats.validators.PrintfFormatTranslationValidator',
    ],
    'QT': [
        'transifex.resources.formats.validators.SpaceValidator',
        'transifex.resources.formats.validators.MatchingBracketsValidator',
        'transifex.resources.formats.validators.UrlsValidator',
        'transifex.resources.formats.validators.EmailAddressesValidator',
        'transifex.resources.formats.validators.NewLineAtBeginningValidator',
        'transifex.resources.formats.validators.NewLineAtEndValidator',
        'transifex.resources.formats.validators.NumbersValidator',
        'transifex.resources.formats.validators.PrintfFormatTranslationValidator',
    ],
    'PO': [
        'transifex.resources.formats.validators.SpaceValidator',
        'transifex.resources.formats.validators.MatchingBracketsValidator',
        'transifex.resources.formats.validators.UrlsValidator',
        'transifex.resources.formats.validators.EmailAddressesValidator',
        'transifex.resources.formats.validators.NumbersValidator',
        'transifex.resources.formats.validators.PrintfFormatTranslationValidator',
    ],
}


#####################
# Translation Origins

TRANS_ORIGIN = {'API': 'Translation added using the API',
                'LOTTE': 'Translation added using Lotte',
                'UPLOAD': 'Translation added from file upload on the UI'}
