Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: translate/translate
...
head fork: translate/translate
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 09, 2012
@friedelwolff friedelwolff Use 'UTF-8' (uppercase) by default.
The gettext manual says "Usually upper case is preferred."
4a5a252
@friedelwolff friedelwolff Simplify header initialisation.
No functional change.
320095f
Showing with 8 additions and 14 deletions.
  1. +7 −13 translate/convert/prop2po.py
  2. +1 −1  translate/storage/poheader.py
View
20 translate/convert/prop2po.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
-# Copyright 2002-2006 Zuza Software Foundation
+# Copyright 2002-2010,2012 Zuza Software Foundation
#
# This file is part of translate.
#
@@ -39,13 +39,10 @@ def convertstore(self, thepropfile, personality="java",
"""converts a .properties file to a .po file..."""
self.personality = personality
thetargetfile = po.pofile()
- if self.personality == "mozilla" or self.personality == "skype":
- targetheader = thetargetfile.init_headers(charset="UTF-8",
- encoding="8bit",
- x_accelerator_marker="&")
+ if self.personality in ("mozilla", "skype"):
+ targetheader = thetargetfile.init_headers(x_accelerator_marker="&")
else:
- targetheader = thetargetfile.init_headers(charset="UTF-8",
- encoding="8bit")
+ targetheader = thetargetfile.init_headers()
targetheader.addnote("extracted from %s" % thepropfile.filename,
"developer")
# we try and merge the header po with any comments at the start of the
@@ -79,13 +76,10 @@ def mergestore(self, origpropfile, translatedpropfile, personality="java",
"""converts two .properties files to a .po file..."""
self.personality = personality
thetargetfile = po.pofile()
- if self.personality == "mozilla" or self.personality == "skype":
- targetheader = thetargetfile.init_headers(charset="UTF-8",
- encoding="8bit",
- x_accelerator_marker="&")
+ if self.personality in ("mozilla", "skype"):
+ targetheader = thetargetfile.init_headers(x_accelerator_marker="&")
else:
- targetheader = thetargetfile.init_headers(charset="UTF-8",
- encoding="8bit")
+ targetheader = thetargetfile.init_headers()
targetheader.addnote("extracted from %s, %s" % (origpropfile.filename, translatedpropfile.filename),
"developer")
translatedpropfile.makeindex()
View
2  translate/storage/poheader.py
@@ -122,7 +122,7 @@ class poheader(object):
"X-Generator",
]
- def init_headers(self, charset='utf-8', encoding='8bit', **kwargs):
+ def init_headers(self, charset='UTF-8', encoding='8bit', **kwargs):
"""sets default values for po headers"""
#FIXME: we need to allow at least setting target language, pluralforms and generator
headerdict = self.makeheaderdict(charset=charset, encoding=encoding, **kwargs)

No commit comments for this range

Something went wrong with that request. Please try again.