'Add one or more :term:`translation directory` paths to the
current configuration state.  The ``specs`` argument is a
sequence that may contain absolute directory paths
(e.g. ``/usr/share/locale``) or :term:`asset specification`
names naming a directory path (e.g. ``some.package:locale``)
or a combination of the two.
Example:
.. code-block:: python
config.add_translation_dirs(\'/usr/share/locale\',
\'some.package:locale\')
The translation directories are defined as a list in which
translations defined later have precedence over translations defined
earlier.
By default, consecutive calls to ``add_translation_dirs`` will add
directories to the start of the list. This means later calls to
``add_translation_dirs`` will have their translations trumped by
earlier calls. If you explicitly need this call to trump an earlier
call then you may set ``override`` to ``True``.
If multiple specs are provided in a single call to
``add_translation_dirs``, the directories will be inserted in the
order they\'re provided (earlier items are trumped by later items).
.. versionchanged:: 1.8
The ``override`` parameter was added to allow a later call
to ``add_translation_dirs`` to override an earlier call, inserting
folders at the beginning of the translation directory list.'

@action_method
def add_translation_dirs(self, *specs, **kw):

    introspectables = []
    override = kw.pop('override', False)
    if kw:
        raise TypeError('invalid    keyword    arguments:    %s', sorted(kw.keys()))
    def register():
        directories = []
        resolver = AssetResolver(self.package_name)
        for spec in specs:
            if (not spec.endswith('/')):
                spec += '/'
            asset = resolver.resolve(spec)
            directory = asset.abspath()
            if (not asset.isdir()):
                raise ConfigurationError(('"%s"    is    not    a    directory' % directory))
            intr = self.introspectable('translation    directories', directory, spec, 'translation    directory')
            intr['directory'] = directory
            intr['spec'] = spec
            introspectables.append(intr)
            directories.append(directory)
        tdirs = self.registry.queryUtility(ITranslationDirectories)
        if (tdirs is None):
            tdirs = []
            self.registry.registerUtility(tdirs, ITranslationDirectories)
        if override:
            tdirs.extend(directories)
        else:
            for directory in reversed(directories):
                tdirs.insert(0, directory)
    self.action(None, register, introspectables=introspectables)
