Skip to content

Added more improvements about i18n, Spanish l10n and colab docs with Sphinx #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -163,3 +163,9 @@ For the next deploy you can just run ``fab deploy`` and in case your
``requirements.txt`` changes ``fab deploy:update``.

The deployed code will be accessible on ``http://localhost:8080``.


.. image:: https://d2weczhvl823v0.cloudfront.net/CanaimaGNULinux/colab/trend.png
:alt: Bitdeli badge
:target: https://bitdeli.com/free

109 changes: 109 additions & 0 deletions docs/debianwheezy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
.. -*- coding: utf-8 -*-

.. highlight:: rest

.. _debianwheezy_install:

Installation instructions for Debian Wheezy
===========================================

.. contents :: :local:

Install dependencies
--------------------

* Install Git and VirtualBox: ::

aptitude install git-core virtualbox libevent-dev

* Download Vagrant 3.3 and install it: ::

wget http://files.vagrantup.com/packages/a40522f5fabccb9ddabad03d836e120ff5d14093/vagrant_1.3.5_i686.deb
dpkg -i vagrant_1.3.5_i686.deb

* Install Fabric: ::

aptitude install build-essential python-dev python-pkg-resources python-setuptools
easy_install --upgrade pip
pip install --upgrade setuptools
pip install fabric

Getting started with the Virtual Machine
------------------------------------------

First you will need to clone the repository:

::

git clone git@github.com:interlegis/colab.git


.. note::

Here we are assuming you have ssh permissions to clone the repo using ssh. If not
fork it and clone your own fork (or use https instead of ssh).


Enter in the repository you've just cloned.
To start working all you need is to turn the virtual machine on with the command:

::

vagrant up


.. note::

BE PATIENT!

This will take a while. The :command:`vagrant up` will download a full virtual
machine (with ``virtualbox``) running a *Ubuntu 12.04 64bits*. After the vm is up
and running the command will also configure it (using ``puppet``) and that will
also take a bit.


Running Colab
--------------

Now that you have a vm running we have two options to run Colab:

* Django development server (runserver)

* Gunicorn + supervisor + Nginx


Django development server (runserver)
++++++++++++++++++++++++++++++++++++++

This option is advised for developers working in new features for Colab.
The code used to run Colab will be the same code placed on your machine,
that means that if you change the code in your own computer the code on
the vm will also change.

Make sure you have a :file:`local_settings.py` file placed in your repository. It
should be located in :file:`src/colab/`.

To get started you can copy the example file as follow:

::

cp src/colab/local_settings-dev.py src/colab/local_settings.py


Now we are ready to run:

::

fab runserver


.. note::

As this is the first time you run this command it will install all
requirements from :file:`requirements.txt` into a virtualenv. To update
those requirements you should run :command:`fab runserver:update`.


The :command:`fab runserver` command will open the django builtin development
server on the port 7000 but due to vagrant magic you will be able to
access it on ``http://localhost:8000/``.
2 changes: 2 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
@@ -12,4 +12,6 @@ Colab software can be install in many Linux distros, like these:
.. toctree::
:maxdepth: 1

debianwheezy
ubuntu1204
ubuntu1004
108 changes: 108 additions & 0 deletions docs/ubuntu1204.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
.. -*- coding: utf-8 -*-

.. highlight:: rest

.. _ubuntu1204_install:

Installation instructions for Ubuntu 12.04
==========================================

.. contents :: :local:

Install dependencies
--------------------

* Install Git and VirtualBox: ::

sudo apt-get install git-core virtualbox

* Download Vagrant 3.3 and install it: ::

wget http://files.vagrantup.com/packages/a40522f5fabccb9ddabad03d836e120ff5d14093/vagrant_1.3.5_i686.deb
sudo dpkg -i vagrant_1.3.5_i686.deb

* Install Fabric: ::

sudo apt-get install build-essential python-dev python-pkg-resources python-setuptools
sudo easy_install --upgrade pip
sudo pip install fabric

Getting started with the Virtual Machine
------------------------------------------

First you will need to clone the repository:

.. code-block::

git clone git@github.com:interlegis/colab.git


.. note::

Here we are assuming you have ssh permissions to clone the repo using ssh. If not
fork it and clone your own fork (or use https instead of ssh).


Enter in the repository you've just cloned.
To start working all you need is to turn the virtual machine on with the command:

.. code-block::

vagrant up


.. note::

BE PATIENT!

This will take a while. The :command:`vagrant up` will download a full virtual
machine (with ``virtualbox``) running a *Ubuntu 12.04 64bits*. After the vm is up
and running the command will also configure it (using ``puppet``) and that will
also take a bit.


Running Colab
--------------

Now that you have a vm running we have two options to run Colab:

* Django development server (runserver)

* Gunicorn + supervisor + Nginx


Django development server (runserver)
++++++++++++++++++++++++++++++++++++++

This option is advised for developers working in new features for Colab.
The code used to run Colab will be the same code placed on your machine,
that means that if you change the code in your own computer the code on
the vm will also change.

Make sure you have a :file:`local_settings.py` file placed in your repository. It
should be located in :file:`src/colab/`.

To get started you can copy the example file as follow:

.. code-block::

cp src/colab/local_settings-dev.py src/colab/local_settings.py


Now we are ready to run:

.. code-block::

fab runserver


.. note::

As this is the first time you run this command it will install all
requirements from :file:`requirements.txt` into a virtualenv. To update
those requirements you should run :command:`fab runserver:update`.


The :command:`fab runserver` command will open the django builtin development
server on the port 7000 but due to vagrant magic you will be able to
access it on ``http://localhost:8000/``.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Django>=1.6,<1.7
South==0.8.1
South==0.8.4
psycopg2==2.5.1
django-piston==0.2.3
pytz==2011n
2 changes: 2 additions & 0 deletions src/badger/models.py
Original file line number Diff line number Diff line change
@@ -80,5 +80,7 @@ def __unicode__(self):

class BadgeI18N(I18nModel):
class Meta:
verbose_name = _(u'Badge I18N')
verbose_name_plural = _(u'Badges I18N')
source_model = Badge
translation_fields = ('title', 'description')
Binary file added src/locale/es/LC_MESSAGES/django.mo
Binary file not shown.
1,057 changes: 1,057 additions & 0 deletions src/locale/es/LC_MESSAGES/django.po

Large diffs are not rendered by default.

Binary file modified src/locale/pt_BR/LC_MESSAGES/django.mo
Binary file not shown.
114 changes: 96 additions & 18 deletions src/locale/pt_BR/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-05 18:14+0000\n"
"POT-Creation-Date: 2013-12-14 22:56+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -288,7 +288,7 @@ msgstr "Automaticamente"
msgid "Manual"
msgstr "Manual"

#: badger/models.py:22 super_archives/models.py:258
#: badger/models.py:22 super_archives/models.py:277
msgid "Messages"
msgstr "Mensagens"

@@ -341,6 +341,16 @@ msgstr "Ordem"
msgid "Badge"
msgstr "Medalha"

#: badger/models.py:83
#, fuzzy
msgid "Badge I18N"
msgstr "Medalha"

#: badger/models.py:84
#, fuzzy
msgid "Badges I18N"
msgstr "Medalhas"

#: colab/custom_settings.py:9
msgid "English"
msgstr "Inglês"
@@ -385,11 +395,11 @@ msgstr "Compactado"
msgid "Spreadsheet"
msgstr "Planilha"

#: colab/custom_settings.py:265
#: colab/custom_settings.py:268
msgid "Planet Colab"
msgstr ""

#: colab/custom_settings.py:266
#: colab/custom_settings.py:269
msgid "Colab blog aggregator"
msgstr "Agregador de blog Colab"

@@ -592,6 +602,7 @@ msgid "Changeset"
msgstr "Conjunto de Mudanças"

#: search/views.py:95 search/templates/search/includes/search_filters.html:132
#: super_archives/models.py:44
msgid "User"
msgstr "Usuário"

@@ -646,61 +657,128 @@ msgstr "Ordenar por"
msgid "Types"
msgstr "Tipos"

#: super_archives/models.py:62
#: super_archives/models.py:45
msgid "Select an User from list"
msgstr ""

#: super_archives/models.py:47 super_archives/models.py:57
#, fuzzy
msgid "Email Address"
msgstr "Endereço de e-mail verificado!"

#: super_archives/models.py:48
#, fuzzy
msgid "Enter a Email Address"
msgstr "Adicionar outro endereço de e-mail"

#: super_archives/models.py:50
msgid "Real name"
msgstr ""

#: super_archives/models.py:51
msgid "Enter an User's real name"
msgstr ""

#: super_archives/models.py:53
msgid "MD5"
msgstr ""

#: super_archives/models.py:54
msgid "Enter a MD5 Sum"
msgstr ""

#: super_archives/models.py:58
#, fuzzy
msgid "Email Addresses"
msgstr "Endereço de e-mail verificado!"

#: super_archives/models.py:72
#: super_archives/templates/message-preview.html:62
#: super_archives/templates/message-thread.html:4
msgid "Anonymous"
msgstr "Anônimo"

#: super_archives/models.py:112
#: super_archives/models.py:121
#, fuzzy
msgid "Subject token"
msgstr "Assunto"

#: super_archives/models.py:123
msgid "Mailing List"
msgstr "Lista de e-mail"

#: super_archives/models.py:113
#: super_archives/models.py:124
msgid "The Mailing List where is the thread"
msgstr "A lista de e-mail onde estão as mensagens"

#: super_archives/models.py:116
#: super_archives/models.py:127
msgid "Latest message"
msgstr "Última mensagem"

#: super_archives/models.py:117
#: super_archives/models.py:128
msgid "Latest message posted"
msgstr "Última mensagem postada"

#: super_archives/models.py:118
#: super_archives/models.py:129
msgid "Score"
msgstr "Pontuação"

#: super_archives/models.py:118
#: super_archives/models.py:129
msgid "Thread score"
msgstr "Pontuação do conjunto de mensagens"

#: super_archives/models.py:127
#: super_archives/models.py:131 super_archives/models.py:269
msgid "is SPAM?"
msgstr ""

#: super_archives/models.py:139 super_archives/models.py:251
msgid "Thread"
msgstr "Conjunto de mensagens"

#: super_archives/models.py:128
#: super_archives/models.py:140
msgid "Threads"
msgstr "Conjuntos de mensagens"

#: super_archives/models.py:242
#: super_archives/models.py:249
msgid "From address"
msgstr ""

#: super_archives/models.py:256
msgid "Subject"
msgstr "Assunto"

#: super_archives/models.py:243
#: super_archives/models.py:257
msgid "Please enter a message subject"
msgstr "Por favor, digite o assunto da mensagem"

#: super_archives/models.py:246
#: super_archives/models.py:259
#, fuzzy
msgid "Subject clean"
msgstr "Assunto"

#: super_archives/models.py:261
msgid "Message body"
msgstr "Corpo da mensagem"

#: super_archives/models.py:247
#: super_archives/models.py:262
msgid "Please enter a message body"
msgstr "Por favor, digite o corpo da mensagem"

#: super_archives/models.py:257
#: super_archives/models.py:264
msgid "Received time"
msgstr ""

#: super_archives/models.py:265
#, fuzzy
msgid "Please enter a Received time"
msgstr "Por favor, digite o assunto da mensagem"

#: super_archives/models.py:267
#, fuzzy
msgid "Message id"
msgstr "Mensagem"

#: super_archives/models.py:276
msgid "Message"
msgstr "Mensagem"

Binary file added src/planet/locale/es/LC_MESSAGES/django.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions src/planet/locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -96,8 +96,8 @@ msgstr "Solicite la inclusión de un blog"
#: templates/feedzilla/tag.html:5
#, python-format
msgid "Posts with &laquo;%(tag)s&raquo; label"
msgstr "Envíos con etiqueta &laquo;%(tag)s&raquo;"
msgstr "Mensajes con etiqueta &laquo;%(tag)s&raquo;"

#: templates/feedzilla/tag.html:14
msgid "No posts with such label"
msgstr "No hay envíos con dicha etiqueta"
msgstr "No hay mensajes con dicha etiqueta"
Binary file not shown.
47 changes: 33 additions & 14 deletions src/super_archives/models.py
Original file line number Diff line number Diff line change
@@ -37,15 +37,25 @@ class EmailAddressValidation(models.Model):
class Meta:
unique_together = ('user', 'address')


class EmailAddress(models.Model):
user = models.ForeignKey(User, null=True, related_name='emails',
on_delete=models.SET_NULL)
address = models.EmailField(unique=True)
real_name = models.CharField(max_length=64, blank=True, db_index=True)
md5 = models.CharField(max_length=32, null=True)
user = models.ForeignKey(User,
null=True, related_name='emails',
on_delete=models.SET_NULL,
verbose_name=_(u"User"),
help_text=_(u"Select an User from list"))
address = models.EmailField(unique=True,
verbose_name=_(u"Email Address"),
help_text=_(u"Enter a Email Address"))
real_name = models.CharField(max_length=64, blank=True, db_index=True,
verbose_name=_(u"Real name"),
help_text=_(u"Enter an User's real name"))
md5 = models.CharField(max_length=32, null=True,
verbose_name=_(u"MD5"),
help_text=_(u"Enter a MD5 Sum"))

class Meta:
verbose_name = _(u"Email Address")
verbose_name_plural = _(u"Email Addresses")
ordering = ('id', )

def save(self, *args, **kwargs):
@@ -107,7 +117,8 @@ def __unicode__(self):

class Thread(models.Model, HitCounterModelMixin):

subject_token = models.CharField(max_length=512)
subject_token = models.CharField(max_length=512,
verbose_name=_(u"Subject token"))
mailinglist = models.ForeignKey(MailingList,
verbose_name=_(u"Mailing List"),
help_text=_(u"The Mailing List where is the thread"))
@@ -116,7 +127,8 @@ class Thread(models.Model, HitCounterModelMixin):
verbose_name=_(u"Latest message"),
help_text=_(u"Latest message posted"))
score = models.IntegerField(default=0, verbose_name=_(u"Score"), help_text=_(u"Thread score"))
spam = models.BooleanField(default=False)
spam = models.BooleanField(default=False,
verbose_name=_(u"is SPAM?"))

highest_score = HighestScore()
all_objects = models.Manager()
@@ -233,21 +245,28 @@ def __unicode__(self):

class Message(models.Model):

from_address = models.ForeignKey(EmailAddress, db_index=True)
thread = models.ForeignKey(Thread, null=True, db_index=True)
from_address = models.ForeignKey(EmailAddress, db_index=True,
verbose_name=_(u"From address"))
thread = models.ForeignKey(Thread, null=True, db_index=True,
verbose_name=_(u"Thread"))
# RFC 2822 recommends to use 78 chars + CRLF (so 80 chars) for
# the max_length of a subject but most of implementations
# goes for 256. We use 512 just in case.
subject = models.CharField(max_length=512, db_index=True,
verbose_name=_(u"Subject"),
help_text=_(u"Please enter a message subject"))
subject_clean = models.CharField(max_length=512, db_index=True)
subject_clean = models.CharField(max_length=512, db_index=True,
verbose_name=_(u"Subject clean"))
body = models.TextField(default='',
verbose_name=_(u"Message body"),
help_text=_(u"Please enter a message body"))
received_time = models.DateTimeField(db_index=True)
message_id = models.CharField(max_length=512)
spam = models.BooleanField(default=False)
received_time = models.DateTimeField(db_index=True,
verbose_name=_(u"Received time"),
help_text=_(u"Please enter a Received time"))
message_id = models.CharField(max_length=512,
verbose_name=_(u"Message id"))
spam = models.BooleanField(default=False,
verbose_name=_(u"is SPAM?"))

all_objects = models.Manager()
objects = NotSpamManager()