| 1 | # Check that a string that needs a comment has one |
| 2 | # # Copyright (C) 2015 Red Hat, Inc. |
| 3 | # |
| 4 | # This copyrighted material is made available to anyone wishing to use, |
| 5 | # modify, copy, or redistribute it subject to the terms and conditions of |
| 6 | # the GNU Lesser General Public License v.2, or (at your option) any later |
| 7 | # version. This program is distributed in the hope that it will be useful, |
| 8 | # but WITHOUT ANY WARRANTY expressed or implied, including the implied |
| 9 | # warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
| 10 | # the GNU Lesser General Public License for more details. You should have |
| 11 | # received a copy of the GNU Lesser General Public License along with this |
| 12 | # program; if not, write to the Free Software Foundation, Inc., 51 Franklin |
| 13 | # Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat trademarks |
| 14 | # that are incorporated in the source code or documentation are not subject |
| 15 | # to the GNU Lesser General Public License and may only be used or |
| 16 | # replicated with the express permission of Red Hat, Inc. |
| 17 | # |
| 18 | # Red Hat Author(s): David Shea <[email protected]> |
| 19 | |
| 20 | def test_comment(poentry): |
| 21 | # Single-character translatable strings (e.g., the 'c' of press c to |
| 22 | # continue) need some additional context in order to make sense. Make |
| 23 | # sure that they have it. |
| 24 | |
| 25 | if len(poentry.msgid) == 1 and not poentry.comment: |
| 26 | raise AssertionError("Single-character string missing a comment.") |