diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-02-21 18:39:22 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-02-21 18:49:55 +0100 |
commit | 4e7949974f44e9b1c7b6bae5e8f78234ff860e45 (patch) | |
tree | 7e359fc314a902f698e148fdc4d4f0b07afdcfc6 /svx | |
parent | 596bd0f61f8cfc957410148ae221c62331067bdd (diff) |
fdo#59793 Make compress graphic dialog strings translatable.
Change-Id: I8b42a6c047f95aa567f520db81699c83a115a6c7
Diffstat (limited to 'svx')
-rw-r--r-- | svx/AllLangResTarget_svx.mk | 1 | ||||
-rw-r--r-- | svx/source/dialog/compressgraphicdialog.cxx | 47 | ||||
-rw-r--r-- | svx/source/dialog/compressgraphicdialog.hrc | 21 | ||||
-rw-r--r-- | svx/source/dialog/compressgraphicdialog.src | 34 |
4 files changed, 79 insertions, 24 deletions
diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk index 4e139e1704ac..18a7bbcf6cd5 100644 --- a/svx/AllLangResTarget_svx.mk +++ b/svx/AllLangResTarget_svx.mk @@ -50,6 +50,7 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\ svx/source/core/graphichelper.src \ svx/source/dialog/bmpmask.src \ svx/source/dialog/contdlg.src \ + svx/source/dialog/compressgraphicdialog.src \ svx/source/dialog/dlgctrl.src \ svx/source/dialog/docrecovery.src \ svx/source/dialog/fontwork.src \ diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index ff33a9da6334..4f86229daecc 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -31,6 +31,8 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/beans/XPropertySet.hpp> +#include "compressgraphicdialog.hrc" + using namespace com::sun::star::uno; using namespace com::sun::star::beans; @@ -104,27 +106,24 @@ void CompressGraphicsDialog::Update() Size aPixelSize = m_aGraphic.GetSizePixel(); Size aOriginalSize100mm( pDummyVDev->PixelToLogic( m_aGraphic.GetSizePixel(), MAP_100TH_MM ) ); - String aBitmapSizeString; - aBitmapSizeString += GetUnitString( aOriginalSize100mm.Width(), eFieldUnit, cSeparator ); - aBitmapSizeString += String( " x " ) ; - aBitmapSizeString += GetUnitString( aOriginalSize100mm.Height(), eFieldUnit, cSeparator ); - aBitmapSizeString += String( " ( " ) ; - aBitmapSizeString += OUString::valueOf(aPixelSize.Width()); - aBitmapSizeString += String( " x " ) ; - aBitmapSizeString += OUString::valueOf(aPixelSize.Height()); - aBitmapSizeString += String( " px )" ) ; + String aBitmapSizeString = String(SVX_RES(STR_IMAGE_ORIGINAL_SIZE)); + OUString aWidthString = GetUnitString( aOriginalSize100mm.Width(), eFieldUnit, cSeparator ); + OUString aHeightString = GetUnitString( aOriginalSize100mm.Height(), eFieldUnit, cSeparator ); + aBitmapSizeString.SearchAndReplaceAllAscii( "$(WIDTH)", aWidthString ); + aBitmapSizeString.SearchAndReplaceAllAscii( "$(HEIGHT)", aHeightString ); + aBitmapSizeString.SearchAndReplaceAllAscii( "$(WIDTH_IN_PX)", OUString::valueOf(aPixelSize.Width()) ); + aBitmapSizeString.SearchAndReplaceAllAscii( "$(HEIGHT_IN_PX)", OUString::valueOf(aPixelSize.Height()) ); m_pFixedText2->SetText(aBitmapSizeString); - String aViewSizeString; - int aValX = (int) (aPixelSize.Width() / GetViewWidthInch()); - aViewSizeString += GetUnitString( m_aViewSize100mm.Width(), eFieldUnit, cSeparator ); - aViewSizeString += String( " x " ) ; - aViewSizeString += GetUnitString( m_aViewSize100mm.Height(), eFieldUnit, cSeparator ); - aViewSizeString += ( " at " ) ; - aViewSizeString += OUString::number( aValX); - aViewSizeString += ( " DPI" ) ; + String aViewSizeString = String(SVX_RES(STR_IMAGE_VIEW_SIZE)); + + aWidthString = GetUnitString( m_aViewSize100mm.Width(), eFieldUnit, cSeparator ); + aHeightString = GetUnitString( m_aViewSize100mm.Height(), eFieldUnit, cSeparator ); + aViewSizeString.SearchAndReplaceAllAscii( "$(WIDTH)", aWidthString ); + aViewSizeString.SearchAndReplaceAllAscii( "$(HEIGHT)", aHeightString ); + aViewSizeString.SearchAndReplaceAllAscii( "$(DPI)", OUString::number( aValX) ); m_pFixedText3->SetText(aViewSizeString); SvMemoryStream aMemStream; @@ -133,11 +132,10 @@ void CompressGraphicsDialog::Update() aMemStream.Seek( STREAM_SEEK_TO_END ); sal_Int32 aNativeSize = aMemStream.Tell(); - String aNativeSizeString; - aNativeSizeString += OUString::valueOf(aNativeSize / 1024); - aNativeSizeString += String( " kiB" ) ; - + String aNativeSizeString = String(SVX_RES(STR_IMAGE_CAPACITY)); + aNativeSizeString.SearchAndReplaceAllAscii( "$(CAPACITY)", OUString::valueOf(aNativeSize / 1024) ); m_pFixedText5->SetText(aNativeSizeString); + m_pFixedText6->SetText(String("??")); } @@ -279,9 +277,10 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, CalculateClickHdl ) if ( aSize > 0 ) { - String aNewSizeString; - aNewSizeString += OUString::valueOf(aSize / 1024); - aNewSizeString += String( " kiB" ) ; + OUString aSizeAsString = OUString::valueOf(aSize / 1024); + + String aNewSizeString = String(SVX_RES(STR_IMAGE_CAPACITY)); + aNewSizeString.SearchAndReplaceAllAscii( "$(CAPACITY)", aSizeAsString ); m_pFixedText6->SetText(aNewSizeString); } return 0L; diff --git a/svx/source/dialog/compressgraphicdialog.hrc b/svx/source/dialog/compressgraphicdialog.hrc new file mode 100644 index 000000000000..4b3060d1c432 --- /dev/null +++ b/svx/source/dialog/compressgraphicdialog.hrc @@ -0,0 +1,21 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#define STR_IMAGE_ORIGINAL_SIZE 1 +#define STR_IMAGE_VIEW_SIZE 2 +#define STR_IMAGE_CAPACITY 3 diff --git a/svx/source/dialog/compressgraphicdialog.src b/svx/source/dialog/compressgraphicdialog.src new file mode 100644 index 000000000000..287bacf70419 --- /dev/null +++ b/svx/source/dialog/compressgraphicdialog.src @@ -0,0 +1,34 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "compressgraphicdialog.hrc" + +String STR_IMAGE_ORIGINAL_SIZE +{ + Text [ en-US ] = "$(WIDTH) x $(HEIGHT) ( $(WIDTH_IN_PX) x $(HEIGHT_IN_PX) px )" ; +}; + +String STR_IMAGE_VIEW_SIZE +{ + Text [ en-US ] = "$(WIDTH) x $(HEIGHT) at $(DPI) DPI" ; +}; + +String STR_IMAGE_CAPACITY +{ + Text [ en-US ] = "$(CAPACITY) kiB" ; +}; |