- WIP for internationalization
This commit is contained in:
@@ -278,10 +278,6 @@ class App(QtCore.QObject):
|
|||||||
self.FC_light_blue = '#a5a5ffbf'
|
self.FC_light_blue = '#a5a5ffbf'
|
||||||
self.FC_dark_blue = '#0000ffbf'
|
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)
|
QtCore.QObject.__init__(self)
|
||||||
self.ui = FlatCAMGUI(self.version, self.beta, self)
|
self.ui = FlatCAMGUI(self.version, self.beta, self)
|
||||||
|
|
||||||
@@ -3278,8 +3274,6 @@ class App(QtCore.QObject):
|
|||||||
|
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
self.report_usage("on_language_apply()")
|
|
||||||
|
|
||||||
name = ''
|
name = ''
|
||||||
|
|
||||||
if lang is None:
|
if lang is None:
|
||||||
|
|||||||
@@ -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
|
- made showing a shape when hovering over objects, optional, by adding a Preferences -> General parameter
|
||||||
- starting to work in internationalization using gettext()
|
- starting to work in internationalization using gettext()
|
||||||
- Finished adding _() in FlatCAM Tools
|
- Finished adding _() in FlatCAM Tools
|
||||||
|
-
|
||||||
|
|
||||||
6.03.2019
|
6.03.2019
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ from GUIElements import FCEntry
|
|||||||
from FlatCAMTool import FlatCAMTool
|
from FlatCAMTool import FlatCAMTool
|
||||||
from FlatCAMObj import *
|
from FlatCAMObj import *
|
||||||
import math
|
import math
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class ToolCalculator(FlatCAMTool):
|
class ToolCalculator(FlatCAMTool):
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ from FlatCAMTool import FlatCAMTool
|
|||||||
from ObjectCollection import *
|
from ObjectCollection import *
|
||||||
from FlatCAMApp import *
|
from FlatCAMApp import *
|
||||||
from shapely.geometry import box
|
from shapely.geometry import box
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class CutOut(FlatCAMTool):
|
class CutOut(FlatCAMTool):
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ from FlatCAMObj import *
|
|||||||
from shapely.geometry import Point
|
from shapely.geometry import Point
|
||||||
from shapely import affinity
|
from shapely import affinity
|
||||||
from PyQt5 import QtCore
|
from PyQt5 import QtCore
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class DblSidedTool(FlatCAMTool):
|
class DblSidedTool(FlatCAMTool):
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ from FlatCAMTool import FlatCAMTool
|
|||||||
|
|
||||||
from GUIElements import RadioSet, FCEntry
|
from GUIElements import RadioSet, FCEntry
|
||||||
from PyQt5 import QtGui, QtCore, QtWidgets
|
from PyQt5 import QtGui, QtCore, QtWidgets
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class Film(FlatCAMTool):
|
class Film(FlatCAMTool):
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ from FlatCAMTool import FlatCAMTool
|
|||||||
|
|
||||||
from GUIElements import RadioSet, FloatEntry, FCComboBox, IntEntry
|
from GUIElements import RadioSet, FloatEntry, FCComboBox, IntEntry
|
||||||
from PyQt5 import QtGui, QtCore, QtWidgets
|
from PyQt5 import QtGui, QtCore, QtWidgets
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class ToolImage(FlatCAMTool):
|
class ToolImage(FlatCAMTool):
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ from VisPyVisuals import *
|
|||||||
|
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from math import sqrt
|
from math import sqrt
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
class Measurement(FlatCAMTool):
|
class Measurement(FlatCAMTool):
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ from VisPyVisuals import *
|
|||||||
|
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from copy import copy
|
from copy import copy
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class ToolMove(FlatCAMTool):
|
class ToolMove(FlatCAMTool):
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ from FlatCAMTool import FlatCAMTool
|
|||||||
from copy import copy,deepcopy
|
from copy import copy,deepcopy
|
||||||
from ObjectCollection import *
|
from ObjectCollection import *
|
||||||
import time
|
import time
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class NonCopperClear(FlatCAMTool, Gerber):
|
class NonCopperClear(FlatCAMTool, Gerber):
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
from FlatCAMTool import FlatCAMTool
|
from FlatCAMTool import FlatCAMTool
|
||||||
from copy import copy,deepcopy
|
from copy import copy,deepcopy
|
||||||
from ObjectCollection import *
|
from ObjectCollection import *
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class ToolPaint(FlatCAMTool, Gerber):
|
class ToolPaint(FlatCAMTool, Gerber):
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ from FlatCAMTool import FlatCAMTool
|
|||||||
from copy import copy, deepcopy
|
from copy import copy, deepcopy
|
||||||
from ObjectCollection import *
|
from ObjectCollection import *
|
||||||
import time
|
import time
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class Panelize(FlatCAMTool):
|
class Panelize(FlatCAMTool):
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ from PyQt5 import QtGui, QtCore, QtWidgets
|
|||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
from FlatCAMTool import FlatCAMTool
|
from FlatCAMTool import FlatCAMTool
|
||||||
from FlatCAMObj import *
|
from FlatCAMObj import *
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class Properties(FlatCAMTool):
|
class Properties(FlatCAMTool):
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ from PyQt5.QtGui import QTextCursor
|
|||||||
from PyQt5.QtWidgets import QVBoxLayout, QWidget
|
from PyQt5.QtWidgets import QVBoxLayout, QWidget
|
||||||
from GUIElements import _BrowserTextEdit, _ExpandableTextEdit
|
from GUIElements import _BrowserTextEdit, _ExpandableTextEdit
|
||||||
import html
|
import html
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class TermWidget(QWidget):
|
class TermWidget(QWidget):
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ from shapely.ops import cascaded_union
|
|||||||
|
|
||||||
import traceback
|
import traceback
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class SolderPaste(FlatCAMTool):
|
class SolderPaste(FlatCAMTool):
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ from PyQt5.QtCore import Qt
|
|||||||
from GUIElements import FCEntry, FCButton, OptionalInputSection
|
from GUIElements import FCEntry, FCButton, OptionalInputSection
|
||||||
from FlatCAMTool import FlatCAMTool
|
from FlatCAMTool import FlatCAMTool
|
||||||
from FlatCAMObj import *
|
from FlatCAMObj import *
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
def _(text):
|
||||||
|
return text
|
||||||
|
|
||||||
|
|
||||||
class ToolTransform(FlatCAMTool):
|
class ToolTransform(FlatCAMTool):
|
||||||
|
|||||||
1
locale/__init__.py
Normal file
1
locale/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pass
|
||||||
Reference in New Issue
Block a user