File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 33from redgettext import Options
44from tests .utils import FILENAME , get_extractor , get_test_potfile
55
6- OPTIONS = Options ()
6+ OPTIONS = Options (keyword_specs = ( "_:1" , 'ngettext:1,2,"comment from keyword spec"' ) )
77SOURCE = """\
88 # Translators: comment A1
99_('A') + _('B')
4141# as long as there's no code between
4242
4343_('D')
44+
45+ # Translators: handles comments from keyspec too
46+ # no matter if there's a translator comment in code or not
47+ ngettext('E', 'F', 2)
48+
49+ ngettext('G', 'H', 2)
4450"""
4551
4652
@@ -86,6 +92,22 @@ def test_comments() -> None:
8692 "as long as there's no code between"
8793 ),
8894 ),
95+ polib .POEntry (
96+ msgid = "E" ,
97+ msgid_plural = "F" ,
98+ occurrences = [(FILENAME , 40 )],
99+ comment = (
100+ "Translators: handles comments from keyspec too\n "
101+ "no matter if there's a translator comment in code or not\n "
102+ "comment from keyword spec"
103+ ),
104+ ),
105+ polib .POEntry (
106+ msgid = "G" ,
107+ msgid_plural = "H" ,
108+ occurrences = [(FILENAME , 42 )],
109+ comment = "comment from keyword spec" ,
110+ ),
89111 )
90112 assert str (extractor .potfile_manager .current_potfile ) == str (expected )
91113 assert extractor .potfile_manager .current_potfile == expected
You can’t perform that action at this time.
0 commit comments