Skip to content

Commit

Permalink
Add classes in the function category
Browse files Browse the repository at this point in the history
  • Loading branch information
yannis300307 committed Aug 6, 2024
1 parent 9072ab8 commit e3b9959
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/code/i18n/toolbox.de.i18n
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Catalog = "Katalog"
Modules = "Module"
LoopsAndTests = "Schleifen und Tests"
FunctionsAndClasses = "Funktionen und Klassen"
1 change: 1 addition & 0 deletions apps/code/i18n/toolbox.en.i18n
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Catalog = "Catalog"
Modules = "Modules"
LoopsAndTests = "Loops and tests"
FunctionsAndClasses = "Functions and classes"
1 change: 1 addition & 0 deletions apps/code/i18n/toolbox.es.i18n
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Catalog = "Catalog"
Modules = "Modules"
LoopsAndTests = "Loops and tests"
FunctionsAndClasses = "funciones y clases"
1 change: 1 addition & 0 deletions apps/code/i18n/toolbox.fr.i18n
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Catalog = "Catalogue"
Modules = "Modules"
LoopsAndTests = "Boucles et tests"
FunctionsAndClasses = "Fonction et classes"
1 change: 1 addition & 0 deletions apps/code/i18n/toolbox.it.i18n
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Catalog = "Catalogo"
Modules = "Moduli"
LoopsAndTests = "Cicli e test"
FunctionsAndClasses = "funzioni e classi"
1 change: 1 addition & 0 deletions apps/code/i18n/toolbox.nl.i18n
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Catalog = "Catalogus"
Modules = "Modules"
LoopsAndTests = "Herhalingen en testen"
FunctionsAndClasses = "functies en klassen"
1 change: 1 addition & 0 deletions apps/code/i18n/toolbox.pt.i18n
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Catalog = "Catálogo"
Modules = "Módulos"
LoopsAndTests = "Laços e testes"
FunctionsAndClasses = "funções e classes"
6 changes: 6 additions & 0 deletions apps/code/i18n/toolbox.universal.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@ ForInRange1ArgLoopWithArg = "for i in range(size):\n instruction"
PythonCommandDef = "def \x11():\n "
PythonCommandDefWithArg = "def function(x):"
PythonCommandReturn = "return "
PythonCommandClassWithArg = "class ClassName:"
PythonCommandClass = "class \x11:\n "
PythonCommandInitDefWithArg = "def __init__(self):"
PythonCommandInitDef = "def __init__(self):\n "
PythonCommandClassSelf = "self."
PythonCommandStaticMethodDecorator = "@staticmethod"
RandomModule = "random"
NumpyModule = "numpy"
15 changes: 13 additions & 2 deletions apps/code/python_toolbox_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,19 +1002,30 @@ constexpr ToolboxMessageTree catalogChildren[] = {
I18n::Message::PythonZeros),
};

constexpr ToolboxMessageTree functionsChildren[] = {
constexpr ToolboxMessageTree functionsAndClassesChildren[] = {
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandDefWithArg,
I18n::Message::Default, false,
I18n::Message::PythonCommandDef),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandReturn,
I18n::Message::Default),

ToolboxMessageTree::Leaf(I18n::Message::PythonCommandClassWithArg,
I18n::Message::Default, false,
I18n::Message::PythonCommandClass),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandInitDefWithArg,
I18n::Message::Default, false,
I18n::Message::PythonCommandInitDef),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandClassSelf,
I18n::Message::Default),
ToolboxMessageTree::Leaf(I18n::Message::PythonCommandStaticMethodDecorator,
I18n::Message::Default)};

constexpr ToolboxMessageTree menu[] = {
ToolboxMessageTree::Node(I18n::Message::LoopsAndTests,
loopsAndTestsChildren),
ToolboxMessageTree::Node(I18n::Message::Modules, modulesChildren),
ToolboxMessageTree::Node(I18n::Message::Catalog, catalogChildren),
ToolboxMessageTree::Node(I18n::Message::Functions, functionsChildren)};
ToolboxMessageTree::Node(I18n::Message::FunctionsAndClasses, functionsAndClassesChildren)};

constexpr ToolboxMessageTree toolboxModel =
ToolboxMessageTree::Node(I18n::Message::Toolbox, menu);
Expand Down

0 comments on commit e3b9959

Please sign in to comment.