- WIP for internationalization

This commit is contained in:
Marius Stanciu 2019-03-07 18:04:11 +02:00 committed by Marius
parent 94d2fb23e2
commit 934d971002
17 changed files with 59 additions and 6 deletions

View File

@ -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:

View File

@ -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

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

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

View File

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

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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
locale/__init__.py Normal file
View File

@ -0,0 +1 @@
pass