Back to index

scribus-ng  1.3.4.dfsg+svn20071115
commonstrings.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008        begin                : Aug 2005
00009        copyright            : (C) 2005 by Craig Bradney
00010        email                : cbradney@zip.com.au
00011 ***************************************************************************/
00012 
00013 /***************************************************************************
00014 *                                                                         *
00015 *   ScMW program is free software; you can redistribute it and/or modify  *
00016 *   it under the terms of the GNU General Public License as published by  *
00017 *   the Free Software Foundation; either version 2 of the License, or     *
00018 *   (at your option) any later version.                                   *
00019 *                                                                         *
00020 ***************************************************************************/
00021 
00022 #include "commonstrings.h"
00023 #include "commonstrings.moc"
00024 
00025 QString CommonStrings::_Apply      = "";
00026 QString CommonStrings::tr_Apply    = "";
00027 QString CommonStrings::_Cancel     = "";
00028 QString CommonStrings::tr_Cancel   = "";
00029 QString CommonStrings::None        = "";
00030 QString CommonStrings::tr_None     = "";
00031 QString CommonStrings::tr_NoneColor= "";
00032 QString CommonStrings::_OK         = "";
00033 QString CommonStrings::tr_OK       = "";
00034 QString CommonStrings::_Save       = "";
00035 QString CommonStrings::tr_Save     = "";
00036 QString CommonStrings::Warning     = "";
00037 QString CommonStrings::trWarning   = "";
00038 
00039 QString CommonStrings::trYes       = "";
00040 QString CommonStrings::trNo        = "";
00041 QString CommonStrings::trYesKey    = "";
00042 QString CommonStrings::trNoKey     = "";
00043 
00044 QString CommonStrings::customPageSize = "";
00045 QString CommonStrings::trCustomPageSize = "";
00046 
00047 QString CommonStrings::pageSet1    = "";
00048 QString CommonStrings::pageSet2    = "";
00049 QString CommonStrings::pageSet3    = "";
00050 QString CommonStrings::pageSet4    = "";
00051 QString CommonStrings::trPageSet1  = "";
00052 QString CommonStrings::trPageSet2  = "";
00053 QString CommonStrings::trPageSet3  = "";
00054 QString CommonStrings::trPageSet4  = "";
00055 QString CommonStrings::pageLocLeft          = "";
00056 QString CommonStrings::pageLocMiddle        = "";
00057 QString CommonStrings::pageLocMiddleLeft    = "";
00058 QString CommonStrings::pageLocMiddleRight   = "";
00059 QString CommonStrings::pageLocRight         = "";
00060 QString CommonStrings::trPageLocLeft        = "";
00061 QString CommonStrings::trPageLocMiddle      = "";
00062 QString CommonStrings::trPageLocMiddleLeft  = "";
00063 QString CommonStrings::trPageLocMiddleRight = "";
00064 QString CommonStrings::trPageLocRight       = "";
00065 
00066 QString CommonStrings:: masterPageNormal         = "";
00067 QString CommonStrings:: trMasterPageNormal       = "";
00068 QString CommonStrings:: masterPageNormalLeft     = "";
00069 QString CommonStrings:: trMasterPageNormalLeft   = "";
00070 QString CommonStrings:: masterPageNormalMiddle   = "";
00071 QString CommonStrings:: trMasterPageNormalMiddle = "";
00072 QString CommonStrings:: masterPageNormalRight    = "";
00073 QString CommonStrings:: trMasterPageNormalRight  = "";
00074 
00075 QString CommonStrings::trPenStyle_SolidLine      = "";
00076 QString CommonStrings::trPenStyle_DashedLine     = "";
00077 QString CommonStrings::trPenStyle_DottedLine     = "";
00078 QString CommonStrings::trPenStyle_DashDotLine    = "";
00079 QString CommonStrings::trPenStyle_DashDotDotLine = "";
00080 
00081 
00082 QString CommonStrings::monday="", CommonStrings::tuesday="", CommonStrings::wednesday="";
00083 QString CommonStrings::thursday="", CommonStrings::friday="", CommonStrings::saturday="", CommonStrings::sunday="";
00084 QString CommonStrings::january="", CommonStrings::february="", CommonStrings::march="";
00085 QString CommonStrings::april="", CommonStrings::may="", CommonStrings::june="";
00086 QString CommonStrings::july="", CommonStrings::august="", CommonStrings::september="";
00087 QString CommonStrings::october="", CommonStrings::november="", CommonStrings::december="";
00088 
00089 
00090 QString CommonStrings::trVisionNormal         = "";
00091 QString CommonStrings::trVisionProtanopia     = "";
00092 QString CommonStrings::trVisionDeuteranopia   = "";
00093 QString CommonStrings::trVisionTritanopia     = "";
00094 QString CommonStrings::trVisionFullColorBlind = "";
00095 
00096 QString CommonStrings::trCustomTabFill        = "";
00097 
00098 QString CommonStrings::trOpticalMarginsNone            = "";
00099 QString CommonStrings::trOpticalMarginsLeftProtruding  = "";
00100 QString CommonStrings::trOpticalMarginsRightProtruding = "";
00101 QString CommonStrings::trOpticalMarginsLeftHangPunct   = "";
00102 QString CommonStrings::trOpticalMarginsRightHangPunct  = "";
00103 QString CommonStrings::trOpticalMarginsDefault         = "";
00104 
00105 QString CommonStrings::trMinWordTracking   = "";
00106 QString CommonStrings::trNormWordTracking   = "";
00107 QString CommonStrings::trMinGlyphExtension = "";
00108 QString CommonStrings::trMaxGlyphExtension = "";
00109 
00110 
00111 
00112 CommonStrings::CommonStrings()
00113 {
00114        languageChange();
00115 }
00116 
00117 const QString& CommonStrings::translatePageSetString(const QString &untrString)
00118 {
00119        if (untrString==pageSet1)
00120               return trPageSet1;
00121        if (untrString==pageSet2)
00122               return trPageSet2;
00123        if (untrString==pageSet3)
00124               return trPageSet3;
00125        if (untrString==pageSet4)
00126               return trPageSet4;
00127        return untrString;
00128 }
00129 
00130 const QString& CommonStrings::translatePageSetLocString(const QString &untrString)
00131 {
00132        if (untrString==pageLocLeft)
00133               return trPageLocLeft;
00134        if (untrString==pageLocMiddle)
00135               return trPageLocMiddle;
00136        if (untrString==pageLocMiddleLeft)
00137               return trPageLocMiddleLeft;
00138        if (untrString==pageLocMiddleRight)
00139               return trPageLocMiddleRight;
00140        if (untrString==pageLocRight)
00141               return trPageLocRight;
00142        return untrString;
00143 }
00144 
00145 const QString& CommonStrings::untranslatePageSetString(const QString &trString)
00146 {
00147        if (trString==trPageSet1)
00148               return pageSet1;
00149        if (trString==trPageSet2)
00150               return pageSet2;
00151        if (trString==trPageSet3)
00152               return pageSet3;
00153        if (trString==trPageSet4)
00154               return pageSet4;
00155        return trString;
00156 }
00157 
00158 const QString& CommonStrings::untranslatePageSetLocString(const QString &trString)
00159 {
00160        if (trString==trPageLocLeft)
00161               return pageLocLeft;
00162        if (trString==trPageLocMiddle)
00163               return pageLocMiddle;
00164        if (trString==trPageLocMiddleLeft)
00165               return pageLocMiddleLeft;
00166        if (trString==trPageLocMiddleRight)
00167               return pageLocMiddleRight;
00168        if (trString==trPageLocRight)
00169               return pageLocRight;
00170        return trString;
00171 }
00172 
00173 void CommonStrings::languageChange()
00174 {
00175        CommonStrings::_Apply     = "&Apply";
00176        CommonStrings::tr_Apply   = tr( "&Apply" );
00177 
00178        CommonStrings::_Cancel    = "&Cancel";
00179        CommonStrings::tr_Cancel  = tr( "&Cancel" );
00180 
00181        CommonStrings::None        = "None";
00182        CommonStrings::tr_None     = tr( "None" );
00183        CommonStrings::tr_NoneColor= tr("None", "color name");
00184 
00185        CommonStrings::_OK        = "&OK";
00186        CommonStrings::tr_OK      = tr( "&OK" );
00187 
00188        CommonStrings::_Save      = "&Save";
00189        CommonStrings::tr_Save    = tr( "&Save" );
00190 
00191        CommonStrings::Warning    = "Warning";
00192        CommonStrings::trWarning  = tr( "Warning" );
00193 
00194        CommonStrings::trYes      = tr("Yes");
00195        CommonStrings::trNo       = tr("No");
00196        CommonStrings::trYesKey   = tr("&Yes");
00197        CommonStrings::trNoKey    = tr("&No");
00198        
00199        CommonStrings::customPageSize = "Custom";
00200        CommonStrings::trCustomPageSize = tr( "Custom", "CommonStrings, custom page size" );
00201 
00202        CommonStrings::pageSet1    = "Single Page";
00203        CommonStrings::pageSet2    = "Double Sided";
00204        CommonStrings::pageSet3    = "3-Fold";
00205        CommonStrings::pageSet4    = "4-Fold";
00206        CommonStrings::trPageSet1  = tr( "Single Page" );
00207        CommonStrings::trPageSet2  = tr( "Double Sided" );
00208        CommonStrings::trPageSet3  = tr( "3-Fold" );
00209        CommonStrings::trPageSet4  = tr( "4-Fold" );
00210 
00211        CommonStrings::pageLocLeft          = "Left Page";
00212        CommonStrings::pageLocMiddle        = "Middle";
00213        CommonStrings::pageLocMiddleLeft    = "Middle Left";
00214        CommonStrings::pageLocMiddleRight   = "Middle Right";
00215        CommonStrings::pageLocRight         = "Right Page";
00216        CommonStrings::trPageLocLeft        = tr( "Left Page", "Left page location" );
00217        CommonStrings::trPageLocMiddle      = tr( "Middle", "Middle page location" );
00218        CommonStrings::trPageLocMiddleLeft  = tr( "Middle Left", "Middle Left page location" );
00219        CommonStrings::trPageLocMiddleRight = tr( "Middle Right", "Middle Right page location" );
00220        CommonStrings::trPageLocRight       = tr( "Right Page", "Right page location" );
00221        
00222        CommonStrings::masterPageNormal         = "Normal";
00223        CommonStrings::trMasterPageNormal       = tr( "Normal", "Default single master page" );
00224        CommonStrings::masterPageNormalLeft     = "Normal Left";
00225        CommonStrings::trMasterPageNormalLeft   = tr( "Normal Left", "Default left master page" );
00226        CommonStrings::masterPageNormalMiddle   = "Normal Middle";
00227        CommonStrings::trMasterPageNormalMiddle = tr( "Normal Middle", "Default middle master page" );
00228        CommonStrings::masterPageNormalRight    = "Normal Right";
00229        CommonStrings::trMasterPageNormalRight  = tr( "Normal Right", "Default right master page" );
00230        
00231        CommonStrings::trPenStyle_SolidLine      = tr("Solid Line");
00232        CommonStrings::trPenStyle_DashedLine     = tr("Dashed Line");
00233        CommonStrings::trPenStyle_DottedLine     = tr("Dotted Line");
00234        CommonStrings::trPenStyle_DashDotLine    = tr("Dash Dot Line");
00235        CommonStrings::trPenStyle_DashDotDotLine = tr("Dash Dot Dot Line");
00236        
00237        CommonStrings::monday    = tr("Monday");
00238        CommonStrings::tuesday   = tr("Tuesday");
00239        CommonStrings::wednesday = tr("Wednesday");
00240        CommonStrings::thursday  = tr("Thursday");
00241        CommonStrings::friday    = tr("Friday");
00242        CommonStrings::saturday  = tr("Saturday");
00243        CommonStrings::sunday    = tr("Sunday");
00244        CommonStrings::january   = tr("January");
00245        CommonStrings::february  = tr("February");
00246        CommonStrings::march     = tr("March");
00247        CommonStrings::april     = tr("April");
00248        CommonStrings::may       = tr("May");
00249        CommonStrings::june      = tr("June");
00250        CommonStrings::july      = tr("July");
00251        CommonStrings::august    = tr("August");
00252        CommonStrings::september = tr("September");
00253        CommonStrings::october   = tr("October");
00254        CommonStrings::november  = tr("November");
00255        CommonStrings::december  = tr("December");
00256        
00257        CommonStrings::trVisionNormal         = tr("Normal Vision", "Color Blindness - Normal Vision");
00258        CommonStrings::trVisionProtanopia     = tr("Protanopia (Red)", "Color Blindness - Red Color Blind");
00259        CommonStrings::trVisionDeuteranopia   = tr("Deuteranopia (Green)", "Color Blindness - Greed Color Blind");
00260        CommonStrings::trVisionTritanopia     = tr("Tritanopia (Blue)", "Color Blindness - Blue Color Blind");
00261        CommonStrings::trVisionFullColorBlind = tr("Full Color Blindness", "Color Blindness - Full Color Blindness");
00262        
00263        CommonStrings::trCustomTabFill = tr("Custom: ","Custom Tab Fill Option");
00264        
00265        CommonStrings::trOpticalMarginsNone            = tr("None", "Optical Margin Setting");
00266        CommonStrings::trOpticalMarginsLeftProtruding  = tr("Left Protruding", "Optical Margin Setting");
00267        CommonStrings::trOpticalMarginsRightProtruding = tr("Right Protruding", "Optical Margin Setting");
00268        CommonStrings::trOpticalMarginsLeftHangPunct   = tr("Left Hanging Punctuation", "Optical Margin Setting");
00269        CommonStrings::trOpticalMarginsRightHangPunct  = tr("Right Hanging Punctuation", "Optical Margin Setting");
00270        CommonStrings::trOpticalMarginsDefault         = tr("Both sides", "Optical Margin Setting");
00271        
00272        //Paragraph Style Word Tracking
00273        CommonStrings::trMinWordTracking = tr("Min. Word Tracking");
00274        CommonStrings::trNormWordTracking = tr("Norm. Word Tracking");
00275        
00276        //Paragraph Style Glyph Extension
00277        CommonStrings::trMinGlyphExtension = tr("Min. Glyph Extension");
00278        CommonStrings::trMaxGlyphExtension = tr("Max. Glyph Extension");
00279 }
00280 
00281 const QString & CommonStrings::translatePenStyleName( Qt::PenStyle ps )
00282 {
00283        if (ps == Qt::DashLine)
00284               return trPenStyle_DashedLine;
00285        if (ps == Qt::DotLine)
00286               return trPenStyle_DottedLine;
00287        if (ps == Qt::DashDotLine)
00288               return trPenStyle_DashDotLine;
00289        if (ps == Qt::DashDotDotLine)
00290               return trPenStyle_DashDotDotLine;
00291        //Return SolidLine as default or if SolidLine
00292        //if (ps == Qt::SolidLine)
00293        return trPenStyle_SolidLine;
00294 }
00295