diff options
Diffstat (limited to 'babel/messages/pofile.py')
-rw-r--r-- | babel/messages/pofile.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/babel/messages/pofile.py b/babel/messages/pofile.py index 76d3123..a9180a7 100644 --- a/babel/messages/pofile.py +++ b/babel/messages/pofile.py @@ -184,7 +184,7 @@ class PoFileParser: string = ['' for _ in range(self.catalog.num_plurals)] for idx, translation in self.translations: if idx >= self.catalog.num_plurals: - self._invalid_pofile(u"", self.offset, "msg has more translations than num_plurals of catalog") + self._invalid_pofile("", self.offset, "msg has more translations than num_plurals of catalog") continue string[idx] = translation.denormalize() string = tuple(string) @@ -320,8 +320,8 @@ class PoFileParser: # No actual messages found, but there was some info in comments, from which # we'll construct an empty header message if not self.counter and (self.flags or self.user_comments or self.auto_comments): - self.messages.append(_NormalizedString(u'""')) - self.translations.append([0, _NormalizedString(u'""')]) + self.messages.append(_NormalizedString('""')) + self.translations.append([0, _NormalizedString('""')]) self._add_message() def _invalid_pofile(self, line, lineno, msg) -> None: @@ -462,7 +462,7 @@ def normalize(string: str, prefix: str = '', width: int = 76) -> str: # separate line buf.append(chunks.pop()) break - lines.append(u''.join(buf)) + lines.append(''.join(buf)) else: lines.append(line) else: @@ -475,7 +475,7 @@ def normalize(string: str, prefix: str = '', width: int = 76) -> str: if lines and not lines[-1]: del lines[-1] lines[-1] += '\n' - return u'""\n' + u'\n'.join([(prefix + escape(line)) for line in lines]) + return '""\n' + '\n'.join([(prefix + escape(line)) for line in lines]) def write_po( @@ -586,7 +586,7 @@ def write_po( for line in comment_header.splitlines(): lines += wraptext(line, width=width, subsequent_indent='# ') - comment_header = u'\n'.join(lines) + comment_header = '\n'.join(lines) _write(f"{comment_header}\n") for comment in message.user_comments: |