summaryrefslogtreecommitdiff
path: root/horizon/test
diff options
context:
space:
mode:
authorAkihiro Motoki <motoki@da.jp.nec.com>2016-03-07 00:58:00 +0900
committerAkihiro Motoki <motoki@da.jp.nec.com>2016-03-07 23:11:39 +0900
commitce6e34a5e4c8841ff0d8da738339cb374beb0949 (patch)
tree56e5097eef718d42fb432ad48b85e3f7806a9a71 /horizon/test
parent086b704278fcc63ca4904bfd0adbdcc6e3827426 (diff)
downloadhorizon-ce6e34a5e4c8841ff0d8da738339cb374beb0949.tar.gz
Honor comments for translators when extracting messages
To extract commments for translators, '--add-comments' option must be passed to pybabel. Comments for translators were extracted when we used Django tools to extract messages, but when we switched to pybabel it was lost. This commit adds the option to run_tests.sh. Move the place of existing comments for translators so that pybabel can find them. Django tool and pybabel expect a bit different places. Also add comments to ungettext_lazy in test codes. Closes-Bug: #1553581 Change-Id: Ia2df36dfebb59bede19d57b2158a907126ca1944
Diffstat (limited to 'horizon/test')
-rw-r--r--horizon/test/test_dashboards/dogs/puppies/tables.py4
-rw-r--r--horizon/test/tests/tables.py6
2 files changed, 8 insertions, 2 deletions
diff --git a/horizon/test/test_dashboards/dogs/puppies/tables.py b/horizon/test/test_dashboards/dogs/puppies/tables.py
index 933fc9a23..cfea9a426 100644
--- a/horizon/test/test_dashboards/dogs/puppies/tables.py
+++ b/horizon/test/test_dashboards/dogs/puppies/tables.py
@@ -26,8 +26,8 @@ class EagerPuppiesTable(tables.DataTable):
class SellPuppy(tables.DeleteAction):
@staticmethod
def action_present(count):
+ # Translators: test code, don't really have to translate
return ungettext_lazy(
- # Translators: test code, don't really have to translate
u"Sell Puppy",
u"Sell Puppies",
count
@@ -35,8 +35,8 @@ class SellPuppy(tables.DeleteAction):
@staticmethod
def action_past(count):
+ # Translators: test code, don't really have to translate
return ungettext_lazy(
- # Translators: test code, don't really have to translate
u"Sold Puppy",
u"Sold Puppies",
count
diff --git a/horizon/test/tests/tables.py b/horizon/test/tests/tables.py
index c1d43e8b4..be073d210 100644
--- a/horizon/test/tests/tables.py
+++ b/horizon/test/tests/tables.py
@@ -135,6 +135,7 @@ class MyBatchAction(tables.BatchAction):
@staticmethod
def action_present(count):
+ # Translators: test code, don't really have to translate
return ungettext_lazy(
u"Batch Item",
u"Batch Items",
@@ -143,6 +144,7 @@ class MyBatchAction(tables.BatchAction):
@staticmethod
def action_past(count):
+ # Translators: test code, don't really have to translate
return ungettext_lazy(
u"Batched Item",
u"Batched Items",
@@ -170,12 +172,14 @@ class MyToggleAction(tables.BatchAction):
def action_present(self, count):
if self.current_present_action:
+ # Translators: test code, don't really have to translate
return ungettext_lazy(
u"Up Item",
u"Up Items",
count
)
else:
+ # Translators: test code, don't really have to translate
return ungettext_lazy(
u"Down Item",
u"Down Items",
@@ -184,12 +188,14 @@ class MyToggleAction(tables.BatchAction):
def action_past(self, count):
if self.current_past_action:
+ # Translators: test code, don't really have to translate
return ungettext_lazy(
u"Upped Item",
u"Upped Items",
count
)
else:
+ # Translators: test code, don't really have to translate
return ungettext_lazy(
u"Downed Item",
u"Downed Items",