chiark / gitweb /
Fix localization merge.
authordaid <daid303@gmail.com>
Mon, 16 Sep 2013 13:23:26 +0000 (15:23 +0200)
committerdaid <daid303@gmail.com>
Mon, 16 Sep 2013 13:23:26 +0000 (15:23 +0200)
1  2 
Cura/gui/configWizard.py
Cura/gui/mainWindow.py
Cura/gui/printWindow.py
Cura/gui/sceneView.py
Cura/gui/simpleMode.py
Cura/gui/tools/youmagineGui.py
Cura/util/profile.py
Cura/util/resources.py

index a6415977a919b4b89422e0b9998c93fe07ec6459,214d76ece4aaf88edb5faa9531bdb885a197c56f..f68f8d8c4d863aa3a3f25f8d29eef45cbe2bd43f
@@@ -261,28 -261,23 +261,28 @@@ class RepRapInfoPage(InfoPage)
  
  class MachineSelectPage(InfoPage):
        def __init__(self, parent):
-               super(MachineSelectPage, self).__init__(parent, "Select your machine")
-               self.AddText('What kind of machine do you have:')
+               super(MachineSelectPage, self).__init__(parent, _("Select your machine"))
+               self.AddText(_("What kind of machine do you have:"))
  
 -              self.UltimakerRadio = self.AddRadioButton("Ultimaker", style=wx.RB_GROUP)
 -              self.UltimakerRadio.SetValue(True)
 +              self.Ultimaker2Radio = self.AddRadioButton("Ultimaker2", style=wx.RB_GROUP)
 +              self.Ultimaker2Radio.SetValue(True)
 +              self.Ultimaker2Radio.Bind(wx.EVT_RADIOBUTTON, self.OnUltimaker2Select)
 +              self.UltimakerRadio = self.AddRadioButton("Ultimaker")
                self.UltimakerRadio.Bind(wx.EVT_RADIOBUTTON, self.OnUltimakerSelect)
-               self.OtherRadio = self.AddRadioButton("Other (Ex: RepRap)")
+               self.OtherRadio = self.AddRadioButton(_("Other (Ex: RepRap)"))
                self.OtherRadio.Bind(wx.EVT_RADIOBUTTON, self.OnOtherSelect)
                self.AddSeperator()
-               self.AddText('The collection of anonymous usage information helps with the continued improvement of Cura.')
-               self.AddText('This does NOT submit your models online nor gathers any privacy related information.')
-               self.SubmitUserStats = self.AddCheckbox('Submit anonymous usage information:')
-               self.AddText('For full details see: http://wiki.ultimaker.com/Cura:stats')
+               self.AddText(_("The collection of anonymous usage information helps with the continued improvement of Cura."))
+               self.AddText(_("This does NOT submit your models online nor gathers any privacy related information."))
+               self.SubmitUserStats = self.AddCheckbox(_("Submit anonymous usage information:"))
+               self.AddText(_("For full details see: http://wiki.ultimaker.com/Cura:stats"))
                self.SubmitUserStats.SetValue(True)
  
 +      def OnUltimaker2Select(self, e):
 +              wx.wizard.WizardPageSimple.Chain(self, self.GetParent().ultimaker2ReadyPage)
 +
        def OnUltimakerSelect(self, e):
 -              wx.wizard.WizardPageSimple.Chain(self, self.GetParent().ultimakerFirmwareUpgradePage)
 +              wx.wizard.WizardPageSimple.Chain(self, self.GetParent().ultimakerSelectParts)
  
        def OnOtherSelect(self, e):
                wx.wizard.WizardPageSimple.Chain(self, self.GetParent().repRapInfoPage)
@@@ -355,14 -335,14 +355,14 @@@ class SelectParts(InfoPage)
                        profile.putProfileSetting('retraction_enable', 'False')
  
  
 -class FirmwareUpgradePage(InfoPage):
 +class UltimakerFirmwareUpgradePage(InfoPage):
        def __init__(self, parent):
-               super(UltimakerFirmwareUpgradePage, self).__init__(parent, "Upgrade Ultimaker Firmware")
-               self.AddText('Firmware is the piece of software running directly on your 3D printer.\nThis firmware controls the step motors, regulates the temperature\nand ultimately makes your printer work.')
 -              super(FirmwareUpgradePage, self).__init__(parent, "Upgrade Ultimaker Firmware")
++              super(UltimakerFirmwareUpgradePage, self).__init__(parent, _("Upgrade Ultimaker Firmware"))
+               self.AddText(_("Firmware is the piece of software running directly on your 3D printer.\nThis firmware controls the step motors, regulates the temperature\nand ultimately makes your printer work."))
                self.AddHiddenSeperator()
-               self.AddText('The firmware shipping with new Ultimakers works, but upgrades\nhave been made to make better prints, and make calibration easier.')
+               self.AddText(_("The firmware shipping with new Ultimakers works, but upgrades\nhave been made to make better prints, and make calibration easier."))
                self.AddHiddenSeperator()
-               self.AddText('Cura requires these new features and thus\nyour firmware will most likely need to be upgraded.\nYou will get the chance to do so now.')
+               self.AddText(_("Cura requires these new features and thus\nyour firmware will most likely need to be upgraded.\nYou will get the chance to do so now."))
                upgradeButton, skipUpgradeButton = self.AddDualButton('Upgrade to Marlin firmware', 'Skip upgrade')
                upgradeButton.Bind(wx.EVT_BUTTON, self.OnUpgradeClick)
                skipUpgradeButton.Bind(wx.EVT_BUTTON, self.OnSkipClick)
index dcebc58145f5b296401f0f25c01a8ebd14c71dfd,cd656e74d64f9d640bd6ed33cc5dedb3081ceb61..41cb1f0615b3f9ffd4b7575800c9eb6bce1f420d
@@@ -100,20 -100,20 +100,20 @@@ class mainWindow(wx.Frame)
                self.profileFileHistory.UseMenu(profileHistoryMenu)
                self.profileFileHistory.AddFilesToMenu()
                self.Bind(wx.EVT_MENU_RANGE, self.OnProfileMRU, id=self.ID_MRU_PROFILE1, id2=self.ID_MRU_PROFILE10)
-               
                self.fileMenu.AppendSeparator()
-               i = self.fileMenu.Append(wx.ID_EXIT, 'Quit')
+               i = self.fileMenu.Append(wx.ID_EXIT, _("Quit"))
                self.Bind(wx.EVT_MENU, self.OnQuit, i)
-               self.menubar.Append(self.fileMenu, '&File')
+               self.menubar.Append(self.fileMenu, _("&File"))
  
                toolsMenu = wx.Menu()
-               i = toolsMenu.Append(-1, 'Switch to quickprint...')
+               i = toolsMenu.Append(-1, _("Switch to quickprint..."))
                self.switchToQuickprintMenuItem = i
                self.Bind(wx.EVT_MENU, self.OnSimpleSwitch, i)
-               i = toolsMenu.Append(-1, 'Switch to full settings...')
+               i = toolsMenu.Append(-1, _("Switch to full settings..."))
                self.switchToNormalMenuItem = i
                self.Bind(wx.EVT_MENU, self.OnNormalSwitch, i)
 -              toolsMenu.AppendSeparator()
 +              #toolsMenu.AppendSeparator()
                #i = toolsMenu.Append(-1, 'Batch run...')
                #self.Bind(wx.EVT_MENU, self.OnBatchRun, i)
                #self.normalModeOnlyItems.append(i)
Simple merge
index da35e2c08251ea81eaa0040be6ef57884a0639cb,916eaa0262bd92bcca8ead1add297dfa0b14e984..5023bdc51b64326ca81d3dd2b46ff08ab7e27ae7
@@@ -617,13 -614,13 +617,13 @@@ class SceneView(openglGui.glGuiPanel)
                        if e.GetButton() == 3:
                                        menu = wx.Menu()
                                        if self._focusObj is not None:
-                                               self.Bind(wx.EVT_MENU, lambda e: self._deleteObject(self._focusObj), menu.Append(-1, 'Delete'))
-                                               self.Bind(wx.EVT_MENU, self.OnMultiply, menu.Append(-1, 'Multiply'))
-                                               self.Bind(wx.EVT_MENU, self.OnSplitObject, menu.Append(-1, 'Split'))
+                                               self.Bind(wx.EVT_MENU, lambda e: self._deleteObject(self._focusObj), menu.Append(-1, _("Delete")))
+                                               self.Bind(wx.EVT_MENU, self.OnMultiply, menu.Append(-1, _("Multiply")))
+                                               self.Bind(wx.EVT_MENU, self.OnSplitObject, menu.Append(-1, _("Split")))
 -                                      if self._selectedObj != self._focusObj and self._focusObj is not None and int(profile.getPreference('extruder_amount')) > 1:
 +                                      if ((self._selectedObj != self._focusObj and self._focusObj is not None and self._selectedObj is not None) or len(self._scene.objects()) == 2) and int(profile.getPreference('extruder_amount')) > 1:
-                                               self.Bind(wx.EVT_MENU, self.OnMergeObjects, menu.Append(-1, 'Dual extrusion merge'))
+                                               self.Bind(wx.EVT_MENU, self.OnMergeObjects, menu.Append(-1, _("Dual extrusion merge")))
                                        if len(self._scene.objects()) > 0:
-                                               self.Bind(wx.EVT_MENU, self.OnDeleteAll, menu.Append(-1, 'Delete all'))
+                                               self.Bind(wx.EVT_MENU, self.OnDeleteAll, menu.Append(-1, _("Delete all")))
                                        if menu.MenuItemCount > 0:
                                                self.PopupMenu(menu)
                                        menu.Destroy()
index 498993b3bb415a0ba40c5b18040576b7beef00a2,c5552230d3364fab433004d368d3b47b6607615c..13ea7a2280f02801ea622585a11327e3fd1a5c84
@@@ -27,10 -27,8 +27,10 @@@ class simpleModePanel(wx.Panel)
                self.printMaterialPLA = wx.RadioButton(printMaterialPanel, -1, 'PLA', style=wx.RB_GROUP)
                self.printMaterialABS = wx.RadioButton(printMaterialPanel, -1, 'ABS')
                self.printMaterialDiameter = wx.TextCtrl(printMaterialPanel, -1, profile.getProfileSetting('filament_diameter'))
 +              if profile.getPreference('gcode_flavor') == 'UltiGCode':
 +                      printMaterialPanel.Show(False)
                
-               self.printSupport = wx.CheckBox(self, -1, 'Print support structure')
+               self.printSupport = wx.CheckBox(self, -1, _("Print support structure"))
  
                sizer = wx.GridBagSizer()
                self.SetSizer(sizer)
index a9104f621bbeaf20dc99a33e91fac229d60c7989,951acfeaf04707fec00ab076031fa994d10f504d..126d3a775b74b840a3962e0210c383c9fc5ea5cd
@@@ -275,8 -275,8 +275,8 @@@ class newDesignWindow(wx.Frame)
                self._designDescription = wx.TextCtrl(p, -1, '', size=(1, 150), style = wx.TE_MULTILINE)
                self._designLicense = wx.ComboBox(p, -1, licenseOptions[0], choices=licenseOptions, style=wx.CB_DROPDOWN|wx.CB_READONLY)
                self._category = wx.ComboBox(p, -1, categoryOptions[-1], choices=categoryOptions, style=wx.CB_DROPDOWN|wx.CB_READONLY)
-               self._publish = wx.CheckBox(p, -1, 'Publish after upload')
-               self._shareButton = wx.Button(p, -1, 'Share!')
+               self._publish = wx.CheckBox(p, -1, _("Publish after upload"))
 -              self._shareButton = wx.Button(p, -1, _("Upload"))
++              self._shareButton = wx.Button(p, -1, _("Share!"))
                self._imageScroll = wx.lib.scrolledpanel.ScrolledPanel(p)
                self._additionalFiles = wx.CheckListBox(p, -1)
                self._additionalFiles.InsertItems(getAdditionalFiles(self._manager._scene.objects(), True), 0)
                p.SetSizer(s)
  
                s.Add(wx.StaticBitmap(p, -1, wx.Bitmap(getPathForImage('youmagine-text.png'))), (0,0), span=(1,3), flag=wx.ALIGN_CENTRE | wx.ALL, border=5)
-               s.Add(wx.StaticText(p, -1, 'Design name:'), (1, 0), flag=wx.LEFT|wx.TOP, border=5)
+               s.Add(wx.StaticText(p, -1, _("Design name:")), (1, 0), flag=wx.LEFT|wx.TOP, border=5)
                s.Add(self._designName, (1, 1), span=(1,2), flag=wx.EXPAND|wx.LEFT|wx.TOP|wx.RIGHT, border=5)
-               s.Add(wx.StaticText(p, -1, 'Description:'), (2, 0), flag=wx.LEFT|wx.TOP, border=5)
+               s.Add(wx.StaticText(p, -1, _("Description:")), (2, 0), flag=wx.LEFT|wx.TOP, border=5)
                s.Add(self._designDescription, (2, 1), span=(1,2), flag=wx.EXPAND|wx.LEFT|wx.TOP|wx.RIGHT, border=5)
-               s.Add(wx.StaticText(p, -1, 'Category:'), (3, 0), flag=wx.LEFT|wx.TOP, border=5)
+               s.Add(wx.StaticText(p, -1, _("Category:")), (3, 0), flag=wx.LEFT|wx.TOP, border=5)
                s.Add(self._category, (3, 1), span=(1,2), flag=wx.EXPAND|wx.LEFT|wx.TOP|wx.RIGHT, border=5)
-               s.Add(wx.StaticText(p, -1, 'License:'), (4, 0), flag=wx.LEFT|wx.TOP, border=5)
+               s.Add(wx.StaticText(p, -1, _("License:")), (4, 0), flag=wx.LEFT|wx.TOP, border=5)
                s.Add(self._designLicense, (4, 1), span=(1,2), flag=wx.EXPAND|wx.LEFT|wx.TOP|wx.RIGHT, border=5)
                s.Add(wx.StaticLine(p, -1), (5,0), span=(1,3), flag=wx.EXPAND|wx.ALL)
-               s.Add(wx.StaticText(p, -1, 'Images:'), (6, 0), flag=wx.LEFT|wx.TOP, border=5)
+               s.Add(wx.StaticText(p, -1, _("Images:")), (6, 0), flag=wx.LEFT|wx.TOP, border=5)
                s.Add(self._imageScroll, (6, 1), span=(1, 2), flag=wx.EXPAND|wx.LEFT|wx.TOP|wx.RIGHT, border=5)
                s.Add(wx.StaticLine(p, -1), (7,0), span=(1,3), flag=wx.EXPAND|wx.ALL)
-               s.Add(wx.StaticText(p, -1, 'Related design files:'), (8, 0), flag=wx.LEFT|wx.TOP, border=5)
 -              s.Add(wx.StaticText(p, -1, _("Design files:")), (8, 0), flag=wx.LEFT|wx.TOP, border=5)
++              s.Add(wx.StaticText(p, -1, _("Related design files:")), (8, 0), flag=wx.LEFT|wx.TOP, border=5)
++
                s.Add(self._additionalFiles, (8, 1), span=(1, 2), flag=wx.EXPAND|wx.LEFT|wx.TOP|wx.RIGHT, border=5)
                s.Add(wx.StaticLine(p, -1), (9,0), span=(1,3), flag=wx.EXPAND|wx.ALL)
                s.Add(self._shareButton, (10, 1), flag=wx.BOTTOM, border=15)
Simple merge
index ad1e5ebc2364ee1719e5dc79a9ea45f0a853e694,473f496459e09e1ea212a23261164e00bbf7bcd9..a58792774abfff7694e5da5b9f5a6d00a9c8ddd0
@@@ -37,3 -42,16 +42,18 @@@ def getPathForMesh(name)
  
  def getPathForFirmware(name):
        return getPathForResource(resourceBasePath, 'firmware', name)
 -                      languages = [wx.Locale(wx.LANGUAGE_DEFAULT).GetCanonicalName()]
+ def setupLocalization():
+       try:
+               if sys.platform.startswith('darwin'):
+                       languages = NSLocale.preferredLanguages()
+               else:
++                      #Using wx.Locale before you created wx.App seems to cause an nasty exception. So default to 'en' at the moment.
++                      #languages = [wx.Locale(wx.LANGUAGE_DEFAULT).GetCanonicalName()]
++                      languages = ['en']
+       except Exception as e:
+               languages = ['en']
+       locale_path = os.path.normpath(os.path.join(resourceBasePath, 'locale'))
+       translation = gettext.translation('Cura', locale_path, languages, fallback=True)
+       translation.install(unicode=True)