Skip to content

Commit

Permalink
Add guided tour strings to the language file
Browse files Browse the repository at this point in the history
  • Loading branch information
serivesmejia committed Nov 7, 2024
1 parent 284e19b commit 75d4485
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.github.deltacv.papervision.gui
import imgui.ImGui
import imgui.ImVec2
import imgui.flag.ImGuiWindowFlags
import io.github.deltacv.mai18n.tr
import io.github.deltacv.papervision.gui.util.Window
import io.github.deltacv.papervision.node.vision.featuredet.FindContoursNode
import io.github.deltacv.papervision.node.vision.imageproc.ThresholdNode
Expand All @@ -12,20 +13,20 @@ import io.github.deltacv.papervision.util.flags
typealias Stage = GuidedTourWindow.() -> Unit

val Next: GuidedTourWindow.() -> Boolean = {
ImGui.button("Next")
ImGui.button(tr("mis_next"))
}

val Close: Stage = {
if (ImGui.button("Close")) {
if (ImGui.button(tr("mis_cancel"))) {
delete()
}
}

val InitialStage: Stage = {
centerWindow()

ImGui.text("Welcome to the guided tour!")
ImGui.text("This will help you get started with PaperVision.")
ImGui.text(tr("mis_guidedtour_1"))
ImGui.text(tr("mis_guidedtour_2"))

if (Next()) {
currentStage = Stage1
Expand All @@ -41,8 +42,8 @@ val Stage1: Stage = {
nodeEditor.inputNode.position.y + (nodeEditor.inputNode.size.y / 2f)
)

ImGui.text("A pipeline is a sequence of nodes that transform data in a series of steps.")
ImGui.text("This is the entry point, from which the pipeline receives the input images.")
ImGui.text(tr("mis_guidedtour_3"))
ImGui.text(tr("mis_guidedtour_4"))

if (Next()) {
currentStage = Stage2
Expand All @@ -58,9 +59,8 @@ val Stage2: Stage = {
nodeEditor.outputNode.position.y + (nodeEditor.outputNode.size.y * 0.8f)
)

ImGui.text("This is the exit point, where the pipeline outputs the final result.")
ImGui.text("The output image can be visualized, you can draw various graphics and")
ImGui.text("annotations that represent the results of your processing.")
ImGui.text(tr("mis_guidedtour_5"))
ImGui.text(tr("mis_guidedtour_6"))


if (Next()) {
Expand All @@ -79,8 +79,7 @@ val Stage3: Stage = {
floatingButton.position.y - size.y
)

ImGui.text("Press SPACE or")
ImGui.text("click this button \\/")
ImGui.text(tr("mis_guidedtour_7"))

if (nodeEditor.paperVision.nodeList.isNodesListOpen) {
currentStage = Stage4
Expand All @@ -100,15 +99,14 @@ val Stage4: Stage = {
if (nodeEditor.paperVision.nodes.find { it is ThresholdNode } != null) {
currentStage = Stage5
} else {
ImGui.text("You need to add the \"Color Threshold\" node to proceed.")
ImGui.text("Try opening the node list and dragging the node to the editor.")
ImGui.text(tr("mis_guidedtour_9"))
Close()
}
} else {
ImGui.text("This is the node list. Here you can find all the nodes available to you.")
ImGui.text("You can drag and drop nodes from here to the editor to create a pipeline.")
ImGui.text(tr("mis_guidedtour_8_0"))
ImGui.text(tr("mis_guidedtour_8_1"))
ImGui.text("")
ImGui.text("**Grab the \"Color Threshold\" Node to proceed.**")
ImGui.text(tr("mis_guidedtour_8_2"))

Close()

Expand All @@ -121,16 +119,16 @@ val Stage5: Stage = {
val node = nodeEditor.paperVision.nodes.find { it is ThresholdNode } as ThresholdNode?

if (node == null) {
ImGui.text("You need to add the \"Color Threshold\" node to proceed.")
ImGui.text(tr("mis_guidedtour_9"))
Close()
} else {
centerWindow()

ImGui.text("Great! You've added the \"Color Threshold\" node.")
ImGui.text("Now, let's connect the input node to the threshold node.")
ImGui.text(tr("mis_guidedtour_10"))
ImGui.text(tr("mis_guidedtour_11_0"))
ImGui.text("")
ImGui.text("Click on the pin of the input attribute of this node.")
ImGui.text("Then, drag the connection to the input node of the pipeline.")
ImGui.text(tr("mis_guidedtour_11_1"))
ImGui.text(tr("mis_guidedtour_11_2"))

Close()

Expand All @@ -149,16 +147,15 @@ val Stage6: Stage = {
val node = nodeEditor.paperVision.nodes.find { it is ThresholdNode } as ThresholdNode?

if (node == null) {
ImGui.text("You need to add the \"Color Threshold\" node to proceed.")
ImGui.text(tr("mis_guidedtour_9"))
Close()
} else {
position = ImVec2(
node.input.position.x + node.size.x,
node.input.position.y
)

ImGui.text("Great! Let's add a few more nodes to the pipeline.")
ImGui.text("Open the node list and drag the \"Simple Find Contours\" node to the editor.")
ImGui.text(tr("mis_guidedtour_12"))

Close()

Expand All @@ -172,15 +169,15 @@ val Stage7: Stage = {
val node = nodeEditor.paperVision.nodes.find { it is FindContoursNode } as FindContoursNode?

if (node == null) {
ImGui.text("You need to add the \"Simple Find Contours\" node to proceed.")
ImGui.text(tr("mis_guidedtour_15"))
Close()

nodeEditor.paperVision.nodeList.highlight(FindContoursNode::class.java)
} else {
centerWindow()

ImGui.text("You've added the \"Simple Find Contours\" node.")
ImGui.text("Now, connect the threshold node to it !")
ImGui.text(tr("mis_guidedtour_13"))
ImGui.text(tr("mis_guidedtour_14"))

Close()

Expand All @@ -206,8 +203,8 @@ val Stage8: Stage = {
node.inputMat.position.y
)

ImGui.text("Great! You've connected the nodes. Let's add one more node !")
ImGui.text("Open the node list and drag the \"Draw Contours\" node to the editor.")
ImGui.text(tr("mis_guidedtour_16"))
ImGui.text(tr("mis_guidedtour_17"))

Close()

Expand All @@ -221,16 +218,16 @@ val Stage9: Stage = {
val node = nodeEditor.paperVision.nodes.find { it is DrawContoursNode } as DrawContoursNode?

if (node == null) {
ImGui.text("You need to add the \"Draw Contours\" node to proceed.")
ImGui.text(tr("mis_guidedtour_18"))
Close()

nodeEditor.paperVision.nodeList.highlight(DrawContoursNode::class.java)
} else {
centerWindow()

ImGui.text("You've added the \"Draw Contours\" node.")
ImGui.text("Now, connect the \"Simple Find Contours\" node to it !")
ImGui.text("Ensure you are connecting it to the right input type.")
ImGui.text(tr("mis_guidedtour_19"))
ImGui.text(tr("mis_guidedtour_20"))
ImGui.text(tr("mis_guidedtour_21"))

Close()

Expand All @@ -255,8 +252,8 @@ val Stage10: Stage = {
} else {
centerWindow()

ImGui.text("Almost there ! Link the \"Input\" attribute of this node")
ImGui.text("to the \"Pipeline Input\", all the way to the beginning !.")
ImGui.text(tr("mis_guidedtour_22"))
ImGui.text(tr("mis_guidedtour_23"))

Close()

Expand Down Expand Up @@ -284,8 +281,8 @@ val Stage11: Stage = {
node.contours.position.y
)

ImGui.text("Connect the output of the \"Draw Contours\" node to the")
ImGui.text("\"Pipeline Output\" to wrap up the process.")
ImGui.text(tr("mis_guidedtour_24"))
ImGui.text(tr("mis_guidedtour_25"))

if(node.outputMat.hasLink) {
currentStage = Stage12
Expand All @@ -303,8 +300,8 @@ val Stage12: Stage = {
floatingButton.position.y - size.y
)

ImGui.text("You're all set !")
ImGui.text("Press this button to run the pipeline. \\/")
ImGui.text(tr("mis_guidedtour_26"))
ImGui.text(tr("mis_guidedtour_27"))

if(floatingButton.isPressed) {
currentStage = Stage13
Expand All @@ -322,16 +319,13 @@ val Stage13: Stage = {
node.output.position.y
)

ImGui.text("Click on the Eye button to visualize the output of certain nodes.")
ImGui.text("This lets you see the output at different steps of the pipeline.")
ImGui.text("Play around with the node's threshold values to see how it affects the output.")
ImGui.text(tr("mis_guidedtour_28"))
ImGui.text(tr("mis_guidedtour_29"))
ImGui.text(tr("mis_guidedtour_30"))

if(Next() || node.output.isPrevizEnabled) {
currentStage = Stage14
}

ImGui.sameLine()
Close()
}
}

Expand All @@ -343,9 +337,9 @@ val Stage14: Stage = {
floatingButton.position.y - size.y
)

ImGui.text("That's it for the guided tour. Have fun !")
ImGui.text("After you're done, you can export the pipeline to different formats.")
ImGui.text("Press this button to export your pipeline as source code. \\/")
ImGui.text(tr("mis_guidedtour_31"))
ImGui.text(tr("mis_guidedtour_32"))
ImGui.text(tr("mis_guidedtour_33"))

if(floatingButton.isPressed) {
delete()
Expand All @@ -357,7 +351,7 @@ class GuidedTourWindow(
val nodeEditor: NodeEditor
) : Window() {

override var title = "Guided Tour"
override var title = "$[mis_guidedtour]"

var currentStage: Stage = InitialStage

Expand All @@ -376,8 +370,8 @@ class GuidedTourWindow(
override fun drawContents() {
if(nodeEditor.paperVision.nodes.elements.size > 4 && currentStage == InitialStage) {
centerWindow()
ImGui.text("This guided tour is not available for existing projects.")
ImGui.text("Please create a new project and try again.")
ImGui.text(tr("mis_guidedtour_notavailable_1"))
ImGui.text(tr("mis_guidedtour_notavailable_2"))

Close()
return
Expand Down
44 changes: 43 additions & 1 deletion PaperVision/src/main/resources/lang.csv
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,48 @@ mis_welcome4,"If you are new, make sure to click on the 'Guided Tour' button bel
mis_welcome5,Made with <3 by the deltacv team. Have fun!,Hecho con <3 por el equipo de deltacv. Buena suerte!
mis_gotit,Got it!,Entendido!
mis_dontshow_again,Don't Show Again,No Mostrar de Nuevo
mis_next,Next,Siguiente
mis_close,Close,Cerrar
mis_cancel,Cancel,Cancelar
mis_guidedtour,Guided Tour,Visita Guiada
mis_guidedtour_1,Welcome to the guided tour!,¡Bienvenido al recorrido guiado!
mis_guidedtour_2,This will help you get started with PaperVision.<br>Read each step carefully !,Esto te ayudará a comenzar con PaperVision.<br>¡Lee cada paso con cuidado!
mis_guidedtour_3,A pipeline is a sequence of nodes that transform data in a series of steps.,Un pipeline es una secuencia de nodos que transforman datos en una serie de pasos.
mis_guidedtour_4,"This is the entry point, from which the pipeline receives the input images.","Este es el punto de entrada, desde donde el pipeline recibe las imágenes de entrada."
mis_guidedtour_5,"This is the exit point, where the pipeline outputs the final result.","Este es el punto de salida, donde el pipeline genera el resultado final."
mis_guidedtour_6,"The output image can be visualized, you can draw various graphics and<br>annotations that represent the results of your processing.","La imagen de salida puede ser visualizada, puedes dibujar diversos gráficos<br>y anotaciones que representan los resultados de tu procesamiento."
mis_guidedtour_7,Press SPACE or<br>click this button \\/,Presiona ESPACIO o<br>haz clic en este botón \\/
mis_guidedtour_8_0,This is the node list. Here you can find all the nodes available to you.,Esta es la lista de nodos. Aquí puedes encontrar todos los nodos disponibles para ti.
mis_guidedtour_8_1,You can drag and drop nodes from here to the editor to create a pipeline.,Puedes arrastrar y soltar nodos desde aquí al editor para crear un pipeline.
mis_guidedtour_8_2,**Grab the "Color Threshold" Node to proceed.**,**Toma el nodo "Umbral de Color" para continuar.**
mis_guidedtour_9,You need to add the "Color Threshold" node to proceed.<br>Try opening the node list and dragging the node to the editor.,Necesitas agregar el nodo "Umbral de Color" para continuar.<br>Intenta abrir la lista de nodos y arrastrar el nodo al editor.
mis_guidedtour_10,Great! You've added the "Color Threshold" node.,¡Genial! Has agregado el nodo "Umbral de Color".
mis_guidedtour_11_0,"Now, let's connect the input node to the threshold node.","Ahora, conectemos el nodo de entrada al nodo de umbral."
mis_guidedtour_11_1,Click on the pin of the input attribute of this node.,Haz clic en el pin del atributo de entrada de este nodo.
mis_guidedtour_11_2,"Then, drag the connection to the input node of the pipeline.","Luego, arrastra la conexión al nodo de entrada del pipeline."
mis_guidedtour_12,Great! Let's add a few more nodes to the pipeline.<br>Open the node list and drag the "Simple Find Contours" node to the editor.,¡Genial! Agreguemos unos cuantos nodos más al pipeline.<br>Abre la lista de nodos y arrastra el nodo "Deteccion de Contornos" al editor.
mis_guidedtour_13,You've added the "Simple Find Contours" node.,Has agregado el nodo "Deteccion de Contornos".
mis_guidedtour_14,"Now, connect the threshold node to it!","¡Ahora, conecta el nodo de umbral a este!"
mis_guidedtour_15,You need to add the "Simple Find Contours" node to proceed.,Necesitas agregar el nodo "Deteccion de Contornos" para continuar.
mis_guidedtour_16,"Great! You've connected the nodes. Let's add one more node !","¡Genial! Has conectado los nodos. ¡Agreguemos un nodo más!"
mis_guidedtour_17,"Open the node list and drag the "Draw Contours" node to the editor.","Abre la lista de nodos y arrastra el nodo "Dibujar Contornos" al editor."
mis_guidedtour_18,"You need to add the "Draw Contours" node to proceed.","Necesitas agregar el nodo "Dibujar Contornos" para continuar."
mis_guidedtour_19,"You've added the "Draw Contours" node.","Has agregado el nodo "Dibujar Contornos"."
mis_guidedtour_20,"Now, connect the "Simple Find Contours" node to it !","¡Ahora, conecta el nodo "Deteccion de Contornos" a este!"
mis_guidedtour_21,"Ensure you are connecting it to the right input type.","Asegúrate de conectarlo al tipo de entrada correcto."
mis_guidedtour_22,"Almost there ! Link the "Input" attribute of this node","¡Casi terminamos! Conecta el atributo "Entrada" de este nodo"
mis_guidedtour_23,"to the "Pipeline Input" all the way from the beginning !","a la "Entrada" del Pipeline que se encuentra hasta el principio !"
mis_guidedtour_24,"Connect the output of the "Draw Contours" node to the","Conecta la salida del nodo "Dibujar Contornos" a la"
mis_guidedtour_25,""Pipeline Output" to wrap up the process.",""Salida" del pipeline para finalizar el proceso."
mis_guidedtour_26,"You're all set !","¡Todo listo!"
mis_guidedtour_27,"Press this button to run the pipeline. \\/","Presiona este botón para ejecutar el pipeline. \\/"
mis_guidedtour_28,"Click on the Eye button to visualize the output of certain nodes.","Haz clic en el botón de Ojo para visualizar la salida de ciertos nodos."
mis_guidedtour_29,"This lets you see the output at different steps of the pipeline.","Esto te permite ver la salida en diferentes pasos del pipeline."
mis_guidedtour_30,"Play around with the threshold values to see how it affects the output.","Juega con los valores de umbral para ver cómo afecta la salida."
mis_guidedtour_31,"That's it for the guided tour. Have fun !","¡Eso es todo para la visita guiada. ¡Diviertete!"
mis_guidedtour_32,"After you're done, you can export the pipeline to different formats.","Después de terminar, puedes exportar el pipeline a diferentes formatos."
mis_guidedtour_33,"Press this button to export your pipeline as source code. \\/","Presiona este botón para exportar tu pipeline como código fuente. \\/"
mis_guidedtour_notavailable_1,"This guided tour is not available for existing projects.","Esta visita guiada no está disponible para proyectos existentes."
mis_guidedtour_notavailable_2,"Please create a new project and try again.","Por favor, crea un nuevo proyecto e intenta de nuevo."
mis_loading,Loading...,Cargando...
mis_runningok,Running OK,Estatus OK
mis_runningok,Running OK,Estatus OK

0 comments on commit 75d4485

Please sign in to comment.