'Symlink project translations
Link from $WEB_ROOT/<project>/<language>/ ->
$WEB_ROOT/<translation>/<language>/'

def symlink_translations(self):

    translations = {}
    for trans in self.get_translations():
        translations[trans.language] = trans.slug
    language_dir = os.path.join(self.project_root, self.project.language)
    if os.path.islink(language_dir):
        os.unlink(language_dir)
    if (not os.path.lexists(language_dir)):
        safe_makedirs(language_dir)
    for (language, slug) in list(translations.items()):
        self._log(u'Symlinking    translation:    {0}->{1}'.format(language, slug))
        symlink = os.path.join(self.project_root, language)
        docs_dir = os.path.join(self.WEB_ROOT, slug, language)
        run('ln    -nsf    {0}    {1}'.format(docs_dir, symlink))
    for lang in os.listdir(self.project_root):
        if ((lang not in translations) and (lang not in ['projects', self.project.language])):
            to_delete = os.path.join(self.project_root, lang)
            if os.path.islink(to_delete):
                os.unlink(to_delete)
            else:
                shutil.rmtree(to_delete)
