diff options
author | Xisco Fauli <anistenis@gmail.com> | 2012-10-28 20:54:50 +0100 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2012-10-30 01:09:33 +0100 |
commit | 6fa0930ed4208e6fb13bc986616ad7441bbd4bd1 (patch) | |
tree | e9becd1f41fae09feaf28ec83fc3324617fd5b30 /wizards/com/sun/star/wizards/letter | |
parent | 4a11a47103fcbd7646234fc9565a409b8055507e (diff) |
pyletter: Translate the templates at runtime
Change-Id: Ie0b149b4a8928e5b61153a6ed62b66d02f916f20
Diffstat (limited to 'wizards/com/sun/star/wizards/letter')
3 files changed, 20 insertions, 2 deletions
diff --git a/wizards/com/sun/star/wizards/letter/CGLetter.py b/wizards/com/sun/star/wizards/letter/CGLetter.py index abed25080715..cf9bd76fe07f 100644 --- a/wizards/com/sun/star/wizards/letter/CGLetter.py +++ b/wizards/com/sun/star/wizards/letter/CGLetter.py @@ -28,7 +28,6 @@ class CGLetter(ConfigGroup): self.cp_PaperCompanyAddressReceiverField = bool() self.cp_PaperFooter = bool() self.cp_PaperFooterHeight = float() - self.cp_Norm = int() self.cp_PrintCompanyLogo = bool() self.cp_PrintCompanyAddressReceiverField = bool() self.cp_PrintLetterSigns = bool() diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py index 4f91d37291f7..bfdd6671ba4f 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py @@ -25,6 +25,7 @@ from ..common.FileAccess import FileAccess from ..common.Configuration import Configuration from ..common.SystemDialog import SystemDialog from ..common.Desktop import Desktop +from ..common.TextElement import TextElement from ..ui.PathSelection import PathSelection from ..ui.event.UnoDataAware import UnoDataAware from ..ui.event.RadioDataAware import RadioDataAware @@ -386,6 +387,7 @@ class LetterWizardDialogImpl(LetterWizardDialog): self.initializeElements() self.chkBusinessPaperItemChanged() self.setElements(False) + self.drawConstants() def lstPrivOfficialStyleItemChanged(self): selectedItemPos = self.lstPrivOfficialStyle.SelectedItemPos @@ -397,6 +399,7 @@ class LetterWizardDialogImpl(LetterWizardDialog): self.initializeElements() self.setPossibleSenderData(True) self.setElements(False) + self.drawConstants() def lstPrivateStyleItemChanged(self): selectedItemPos = self.lstPrivateStyle.SelectedItemPos @@ -981,7 +984,18 @@ class LetterWizardDialogImpl(LetterWizardDialog): if self.optMakeChanges.State: self.optMakeChangesItemChanged() - + + def drawConstants(self): + '''Localise the template''' + constRangeList = TextDocument.searchFillInItems(1) + + for i in xrange(constRangeList.Count): + item = constRangeList.getByIndex(i) + text = item.String.lower() + aux = TextElement(item, self.resources.dictConstants[text], + "hint", self.xMSF) + aux.write() + def insertRoadmap(self): self.addRoadmap() diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py index 8e0a0162b2ba..64b45f76cc1b 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py @@ -208,6 +208,11 @@ class LetterWizardDialogResources(Resource): self.reslblTitle6_value = \ self.getResText( LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 58) + + #Create a Dictionary for the constants values. + self.dictConstants = { + "#subjectconst#" : self.getResText( + LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 59)} #Create a dictionary for localising the bussiness templates self.dictBusinessTemplate = { |