[pybliographer] Use Unicode in translatable strings
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pybliographer] Use Unicode in translatable strings
- Date: Sat, 7 Oct 2017 01:38:58 +0000 (UTC)
commit 89fa0ffa9f6eb9200608f7259b701792fe6371dd
Author: Piotr Drąg <piotrdrag gmail com>
Date: Fri Apr 28 19:45:29 2017 +0200
Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html
https://bugzilla.gnome.org/show_bug.cgi?id=781912
Pyblio/Autoload.py | 2 +-
Pyblio/Config.py | 4 +-
Pyblio/Format/BibTeX.py | 8 +++---
Pyblio/GnomeUI/Document.py | 40 +++++++++++++++++-----------------
Pyblio/GnomeUI/Editor.py | 6 ++--
Pyblio/GnomeUI/FileSelector.py | 2 +-
Pyblio/GnomeUI/OpenURL.py | 2 +-
Pyblio/GnomeUI/glade/pyblio.glade.in | 18 +++++++-------
Pyblio/LyX.py | 4 +-
Pyblio/Open.py | 12 +++++-----
Pyblio/Resource.py | 6 ++--
Pyblio/Style/Parser.py | 2 +-
pybliographer.py | 8 +++---
scripts/pybliocheck.py | 4 +-
scripts/pybliocompact.py | 4 +-
scripts/pyblioformat.py | 22 +++++++++---------
scripts/pybliotex.py | 4 +-
scripts/pybliotext.py | 24 ++++++++++----------
18 files changed, 86 insertions(+), 86 deletions(-)
---
diff --git a/Pyblio/Autoload.py b/Pyblio/Autoload.py
index 28bddcc..1080766 100644
--- a/Pyblio/Autoload.py
+++ b/Pyblio/Autoload.py
@@ -76,7 +76,7 @@ class Loader:
import locale
charset = locale.getlocale () [1] or 'ascii'
- print (_("warning: can't import %s: %s") %
+ print (_("warning: can’t import %s: %s") %
(self.module, str (err))).encode (charset)
return 0
diff --git a/Pyblio/Config.py b/Pyblio/Config.py
index 67c5752..71f31b5 100644
--- a/Pyblio/Config.py
+++ b/Pyblio/Config.py
@@ -50,7 +50,7 @@ class ConfigItem:
if self.type:
if not self.type.match (value):
raise ValueError(
- _("value of `%s' should be of type %s") % (
+ _("value of “%s” should be of type %s") % (
self.name, str (self.type)))
# eventually call the hook
@@ -256,7 +256,7 @@ class Element:
return value in self.get()
def __str__ (self):
- return _("Element in `%s'") % str (self.get ())
+ return _("Element in “%s”") % str (self.get ())
class Tuple:
diff --git a/Pyblio/Format/BibTeX.py b/Pyblio/Format/BibTeX.py
index 9ad76d5..d5611bd 100644
--- a/Pyblio/Format/BibTeX.py
+++ b/Pyblio/Format/BibTeX.py
@@ -321,7 +321,7 @@ class DataBase(Base.DataBase):
valid = re.compile('^\w+$')
for k in user.keys():
if not valid.match(k):
- raise TypeError, _("key `%s' is malformed") % k
+ raise TypeError, _("key “%s” is malformed") % k
_bibtex.set_string(self.parser, k,
_bibtex.reverse(_base_fieldtype[Text],
Config.get('bibtex+/braces').data,
@@ -338,7 +338,7 @@ class DataBase(Base.DataBase):
self.add(entry)
else:
if self.dict.has_key(entry.key):
- errors.append(_("%s:%d: key `%s' already defined") % (
+ errors.append(_("%s:%d: key “%s” already defined") % (
str(self.key), entry.line, entry.key.key))
else:
self.dict [entry.key] = entry
@@ -357,7 +357,7 @@ class DataBase(Base.DataBase):
self.add(entry)
else:
if self.dict.has_key(entry.key):
- errors.append(_("%s:%d: key `%s' already defined") % (
+ errors.append(_("%s:%d: key “%s” already defined") % (
repr(self.key), entry.line, repr(entry.key.key)))
else:
self.dict[entry.key] = entry
@@ -369,7 +369,7 @@ class DataBase(Base.DataBase):
valid = re.compile('^\w+$')
for k in user.keys():
if not valid.match(k):
- raise TypeError, _("key `%s' is malformed") % k
+ raise TypeError, _("key “%s” is malformed") % k
_bibtex.set_string(self.parser, k,
_bibtex.reverse(_base_fieldtype[Text],
Config.get('bibtex+/braces').data,
diff --git a/Pyblio/GnomeUI/Document.py b/Pyblio/GnomeUI/Document.py
index 7ef89a3..8692543 100644
--- a/Pyblio/GnomeUI/Document.py
+++ b/Pyblio/GnomeUI/Document.py
@@ -158,8 +158,8 @@ class Document (Connector.Publisher):
('Close', gtk.STOCK_CLOSE, None, None, None, self.close_document),
('Quit', gtk.STOCK_QUIT, None, None, None, self.exit_application),
- ('Merge', None, _('Merge With...'), '<control>g', None, self.merge_database),
- ('Medline', None, _('Medline Query...'), '<control>m', None, self.query_database),
+ ('Merge', None, _('Merge With…'), '<control>g', None, self.merge_database),
+ ('Medline', None, _('Medline Query…'), '<control>m', None, self.query_database),
@@ -172,11 +172,11 @@ class Document (Connector.Publisher):
('Delete', gtk.STOCK_DELETE, None, None, None, self.delete_entry),
('Find', gtk.STOCK_FIND, None, None, None, self.find_entries),
- ('Sort', None, _('S_ort...'), None, None, self.sort_entries),
- ('Cite', gtk.STOCK_JUMP_TO, _('Cite...'), None, _('Cite key(s)'), self.lyx_cite),
- ('Format', gtk.STOCK_EXECUTE, _('Format...'), None, None, self.format_entries),
+ ('Sort', None, _('S_ort…'), None, None, self.sort_entries),
+ ('Cite', gtk.STOCK_JUMP_TO, _('Cite…'), None, _('Cite key(s)'), self.lyx_cite),
+ ('Format', gtk.STOCK_EXECUTE, _('Format…'), None, None, self.format_entries),
- ('Fields', None, _('Fields...'), None, None, self.set_fields),
+ ('Fields', None, _('Fields…'), None, None, self.set_fields),
('Preferences', gtk.STOCK_PREFERENCES, None, None, None, self.set_preferences),
('Forget', None, _('Forget all changes'), None, None, self.forget_changes_cb),
@@ -390,7 +390,7 @@ class Document (Connector.Publisher):
try:
file = open (output, 'w')
except IOError, err:
- self.w.error (_("can't open file `%s' for writing:\n%s")
+ self.w.error (_("can’t open file “%s” for writing:\n%s")
% (output, str (err)))
return
@@ -411,7 +411,7 @@ class Document (Connector.Publisher):
Pyblio.Style.Utils.generate (url, format, self.data, entries, file)
except RuntimeError, err:
print err
- self.w.error (_("Error while parsing `%s':\n%s") % (style, err))
+ self.w.error (_("Error while parsing “%s”:\n%s") % (style, err))
return
@@ -651,7 +651,7 @@ class Document (Connector.Publisher):
os.remove (old_auto_save)
except (OSError, IOError), error:
Utils.set_cursor (self.w, 'normal')
- self.w.error (_("Unable to remove autosave file `%s':\n%s") % (str (old_auto_save),
str (error)))
+ self.w.error (_("Unable to remove autosave file “%s”:\n%s") % (str (old_auto_save),
str (error)))
return
@@ -730,7 +730,7 @@ class Document (Connector.Publisher):
self.data.update (Sort.Sort([Sort.KeySort()]))
except (OSError, IOError), error:
Utils.set_cursor (self.w, 'normal')
- self.w.error (_("Unable to save `%s':\n%s") % (str (self.data.key),
+ self.w.error (_("Unable to save “%s”:\n%s") % (str (self.data.key),
str (error)))
return
except:
@@ -738,7 +738,7 @@ class Document (Connector.Publisher):
traceback.print_exception (etype, value, tb)
Utils.set_cursor (self.w, 'normal')
- self.w.error (_("An internal error occurred during saving\nTry to Save As..."))
+ self.w.error (_("An internal error occurred during saving\nTry to Save As…"))
return
Utils.set_cursor (self.w, 'normal')
@@ -753,13 +753,13 @@ class Document (Connector.Publisher):
def save_document_as (self, * arg):
# get a new file name
(url, how) = FileSelector.URLFileSelection (
- _("Save As..."), has_auto = False, is_save = True).run ()
+ _("Save As…"), has_auto = False, is_save = True).run ()
if url is None: return
if os.path.exists (url):
if not Utils.Callback (
- _("The file `%s' already exists.\nOverwrite it?")
+ _("The file “%s” already exists.\nOverwrite it?")
% url, parent = self.w).answer ():
return
@@ -792,7 +792,7 @@ class Document (Connector.Publisher):
os.remove (old_auto_save)
except (OSError, IOError), error:
Utils.set_cursor (self.w, 'normal')
- self.w.error (_("Unable to remove autosave file `%s':\n%s") % (str (old_auto_save),
str (error)))
+ self.w.error (_("Unable to remove autosave file “%s”:\n%s") % (str (old_auto_save),
str (error)))
return
@@ -852,7 +852,7 @@ class Document (Connector.Publisher):
os.remove (old_auto_save)
except (OSError, IOError), error:
Utils.set_cursor (self.w, 'normal')
- self.w.error (_("Unable to remove autosave file `%s':\n%s") % (str (old_auto_save),
str (error)))
+ self.w.error (_("Unable to remove autosave file “%s”:\n%s") % (str (old_auto_save),
str (error)))
return
return answer
@@ -877,7 +877,7 @@ class Document (Connector.Publisher):
for entry in entries:
if self.data.would_have_key (entry.key):
- if not Utils.Callback (_("An entry called `%s' already exists.\nRename and add it anyway?")
+ if not Utils.Callback (_("An entry called “%s” already exists.\nRename and add it anyway?")
% entry.key.key, parent = self.w).answer ():
continue
@@ -997,7 +997,7 @@ class Document (Connector.Publisher):
if l > 1:
question = _("Remove all the %d entries?") % len (entries)
else:
- question = _("Remove entry `%s'?") % entries [0].key.key
+ question = _("Remove entry “%s”?") % entries [0].key.key
if not Utils.Callback (question,
parent = self.w).answer ():
@@ -1095,7 +1095,7 @@ class Document (Connector.Publisher):
try:
self.lyx = LyX.LyXClient ()
except IOError, msg:
- self.w.error (_("Can't connect to LyX:\n%s") % msg)
+ self.w.error (_("Can’t connect to LyX:\n%s") % msg)
return
keys = string.join (map (lambda x: x.key.key, entries), ', ')
@@ -1103,7 +1103,7 @@ class Document (Connector.Publisher):
self.lyx ('citation-insert', keys)
except IOError, msg:
msg = msg [1].decode (enc)
- self.w.error (_("Can't connect to LyX:\n%s") % msg)
+ self.w.error (_("Can’t connect to LyX:\n%s") % msg)
return
@@ -1219,7 +1219,7 @@ class Document (Connector.Publisher):
gtk.show_uri (None, "help:pybliographer", timestamp)
except gobject.GError, msg:
- self.w.error (_("Can't display documentation:\n%s") % msg)
+ self.w.error (_("Can’t display documentation:\n%s") % msg)
return
diff --git a/Pyblio/GnomeUI/Editor.py b/Pyblio/GnomeUI/Editor.py
index 31dd40d..8f3e7c3 100644
--- a/Pyblio/GnomeUI/Editor.py
+++ b/Pyblio/GnomeUI/Editor.py
@@ -500,7 +500,7 @@ class URL (BaseField):
self.old_url = self.string.decode ('latin-1')
self.edit.set_text (self.old_url)
self.box.pack_start (self.edit)
- self.button = gtk.Button (_('Browse...'))
+ self.button = gtk.Button (_('Browse…'))
self.button.connect ("clicked", self.cb_clicked)
self.box.pack_start (self.button, False)
h.pack_start (self.box)
@@ -915,7 +915,7 @@ class RealEditor (Connector.Publisher):
if key != self.entry.key:
if database.has_key (key):
Compat.error_dialog_parented (
- _("Key `%s' already exists") % str (key.key),
+ _("Key “%s” already exists") % str (key.key),
self.w.get_toplevel ())
return None
@@ -932,7 +932,7 @@ class RealEditor (Connector.Publisher):
f = Types.get_field(item.field)
Compat.error_dialog_parented(
- _("The `%s' field contains a non Latin-1 symbol") %
+ _("The “%s” field contains a non Latin-1 symbol") %
f.name, self.w.get_toplevel())
return None
diff --git a/Pyblio/GnomeUI/FileSelector.py b/Pyblio/GnomeUI/FileSelector.py
index 25a22c8..71167d7 100644
--- a/Pyblio/GnomeUI/FileSelector.py
+++ b/Pyblio/GnomeUI/FileSelector.py
@@ -91,7 +91,7 @@ class URLFileSelection (gtk.FileChooserDialog):
self.formats = []
if has_auto:
- self.menu.append_text (_(' - According to file suffix - '))
+ self.menu.append_text (_(' — According to file suffix — '))
self.ftype = None
self.formats.append(None)
diff --git a/Pyblio/GnomeUI/OpenURL.py b/Pyblio/GnomeUI/OpenURL.py
index bed9192..9b062e6 100644
--- a/Pyblio/GnomeUI/OpenURL.py
+++ b/Pyblio/GnomeUI/OpenURL.py
@@ -59,7 +59,7 @@ class OpenDialog (Connector.Publisher, Utils.GladeWindow):
if has_auto:
iter = liststore.append ()
- liststore.set (iter, 0, _(' - According to file suffix - '))
+ liststore.set (iter, 0, _(' — According to file suffix — '))
self.ftype = None
else:
self.ftype = liste [0]
diff --git a/Pyblio/GnomeUI/glade/pyblio.glade.in b/Pyblio/GnomeUI/glade/pyblio.glade.in
index d0968fe..3fd1672 100644
--- a/Pyblio/GnomeUI/glade/pyblio.glade.in
+++ b/Pyblio/GnomeUI/glade/pyblio.glade.in
@@ -65,7 +65,7 @@
<child>
<widget class="GtkImageMenuItem" id="merge_with1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Merge With...</property>
+ <property name="label" translatable="yes">Merge With…</property>
<property name="use_underline">True</property>
<signal name="activate" handler="merge_database" last_modification_time="Mon, 09
Jun 2003 18:56:54 GMT"/>
<accelerator key="g" modifiers="GDK_CONTROL_MASK" signal="activate"/>
@@ -87,7 +87,7 @@
<child>
<widget class="GtkMenuItem" id="medline_query1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Medline Query...</property>
+ <property name="label" translatable="yes">Medline Query…</property>
<property name="use_underline">True</property>
<signal name="activate" handler="query_database" last_modification_time="Mon, 09
Jun 2003 18:56:54 GMT"/>
<accelerator key="m" modifiers="GDK_CONTROL_MASK" signal="activate"/>
@@ -200,7 +200,7 @@
<child>
<widget class="GtkImageMenuItem" id="add1">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Add...</property>
+ <property name="label" translatable="yes">_Add…</property>
<property name="use_underline">True</property>
<signal name="activate" handler="add_entry" last_modification_time="Mon, 09 Jun
2003 18:56:54 GMT"/>
@@ -221,7 +221,7 @@
<child>
<widget class="GtkMenuItem" id="edit2">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Edit...</property>
+ <property name="label" translatable="yes">_Edit…</property>
<property name="use_underline">True</property>
<signal name="activate" handler="edit_entry" last_modification_time="Mon, 09 Jun
2003 18:56:54 GMT"/>
</widget>
@@ -230,7 +230,7 @@
<child>
<widget class="GtkImageMenuItem" id="delete1">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Delete...</property>
+ <property name="label" translatable="yes">_Delete…</property>
<property name="use_underline">True</property>
<signal name="activate" handler="delete_entry" last_modification_time="Mon, 09 Jun
2003 18:56:54 GMT"/>
<accelerator key="Delete" modifiers="0" signal="activate"/>
@@ -266,7 +266,7 @@
<child>
<widget class="GtkImageMenuItem" id="sort1">
<property name="visible">True</property>
- <property name="label" translatable="yes">S_ort...</property>
+ <property name="label" translatable="yes">S_ort…</property>
<property name="use_underline">True</property>
<signal name="activate" handler="sort_entries" last_modification_time="Mon, 09 Jun
2003 18:56:54 GMT"/>
@@ -300,7 +300,7 @@
<child>
<widget class="GtkImageMenuItem" id="cite2">
<property name="visible">True</property>
- <property name="label" translatable="yes">Cite...</property>
+ <property name="label" translatable="yes">Cite…</property>
<property name="use_underline">True</property>
<signal name="activate" handler="lyx_cite" last_modification_time="Mon, 09 Jun 2003
18:56:54 GMT"/>
@@ -321,7 +321,7 @@
<child>
<widget class="GtkImageMenuItem" id="format1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Format...</property>
+ <property name="label" translatable="yes">Format…</property>
<property name="use_underline">True</property>
<signal name="activate" handler="format_entries" last_modification_time="Mon, 09
Jun 2003 18:56:54 GMT"/>
@@ -356,7 +356,7 @@
<child>
<widget class="GtkMenuItem" id="fields1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Fields...</property>
+ <property name="label" translatable="yes">Fields…</property>
<property name="use_underline">True</property>
<signal name="activate" handler="set_fields" last_modification_time="Mon, 09 Jun
2003 19:02:17 GMT"/>
</widget>
diff --git a/Pyblio/LyX.py b/Pyblio/LyX.py
index f355935..8b1f6be 100644
--- a/Pyblio/LyX.py
+++ b/Pyblio/LyX.py
@@ -35,13 +35,13 @@ class LyXClient:
try:
ans = os.stat (pin)
except OSError, msg:
- raise IOError (_("no input pipe `%s'") % pin)
+ raise IOError (_("no input pipe “%s”") % pin)
pout = os.path.expanduser (base + '.out')
try:
ans = os.stat (pout)
except os.error:
- raise IOError (_("no output pipe `%s'") % pout)
+ raise IOError (_("no output pipe “%s”") % pout)
def noaction (* arg): return
diff --git a/Pyblio/Open.py b/Pyblio/Open.py
index 4df3a9a..9507a6b 100644
--- a/Pyblio/Open.py
+++ b/Pyblio/Open.py
@@ -94,7 +94,7 @@ def bibopen (entity, how = None):
if opener:
base = opener (url, 0)
else:
- raise Exceptions.FormatError (_("method `%s' provides no opener") % how)
+ raise Exceptions.FormatError (_("method “%s” provides no opener") % how)
return base
@@ -102,7 +102,7 @@ def bibopen (entity, how = None):
url = Fields.URL (entity)
if url.url [0] == 'file' and not os.path.exists (url.url [2]):
- raise Exceptions.FileError (_("File `%s' does not exist") % url.get_url ())
+ raise Exceptions.FileError (_("File “%s” does not exist") % url.get_url ())
# eventually load a new module
if how is None:
@@ -113,7 +113,7 @@ def bibopen (entity, how = None):
base = simple_try (url, how)
if base is None:
- raise Exceptions.FormatError (_("don't know how to open `%s'") % entity)
+ raise Exceptions.FormatError (_("don’t know how to open “%s”") % entity)
return base
@@ -141,7 +141,7 @@ def bibiter (entity, how = None):
if opener:
base = opener (url, 0)
else:
- raise Exceptions.FormatError (_("method `%s' provides no iterator") % how)
+ raise Exceptions.FormatError (_("method “%s” provides no iterator") % how)
return base
@@ -149,7 +149,7 @@ def bibiter (entity, how = None):
url = Fields.URL (entity)
if url.url [0] == 'file' and not os.path.exists (url.url [2]):
- raise Exceptions.FileError (_("File `%s' does not exist") % str (url))
+ raise Exceptions.FileError (_("File “%s” does not exist") % str (url))
# eventually load a new module
if how is None:
@@ -160,7 +160,7 @@ def bibiter (entity, how = None):
base = simple_try (url, how)
if base is None:
- raise Exceptions.FormatError (_("don't know how to open `%s'") % entity)
+ raise Exceptions.FormatError (_("don’t know how to open “%s”") % entity)
return base
diff --git a/Pyblio/Resource.py b/Pyblio/Resource.py
index cf84424..88203ad 100644
--- a/Pyblio/Resource.py
+++ b/Pyblio/Resource.py
@@ -79,7 +79,7 @@ def StartViewer (entry, key, stringuri, parent=None, document=None):
if not message.answer (): return
if document:
- document.statusbar.set_status (_("Determining Mime Type ... "))
+ document.statusbar.set_status (_("Determining Mime Type… "))
try:
mimetype = Compat.get_mime_type (fileuri)
@@ -96,7 +96,7 @@ def StartViewer (entry, key, stringuri, parent=None, document=None):
mimetype1 = mimetype.split ('/', 1) [0]
if document:
- document.statusbar.set_status (_("Accessing resource ..."))
+ document.statusbar.set_status (_("Accessing resource…"))
if scheme == 'file' and not location:
filename = path
@@ -135,7 +135,7 @@ def StartViewer (entry, key, stringuri, parent=None, document=None):
) or "%s %s&" %(cmd, filename)
if document:
- document.statusbar.set_status (_("Starting application ..."))
+ document.statusbar.set_status (_("Starting application…"))
os.system (command)
else:
Utils.error_dialog (_("No application to view resource"),
diff --git a/Pyblio/Style/Parser.py b/Pyblio/Style/Parser.py
index 39d1497..00d1bb9 100644
--- a/Pyblio/Style/Parser.py
+++ b/Pyblio/Style/Parser.py
@@ -259,7 +259,7 @@ class XMLBib (sax.handler.ContentHandler):
try:
val = attrs [attr]
except KeyError:
- self._error (_("missing '%s' attribute") % attr)
+ self._error (_("missing “%s” attribute") % attr)
return val
diff --git a/pybliographer.py b/pybliographer.py
index 4d8b28a..331a8f4 100644
--- a/pybliographer.py
+++ b/pybliographer.py
@@ -46,7 +46,7 @@ def print_version ():
def copyright ():
print 'Copyright (C) 1998-2004 Frederic GOBRY'
print _("This is free software with ABSOLUTELY NO WARRANTY.").encode (charset)
- print _("For details, type `warranty'.").encode (charset)
+ print _("For details, type “warranty”.").encode (charset)
def warranty ():
print_version ()
@@ -109,7 +109,7 @@ for opt, value in optlist:
try:
os.stat (value)
except os.error:
- print (_("%s: error: can't open file `%s'") \
+ print (_("%s: error: can’t open file “%s”") \
% (progname, value)).encode (charset)
sys.exit (1)
@@ -122,7 +122,7 @@ for opt, value in optlist:
if opt == '-h' or opt == '--help':
print_version ()
- print (_("For help, run %s and type `help' at the prompt")
+ print (_("For help, run %s and type “help” at the prompt")
% progname).encode (charset)
sys.exit (0)
@@ -161,7 +161,7 @@ if len (args) > 0 :
try:
os.stat (filename)
except os.error:
- print (_("%s: error: can't open file `%s'") % (progname, filename)).encode (charset)
+ print (_("%s: error: can’t open file “%s”") % (progname, filename)).encode (charset)
sys.exit (1)
else:
execfile (filename, user_global)
diff --git a/scripts/pybliocheck.py b/scripts/pybliocheck.py
index f798edc..d4b3634 100644
--- a/scripts/pybliocheck.py
+++ b/scripts/pybliocheck.py
@@ -29,7 +29,7 @@ charset = locale.getlocale () [1] or 'ascii'
# check the arguments
if len (sys.argv) < 3:
- print _("usage: pybliocheck <file | directory>...").encode (charset)
+ print _("usage: pybliocheck <file | directory>…").encode (charset)
sys.exit (1)
# list containing the broken entries
@@ -58,7 +58,7 @@ for dir in sys.argv [2:]:
# try to open the database
try:
b = bibopen (f)
- print (_("file `%s' is ok [%d entries]") % (f, len (b))).encode (charset)
+ print (_("file “%s” is ok [%d entries]") % (f, len (b))).encode (charset)
except (Exceptions.ParserError, KeyError), err:
broken.append (str (err))
diff --git a/scripts/pybliocompact.py b/scripts/pybliocompact.py
index 8416939..5011404 100644
--- a/scripts/pybliocompact.py
+++ b/scripts/pybliocompact.py
@@ -28,7 +28,7 @@ import locale
charset = locale.getlocale () [1] or 'ascii'
def usage ():
- print _("usage: pybliocompact <latexfile> <bibtexfiles...>").encode (charset)
+ print _("usage: pybliocompact <latexfile> <bibtexfiles…>").encode (charset)
return
def error (msg):
@@ -160,6 +160,6 @@ for bib in bibtex:
# check if we were able to solve all the citations
if len (entries) > 0:
- error (_("can't find the following entries: %s")
+ error (_("can’t find the following entries: %s")
% string.join (entries, ", "))
diff --git a/scripts/pyblioformat.py b/scripts/pyblioformat.py
index 910a626..0680f3f 100644
--- a/scripts/pyblioformat.py
+++ b/scripts/pyblioformat.py
@@ -32,7 +32,7 @@ import locale
charset = locale.getlocale () [1] or 'ascii'
def usage ():
- print _("""usage: pyblioformat [options] <database...>
+ print _("""usage: pyblioformat [options] <database…>
options:
-o file, --output=file specify an output filename
@@ -91,21 +91,21 @@ for opt, value in optlist:
try:
outfile = open (value, 'w')
except IOError, err:
- error (_("can't open `%s': %s") % (value, str (err).decode (charset)))
+ error (_("can’t open “%s”: %s") % (value, str (err).decode (charset)))
continue
if opt == '-l' or opt == '--list':
try:
list = Autoload.available (value)
except KeyError:
- error (_("unknown list `%s'") % value)
+ error (_("unknown list “%s”") % value)
if list:
- print (_("pyblioformat: available values for `%s':") % value).encode (charset)
+ print (_("pyblioformat: available values for “%s”:") % value).encode (charset)
print " " + string.join (list, ", ")
sys.exit (0)
else:
- warning (_("empty value list `%s'") % value)
+ warning (_("empty value list “%s”") % value)
sys.exit (0)
if opt == '-h' or opt == '--help':
@@ -134,7 +134,7 @@ files = args
# get the specified style and the output
output = Autoload.get_by_name ('output', format)
if output is None:
- error (_("unknown output format `%s'") % format)
+ error (_("unknown output format “%s”") % format)
url = None
style = os.path.splitext (style) [0]
@@ -147,10 +147,10 @@ else:
if os.path.exists (full): url = Fields.URL (full)
if not url:
- error (_("can't find style `%s'") % style)
+ error (_("can’t find style “%s”") % style)
-sys.stderr.write ((_("pyblioformat: using style `%s', format `%s'\n") % (style, output.name)).encode
(charset))
+sys.stderr.write ((_("pyblioformat: using style “%s”, format “%s”\n") % (style, output.name)).encode
(charset))
formatter = output.data
@@ -165,7 +165,7 @@ if header:
outfile.write (line)
h.close ()
except IOError, err:
- error (_("can't open header `%s': %s") % (header, str (err).decode (charset)))
+ error (_("can’t open header “%s”: %s") % (header, str (err).decode (charset)))
# write the data
for file in files:
@@ -173,7 +173,7 @@ for file in files:
try:
db = bibopen (file)
except IOError, err:
- error (_("can't open database: %s") % file)
+ error (_("can’t open database: %s") % file)
Utils.generate (url, formatter, db, db.keys (), outfile)
@@ -188,7 +188,7 @@ if footer:
outfile.write (line)
h.close ()
except IOError, err:
- error (_("can't open footer `%s': %s") % (footer, str (err).decode (charset)))
+ error (_("can’t open footer “%s”: %s") % (footer, str (err).decode (charset)))
outfile.close ()
diff --git a/scripts/pybliotex.py b/scripts/pybliotex.py
index 50f3a0e..983e460 100644
--- a/scripts/pybliotex.py
+++ b/scripts/pybliotex.py
@@ -32,7 +32,7 @@ import locale
charset = locale.getlocale () [1] or 'ascii'
def usage ():
- print _("usage: pybliotex <latexfile> [bibtexfiles...]").encode (charset)
+ print _("usage: pybliotex <latexfile> [bibtexfiles…]").encode (charset)
return
def error (message):
@@ -84,7 +84,7 @@ else:
if os.path.exists (full): url = Fields.URL (full)
if not url:
- error (_("can't find style `%s'") % style)
+ error (_("can’t find style “%s”") % style)
# open the .bbl file
bblfile = os.path.splitext (os.path.split (latex) [1]) [0] + '.bbl'
diff --git a/scripts/pybliotext.py b/scripts/pybliotext.py
index c20eed9..f12046c 100644
--- a/scripts/pybliotext.py
+++ b/scripts/pybliotext.py
@@ -38,7 +38,7 @@ import locale
charset = locale.getlocale () [1] or 'ascii'
def usage ():
- print _("usage: pybliotext [-o outputfile] [-s style] <textfile> <bibfiles...>").encode (charset)
+ print _("usage: pybliotext [-o outputfile] [-s style] <textfile> <bibfiles…>").encode (charset)
return
def error (msg):
@@ -91,7 +91,7 @@ else:
if os.path.exists (full): url = Fields.URL (full)
if not url:
- error (_("can't find style `%s'") % style)
+ error (_("can’t find style “%s”") % style)
spstyle = os.path.split (style) [1]
@@ -114,17 +114,17 @@ else:
output = Autoload.get_by_name ('output', format)
if output is None:
- error (_("unknown output format `%s'") % format)
+ error (_("unknown output format “%s”") % format)
reffile = outfile + '.ref'
if os.path.exists(outfile):
- error (_("File already exists: `%s'") % outfile)
+ error (_("File already exists: “%s”") % outfile)
if os.path.exists(reffile):
- error (_("A file with the same name already exists: `%s'") % reffile)
+ error (_("A file with the same name already exists: “%s”") % reffile)
textfile = args [0]
bibfile = args [1:]
@@ -190,7 +190,7 @@ entries = h
order = copy.copy (entries)
-sys.stderr.write ((_("pybliotext: using style `%s', format `%s'\n") % (style, output.name)).encode (charset))
+sys.stderr.write ((_("pybliotext: using style “%s”, format “%s”\n") % (style, output.name)).encode (charset))
formatter = output.data
@@ -237,7 +237,7 @@ for bib in bibfile:
# check if we were able to solve all the citations
if len (entries) > 0:
- error (_("can't find the following entries: %s")
+ error (_("can’t find the following entries: %s")
% string.join (entries, ", "))
@@ -249,7 +249,7 @@ keys = map (lambda x: Key.Key (r, x), order)
try:
refs = open (reffile, 'w')
except IOError, err:
- error (_("can't open `%s': %s") % (reffile, str (err).decode (charset)))
+ error (_("can’t open “%s”: %s") % (reffile, str (err).decode (charset)))
refs.write ("\n\nReferences:\n")
@@ -275,7 +275,7 @@ if oldnew:
try:
dest = open (outfile, 'a')
except IOError, err:
- error (_("can't open `%s': %s") % (outfile, str (err).decode (charset)))
+ error (_("can’t open “%s”: %s") % (outfile, str (err).decode (charset)))
citations = []
@@ -313,12 +313,12 @@ else:
try:
copyfile (textfile, outfile)
except:
- error (_("can't create `%s'") % outfile)
+ error (_("can’t create “%s”") % outfile)
try:
dest = open (outfile, 'a')
except IOError, err:
- error (_("can't open `%s': %s") % (outfile, str (err).decode (charset)))
+ error (_("can’t open “%s”: %s") % (outfile, str (err).decode (charset)))
# appending the reference list
@@ -339,6 +339,6 @@ dest.close ()
try:
os.remove (reffile)
except:
- warning (_("can't remove `%s'") % reffile)
+ warning (_("can’t remove “%s”") % reffile)
print _("Done").encode (charset)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]