Просмотр исходного кода

- WIP for internationalization

Marius Stanciu 6 лет назад
Родитель
Сommit
934d971002

+ 0 - 6
FlatCAMApp.py

@@ -278,10 +278,6 @@ class App(QtCore.QObject):
         self.FC_light_blue = '#a5a5ffbf'
         self.FC_dark_blue = '#0000ffbf'
 
-        # needs to install the app default language before the GUI is initialized otherwise we get errors
-        # because FlatCAM will not understand the _() funtion
-        self.on_language_apply(lang='English')
-
         QtCore.QObject.__init__(self)
         self.ui = FlatCAMGUI(self.version, self.beta, self)
 
@@ -3278,8 +3274,6 @@ class App(QtCore.QObject):
 
         :return:
         """
-        self.report_usage("on_language_apply()")
-
         name = ''
 
         if lang is None:

+ 1 - 0
README.md

@@ -14,6 +14,7 @@ CAD program, and create G-Code for Isolation routing.
 - made showing a shape when hovering over objects, optional, by adding a Preferences -> General parameter
 - starting to work in internationalization using gettext()
 - Finished adding _() in FlatCAM Tools
+-
 
 6.03.2019
 

+ 4 - 0
flatcamTools/ToolCalculators.py

@@ -3,6 +3,10 @@ from GUIElements import FCEntry
 from FlatCAMTool import FlatCAMTool
 from FlatCAMObj import *
 import math
+import gettext
+
+def _(text):
+    return text
 
 
 class ToolCalculator(FlatCAMTool):

+ 5 - 0
flatcamTools/ToolCutOut.py

@@ -2,6 +2,11 @@ from FlatCAMTool import FlatCAMTool
 from ObjectCollection import *
 from FlatCAMApp import *
 from shapely.geometry import box
+import gettext
+
+def _(text):
+    return text
+
 
 class CutOut(FlatCAMTool):
 

+ 4 - 0
flatcamTools/ToolDblSided.py

@@ -5,6 +5,10 @@ from FlatCAMObj import *
 from shapely.geometry import Point
 from shapely import affinity
 from PyQt5 import QtCore
+import gettext
+
+def _(text):
+    return text
 
 
 class DblSidedTool(FlatCAMTool):

+ 4 - 0
flatcamTools/ToolFilm.py

@@ -2,6 +2,10 @@ from FlatCAMTool import FlatCAMTool
 
 from GUIElements import RadioSet, FCEntry
 from PyQt5 import QtGui, QtCore, QtWidgets
+import gettext
+
+def _(text):
+    return text
 
 
 class Film(FlatCAMTool):

+ 4 - 0
flatcamTools/ToolImage.py

@@ -2,6 +2,10 @@ from FlatCAMTool import FlatCAMTool
 
 from GUIElements import RadioSet, FloatEntry, FCComboBox, IntEntry
 from PyQt5 import QtGui, QtCore, QtWidgets
+import gettext
+
+def _(text):
+    return text
 
 
 class ToolImage(FlatCAMTool):

+ 4 - 0
flatcamTools/ToolMeasurement.py

@@ -4,6 +4,10 @@ from VisPyVisuals import *
 
 from copy import copy
 from math import sqrt
+import gettext
+
+def _(text):
+    return text
 
 class Measurement(FlatCAMTool):
 

+ 4 - 0
flatcamTools/ToolMove.py

@@ -4,6 +4,10 @@ from VisPyVisuals import *
 
 from io import StringIO
 from copy import copy
+import gettext
+
+def _(text):
+    return text
 
 
 class ToolMove(FlatCAMTool):

+ 4 - 0
flatcamTools/ToolNonCopperClear.py

@@ -2,6 +2,10 @@ from FlatCAMTool import FlatCAMTool
 from copy import copy,deepcopy
 from ObjectCollection import *
 import time
+import gettext
+
+def _(text):
+    return text
 
 
 class NonCopperClear(FlatCAMTool, Gerber):

+ 4 - 0
flatcamTools/ToolPaint.py

@@ -1,6 +1,10 @@
 from FlatCAMTool import FlatCAMTool
 from copy import copy,deepcopy
 from ObjectCollection import *
+import gettext
+
+def _(text):
+    return text
 
 
 class ToolPaint(FlatCAMTool, Gerber):

+ 4 - 0
flatcamTools/ToolPanelize.py

@@ -2,6 +2,10 @@ from FlatCAMTool import FlatCAMTool
 from copy import copy, deepcopy
 from ObjectCollection import *
 import time
+import gettext
+
+def _(text):
+    return text
 
 
 class Panelize(FlatCAMTool):

+ 4 - 0
flatcamTools/ToolProperties.py

@@ -2,6 +2,10 @@ from PyQt5 import QtGui, QtCore, QtWidgets
 from PyQt5.QtCore import Qt
 from FlatCAMTool import FlatCAMTool
 from FlatCAMObj import *
+import gettext
+
+def _(text):
+    return text
 
 
 class Properties(FlatCAMTool):

+ 4 - 0
flatcamTools/ToolShell.py

@@ -12,6 +12,10 @@ from PyQt5.QtGui import QTextCursor
 from PyQt5.QtWidgets import QVBoxLayout, QWidget
 from GUIElements import _BrowserTextEdit, _ExpandableTextEdit
 import html
+import gettext
+
+def _(text):
+    return text
 
 
 class TermWidget(QWidget):

+ 4 - 0
flatcamTools/ToolSolderPaste.py

@@ -16,6 +16,10 @@ from shapely.ops import cascaded_union
 
 import traceback
 from io import StringIO
+import gettext
+
+def _(text):
+    return text
 
 
 class SolderPaste(FlatCAMTool):

+ 4 - 0
flatcamTools/ToolTransform.py

@@ -3,6 +3,10 @@ from PyQt5.QtCore import Qt
 from GUIElements import FCEntry, FCButton, OptionalInputSection
 from FlatCAMTool import FlatCAMTool
 from FlatCAMObj import *
+import gettext
+
+def _(text):
+    return text
 
 
 class ToolTransform(FlatCAMTool):

+ 1 - 0
locale/__init__.py

@@ -0,0 +1 @@
+pass