Foldit Wiki
mNo edit summary
Tag: Visual edit
mNo edit summary
Tag: Visual edit
 
Line 12: Line 12:
   
 
=== English version ===
 
=== English version ===
  +
[[File:EnglishDialogTranslation.JPG|thumb|220x220px]]
 
<blockquote>function GetParams()</blockquote>local FirstCheckbox= false
 
<blockquote>function GetParams()</blockquote>local FirstCheckbox= false
   
Line 19: Line 20:
 
=== === <br>Translation to French: ===
 
=== === <br>Translation to French: ===
 
function GetParams()
 
function GetParams()
  +
[[File:DialogueFR.JPG|thumb|220x220px]]
 
 
local FirstCheckbox= false
 
local FirstCheckbox= false
   
local FirstSlider= 0<blockquote>dlg = dialog.CreateDialog("'''Titre de la fen'''ê'''tre de dialogue'''")</blockquote><blockquote></blockquote><blockquote>dlg.FirstCheckbox = dialog.AddCheckbox("'''Texte de la case '''Ã''' cocher'''",FirstCheckbox)</blockquote><blockquote>dlg.Firstlabel = dialog.AddLabel("'''Texte libre'''")</blockquote><blockquote>dlg.FirstSlider = dialog.AddSlider("'''Texte du s'''é'''lecteur de valeur'''", FirstSlider, 0, 10, 1)</blockquote><blockquote><br>
+
local FirstSlider= 0<blockquote>dlg = dialog.CreateDialog("'''Titre de la fen'''ê'''tre de dialogue'''")</blockquote><blockquote></blockquote><blockquote>dlg.FirstCheckbox = dialog.AddCheckbox("'''Texte de la case '''☀ Ã  ''' cocher'''",FirstCheckbox)</blockquote><blockquote>dlg.Firstlabel = dialog.AddLabel("'''Texte libre'''")</blockquote><blockquote>dlg.FirstSlider = dialog.AddSlider("'''©lecteur'''", FirstSlider, 0, 10, 1)</blockquote><blockquote><br>
</blockquote><blockquote>dlg.ok = dialog.AddButton("'''Bouton OK'''", 1)</blockquote><blockquote>dlg.cancel = dialog.AddButton("'''Bouton abandonner'''", 0)</blockquote><blockquote>if dialog.Show(dlg) > 0 then</blockquote><blockquote>FirstCheckbox=dlg.FirstCheckbox.value</blockquote><blockquote>FirstSlider=dlg.FirstSlider.value</blockquote><blockquote>return true</blockquote><blockquote>else</blockquote><blockquote>return false</blockquote><blockquote>end</blockquote><blockquote>end</blockquote>GetParams()
+
</blockquote><blockquote>dlg.ok = dialog.AddButton("'''OK'''", 1)</blockquote><blockquote>dlg.cancel = dialog.AddButton("'''Abandonner'''", 0)</blockquote><blockquote>if dialog.Show(dlg) > 0 then</blockquote><blockquote>FirstCheckbox=dlg.FirstCheckbox.value</blockquote><blockquote>FirstSlider=dlg.FirstSlider.value</blockquote><blockquote>return true</blockquote><blockquote>else</blockquote><blockquote>return false</blockquote><blockquote>end</blockquote><blockquote>end</blockquote>GetParams()
   
 
[[Category:Translation]]
 
[[Category:Translation]]

Latest revision as of 13:19, 30 May 2020

Most public recipes are in English by default.

However, linguistic groups lile L'Aliance Francophone provide group recipes in their own language.

It's relatively easy to translate a recipe to another language.

Open the code and search for the texts between braquets " XXX ". You'll find these texts in the print() commands and in dialog. parameters. Just translate these texts to your language and you get a translated version.

For exampe, translate

print("hello world")

to

print("Bonjour tout le monde").

Examples of multilingual recipes are JET or Ebola Rebuild . These recipes "automatically" provide the French version for L'Aliance Francophone and known French speaking players. It's easy to translate these "multilingual" recipes by adding a new language in their multilingual(lang) function at start. Or if you want the French version, just change the option lang="en" to lang="fr".

Example of dialog panel translation:[]

English version[]

EnglishDialogTranslation

function GetParams()

local FirstCheckbox= false local FirstSlider= 0

dlg = dialog.CreateDialog("Title of the dialog pannel")

dlg.FirstCheckbox = dialog.AddCheckbox("Text of the check box",FirstCheckbox)

dlg.Firstlabel = dialog.AddLabel("Any free label")

dlg.FirstSlider = dialog.AddSlider("Label of the slider", FirstSlider, 0, 10, 1)

dlg.ok = dialog.AddButton("OK button", 1)

dlg.cancel = dialog.AddButton("Cancel button text", 0)

if dialog.Show(dlg) > 0 then

FirstCheckbox=dlg.FirstCheckbox.value

FirstSlider=dlg.FirstSlider.value

return true

else

return false

end

end

GetParams()

===
Translation to French:
[]

function GetParams()

DialogueFR

local FirstCheckbox= false

local FirstSlider= 0

dlg = dialog.CreateDialog("Titre de la fenêtre de dialogue")

dlg.FirstCheckbox = dialog.AddCheckbox("Texte de la case ☀ Ã   cocher",FirstCheckbox)

dlg.Firstlabel = dialog.AddLabel("Texte libre")

dlg.FirstSlider = dialog.AddSlider("Sélecteur", FirstSlider, 0, 10, 1)


dlg.ok = dialog.AddButton("OK", 1)

dlg.cancel = dialog.AddButton("Abandonner", 0)

if dialog.Show(dlg) > 0 then

FirstCheckbox=dlg.FirstCheckbox.value

FirstSlider=dlg.FirstSlider.value

return true

else

return false

end

end

GetParams()