Ejemplo n.º 1
0
def create_default_projects():
    """Create the default projects that we host.

    You might want to add your projects here, although you can also add things
    through the web interface later.
    """
    from pootle_project.models import Project

    en = require_english()

    criteria = {
        'code': u"tutorial",
        'source_language': en,
        'fullname': u"Tutorial",
        'checkstyle': "standard",
        'localfiletype': "po",
        'treestyle': "auto",
    }
    tutorial = Project(**criteria)
    tutorial.save()

    criteria = {
        'active': True,
        'title': "Project instructions",
        'body': ('<div dir="ltr" lang="en">Tutorial project where users can '
                 'play with Pootle and learn more about translation and '
                 'localisation.<br />For more help on localisation, visit the '
                 '<a href="http://docs.translatehouse.org/projects/'
                 'localization-guide/en/latest/guide/start.html">localisation '
                 'guide</a>.</div>'),
        'virtual_path': "announcements/projects/"+tutorial.code,
    }
    ann = Announcement(**criteria)
    ann.save()
Ejemplo n.º 2
0
def create_default_projects():
    """Create the default projects that we host.

    You might want to add your projects here, although you can also add things
    through the web interface later.
    """
    from pootle_project.models import Project

    en = require_english()

    criteria = {
        'code': u"tutorial",
        'source_language': en,
        'fullname': u"Tutorial",
        'checkstyle': "standard",
        'localfiletype': "po",
        'treestyle': "auto",
    }
    tutorial = Project(**criteria)
    tutorial.save()

    criteria = {
        'active':
        True,
        'title':
        "Project instructions",
        'body': ('<div dir="ltr" lang="en">Tutorial project where users can '
                 'play with Pootle and learn more about translation and '
                 'localisation.<br />For more help on localisation, visit the '
                 '<a href="http://docs.translatehouse.org/projects/'
                 'localization-guide/en/latest/guide/start.html">localisation '
                 'guide</a>.</div>'),
        'virtual_path':
        "announcements/projects/" + tutorial.code,
    }
    ann = Announcement(**criteria)
    ann.save()
Ejemplo n.º 3
0
 def get_announcement(self, user=None):
     """Return the related announcement, if any."""
     return StaticPage.get_announcement_for(self.pootle_path, user)