@@ -55,62 +55,62 @@ class ProcessingConfig:
55
55
def initialize ():
56
56
icon = QtGui .QIcon (os .path .dirname (__file__ ) + '/../images/alg.png' )
57
57
ProcessingConfig .settingIcons ['General' ] = icon
58
- ProcessingConfig .addSetting (Setting ('General' ,
58
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
59
59
ProcessingConfig .SHOW_DEBUG_IN_DIALOG ,
60
- 'Show extra info in Log panel' , True ))
61
- ProcessingConfig .addSetting (Setting ('General' ,
60
+ ProcessingConfig . tr ( 'Show extra info in Log panel' ) , True ))
61
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
62
62
ProcessingConfig .KEEP_DIALOG_OPEN ,
63
- 'Keep dialog open after running an algorithm' , False ))
64
- ProcessingConfig .addSetting (Setting ('General' ,
63
+ ProcessingConfig . tr ( 'Keep dialog open after running an algorithm' ) , False ))
64
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
65
65
ProcessingConfig .USE_SELECTED ,
66
- 'Use only selected features' , True ))
67
- ProcessingConfig .addSetting (Setting ('General' ,
66
+ ProcessingConfig . tr ( 'Use only selected features' ) , True ))
67
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
68
68
ProcessingConfig .USE_FILENAME_AS_LAYER_NAME ,
69
- 'Use filename as layer name' , False ))
70
- ProcessingConfig .addSetting (Setting ('General' ,
69
+ ProcessingConfig . tr ( 'Use filename as layer name' ) , False ))
70
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
71
71
ProcessingConfig .SHOW_RECENT_ALGORITHMS ,
72
- 'Show recently executed algorithms' , True ))
73
- ProcessingConfig .addSetting (Setting ('General' ,
72
+ ProcessingConfig . tr ( 'Show recently executed algorithms' ) , True ))
73
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
74
74
ProcessingConfig .OUTPUT_FOLDER ,
75
- 'Output folder' , tempFolder ()))
76
- ProcessingConfig .addSetting (Setting ('General' ,
75
+ ProcessingConfig . tr ( 'Output folder' ) , tempFolder ()))
76
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
77
77
ProcessingConfig .SHOW_CRS_DEF ,
78
- 'Show layer CRS definition in selection boxes' , True ))
79
- ProcessingConfig .addSetting (Setting ('General' ,
78
+ ProcessingConfig . tr ( 'Show layer CRS definition in selection boxes' ) , True ))
79
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
80
80
ProcessingConfig .WARN_UNMATCHING_CRS ,
81
- "Warn before executing if layer CRS's do not match" , True ))
82
- ProcessingConfig .addSetting (Setting ('General' ,
81
+ ProcessingConfig . tr ( "Warn before executing if layer CRS's do not match" ) , True ))
82
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
83
83
ProcessingConfig .RASTER_STYLE ,
84
- 'Style for raster layers' , '' ))
85
- ProcessingConfig .addSetting (Setting ('General' ,
84
+ ProcessingConfig . tr ( 'Style for raster layers' ) , '' ))
85
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
86
86
ProcessingConfig .VECTOR_POINT_STYLE ,
87
- 'Style for point layers' , '' ))
88
- ProcessingConfig .addSetting (Setting ('General' ,
87
+ ProcessingConfig . tr ( 'Style for point layers' ) , '' ))
88
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
89
89
ProcessingConfig .VECTOR_LINE_STYLE ,
90
- 'Style for line layers' , '' ))
91
- ProcessingConfig .addSetting (Setting ('General' ,
90
+ ProcessingConfig . tr ( 'Style for line layers' ) , '' ))
91
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
92
92
ProcessingConfig .VECTOR_POLYGON_STYLE ,
93
- 'Style for polygon layers' , '' ))
94
- ProcessingConfig .addSetting (Setting ('General' ,
93
+ ProcessingConfig . tr ( 'Style for polygon layers' ) , '' ))
94
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
95
95
ProcessingConfig .VECTOR_POLYGON_STYLE ,
96
- 'Style for polygon layers' , '' ))
97
- ProcessingConfig .addSetting (Setting ('General' ,
96
+ ProcessingConfig . tr ( 'Style for polygon layers' ) , '' ))
97
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
98
98
ProcessingConfig .PRE_EXECUTION_SCRIPT ,
99
- 'Pre-execution script' , '' ))
100
- ProcessingConfig .addSetting (Setting ('General' ,
99
+ ProcessingConfig . tr ( 'Pre-execution script' ) , '' ))
100
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
101
101
ProcessingConfig .POST_EXECUTION_SCRIPT ,
102
- 'Post-execution script' , '' ))
103
- ProcessingConfig .addSetting (Setting ('General' ,
102
+ ProcessingConfig . tr ( 'Post-execution script' ) , '' ))
103
+ ProcessingConfig .addSetting (Setting (ProcessingConfig . tr ( 'General' ) ,
104
104
ProcessingConfig .RECENT_ALGORITHMS ,
105
- 'Recent algs' , '' , hidden = True ))
105
+ ProcessingConfig . tr ( 'Recent algs' ) , '' , hidden = True ))
106
106
107
107
@staticmethod
108
108
def setGroupIcon (group , icon ):
109
109
ProcessingConfig .settingIcons [group ] = icon
110
110
111
111
@staticmethod
112
112
def getGroupIcon (group ):
113
- if group == 'General' :
113
+ if group == ProcessingConfig . tr ( 'General' ) :
114
114
return QtGui .QIcon (os .path .dirname (__file__ ) + '/../images/alg.png'
115
115
)
116
116
if group in ProcessingConfig .settingIcons :
@@ -163,6 +163,12 @@ def setSettingValue(name, value):
163
163
ProcessingConfig .settings [name ].value = value
164
164
ProcessingConfig .settings [name ].save ()
165
165
166
+ @staticmethod
167
+ def tr (string , context = '' ):
168
+ if context == '' :
169
+ context = 'ProcessingConfig'
170
+ return QCoreApplication .translate (context , string )
171
+
166
172
167
173
class Setting :
168
174
"""A simple config parameter that will appear on the config dialog.
0 commit comments