1#!/usr/local/bin/python3.8
2
3## system-config-printer
4
5## Copyright (C) 2008, 2009, 2010 Red Hat, Inc.
6## Authors:
7##  Tim Waugh <twaugh@redhat.com>
8
9## This program is free software; you can redistribute it and/or modify
10## it under the terms of the GNU General Public License as published by
11## the Free Software Foundation; either version 2 of the License, or
12## (at your option) any later version.
13
14## This program is distributed in the hope that it will be useful,
15## but WITHOUT ANY WARRANTY; without even the implied warranty of
16## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17## GNU General Public License for more details.
18
19## You should have received a copy of the GNU General Public License
20## along with this program; if not, write to the Free Software
21## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22
23import config
24import gettext
25gettext.install(domain=config.PACKAGE, localedir=config.localedir)
26
27printer_error_policy = dict()
28printer_op_policy = dict()
29job_sheets = dict()
30job_options = dict()
31ppd = dict()
32backends = dict()
33
34class TranslationDict:
35    STR = {}
36
37    def __init__ (self, d):
38        self.STR = d
39
40    def get (self, str):
41        return self.STR.get (str, str)
42
43def init ():
44    ## IPP strings
45
46    # Names of printer error policies
47    global printer_error_policy
48    printer_error_policy = TranslationDict ({
49            "abort-job": _("Abort job"),
50            "retry-current-job": _("Retry current job"),
51            "retry-job": _("Retry job"),
52            "stop-printer": _("Stop printer")
53            })
54
55    # Names of printer operation policies
56    global printer_op_policy
57    printer_op_policy = TranslationDict ({
58            "default": _("Default behavior"),
59            "authenticated": _("Authenticated")
60            })
61
62    # Names of banner pages.
63    global job_sheets
64    job_sheets = TranslationDict ({
65            "none": _("None"),
66            "classified": _("Classified"),
67            "confidential": _("Confidential"),
68            "secret": _("Secret"),
69            "standard": _("Standard"),
70            "topsecret": _("Top secret"),
71            "unclassified": _("Unclassified")
72            })
73
74    # Names of job-hold-until values.
75    global job_options
76    job_options["job-hold-until"] = TranslationDict ({
77            "no-hold": _("No hold"),
78            "indefinite": _("Indefinite"),
79            "day-time": _("Daytime"),
80            "evening": _("Evening"),
81            "night": _("Night"),
82            "second-shift": _("Second shift"),
83            "third-shift": _("Third shift"),
84            "weekend": _("Weekend")
85            })
86
87    ## Common PPD strings
88
89    # Foomatic strings
90
91    # These are PPD option and group names and values.
92    global ppd
93    ppd = TranslationDict ({
94            "General": _("General"),
95
96            #HP and foo2zjs
97            "Print Quality": _("Print Quality"),
98            "Automatic": _("Automatic"),
99
100            "Printing Quality": _("Printing Quality"),
101            "Draft": _("Draft"),
102            "Normal": _("Normal"),
103            "Normal Color": _("Normal Color"),
104            "Normal Grayscale": _("Normal Grayscale"),
105            "Draft Color": _("Draft Color"),
106            "Draft Grayscale": _("Draft Grayscale"),
107            "Best": _("Best"),
108            "High-Resolution Photo": _("High-Resolution Photo"),
109            "Fast Draft": _("Fast Draft"),
110
111            "Installed Cartridges": _("Installed Cartridges"),
112            "Black Only": _("Fast Only"),
113            "TriColor Only": _("Fast Only"),
114            "Photo Only": _("Photo Only"),
115            "Black and TriColor": _("Black and TriColor"),
116            "Photo and TriColor": _("Photo and TriColor"),
117
118            "Resolution": _("Resolution"),
119
120            "Color Mode": _("Color Mode"),
121            "High Quality Grayscale": _("High Quality Grayscale"),
122            "Black Only Grayscale": _("Black Only Grayscale"),
123
124            "Quality": _("Quality"),
125            "High Resolution ": _("High Resolution "),
126            "Paper Source": _("Paper source"),
127                "Auto Source": _("Auto Source"),
128                "Manual Feed": _("Manual Feed"),
129                "Middle Tray": _("Middle Tray"),
130                "Upper or Only One InputSlot": _("Upper or Only One InputSlot"),
131                "Multi-purpose Tray": _("Multi-purpose Tray"),
132                "Drawer 1 ": _("Drawer 1 "),
133                "Drawer 2 ": _("Drawer 2 "),
134                "Tray 1": _("Tray 1"),
135                "Auto Select": _("Auto Select"),
136
137            "Media Type": _("Media Type"),
138                "Bond": _("Bond"),
139                "Color": _("Color"),
140                "Envelope": _("Envelope"),
141                "Labels": _("Labels"),
142                "Standard Paper": _("Standard Paper"),
143                "Heavy": _("Heavy"),
144                "Light": _("Light"),
145                "Recycled": _("Recycled"),
146                "Transparency": _("Transparency"),
147                "Plain Paper": _("Plain Paper"),
148                "Plain": _("Plain"),
149                "Photo Paper": _("Photo Paper"),
150                "Transparency Film": _("Transparency Film"),
151                "CD or DVD Media": _("CD or DVD Media"),
152            "Print Density": _("Print Density"),
153            "Extra Light (1)": _("Extra Light (1)"),
154            "Light (2)": _("Light (2)"),
155            "Medium (3)": _("Medium (3)"),
156            "Dark (4)": _("Dark (4)"),
157            "Extra Dark (5)": _("Extra Dark (5)"),
158            "Duplex Printing": _("Duplex Printing"),
159            "Copies": _("Copies"),
160
161            "Adjustment": _("Adjustment"),
162            "Halftone Algorithm": _("Halftone Algorithm"),
163            "Default": _("Default"),
164
165            "Miscellaneous": _("Miscellaneous"),
166            "N-up Orientation": _("N-up Orientation"),
167            "N-up Printing": _("N-up Printing"),
168            "Landscape": _("Landscape"),
169            "Seascape": _("Seascape"),
170            "Media Size": _("Media Size"),
171            "Output Mode": _("Output Mode"),
172                 "Grayscale": _("Grayscale"),
173
174            #Brother
175            "Toner save mode": _("Toner save mode"),
176            	"Tray1": _("Tray1"),
177                "Tray2": _("Tray2"),
178                "Tray3": _("Tray3"),
179            "Two-Sided": _("Two-Sided"),
180            "Print Settings": _("Print Settings"),
181            "Print Settings (Advanced)": _("Print Settings (Advanced)"),
182            "Color Settings": _("Color Settings"),
183            "Color Settings (Advanced)": _("Color Settings (Advanced)"),
184            "Brightness": _("Brightness"),
185            "Contrast": _("Contrast"),
186            "Red": _("Red"),
187            "Green": _("Green"),
188            "Blue": _("Blue"),
189
190            #Epson xp serie
191            "_Media Size": _("_Media Size"),
192            "_Grayscale": _("_Grayscale"),
193            "_Brightness": _("_Brightness"),
194            "_Contrast": _("_Contrast"),
195            "_Saturation": _("_Saturation"),
196            "On": _("On"),
197
198            #Gutenprint
199            "2-Sided Printing": _("2-Sided Printing"),
200            "Shrink Page If Necessary to Fit Borders": _("Shrink Page If Necessary to Fit Borders"),
201         	  "Shrink (print the whole page)": _("Shrink (print the whole page)"),
202           	  "Crop (preserve dimensions)": _("Crop (preserve dimensions)"),
203         	  "Expand (use maximum page area)": _("Expand (use maximum page area)"),
204            "Borderless": _("Borderless"),
205            	"No": _("No"),
206            	"Yes": _("Yes"),
207            "Output Control Common": _("Output Control Common"),
208            "Color Correction": _("Color Correction"),
209            "Brightness Fine Adjustment": _("Brightness Fine Adjustment"),
210            "Contrast Fine Adjustment": _("Contrast Fine Adjustment"),
211            "Saturation Fine Adjustment": _("Saturation Fine Adjustment"),
212            "Image Type": _("Image Type"),
213            #Foomatic
214	    "Bidirectional printing": _("Bidirectional printing"),
215            # Options
216            "Installable Options": _("Installable Options"),
217            "Duplexer Installed": _("Duplexer Installed"),
218
219            # Canon
220            "Color Model": _("Color Model"),
221            "Color Precision": _("Color Precision"),
222            "Resolution ": _("Resolution "),
223            "Printer Features Common": _("Printer Features Common"),
224            "CD Hub Size": _("CD Hub Size"),
225            "Ink Type": _("Ink Type"),
226            "Toner Save ": _("Toner Save "),
227            "ON": _("ON"),
228            "Toner Density ": _("Toner Density "),
229            "Media Type ": _("Media Type "),
230            "Collate ": _("Collate "),
231            "Image Refinement ": _("Image Refinement "),
232            "Image Refinement": _("Image Refinement"),
233            "Halftones ": _("Halftones "),
234            "Duplex": _("Duplex"),
235            "OFF": _("OFF"),
236            "ON (Long-edged Binding)": _("ON (Long-edged Binding)"),
237            "ON (Short-edged Binding)": _("ON (Short-edged Binding)"),
238            	"High Quality": _("High Quality"),
239            	"High Quality Grayscale": _("High Quality Grayscale"),
240            "Controlled by 'Print Quality'": _("Controlled by 'Print Quality'"),
241           "Paper Destination": _("Paper Destination"),
242
243            #Samsung
244            "Paper Size": _("Paper Size"),
245            "Paper Type": _("Paper Type"),
246            "Thin": _("Thin"),
247            "Thick": _("Thick"),
248            "Thicker": _("Thicker") ,
249            "Edge Enhance": _("Edge Enhance"),
250            "Skip Blank Pages": _("Skip Blank Pages"),
251            "Double-sided Printing": _("Double-sided Printing"),
252            "None": _("None"),
253            "Reverse Duplex Printing": _("Reverse Duplex Printing"),
254            "Long Edge": _("Long Edge"),
255            "Short Edge": _("Short Edge"),
256            "Two-sided": _("Two-sided"),
257            "Long Edge": _("Long Edge"),
258            "Short Edge": _("Short Edge"),
259            "Toner Save": _("Toner Save"),
260
261            #Ricoh
262            "Finisher": _("Finisher"),
263            "Option Tray": _("Option Tray"),
264            "External Tray": _("External Tray"),
265            "Internal Tray 1": _("Internal Tray 1"),
266            "Internal Tray 2": _("Internal Tray 2"),
267            "Internal Shift Tray": _("Internal Shift Tray"),
268            "Not Installed": _("Not Installed"),
269            "Installed": _("Installed"),
270            "PageSize": _("PageSize"),
271            "InputSlot": _("InputSlot"),
272                "Tray 2": _("Tray 2"),
273                "Tray 3": _("Tray 3"),
274                "Tray 4": _("Tray 4"),
275                "Bypass Tray": _("Bypass Tray"),
276            "Collate": _("Collate"),
277            "Destination": _("Destination"),
278            "Staple": _("Staple"),
279            "Punch": _("Punch"),
280            "Toner Saving": _("Toner Saving"),
281            "Gradation": _("Gradation"),
282            "Fast": _("Fast"),
283
284            # HPIJS options
285            "Printout Mode": _("Printout mode"),
286            "Draft (auto-detect paper type)":
287                _("Draft (auto-detect-paper type)"),
288            "Draft (Color cartridge)":
289                _("Draft (Color cartridge)"),
290            "Draft Grayscale (Black cartridge)":
291                _("Draft grayscale (Black cartridge)"),
292            "Draft Grayscale (auto-detect paper type)":
293                _("Draft grayscale (auto-detect-paper type)"),
294            "Normal (Color cartridge)":
295                _("Normal (Color cartridge)"),
296            "Normal Grayscale (Black cartridge)":
297                _("Normal grayscale (Black cartridge)"),
298            "Normal (auto-detect paper type)":
299                _("Normal (auto-detect-paper type)"),
300            "Normal Grayscale (auto-detect paper type)":
301                _("Normal grayscale (auto-detect-paper type)"),
302            "High Quality (auto-detect paper type)":
303                _("High quality (auto-detect-paper type)"),
304            "High Quality Grayscale (auto-detect paper type)":
305                _("High quality grayscale (auto-detect-paper type)"),
306            "High Quality (Color cartridge)":
307                _("High quality (Color cartridge)"),
308            "High Quality Grayscale (Black cartridge)":
309                _("High quality grayscale (Black cartridge)"),
310            "Photo (on photo paper)": _("Photo (on photo paper)"),
311            "Photo (Color cartridge, on photo paper)": _("Photo (Color cartridge, on photo paper)"),
312            "Best Quality (color on photo paper)": _("Best quality (color on photo paper)"),
313            "Normal Quality (color on photo paper)": _("Normal quality (color on photo paper)"),
314
315            "Media Source": _("Media source"),
316            "Printer Default": _("Printer Default"),
317            "Photo Tray": _("Photo tray"),
318            "Upper Tray": _("Upper tray"),
319            "Lower Tray": _("Lower tray"),
320            "CD or DVD Tray": _("CD or DVD tray"),
321            "Envelope Feeder": _("Envelope feeder"),
322            "Large Capacity Tray": _("Large capacity tray"),
323            "Manual Feeder": _("Manual feeder"),
324            "Multi-purpose Tray ": _("Multi-purpose tray "),
325            "Multipurpose Tray": _("Multipurpose tray"),
326
327            "Page Size": _("Page size"),
328            "Custom": _("Custom"),
329            "Letter": _("Letter"),
330            "Photo or 4x6 inch index card": _("Photo or 4x6 inch index card"),
331            "Photo or 5x7 inch index card": _("Photo or 5x7 inch index card"),
332            "Photo with tear-off tab": _("Photo with tear-off tab"),
333            "3x5 inch index card": _("3x5 inch index card"),
334            "5x8 inch index card": _("5x8 inch index card"),
335            "A6 with tear-off tab": _("A6 with tear-off tab"),
336            "CD or DVD 80 mm": _("CD or DVD 80mm"),
337            "CD or DVD 120 mm": _("CD or DVD 120mm"),
338
339            "Double-Sided Printing": _("Double-sided Printing"),
340            "Long Edge (Standard)": _("Long edge (standard)"),
341            "Short Edge (Flip)": _("Short edge (flip)"),
342            "Off": _("Off"),
343
344            "Resolution, Quality, Ink Type, Media Type": _("Resolution, quality, ink type, media type"),
345            "Controlled by 'Printout Mode'": _("Controlled by 'Printout mode'"),
346            "300 dpi, Color, Color Cartr.": _("300 dpi, Color, Color Cartr."),
347            "300 dpi, Color, Black + Color Cartr.": _("300 dpi, color, black + color cartridge"),
348            "300 dpi, Draft, Color, Color Cartr.": _("300 dpi, Draft, Color, Color Cartr."),
349            "300 dpi, Draft, Color, Black + Color Cartr.": _("300 dpi, draft, color, black + color cartridge"),
350            "300 dpi, Draft, Grayscale, Black Cartr.": _("300 dpi, Draft, Grayscale, Black Cartr."),
351            "300 dpi, Grayscale, Black Cartr.": _("300 dpi, Grayscale, Black Cartr."),
352            "300 dpi, Draft, Grayscale, Black + Color Cartr.": _("300 dpi, draft, grayscale, black + color cartridge"),
353            "300 dpi, Grayscale, Black + Color Cartr.": _("300 dpi, grayscale, black + color cartridge"),
354            "600 dpi, Color, Black + Color Cartr.": _("600 dpi, color, black + color cartridge"),
355            "600 dpi, Grayscale, Black + Color Cartr.": _("600 dpi, grayscale, black + color cartridge"),
356            "600 dpi, Photo, Black + Color Cartr., Photo Paper": _("600 dpi, photo, black + color cartridge, photo paper"),
357            "600 dpi, Color, Black + Color Cartr., Photo Paper, Normal": _("600 dpi, color, black + color cartridge, photo paper, normal"),
358            "1200 dpi, Photo, Black + Color Cartr., Photo Paper": _("1200 dpi, photo, black + color cartridge, photo paper"),
359            })
360
361    ## Common backend descriptions
362    global backends
363    backends = TranslationDict ({
364            "Internet Printing Protocol (ipp)": _("Internet Printing Protocol (ipp)"),
365            "Internet Printing Protocol (http)": _("Internet Printing Protocol (http)"),
366            "Internet Printing Protocol (https)": _("Internet Printing Protocol (https)"),
367            "LPD/LPR Host or Printer": _("LPD/LPR Host or Printer"),
368            "AppSocket/HP JetDirect": _("AppSocket/HP JetDirect"),
369            "Serial Port #1": _("Serial Port #1"),
370            "LPT #1": _("LPT #1"),
371            "Windows Printer via SAMBA": _("Windows Printer via SAMBA"),
372            })
373