Commit 2a8ebf36 authored by Benoît Minisini's avatar Benoît Minisini

Support for automatic translation based on 'translate-shell' tool.

[DEVELOPMENT ENVIRONMENT]
* NEW: Translation dialog: Support for automatic translation based on 'translate-shell' tool.
* NEW: Option dialog: Support for automatic translation based on 'translate-shell' tool.
* BUG: Mark some strings in forms as not to be translated.
* NEW: Update the Spanish translation.
parent 466a5704
app/src/gambas3/.icon.png

11.7 KB | W: | H:

app/src/gambas3/.icon.png

11.7 KB | W: | H:

app/src/gambas3/.icon.png
app/src/gambas3/.icon.png
app/src/gambas3/.icon.png
app/src/gambas3/.icon.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -32,6 +32,7 @@ Description="Integrated Development Environment for Gambas"
Authors="Benoît Minisini\nFabien Bodard\nCharlie Reinl\nJosé Luis Redrejo\nRobert Rowe\nTobias Boege"
Arguments=[["-t","/home/benoit/gambas/git/master/app/src/gambas3"]]
CurrentArgument=0
Environment="GB_NO_JIT=1"
TabSize=2
Translate=1
Language=en
......
......@@ -56,9 +56,10 @@
}
{ btnShowMe ToolButton
MoveScaled(56,0,4,3)
#Translate = False
Font = Font["-1"]
ToolTip = ("Display ME")
Text = ("ME")
ToolTip = "Display ME"
Text = "ME"
}
{ Separator3 Separator
MoveScaled(63,0,0,3)
......
......@@ -21,7 +21,8 @@
}
{ cmbFamily ComboBox
MoveScaled(1,4,24,4)
List = [(""), ("sans-serif"), ("serif"), ("monospace"), ("cursive"), ("fantasy")]
#Translate = False
List = ["", "sans-serif", "serif", "monospace", "cursive", "fantasy"]
Border = False
}
{ Separator2 Separator
......@@ -31,37 +32,42 @@
MoveScaled(0,10,41,4)
{ btnNormal ToolButton
MoveScaled(0,0,4,4)
#Translate = False
Font = Font["+2"]
ToolTip = ("Normal")
Text = ("N")
ToolTip = "Normal"
Text = "N"
Toggle = True
}
{ btnBold ToolButton
MoveScaled(4,0,4,4)
#Translate = False
Font = Font["Bold,+2"]
ToolTip = ("Bold")
Text = ("B")
ToolTip = "Bold"
Text = "B"
Toggle = True
}
{ btnItalic ToolButton
MoveScaled(8,0,4,4)
#Translate = False
Font = Font["Italic,+2"]
ToolTip = ("Italic")
Text = ("I")
ToolTip = "Italic"
Text = "I"
Toggle = True
}
{ btnUnderline ToolButton
MoveScaled(12,0,4,4)
#Translate = False
Font = Font["Underline,+2"]
ToolTip = ("Underline")
Text = ("U")
ToolTip = "Underline"
Text = "U"
Toggle = True
}
{ btnStrikeout ToolButton
MoveScaled(16,0,4,4)
#Translate = False
Font = Font["Strikeout,+2"]
ToolTip = ("Strikeout")
Text = ("S")
ToolTip = "Strikeout"
Text = "S"
Toggle = True
}
{ Separator3 Separator
......
......@@ -147,7 +147,8 @@ Public Sub _new()
[txtLicense, "/Packager/License", "General Public License"],
[txtURL, "/Packager/URL", "www.endoftheinternet.com"],
[cmbPrefix, "/Packager/UsePrefix", 0],
[btnCompressPng, "/CompressPng", 1]]
[btnCompressPng, "/CompressPng", 1],
[btnAutoTrans, "/AutomaticTranslation/Enabled", 0]]
$bNoChange = True
......@@ -200,6 +201,8 @@ Public Sub _new()
choBackgroundColor.Colors = aColors
choBackgroundColor.Current = Project.GetBackgroundColor()
btnAutoTrans_Click
Me.Utility = Settings["/UseUtilityWindows", 1]
End
......@@ -1094,9 +1097,15 @@ Public Sub ipnOption_Click()
Select Case ipnOption.Text
Case ("Project")
Case ("Projects")
panCompressPng.Enabled = System.Exist("pngquant")
panAutoTrans.Enabled = System.Exist("trans")
If panAutoTrans.Enabled Then
FillAutoTransEngines
Else
btnAutoTrans.Value = False
Endif
Case ("Code snippets")
......@@ -1587,3 +1596,42 @@ Public Sub btnCloseStrings_Click()
RefreshEditor
End
Public Sub btnAutoTrans_Click()
Settings["/AutomaticTranslation/Enabled"] = btnAutoTrans.Value
panAutoTransEngine.Visible = btnAutoTrans.Value
End
Public Sub cmbAutoTrans_Click()
Settings["/AutomaticTranslation/Engine"] = cmbAutoTrans.Text
End
Private Sub FillAutoTransEngines()
Dim sResult As String
Dim sEngine As String
Dim aEngine As New String[]
If cmbAutoTrans.Count Then Return
Exec ["trans", "-S"] To sResult
For Each sEngine In Split(Trim(sResult), "\n")
If sEngine Begins "* " Then sEngine = Mid$(sEngine, 2)
sEngine = Trim(sEngine)
If sEngine Then aEngine.Add(sEngine)
Next
If Not aEngine.Exist("google") Then aEngine.Add("google")
aEngine.Sort()
cmbAutoTrans.List = aEngine
cmbAutoTrans.Text = Settings["/AutomaticTranslation/Engine", "google"]
If cmbAutoTrans.Index < 0 Then cmbAutoTrans.Text = "google"
End
\ No newline at end of file
......@@ -247,12 +247,17 @@
Text = ("Restore files when loading a project")
}
{ btnStartupLoad SwitchButton
MoveScaled(43,0,8,4)
MoveScaled(50,0,8,4)
Animated = True
}
}
{ Label83 Label
MoveScaled(0,35,63,3)
Font = Font["Bold"]
Text = ("Images")
}
{ panCompressPng HBox
MoveScaled(1,35,66,4)
MoveScaled(1,40,66,4)
Spacing = True
Indent = True
{ Label77 TextLabel
......@@ -266,6 +271,55 @@
Animated = True
}
}
{ URLLabel1 URLLabel
MoveScaled(1,45,34,2)
#Translate = False
Font = Font["-3"]
Text = "https://pngquant.org/"
Alignment = Align.Right
}
{ Label82 Label
MoveScaled(0,48,63,3)
Font = Font["Bold"]
Text = ("Translation")
}
{ panAutoTrans HBox
MoveScaled(1,52,66,4)
Spacing = True
Indent = True
{ Label80 TextLabel
MoveScaled(0,0,47,4)
Expand = True
Text = ("Automatic translation with '<tt>translate-shell</tt>'")
Alignment = Align.Normal
}
{ btnAutoTrans SwitchButton
MoveScaled(50,0,8,4)
Animated = True
}
}
{ panAutoTransEngine HBox
MoveScaled(1,57,66,4)
Visible = False
Spacing = True
Indent = True
{ Label81 Label
MoveScaled(0,0,43,4)
Expand = True
Text = ("Translation engine")
}
{ cmbAutoTrans ComboBox
MoveScaled(50,0,16,4)
ReadOnly = True
}
}
{ URLLabel2 URLLabel
MoveScaled(1,62,34,2)
#Translate = False
Font = Font["-3"]
Text = "https://github.com/soimort/translate-shell"
Alignment = Align.Right
}
Index = 2
Text = ("Interface")
Picture = Picture["icon:/medium/menu"]
......
......@@ -24,6 +24,12 @@
}
{ Menu1 Menu
}
{ mnuAutoTrans Menu
Text = ("Automatic translation") & "..."
Picture = Picture["icon:/small/fill"]
}
{ Menu2 Menu
}
{ mnuCopy Menu
Text = ("Copy")
Picture = Picture["icon:/small/copy"]
......@@ -111,27 +117,21 @@
{ Separator6 Separator
MoveScaled(30,8,10,0)
}
{ HBox5 HBox
{ panToolbar HBox
MoveScaled(3,10,91,4)
{ btnSave ToolButton
MoveScaled(0,0,4,4)
MoveScaled(0,0,9,4)
ToolTip = ("Save translation")
AutoResize = True
Text = ("Save")
Picture = Picture["icon:/small/save"]
}
{ btnVerify ToolButton
MoveScaled(5,0,4,4)
MoveScaled(12,0,11,4)
ToolTip = ("Verify the translation")
Picture = Picture["icon:/small/wizard"]
}
{ btnNextTranslated ToolButton
MoveScaled(10,0,4,4)
ToolTip = ("Find next translated string")
Picture = Picture["icon:/small/down"]
}
{ btnPreviousTranslated ToolButton
MoveScaled(14,0,4,4)
ToolTip = ("Find previous translated string")
Picture = Picture["icon:/small/up"]
AutoResize = True
Text = ("Verify")
Picture = Picture["icon:/small/apply"]
}
{ Separator7 Separator
MoveScaled(25,0,0,4)
......@@ -183,32 +183,51 @@
{ Separator5 Separator
MoveScaled(3,13,15,0)
}
{ HBox1 HBox
MoveScaled(2,15,43,4)
{ panTransToolbar HBox
MoveScaled(1,15,82,4)
{ btnNextTranslated ToolButton
MoveScaled(1,0,4,4)
ToolTip = ("Find next translated string")
Picture = Picture["icon:/small/down"]
}
{ btnPreviousTranslated ToolButton
MoveScaled(5,0,4,4)
ToolTip = ("Find previous translated string")
Picture = Picture["icon:/small/up"]
}
{ btnPreviousUntranslated ToolButton
MoveScaled(9,0,4,4)
ToolTip = ("Find previous untranslated string")
Picture = Picture["icon:/small/rewind"]
}
{ btnNextUntranslated ToolButton
MoveScaled(13,0,4,4)
ToolTip = ("Find next untranslated string")
Picture = Picture["icon:/small/forward"]
}
{ Separator9 Separator
MoveScaled(19,0,0,4)
}
{ btnClear ToolButton
MoveScaled(0,0,4,4)
MoveScaled(21,0,4,4)
ToolTip = ("Clear this translation")
Picture = Picture["icon:/small/clear"]
Picture = Picture["icon:/small/delete"]
}
{ btnDoNotTranslate ToolButton
MoveScaled(6,0,4,4)
MoveScaled(25,0,4,4)
ToolTip = ("This string must not be translated")
Picture = Picture["icon:/small/warning"]
}
{ btnCopy ToolButton
MoveScaled(10,0,4,4)
MoveScaled(29,0,4,4)
ToolTip = ("Copy untranslated string")
Picture = Picture["icon:/small/paste"]
}
{ btnNextUntranslated ToolButton
MoveScaled(18,0,4,4)
ToolTip = ("Find next untranslated string")
Picture = Picture["icon:/small/rewind"]
Picture = Picture["icon:/small/copy"]
}
{ btnPreviousUntranslated ToolButton
MoveScaled(22,0,4,4)
ToolTip = ("Find previous untranslated string")
Picture = Picture["icon:/small/forward"]
{ btnAutoTrans ToolButton
MoveScaled(34,0,23,4)
AutoResize = True
Text = ("Automatic translation")
Picture = Picture["icon:/small/fill"]
}
}
{ Separator8 Separator
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment