Back to index

system-config-printer  1.3.9+20120706
ppdippstr.py
Go to the documentation of this file.
00001 #!/usr/bin/python
00002 
00003 ## system-config-printer
00004 
00005 ## Copyright (C) 2008, 2009, 2010 Red Hat, Inc.
00006 ## Authors:
00007 ##  Tim Waugh <twaugh@redhat.com>
00008 
00009 ## This program is free software; you can redistribute it and/or modify
00010 ## it under the terms of the GNU General Public License as published by
00011 ## the Free Software Foundation; either version 2 of the License, or
00012 ## (at your option) any later version.
00013 
00014 ## This program is distributed in the hope that it will be useful,
00015 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 ## GNU General Public License for more details.
00018 
00019 ## You should have received a copy of the GNU General Public License
00020 ## along with this program; if not, write to the Free Software
00021 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00022 
00023 from gettext import gettext as _
00024 
00025 printer_error_policy = dict()
00026 printer_op_policy = dict()
00027 job_sheets = dict()
00028 job_options = dict()
00029 ppd = dict()
00030 backends = dict()
00031 
00032 class TranslationDict:
00033     STR = {}
00034 
00035     def __init__ (self, d):
00036         self.STR = d
00037 
00038     def get (self, str):
00039         return self.STR.get (str, str)
00040 
00041 def init ():
00042     ## IPP strings
00043 
00044     # Names of printer error policies
00045     global printer_error_policy
00046     printer_error_policy = TranslationDict ({
00047             "abort-job": _("Abort job"),
00048             "retry-current-job": _("Retry current job"),
00049             "retry-job": _("Retry job"),
00050             "stop-printer": _("Stop printer")
00051             })
00052     
00053     # Names of printer operation policies
00054     global printer_op_policy
00055     printer_op_policy = TranslationDict ({
00056             "default": _("Default behavior"),
00057             "authenticated": _("Authenticated")
00058             })
00059 
00060     # Names of banner pages.
00061     global job_sheets
00062     job_sheets = TranslationDict ({
00063             "none": _("None"),
00064             "classified": _("Classified"),
00065             "confidential": _("Confidential"),
00066             "secret": _("Secret"),
00067             "standard": _("Standard"),
00068             "topsecret": _("Top secret"),
00069             "unclassified": _("Unclassified")
00070             })
00071 
00072     # Names of job-hold-until values.
00073     global job_options
00074     job_options["job-hold-until"] = TranslationDict ({
00075             "no-hold": _("No hold"),
00076             "indefinite": _("Indefinite"),
00077             "day-time": _("Daytime"),
00078             "evening": _("Evening"),
00079             "night": _("Night"),
00080             "second-shift": _("Second shift"),
00081             "third-shift": _("Third shift"),
00082             "weekend": _("Weekend")
00083             })
00084 
00085     ## Common PPD strings
00086 
00087     # Foomatic strings
00088 
00089     # These are PPD option and group names and values.
00090     global ppd
00091     ppd = TranslationDict ({
00092             "General": _("General"),
00093 
00094             # HPIJS options
00095             "Printout Mode": _("Printout mode"),
00096             "Draft (auto-detect paper type)":
00097                 _("Draft (auto-detect-paper type)"),
00098             "Draft Grayscale (auto-detect paper type)":
00099                 _("Draft grayscale (auto-detect-paper type)"),
00100             "Normal (auto-detect paper type)":
00101                 _("Normal (auto-detect-paper type)"),
00102             "Normal Grayscale (auto-detect paper type)":
00103                 _("Normal grayscale (auto-detect-paper type)"),
00104             "High Quality (auto-detect paper type)":
00105                 _("High quality (auto-detect-paper type)"),
00106             "High Quality Grayscale (auto-detect paper type)":
00107                 _("High quality grayscale (auto-detect-paper type)"),
00108             "Photo (on photo paper)": _("Photo (on photo paper)"),
00109             "Best Quality (color on photo paper)":
00110                 _("Best quality (color on photo paper)"),
00111             "Normal Quality (color on photo paper)":
00112                 _("Normal quality (color on photo paper)"),
00113 
00114             "Media Source": _("Media source"),
00115             "Printer default": _("Printer default"),
00116             "Photo Tray": _("Photo tray"),
00117             "Upper Tray": _("Upper tray"),
00118             "Lower Tray": _("Lower tray"),
00119             "CD or DVD Tray": _("CD or DVD tray"),
00120             "Envelope Feeder": _("Envelope feeder"),
00121             "Large Capacity Tray": _("Large capacity tray"),
00122             "Manual Feeder": _("Manual feeder"),
00123             "Multi Purpose Tray": _("Multi-purpose tray"),
00124 
00125             "Page Size": _("Page size"),
00126             "Custom": _("Custom"),
00127             "Photo or 4x6 inch index card": _("Photo or 4x6 inch index card"),
00128             "Photo or 5x7 inch index card": _("Photo or 5x7 inch index card"),
00129             "Photo with tear-off tab": _("Photo with tear-off tab"),
00130             "3x5 inch index card": _("3x5 inch index card"),
00131             "5x8 inch index card": _("5x8 inch index card"),
00132             "A6 with tear-off tab": _("A6 with tear-off tab"),
00133             "CD or DVD 80 mm": _("CD or DVD 80mm"),
00134             "CD or DVD 120 mm": _("CD or DVD 120mm"),
00135 
00136             "Double-Sided Printing": _("Double-sided printing"),
00137             "Long Edge (Standard)": _("Long edge (standard)"),
00138             "Short Edge (Flip)": _("Short edge (flip)"),
00139             "Off": _("Off"),
00140 
00141             "Resolution, Quality, Ink Type, Media Type":
00142                 _("Resolution, quality, ink type, media type"),
00143             "Controlled by 'Printout Mode'": _("Controlled by 'Printout mode'"),
00144             "300 dpi, Color, Black + Color Cartr.":
00145                 _("300 dpi, color, black + color cartridge"),
00146             "300 dpi, Draft, Color, Black + Color Cartr.":
00147                 _("300 dpi, draft, color, black + color cartridge"),
00148             "300 dpi, Draft, Grayscale, Black + Color Cartr.":
00149                 _("300 dpi, draft, grayscale, black + color cartridge"),
00150             "300 dpi, Grayscale, Black + Color Cartr.":
00151                 _("300 dpi, grayscale, black + color cartridge"),
00152             "600 dpi, Color, Black + Color Cartr.":
00153                 _("600 dpi, color, black + color cartridge"),
00154             "600 dpi, Grayscale, Black + Color Cartr.":
00155                 _("600 dpi, grayscale, black + color cartridge"),
00156             "600 dpi, Photo, Black + Color Cartr., Photo Paper":
00157                 _("600 dpi, photo, black + color cartridge, photo paper"),
00158             "600 dpi, Color, Black + Color Cartr., Photo Paper, Normal":
00159                 _("600 dpi, color, black + color cartridge, photo paper, normal"),
00160             "1200 dpi, Photo, Black + Color Cartr., Photo Paper":
00161                 _("1200 dpi, photo, black + color cartridge, photo paper"),
00162             })
00163 
00164     ## Common backend descriptions
00165     global backends
00166     backends = TranslationDict ({
00167             "Internet Printing Protocol (ipp)":
00168                 _("Internet Printing Protocol (ipp)"),
00169             "Internet Printing Protocol (http)":
00170                 _("Internet Printing Protocol (http)"),
00171             "Internet Printing Protocol (https)":
00172                 _("Internet Printing Protocol (https)"),
00173             "LPD/LPR Host or Printer":
00174                 _("LPD/LPR Host or Printer"),
00175             "AppSocket/HP JetDirect":
00176                 _("AppSocket/HP JetDirect"),
00177             "Serial Port #1":
00178                 _("Serial Port #1"),
00179             "LPT #1":
00180                 _("LPT #1"),
00181             "Windows Printer via SAMBA":
00182                 _("Windows Printer via SAMBA"),
00183             })