Commit b17b7720 authored by Nicolas Dufour's avatar Nicolas Dufour Committed by Nicolas Dufour

[Bug #1538277] Translations in inkex.py fail unless extension script itself initalizes gettext.

Fixed bugs:
  - https://launchpad.net/bugs/1538277

(bzr r14918)
parent 1487f3ad
......@@ -26,8 +26,6 @@ import cubicsuperpath
import bezmisc
import simplestyle
inkex.localize()
def tpoint((x1,y1), (x2,y2), t = 0.5):
return [x1+t*(x2-x1),y1+t*(y2-y1)]
def cspbezsplit(sp1, sp2, t = 0.5):
......
......@@ -44,7 +44,6 @@ import inkex
import pathmodifier
from simpletransform import *
inkex.localize()
class Dimension(pathmodifier.PathModifier):
def __init__(self):
......
......@@ -38,7 +38,6 @@ import inkex
import simplestyle
import simplepath
inkex.localize()
#DRAWING ROUTINES
......
......@@ -26,7 +26,6 @@ import inkex, simplestyle, math
from StringIO import StringIO
from urllib import quote
inkex.localize()
def export_MTEXT():
# mandatory group codes : (1 or 3, 10, 20) (text, x, y)
......
......@@ -40,8 +40,6 @@ import cubicsuperpath
import coloreffect
import dxf_templates
inkex.localize()
try:
from numpy import *
from numpy.linalg import solve
......
......@@ -25,7 +25,6 @@ import urlparse
# local library
import inkex
inkex.localize()
class Embedder(inkex.Effect):
def __init__(self):
......
......@@ -19,8 +19,6 @@ except:
import inkex
import simplestyle
inkex.localize()
colortags=(u'fill',u'stroke',u'stop-color',u'flood-color',u'lighting-color')
colors={}
......
......@@ -22,8 +22,6 @@ import os
# local library
import inkex
inkex.localize()
class MyEffect(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
......
......@@ -22,8 +22,6 @@ import simplepath
import simpletransform
import cubicsuperpath
inkex.localize()
class Extrude(inkex.Effect):
def __init__(self):
inkex.Effect.__init__(self)
......
......@@ -34,8 +34,6 @@ import inkex
import simplepath
import simplestyle
inkex.localize()
def drawfunction(xstart, xend, ybottom, ytop, samples, width, height, left, bottom,
fx = "sin(x)", fpx = "cos(x)", fponum = True, times2pi = False, polar = False, isoscale = True, drawaxis = True, endpts = False):
......
......@@ -87,8 +87,6 @@ import simplepath
import cubicsuperpath
import simpletransform
import bezmisc
inkex.localize()
### Check if inkex has errormsg (0.46 version does not have one.) Could be removed later.
if "errormsg" not in dir(inkex):
......
......@@ -27,8 +27,6 @@ import inkex
import simplestyle, simpletransform
import voronoi
inkex.localize()
try:
from subprocess import Popen, PIPE
except:
......
......@@ -27,8 +27,6 @@ import tempfile
# local library
import inkex
inkex.localize()
# Define extension exceptions
class GimpXCFError(Exception): pass
......
......@@ -54,9 +54,6 @@ from math import sqrt
import inkex
from simplestyle import *
# for localized debugging output
inkex.localize()
from xml.etree import ElementTree as ET
# for golden number formula and diagonal guides
......
......@@ -50,8 +50,6 @@ except:
import inkex
import simplestyle
inkex.localize()
locale.setlocale(locale.LC_ALL, '')
def float_sort(a, b):
......
......@@ -25,8 +25,6 @@ from StringIO import StringIO
import hpgl_decoder
import inkex
import sys
inkex.localize()
# parse options
parser = inkex.optparse.OptionParser(usage='usage: %prog [options] HPGLfile', option_class=inkex.InkOption)
......@@ -68,4 +66,4 @@ if 'UNKNOWN_COMMANDS' in warnings:
# deliver document to inkscape
doc.write(inkex.sys.stdout)
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
\ No newline at end of file
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
......@@ -23,7 +23,6 @@ import sys
# local libraries
import hpgl_encoder
import inkex
inkex.localize()
class HpglOutput(inkex.Effect):
......@@ -79,4 +78,4 @@ if __name__ == '__main__':
e = HpglOutput()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
\ No newline at end of file
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
......@@ -28,12 +28,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import inkex
import simplestyle
try:
inkex.localize()
except:
import gettext
_ = gettext.gettext
class SetAttrImage(inkex.Effect):
def __init__(self):
......
......@@ -95,7 +95,6 @@ def errormsg(msg):
Note that this should always be combined with translation:
import inkex
inkex.localize()
...
inkex.errormsg(_("This extension requires two selected paths."))
"""
......@@ -275,6 +274,7 @@ class Effect:
def affect(self, args=sys.argv[1:], output=True):
"""Affect an SVG document with a callback effect"""
self.svg_file = args[-1]
localize()
self.getoptions(args)
self.parse()
self.getposinlayer()
......
......@@ -25,7 +25,6 @@ import inkex
import simplestyle
from pathmodifier import zSort
inkex.localize()
class InterpAttG(inkex.Effect):
......
......@@ -25,7 +25,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
inkex.localize()
class JessyInk_AutoTexts(inkex.Effect):
def __init__(self):
......
......@@ -25,7 +25,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
inkex.localize()
class JessyInk_Effects(inkex.Effect):
def __init__(self):
......
......@@ -31,8 +31,6 @@ import zipfile
import glob
import re
inkex.localize()
def propStrToDict(inStr):
dictio = {}
......
......@@ -26,7 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
inkex.localize()
class JessyInk_CustomKeyBindings(inkex.Effect):
modes = ('slide', 'index', 'drawing')
......
......@@ -26,8 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
inkex.localize()
class JessyInk_MasterSlide(inkex.Effect):
def __init__(self):
# Call the base class constructor.
......
......@@ -28,7 +28,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
inkex.localize()
class JessyInk_CustomMouseHandler(inkex.Effect):
def __init__(self):
......
......@@ -26,7 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
inkex.localize()
def propStrToList(str):
list = []
......
......@@ -26,7 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
inkex.localize()
class JessyInk_Transitions(inkex.Effect):
def __init__(self):
......
......@@ -30,8 +30,6 @@ import re
from lxml import etree
from copy import deepcopy
inkex.localize()
class JessyInk_Effects(inkex.Effect):
def __init__(self):
# Call the base class constructor.
......
......@@ -26,7 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
inkex.localize()
def propStrToList(str):
list = []
......
......@@ -5,7 +5,6 @@ import threading
from optparse import OptionParser
# local library
import inkex
inkex.localize()
class VisitWebSiteWithoutLockingInkscape(threading.Thread):
def __init__(self):
......
......@@ -24,7 +24,6 @@ import copy
import inkex
import simplestyle
inkex.localize()
class MyEffect(inkex.Effect):
def __init__(self):
......
......@@ -41,7 +41,6 @@ import simpletransform
import cubicsuperpath
import bezmisc
inkex.localize()
# On darwin, fall back to C in cases of
# - incorrect locale IDs (see comments in bug #406662)
......
......@@ -42,7 +42,6 @@ import bezmisc
import pathmodifier
import simpletransform
inkex.localize()
def flipxy(path):
for pathcomp in path:
......
......@@ -39,8 +39,6 @@ import bezmisc
import simplestyle
from simpletransform import *
inkex.localize()
####################################################################
##-- zOrder computation...
##-- this should be shipped out in a separate file. inkex.py?
......
......@@ -44,8 +44,6 @@ import bezmisc
import pathmodifier
import simpletransform
inkex.localize()
def zSort(inNode,idList):
sortedList=[]
theid = inNode.get("id")
......
......@@ -34,8 +34,6 @@ import cubicsuperpath
import simpletransform
from ffgeom import *
inkex.localize()
# third party
try:
from numpy import *
......
......@@ -27,7 +27,6 @@ import gettext
import hpgl_decoder
import hpgl_encoder
import inkex
inkex.localize()
class Plot(inkex.Effect):
......@@ -268,4 +267,4 @@ if __name__ == '__main__':
e = Plot()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
\ No newline at end of file
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
......@@ -57,8 +57,6 @@ import inkex
import simplestyle
from simpletransform import computePointInNode
inkex.localize()
# third party
try:
from numpy import *
......
......@@ -35,8 +35,6 @@ import simplestyle
import simpletransform
import cubicsuperpath
inkex.localize()
if not inkex.sys.platform.startswith('win'):
exit(_("sorry, this will run only on Windows, exiting..."))
......
......@@ -35,8 +35,6 @@ import bezmisc
import simplepath
import simpletransform
inkex.localize()
syntax = render_alphabetsoup_config.syntax
alphabet = render_alphabetsoup_config.alphabet
units = render_alphabetsoup_config.units
......
......@@ -55,8 +55,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import inkex
import simplestyle
from simpletransform import computePointInNode
inkex.localize()
symbols = {
'sq10': (10, 10),
......
......@@ -4,8 +4,6 @@ import math, sys
import inkex
from simpletransform import computePointInNode
inkex.localize()
#QRCode for Python
#
#Ported from the Javascript library by Sam Curren
......
......@@ -34,8 +34,6 @@ import sys
import inkex
import simplestyle
inkex.localize()
text_tags = ['{http://www.w3.org/2000/svg}tspan',
'{http://www.w3.org/2000/svg}text',
'{http://www.w3.org/2000/svg}flowRoot',
......
......@@ -24,7 +24,6 @@ THE SOFTWARE.
import inkex, os, csv, math, random
from pathmodifier import zSort
inkex.localize()
try:
from subprocess import Popen, PIPE
......
......@@ -26,8 +26,6 @@ import simplepath
import simpletransform
from ffgeom import *
inkex.localize()
try:
from subprocess import Popen, PIPE
bsubprocess = True
......
......@@ -51,7 +51,7 @@ import inkex
import simplestyle
locale.setlocale(locale.LC_ALL, '')
inkex.localize()
inkex.localize() # TODO: test if it's still needed now that localize is called from inkex.
class CompressedMediaOutput(inkex.Effect):
def __init__(self):
......
......@@ -37,7 +37,6 @@ from datetime import *
import inkex
import simplestyle
inkex.localize()
class SVGCalendar (inkex.Effect):
......
......@@ -26,8 +26,6 @@ import sys
from run_command import run
import inkex
inkex.localize()
cmd = None
try:
......
......@@ -34,7 +34,6 @@ import sys
import tempfile
# local library
import inkex
inkex.localize()
def run(command_format, prog_name, uniconv_format):
outfile = tempfile.mktemp(uniconv_format)
......
......@@ -38,7 +38,6 @@ import simpletransform
import voronoi
import random
inkex.localize()
class Point:
def __init__(self,x,y):
......
......@@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import inkwebeffect
import inkex
inkex.localize()
class InkWebTransmitAtt(inkwebeffect.InkWebEffect):
def __init__(self):
......
......@@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import inkwebeffect
import inkex
inkex.localize()
class InkWebTransmitAtt(inkwebeffect.InkWebEffect):
......
......@@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from webslicer_effect import *
import inkex
inkex.localize()
class WebSlicer_CreateGroup(WebSlicer_Effect):
def __init__(self):
......
......@@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from webslicer_effect import *
import inkex
inkex.localize()
class WebSlicer_CreateRect(WebSlicer_Effect):
def __init__(self):
......
......@@ -24,8 +24,6 @@ import tempfile
from webslicer_effect import *
import inkex
inkex.localize()
class WebSlicer_Export(WebSlicer_Effect):
......
......@@ -61,7 +61,6 @@ import inkex
import simplestyle
from simpletransform import computePointInNode
inkex.localize()
#SVG OUTPUT FUNCTIONS ================================================
def draw_SVG_ellipse((rx, ry), (cx, cy), width, parent, start_end=(0,2*pi),transform='' ):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment