Skip to content

Commit

Permalink
Partial internationalization, fix #6; Adds translation strings for pt-br
Browse files Browse the repository at this point in the history
  • Loading branch information
dirtycoder committed Nov 17, 2016
1 parent 79cfba2 commit 4e83f02
Show file tree
Hide file tree
Showing 30 changed files with 568 additions and 153 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
*.log
*.pyc
*.sqlite3
*.mo
.coverage
.env
.idea
Expand Down
95 changes: 95 additions & 0 deletions locale/pt_BR/LC_MESSAGES/django.po
@@ -0,0 +1,95 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-16 22:36-0200\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"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#: pets/templates/_layouts/base.html:8
msgid "Missing and for adoption pets"
msgstr "Pets desaparecidos e para adoção"

#: pets/templates/_layouts/base.html:36
msgid "Toggle navigation"
msgstr "Alternar navegação"

#: pets/templates/_layouts/base.html:47
msgid "Pets"
msgstr "Pets"

#: pets/templates/_layouts/base.html:48
msgid "Register Pet"
msgstr "Cadastrar Pet"

#: pets/templates/_layouts/base.html:50
msgid "Profile"
msgstr "Perfil"

#: pets/templates/_layouts/base.html:51
msgid "Logout"
msgstr "Logout"

#: pets/templates/_layouts/base.html:53
msgid "Create Account"
msgstr "Criar Conta"

#: pets/templates/_layouts/base.html:54
msgid "Login"
msgstr "Login"

#: pets/templates/_layouts/base.html:56
msgid "About"
msgstr "Sobre"

#: pets/templates/_layouts/base.html:57
msgid "Search"
msgstr "Pesquisar"

#: pets/templates/_layouts/base.html:108
msgid "Made with &hearts; in Araras, São Paulo"
msgstr "Feito com &hearts; em Araras, São Paulo"

#: pets/templates/_layouts/base.html:118
msgid "What is it?"
msgstr "O que é?"

#: pets/templates/_layouts/base.html:120
msgid ""
"The purpose of Cadê meu Bicho is to provide the encounter between the best "
"or future best friends. :)"
msgstr ""
"O objetivo do Cadê meu Bicho é proporcionar o encontro entre os melhores ou "
"futuro melhores amigos. :)"

#: pets/templates/_layouts/base.html:123
msgid "Contact"
msgstr "Contato"

#: pets/templates/_partials/pets_list.html:23
msgid "Details"
msgstr "Detalhes"

#: pets/templates/_partials/pets_list.html:35
msgid "Previous"
msgstr "Anterior"

#: pets/templates/_partials/pets_list.html:47
msgid "Next"
msgstr "Próxima"

#: pets/templates/_partials/pets_list.html:56
msgid "No friends in this category yet :)"
msgstr "Nenhum amiguinho nessa categoria ainda. :)"
9 changes: 4 additions & 5 deletions pets/api/tests/test_home_view.py
Expand Up @@ -2,12 +2,12 @@

from django.shortcuts import resolve_url
from django.test import TestCase

from meupet.models import City, Kind, Pet
from users.models import OwnerProfile


class TestGetHome(TestCase):

def setUp(self):
City.objects.create(city='Araras')

Expand Down Expand Up @@ -57,13 +57,12 @@ def test_contents(self):
self.assertEqual('Costelinha', pet['description'])
self.assertEqual('Araras', pet['city'])
self.assertEqual('Gato', pet['kind'])
self.assertEqual('Para Adoção', pet['status'])
self.assertEqual('Pequeno', pet['size'])
self.assertEqual('Macho', pet['sex'])
self.assertEqual('For Adoption', pet['status'])
self.assertEqual('Small', pet['size'])
self.assertEqual('Male', pet['sex'])


class TestPostHome(TestCase):

def setUp(self):
super().setUp()
self.resp = self.client.post(resolve_url('api:home'))
Expand Down
27 changes: 14 additions & 13 deletions pets/functional_tests/tests.py
Expand Up @@ -83,9 +83,10 @@ def login(self):
password.send_keys('admin')
submit = self.browser.find_element_by_name('login')
submit.click()
self.assertIn('Cadastrar Pet', self.browser.page_source)
self.assertIn('Register Pet', self.browser.page_source)

def create_pet(self):
@staticmethod
def create_pet():
admin = OwnerProfile.objects.first()
kind = Kind.objects.first()
pet = Pet(owner=admin, name='Costela', description='Costelinha', kind_id=kind.id,
Expand All @@ -95,11 +96,11 @@ def create_pet(self):

def test_login(self):
self.login()
self.assertIn('Cadastrar Pet', self.browser.page_source)
self.assertIn('Register Pet', self.browser.page_source)

def test_register_pet(self):
self.login()
self.assertIn('Cadastrar Pet', self.browser.page_source)
self.assertIn('Register Pet', self.browser.page_source)

self.browser.get(self.live_server_url + '/pets/novo/')

Expand Down Expand Up @@ -132,7 +133,7 @@ def test_logout(self):
def test_edit_own_pet(self):
# user log in
self.login()
self.assertIn('Cadastrar Pet', self.browser.page_source)
self.assertIn('Register Pet', self.browser.page_source)

# user register a lost cat with wrong name
self.browser.get(self.live_server_url + '/pets/novo/')
Expand Down Expand Up @@ -160,11 +161,11 @@ def test_edit_own_pet(self):

# assert pet was registered
self.browser.find_element_by_link_text('aqui').click()
self.assertIn('Wrong Boots - Desaparecido', self.browser.page_source)
self.assertIn('Wrong Boots - Missing', self.browser.page_source)

# user is redirected for the page of his pet and see the wrong name
# then click on 'Edit' and get redirected for the editing page
self.browser.find_element_by_link_text('Editar').click()
self.browser.find_element_by_link_text('Edit').click()

# user change the status to 'For Adoption'
self.select_dropdown('status', 1)
Expand All @@ -175,14 +176,14 @@ def test_edit_own_pet(self):
self.browser.find_element_by_name('submit').click()

# user see that he is back at the pet page
self.browser.find_element_by_link_text('Editar')
self.browser.find_element_by_link_text('Edit')

# user see the correct name of the cat
self.assertIn('Fuzzy Boots', self.browser.page_source)
self.assertIn('Grande', self.browser.page_source)
self.assertIn('Fêmea', self.browser.page_source)
self.assertIn('Large', self.browser.page_source)
self.assertIn('Female', self.browser.page_source)
self.assertIn('Araras', self.browser.page_source)
self.assertIn('Fuzzy Boots - Para Adoção', self.browser.page_source)
self.assertIn('Fuzzy Boots - For Adoption', self.browser.page_source)

def test_edit_profile_information(self):
# user login
Expand All @@ -205,7 +206,7 @@ def test_edit_profile_information(self):
self.browser.find_element_by_name('submit').click()

# user is back to the profile page and see the correct information
self.assertIn('Alterações gravadas com sucesso.', self.browser.page_source)
self.assertIn('Changes saved successfully.', self.browser.page_source)

def test_upload_second_photo(self):
# pre register pet
Expand All @@ -229,7 +230,7 @@ def test_upload_second_photo(self):
img_after = len(self.browser.find_elements_by_tag_name('img'))

# verify new photo is showing
self.assertIn('Outras fotos', self.browser.page_source)
self.assertIn('More photos', self.browser.page_source)
self.assertEquals(img_after, img_before + 1)

def test_create_new_city(self):
Expand Down

0 comments on commit 4e83f02

Please sign in to comment.