summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarko Živković <[email protected]>2015-02-26 23:35:42 +0000
committerMarko Živković <[email protected]>2015-02-26 23:35:42 +0000
commit1338ce5d3efdaca292a420bac59756311efc0a3c (patch)
treed84b760e71132b10398d39a5226ac4c809c093dc
parente5d505f0329e1ae048a1445c45b65cef8cd4e36b (diff)
Separeted selection for gui language and logo language
git-svn-id: https://svn.code.sf.net/p/xlogo4schools/svn/trunk@29 3b0d7934-f7ef-4143-9606-b51f2e2281fd
-rw-r--r--logo/src/langage.properties1
-rw-r--r--logo/src/langage_ar_MA.properties1
-rw-r--r--logo/src/langage_as_ES.properties1
-rw-r--r--logo/src/langage_ca_ES.properties1
-rw-r--r--logo/src/langage_de_DE.properties8
-rw-r--r--logo/src/langage_el_GR.properties1
-rw-r--r--logo/src/langage_en_DE.properties1
-rw-r--r--logo/src/langage_en_US.properties7
-rw-r--r--logo/src/langage_eo_EO.properties1
-rw-r--r--logo/src/langage_es_ES.properties1
-rw-r--r--logo/src/langage_fr_FR.properties7
-rw-r--r--logo/src/langage_gl_ES.properties1
-rw-r--r--logo/src/langage_hu_HU.properties1
-rw-r--r--logo/src/langage_it_IT.properties8
-rw-r--r--logo/src/langage_pt_BR.properties1
-rw-r--r--logo/src/primitives.properties5
-rw-r--r--logo/src/primitives_ar_MA.properties5
-rw-r--r--logo/src/primitives_as_ES.properties5
-rw-r--r--logo/src/primitives_ca_ES.properties5
-rw-r--r--logo/src/primitives_de_DE.properties5
-rw-r--r--logo/src/primitives_el_GR.properties5
-rw-r--r--logo/src/primitives_en_DE.properties4
-rw-r--r--logo/src/primitives_en_US.properties5
-rw-r--r--logo/src/primitives_eo_EO.properties5
-rw-r--r--logo/src/primitives_es_ES.properties5
-rw-r--r--logo/src/primitives_fr_FR.properties5
-rw-r--r--logo/src/primitives_gl_ES.properties5
-rw-r--r--logo/src/primitives_hu_HU.properties5
-rw-r--r--logo/src/primitives_it_IT.properties5
-rw-r--r--logo/src/primitives_pt_BR.properties5
-rw-r--r--logo/src/xlogo/AppSettings.java30
-rw-r--r--logo/src/xlogo/Logo.java13
-rw-r--r--logo/src/xlogo/gui/welcome/settings/tabs/SyntaxHighlightingTab.java18
-rw-r--r--logo/src/xlogo/gui/welcome/settings/tabs/WorkspaceTab.java70
-rw-r--r--logo/src/xlogo/kernel/Kernel.java6
-rw-r--r--logo/src/xlogo/kernel/Primitive.java15
-rw-r--r--logo/src/xlogo/kernel/userspace/ProcedureErrorMessage.java5
-rw-r--r--logo/src/xlogo/kernel/userspace/files/LogoFile.java3
-rw-r--r--logo/src/xlogo/kernel/userspace/procedures/Procedure.java11
-rw-r--r--logo/src/xlogo/storage/workspace/WorkspaceConfig.java2
-rw-r--r--logo/src/xlogo/storage/workspace/WorkspaceConfigJSONSerializer.java2
41 files changed, 226 insertions, 64 deletions
diff --git a/logo/src/langage.properties b/logo/src/langage.properties
index f0f99dc..f55533e 100644
--- a/logo/src/langage.properties
+++ b/logo/src/langage.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
diff --git a/logo/src/langage_ar_MA.properties b/logo/src/langage_ar_MA.properties
index e112c0a..8ac419d 100644
--- a/logo/src/langage_ar_MA.properties
+++ b/logo/src/langage_ar_MA.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
diff --git a/logo/src/langage_as_ES.properties b/logo/src/langage_as_ES.properties
index 4262775..87a1095 100644
--- a/logo/src/langage_as_ES.properties
+++ b/logo/src/langage_as_ES.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
diff --git a/logo/src/langage_ca_ES.properties b/logo/src/langage_ca_ES.properties
index b8746de..f16e6db 100644
--- a/logo/src/langage_ca_ES.properties
+++ b/logo/src/langage_ca_ES.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
diff --git a/logo/src/langage_de_DE.properties b/logo/src/langage_de_DE.properties
index ee950d4..8ee8628 100644
--- a/logo/src/langage_de_DE.properties
+++ b/logo/src/langage_de_DE.properties
@@ -285,6 +285,7 @@ vrai="wahr
xgrid=X-Gitter:
y_a_pas = Es gibt kein
ygrid=Y-Gitter:
+
ws.settings.require_password=Sch�tze diese Einstellungen mit einem Passwort
ws.settings.password=Passwort
ws.settings.retype.password=Wiederhole das Passwort
@@ -292,6 +293,7 @@ ws.settings.save.password=Passwort speichern
ws.settings.workspace=Arbeitsplatz:
ws.settings.location=Ort:
ws.settings.language=Sprache:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Anzahl Backups:
ws.settings.user=Benutzer:
ws.settings.add=Hinzuf�gen
@@ -394,7 +396,7 @@ logo.file.has.error=Dieses Dokument enth�lt Fehler und dessen Programme k�nnen n
error.while.creating.editor=Leider konnte ich aus folgendem Grund den Editor nicht �ffnen:
error.no.error=Hurray, the Procedure has no errors. Why do I bother you? Just to be consistent with my enum.
-error.missing.to=Ein Logo-Dokument muss immer mit "lerne" beginnen
+error.missing.to=Ein Programm muss immer mit "{to}" beginnen
error.missing.name=Ich habe einen Programmnamen erwartet, aber keinen gefunden.
error.name.is.number=Ein Name eines Programms darf keine Zahl sein.
error.name.special=Ein Name eines Programms darf keine Sonderzeichen enthalten.
@@ -406,8 +408,8 @@ error.opt.var.bracket=Da ist etwas mit der Klammerung bei den optionalen Paramet
error.var.extra.chars=Ich verstehe nicht, was am Ende der Variablendeklaration steht.
error.missing.expr=Ich vermisse einen Standardwert f�r einen optionalen Parameter.
error.more.chars.after.end="Ende" sollte alleine auf einer Zeile stehen.
-error.missing.end=Deins letztes Programm besitzt kein "Ende".
-error.to.before.end= hat kein end.
+error.missing.end=Deins letztes Programm besitzt kein "{end}".
+error.to.before.end= hat kein "{end}".
error.name.is.key.word=Einer der von dir gew�hlten Namen ist ein reserviertes Schl�sselwort, das ich nicht �berschreiben kann.
error.procedure.ambiguous=Es gibt ein anderes Programm mit demselben Namen.
diff --git a/logo/src/langage_el_GR.properties b/logo/src/langage_el_GR.properties
index 277cad9..7c551b6 100644
--- a/logo/src/langage_el_GR.properties
+++ b/logo/src/langage_el_GR.properties
@@ -293,6 +293,7 @@ ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
ws.settings.backups=Number of Backups:
+ws.settings.logolanguage=Logo:
ws.settings.user=User:
ws.settings.add=Add
ws.settings.remove=Remove
diff --git a/logo/src/langage_en_DE.properties b/logo/src/langage_en_DE.properties
index 144f27b..f7f7174 100644
--- a/logo/src/langage_en_DE.properties
+++ b/logo/src/langage_en_DE.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Passwort speichern
ws.settings.workspace=Arbeitsplatz:
ws.settings.location=Ort:
ws.settings.language=Sprache:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Anzahl Backups:
ws.settings.user=Benutzer:
ws.settings.add=Hinzuf�gen
diff --git a/logo/src/langage_en_US.properties b/logo/src/langage_en_US.properties
index d1242c6..9db080c 100644
--- a/logo/src/langage_en_US.properties
+++ b/logo/src/langage_en_US.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace_label=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
@@ -394,7 +395,7 @@ logo.file.has.error=This file contains errors and it cannot be executed.
error.while.creating.editor=Unfortunately I could not create the editor for the following reason :
error.no.error=Hurray, the Procedure has no errors. Why do I bother you? Just to be consistent with my enum.
-error.missing.to=The document should always start with 'to'
+error.missing.to=The document should always start with '{to}'
error.missing.name=I'm missing a procedure name.
error.name.is.number=A procedure name cannot be a number.
error.name.special=Procedure names should not contain special characters.
@@ -406,8 +407,8 @@ error.opt.var.bracket=There is a problem with the brackets for optional variable
error.var.extra.chars=I don't understand the variables declaration. Maybe there is a ":" missing?
error.missing.expr=I am missing a default value for one of the optional variables.
error.more.chars.after.end='End' should be alone on a new line.
-error.missing.end=Your last procedure is missing an end.
-error.to.before.end=I cannot find 'end' for the procedure
+error.missing.end=Your last procedure is missing an '{end}'.
+error.to.before.end=I cannot find '{end}' for the procedure
error.name.is.key.word=One of your names is a reserved key word.
error.procedure.ambiguous=There is another procedure with the same name. Every procedure should be called differently.
diff --git a/logo/src/langage_eo_EO.properties b/logo/src/langage_eo_EO.properties
index ca8231e..710c90f 100644
--- a/logo/src/langage_eo_EO.properties
+++ b/logo/src/langage_eo_EO.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
diff --git a/logo/src/langage_es_ES.properties b/logo/src/langage_es_ES.properties
index e5ac1b6..29d81cd 100644
--- a/logo/src/langage_es_ES.properties
+++ b/logo/src/langage_es_ES.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
diff --git a/logo/src/langage_fr_FR.properties b/logo/src/langage_fr_FR.properties
index 644aff1..7bab4f1 100644
--- a/logo/src/langage_fr_FR.properties
+++ b/logo/src/langage_fr_FR.properties
@@ -293,6 +293,7 @@ ws.settings.save.password=enregistrer le mot de passe
ws.settings.workspace= Espace de travail:
ws.settings.location= Emplacement:
ws.settings.language=Langue:
+ws.settings.logolanguage=Logo:
ws.settings.backups= Nombre de sauvegardes:
ws.settings.user= Utilisateur:
ws.settings.add=Ajouter
@@ -395,7 +396,7 @@ logo.file.has.error= Ce fichier contient des erreurs et il ne peut pas �tre ex�c
error.while.creating.editor= Malheureusement, je ne pouvais pas cr�er l'�diteur pour la raison suivante:
error.no.error= Hourra, la proc�dure comporte pas d'erreurs. Pourquoi dois-je vous d�ranger? Juste pour �tre compatible avec mon �num�ration.
-error.missing.to= Le document doit toujours commencer par 'to'
+error.missing.to= Le document doit toujours commencer par �{to}�.
error.missing.name= Il me manque un nom de proc�dure.
error.name.is.number= Un nom de proc�dure ne peut pas �tre un nombre.
error.name.special= Noms de proc�dure ne doivent pas contenir de caract�res sp�ciaux .
@@ -407,8 +408,8 @@ error.opt.var.bracket= Il ya un probl�me avec les parenth�ses pour les variables
error.var.extra.chars= Je ne comprends pas ce que vous avez �crit apr�s la d�claration de variable.
error.missing.expr= Il me manque une valeur par d�faut pour l'une des variables facultatives.
error.more.chars.after.end=�Fin� devrait �tre seul sur une nouvelle ligne .
-error.missing.end= Votre derni�re proc�dure manque la fin .
-error.to.before.end= Je ne peux pas trouver �fin� de la proc�dure
+error.missing.end= Votre derni�re proc�dure manque la �{end}�.
+error.to.before.end= Je ne peux pas trouver �{end}� de la proc�dure
error.name.is.key.word= Un de vos noms de programme est un mot-cl� r�serv�.
error.procedure.ambiguous= Il existe une autre proc�dure de m�me nom . Chaque proc�dure doit �tre nomm�e diff�remment.
diff --git a/logo/src/langage_gl_ES.properties b/logo/src/langage_gl_ES.properties
index d2e0295..3a0e284 100644
--- a/logo/src/langage_gl_ES.properties
+++ b/logo/src/langage_gl_ES.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
diff --git a/logo/src/langage_hu_HU.properties b/logo/src/langage_hu_HU.properties
index 908960a..7fc4d4a 100644
--- a/logo/src/langage_hu_HU.properties
+++ b/logo/src/langage_hu_HU.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
diff --git a/logo/src/langage_it_IT.properties b/logo/src/langage_it_IT.properties
index 33c8611..ece64c5 100644
--- a/logo/src/langage_it_IT.properties
+++ b/logo/src/langage_it_IT.properties
@@ -285,7 +285,6 @@ vrai="vero
xgrid=Griglia X
y_a_pas=Non c'\u00e8
ygrid=Griglia Y
-
ws.settings.require_password=Proteggi queste impostazioni con una password.
ws.settings.password=Password
ws.settings.retype.password=Immetti nuovamente la password
@@ -293,6 +292,7 @@ ws.settings.save.password=Salva la password
ws.settings.workspace=Spazio di lavoro:
ws.settings.location=Posizione predefinita:
ws.settings.language=Lingua:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Numero di backups:
ws.settings.user=Utente:
ws.settings.add=Aggiungi
@@ -395,7 +395,7 @@ logo.file.has.error=Questo file contiene degli errori e non può essere eseguito
error.while.creating.editor=Purtroppo non posso aprire l'editore. La ragione è la seguente:
error.no.error=Evviva, il programma non contiene errori. Allora perché ti annoio? Lo faccio solo per essere coerente con la mia enumerazione.
-error.missing.to=Un documento in Logo deve sempre cominciare con 'to'
+error.missing.to=Un documento in Logo deve sempre cominciare con '{to}'
error.missing.name=Manca il nome del programma.
error.name.is.number=Un numero non può venir utilizzato come nome per un programma.
error.name.special=Il nome di un programma non può contenere caratteri speciali.
@@ -407,8 +407,8 @@ error.opt.var.bracket=C'è un problema con le parentesi per le variabili opziona
error.var.extra.chars=Non capisco cos'hai scritto dopo la dichiarazione della variabile.
error.missing.expr=Manca un valore di default per una delle variabili opzionali.
error.more.chars.after.end='end' va sempre scritto da solo e su una nuova riga.
-error.missing.end=Nel tuo ultimo programma manca un 'end'.
-error.to.before.end=Non riesco a trovare un 'end' per il programma.
+error.missing.end=Nel tuo ultimo programma manca un '{end}'.
+error.to.before.end=Non riesco a trovare un '{end}' per il programma.
error.name.is.key.word=Uno dei nomi da te scelti è una parola riservata.
error.procedure.ambiguous=Un altro programma ha già lo stesso nome. Ogni programma deve avere un nome proprio ed unico.
diff --git a/logo/src/langage_pt_BR.properties b/logo/src/langage_pt_BR.properties
index f262e41..96cbaac 100644
--- a/logo/src/langage_pt_BR.properties
+++ b/logo/src/langage_pt_BR.properties
@@ -292,6 +292,7 @@ ws.settings.save.password=Save Password
ws.settings.workspace=Workspace:
ws.settings.location=Location:
ws.settings.language=Language:
+ws.settings.logolanguage=Logo:
ws.settings.backups=Number of Backups:
ws.settings.user=User:
ws.settings.add=Add
diff --git a/logo/src/primitives.properties b/logo/src/primitives.properties
index 4e25fc3..0b1a98b 100644
--- a/logo/src/primitives.properties
+++ b/logo/src/primitives.properties
@@ -289,4 +289,7 @@ loop.dountil=
loop.dowhile=
aritmetic.modulo=
drawing.setfontjustify=
-drawing.fontjustify= \ No newline at end of file
+drawing.fontjustify=
+pref.highlight.example=# This is a comment\n repeat 4 [forward 100 right 90]
+pour=to
+fin=end \ No newline at end of file
diff --git a/logo/src/primitives_ar_MA.properties b/logo/src/primitives_ar_MA.properties
index a65813f..3ddb96c 100644
--- a/logo/src/primitives_ar_MA.properties
+++ b/logo/src/primitives_ar_MA.properties
@@ -285,4 +285,7 @@ loop.dountil=\u0627\u0641\u0639\u0644\u062d\u062a\u0649 \u0643\u0631\u0631\u06
loop.dowhile=\u0627\u0641\u0639\u0644\u0645\u0627\u062f\u0627\u0645 \u0643\u0631\u0631\u0645\u0627\u062f\u0627\u0645
aritmetic.modulo=\u0645\u0648\u062f \u0645\u0648\u062f\u0648\u0644\u0648
drawing.setfontjustify=\u0627\u0644\u062e\u0637\u0645\u0644\u0623\u0627\u0644\u0633\u0637\u0631
-drawing.fontjustify=\u0644\u062e\u0637\u0645\u0644\u0623\u0627\u0644\u0633\u0637 \ No newline at end of file
+drawing.fontjustify=\u0644\u062e\u0637\u0645\u0644\u0623\u0627\u0644\u0633\u0637
+pref.highlight.example= # \u0647\u062f\u0647 \u0645\u0644\u0627\u062d\u0638\u0629\n \u0643\u0631\u0631 4[\u062a\u0642\u062f\u0645 100 \u064a\u0645\u064a\u0646 90]\n
+pour=\u0628\u062f\u0627\u064a\u0629
+fin=\u0646\u0647\u0627\u064a\u0629 \ No newline at end of file
diff --git a/logo/src/primitives_as_ES.properties b/logo/src/primitives_as_ES.properties
index 96f6d7a..1758c54 100644
--- a/logo/src/primitives_as_ES.properties
+++ b/logo/src/primitives_as_ES.properties
@@ -285,4 +285,7 @@ loop.dountil=repitehasta
loop.dowhile=repitemientres
aritmetic.modulo=mod modulu m\u00f3dulu
drawing.setfontjustify=ponxustificaofonte
-drawing.fontjustify=xustificaofonte \ No newline at end of file
+drawing.fontjustify=xustificaofonte
+pref.highlight.example = # Esto ye un comentariu\n repite 4 [avanza 100 giraderecha 90]
+pour = pa
+fin = fin \ No newline at end of file
diff --git a/logo/src/primitives_ca_ES.properties b/logo/src/primitives_ca_ES.properties
index 3386af7..3e6eaa6 100644
--- a/logo/src/primitives_ca_ES.properties
+++ b/logo/src/primitives_ca_ES.properties
@@ -285,4 +285,7 @@ xaxis=eixx
xaxis?=eixx?
yaxis=eixy
yaxis?=eixy?
-zoom=zoom \ No newline at end of file
+zoom=zoom
+pref.highlight.example=# Aix\u00f2 \u00e9s un comentari\nrepeteix 4 [avan\u00e7a 100 gd 90]
+pour=per
+fin=fi \ No newline at end of file
diff --git a/logo/src/primitives_de_DE.properties b/logo/src/primitives_de_DE.properties
index 26cd23b..9686ef0 100644
--- a/logo/src/primitives_de_DE.properties
+++ b/logo/src/primitives_de_DE.properties
@@ -275,4 +275,7 @@ xaxis?=xachse?
xaxis=xachse
yaxis?=yachse?
yaxis=yachse
-zoom=zoom \ No newline at end of file
+zoom=zoom
+pref.highlight.example=# Dies ist ein Kommentar\n wiederhole 4[vorw�rts 100 rechts 90]\n
+pour=lerne
+fin=Ende \ No newline at end of file
diff --git a/logo/src/primitives_el_GR.properties b/logo/src/primitives_el_GR.properties
index b4750eb..6670e2e 100644
--- a/logo/src/primitives_el_GR.properties
+++ b/logo/src/primitives_el_GR.properties
@@ -285,4 +285,7 @@ xaxis=\u03ac\u03be\u03bf\u03bd\u03b1\u03c2\u03c7
xaxis?=\u03ac\u03be\u03bf\u03bd\u03b1\u03c2\u03c7?
yaxis=\u03ac\u03be\u03bf\u03bd\u03b1\u03c2\u03c8
yaxis?=\u03ac\u03be\u03bf\u03bd\u03b1\u03c2\u03c8?
-zoom=\u03bc\u03b5\u03b3\u03ad\u03b8\u03c5\u03bd\u03c3\u03b7 \ No newline at end of file
+zoom=\u03bc\u03b5\u03b3\u03ad\u03b8\u03c5\u03bd\u03c3\u03b7
+pref.highlight.example=# \u0391\u03c5\u03c4\u03cc \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03bd\u03b1 \u03c3\u03c7\u03cc\u03bb\u03b9\u03bf\n \u03b5\u03c0\u03b1\u03bd\u03ac\u03bb\u03b1\u03b2\u03b5 4 [\u03bc\u03c0\u03c1\u03bf\u03c3\u03c4\u03ac 100 \u03b4\u03b5\u03be\u03b9\u03ac 90]
+pour=\u03b3\u03b9\u03b1
+fin=\u03c4\u03ad\u03bb\u03bf\u03c2 \ No newline at end of file
diff --git a/logo/src/primitives_en_DE.properties b/logo/src/primitives_en_DE.properties
index 715b1b6..0c7b848 100644
--- a/logo/src/primitives_en_DE.properties
+++ b/logo/src/primitives_en_DE.properties
@@ -285,4 +285,6 @@ loop.dountil=repeatuntil dountil
loop.dowhile=repeatwhile dowhile
aritmetic.modulo=mod modulo
drawing.setfontjustify=setfontjustify
-drawing.fontjustify=fontjustify \ No newline at end of file
+drawing.fontjustify=fontjustify
+pref.highlight.example=# Dies ist ein Kommentar\n repeat 4[forward 100 right 90]\n
+pour=lerne \ No newline at end of file
diff --git a/logo/src/primitives_en_US.properties b/logo/src/primitives_en_US.properties
index 715b1b6..6d235ea 100644
--- a/logo/src/primitives_en_US.properties
+++ b/logo/src/primitives_en_US.properties
@@ -285,4 +285,7 @@ loop.dountil=repeatuntil dountil
loop.dowhile=repeatwhile dowhile
aritmetic.modulo=mod modulo
drawing.setfontjustify=setfontjustify
-drawing.fontjustify=fontjustify \ No newline at end of file
+drawing.fontjustify=fontjustify
+pref.highlight.example=# This is a comment\n repeat 4 [forward 100 right 90]
+pour=to
+fin=end \ No newline at end of file
diff --git a/logo/src/primitives_eo_EO.properties b/logo/src/primitives_eo_EO.properties
index 5ba6673..2587b18 100644
--- a/logo/src/primitives_eo_EO.properties
+++ b/logo/src/primitives_eo_EO.properties
@@ -285,4 +285,7 @@ loop.dountil=repetejusqua
loop.dowhile=repetetantque
aritmetic.modulo=mod modulo
drawing.setfontjustify=fixealignementpolice
-drawing.fontjustify=alignementpolice \ No newline at end of file
+drawing.fontjustify=alignementpolice
+pref.highlight.example= # Tio estas komento \n ripetu 4[an 100 td 90]\n
+pour=por
+fin=fino \ No newline at end of file
diff --git a/logo/src/primitives_es_ES.properties b/logo/src/primitives_es_ES.properties
index cfb1fae..edf906a 100644
--- a/logo/src/primitives_es_ES.properties
+++ b/logo/src/primitives_es_ES.properties
@@ -289,4 +289,7 @@ drawing.fontjustify = justificadofuente
arithmetic.inf = menor?
arithmetic.infequal = menoroigual?
arithmetic.sup = mayor?
-arithmetic.supequal = mayoroigual? \ No newline at end of file
+arithmetic.supequal = mayoroigual?
+pref.highlight.example = # Esto es un comentario\n repite 4 [avanza 100 giraderecha 90]\n
+pour= para
+fin= fin \ No newline at end of file
diff --git a/logo/src/primitives_fr_FR.properties b/logo/src/primitives_fr_FR.properties
index 6fa046d..b05588a 100644
--- a/logo/src/primitives_fr_FR.properties
+++ b/logo/src/primitives_fr_FR.properties
@@ -289,4 +289,7 @@ xaxis?=axex?
xaxis=axex
yaxis?=axey?
yaxis=axey
-zoom=zoom \ No newline at end of file
+zoom=zoom
+pref.highlight.example= # Ceci est un commentaire\n repete 4[avance 100 td 90]\n
+pour=pour
+fin=fin \ No newline at end of file
diff --git a/logo/src/primitives_gl_ES.properties b/logo/src/primitives_gl_ES.properties
index 150b5e1..b0a8b1f 100644
--- a/logo/src/primitives_gl_ES.properties
+++ b/logo/src/primitives_gl_ES.properties
@@ -275,4 +275,7 @@ xaxis?=eixox
xaxis=eixox
yaxis?=eixoy?
yaxis=eixoy
-zoom=zoom \ No newline at end of file
+zoom=zoom
+pref.highlight.example=#Isto \u00e9 un comentario\nrepite 4[avanza 100 xiradereita 90]
+pour=para
+fin=fin \ No newline at end of file
diff --git a/logo/src/primitives_hu_HU.properties b/logo/src/primitives_hu_HU.properties
index 0123abf..4813db5 100644
--- a/logo/src/primitives_hu_HU.properties
+++ b/logo/src/primitives_hu_HU.properties
@@ -285,4 +285,7 @@ xaxis?=xtengely?
xaxis=xtengely
yaxis?=ytengely?
yaxis=ytengely
-zoom=nagy\u00edt\u00e1s \ No newline at end of file
+zoom=nagy\u00edt\u00e1s
+pref.highlight.example=# Megjegyz\u00e9s \n ism\u00e9tl\u00e9s 4 [el\u0151re 100 jobbra 90]
+pour=tudd
+fin=v\u00e9ge \ No newline at end of file
diff --git a/logo/src/primitives_it_IT.properties b/logo/src/primitives_it_IT.properties
index 200d25e..c439139 100644
--- a/logo/src/primitives_it_IT.properties
+++ b/logo/src/primitives_it_IT.properties
@@ -290,4 +290,7 @@ xaxis=AsseX
xaxis?=AsseX?
yaxis=AsseY
yaxis?=AsseY?
-zoom=Zoom \ No newline at end of file
+zoom=Zoom
+pref.highlight.example=# Questo \u00e8 un commento\nRipeti 4 [Avanti 100 RuotaDestra 90]
+pour=per
+fin=fine \ No newline at end of file
diff --git a/logo/src/primitives_pt_BR.properties b/logo/src/primitives_pt_BR.properties
index b1b5ba1..76f2d6d 100644
--- a/logo/src/primitives_pt_BR.properties
+++ b/logo/src/primitives_pt_BR.properties
@@ -285,4 +285,7 @@ xaxis?=eixox?
xaxis=eixox
yaxis?=eixoy?
yaxis=eixoy
-zoom=zoom \ No newline at end of file
+zoom=zoom
+pref.highlight.example= # Isto \u00e9 um coment\u00e1rio\n repita 4[pf 100 pd 90]\n
+pour=aprenda
+fin=fim \ No newline at end of file
diff --git a/logo/src/xlogo/AppSettings.java b/logo/src/xlogo/AppSettings.java
index 8a8d2da..aa1beba 100644
--- a/logo/src/xlogo/AppSettings.java
+++ b/logo/src/xlogo/AppSettings.java
@@ -11,6 +11,7 @@ import xlogo.storage.WSManager;
import xlogo.storage.global.GlobalConfig;
import xlogo.storage.global.GlobalConfig.GlobalProperty;
import xlogo.storage.workspace.Language;
+import xlogo.storage.workspace.LogoLanguage;
import xlogo.storage.workspace.SyntaxHighlightConfig;
import xlogo.storage.workspace.WorkspaceConfig;
import xlogo.storage.workspace.WorkspaceConfig.WorkspaceProperty;
@@ -39,6 +40,10 @@ public class AppSettings implements Observable<AppSettings.AppProperty>{
setLanguage(wc.getLanguage());
};
+ private PropertyChangeListener logoLanguageListener= () -> {
+ setLogoLanguage(wc.getLogoLanguage());
+ };
+
private PropertyChangeListener syntaxListener = () -> {
setSyntaxHighlightingStyles(wc.getSyntaxHighlightStyles());
};
@@ -67,6 +72,7 @@ public class AppSettings implements Observable<AppSettings.AppProperty>{
if (wc != null) {
wc.removePropertyChangeListener(WorkspaceProperty.LANGUAGE, languageListener);
+ wc.removePropertyChangeListener(WorkspaceProperty.LOGO_LANGUAGE, logoLanguageListener);
wc.removePropertyChangeListener(WorkspaceProperty.SYNTAX_HIGHLIGHTING, syntaxListener);
}
@@ -74,9 +80,11 @@ public class AppSettings implements Observable<AppSettings.AppProperty>{
if (wc != null) {
setLanguage(wc.getLanguage());
+ setLogoLanguage(wc.getLogoLanguage());
setSyntaxHighlightingStyles(wc.getSyntaxHighlightStyles());
wc.addPropertyChangeListener(WorkspaceProperty.LANGUAGE, languageListener);
+ wc.addPropertyChangeListener(WorkspaceProperty.LOGO_LANGUAGE, logoLanguageListener);
wc.addPropertyChangeListener(WorkspaceProperty.SYNTAX_HIGHLIGHTING, syntaxListener);
}
publisher.publishEvent(AppProperty.WORKSPACE);
@@ -104,6 +112,26 @@ public class AppSettings implements Observable<AppSettings.AppProperty>{
Logo.generateLanguage(language);
publisher.publishEvent(AppProperty.LANGUAGE);
}
+
+
+ /* * * * * * *
+ * LANGUAGE
+ * * * * * * */
+
+ private LogoLanguage logoLanguage = LogoLanguage.ENGLISH;
+
+ public LogoLanguage getLogoLanguage() {
+ return logoLanguage;
+ }
+
+ protected void setLogoLanguage(LogoLanguage language) {
+ if (language == this.logoLanguage)
+ return;
+ logger.trace("Change language from " + this.language + " to " + language);
+ this.logoLanguage = language;
+ Logo.generateLogoLanguage(language);
+ publisher.publishEvent(AppProperty.LOGO_LANGUAGE);
+ }
/**
* Translate the key into the current language.
@@ -157,7 +185,7 @@ public class AppSettings implements Observable<AppSettings.AppProperty>{
* * * * * * */
public enum AppProperty {
- LANGUAGE, SYNTAX_HIGHLIGHTING, FONT, WORKSPACE;
+ LANGUAGE, LOGO_LANGUAGE, SYNTAX_HIGHLIGHTING, FONT, WORKSPACE;
}
private transient final PropertyChangePublisher<AppProperty> publisher = new PropertyChangePublisher<>();
diff --git a/logo/src/xlogo/Logo.java b/logo/src/xlogo/Logo.java
index 907aa79..580c28b 100644
--- a/logo/src/xlogo/Logo.java
+++ b/logo/src/xlogo/Logo.java
@@ -45,6 +45,7 @@ import java.util.ResourceBundle;
import xlogo.storage.WSManager;
import xlogo.storage.global.GlobalConfig;
import xlogo.storage.workspace.Language;
+import xlogo.storage.workspace.LogoLanguage;
import xlogo.storage.workspace.WorkspaceConfig;
import xlogo.gui.welcome.WelcomeScreen;
import xlogo.kernel.Primitive;
@@ -116,6 +117,11 @@ public class Logo {
lang = WSManager.getInstance().getWorkspaceConfigInstance().getLanguage();
}
generateLanguage(lang);
+ LogoLanguage logo = LogoLanguage.ENGLISH;
+ if (wc != null){
+ lang = WSManager.getInstance().getWorkspaceConfigInstance().getLanguage();
+ }
+ generateLogoLanguage(logo);
showWelcomeScreen();
}
@@ -152,6 +158,7 @@ public class Logo {
welcomeScreen.closeFrame();
generateLanguage(wc.getLanguage());
+ generateLogoLanguage(wc.getLogoLanguage());
// Initialize frame
SwingUtilities.invokeLater(new Runnable(){
@@ -182,7 +189,9 @@ public class Logo {
translationLanguage[11]=Logo.messages.getString("pref.general.catalan");
translationLanguage[12]=Logo.messages.getString("pref.general.hungarian");
translationLanguage[13]=Logo.messages.getString("pref.general.abz.german.english");
-
+ }
+
+ public static void generateLogoLanguage(LogoLanguage lang){
Primitive.buildPrimitiveTreemap(lang);
- }
+ }
} \ No newline at end of file
diff --git a/logo/src/xlogo/gui/welcome/settings/tabs/SyntaxHighlightingTab.java b/logo/src/xlogo/gui/welcome/settings/tabs/SyntaxHighlightingTab.java
index 34a2bfe..025135f 100644
--- a/logo/src/xlogo/gui/welcome/settings/tabs/SyntaxHighlightingTab.java
+++ b/logo/src/xlogo/gui/welcome/settings/tabs/SyntaxHighlightingTab.java
@@ -45,6 +45,7 @@ import xlogo.AppSettings.AppProperty;
import xlogo.StyledDocument.DocumentLogo;
import xlogo.gui.components.ColorStyleSelectionPanel;
import xlogo.interfaces.Observable.PropertyChangeListener;
+import xlogo.kernel.Primitive;
import xlogo.storage.WSManager;
import xlogo.storage.workspace.SyntaxHighlightConfig;
import xlogo.storage.workspace.WorkspaceConfig;
@@ -64,6 +65,7 @@ public class SyntaxHighlightingTab extends AbstractWorkspacePanel{
private DocumentLogo previewLogoDocument;
private JTextPane previewTextPane;
+ private PropertyChangeListener logoLanguageChangeListener;
private PropertyChangeListener syntaxHighlightChangeListener;
public SyntaxHighlightingTab() {
@@ -167,7 +169,7 @@ public class SyntaxHighlightingTab extends AbstractWorkspacePanel{
operandStyleSelection.setTitle(translate("pref.highlight.operand"));
activateHighlightingLabel.setText(translate("pref.highlight.enabled"));
restoreDefaultsButton.setText(translate("pref.highlight.init"));
- previewTextPane.setText(translate("pref.highlight.example"));
+ updateLogoLanguage();
}
@Override
@@ -189,6 +191,12 @@ public class SyntaxHighlightingTab extends AbstractWorkspacePanel{
}
});
+ logoLanguageChangeListener = () -> {
+ updateLogoLanguage();
+ };
+
+ AppSettings.getInstance().addPropertyChangeListener(AppProperty.LOGO_LANGUAGE, logoLanguageChangeListener);
+
syntaxHighlightChangeListener = () -> {
updateSyntaxHighlightingPreview();
};
@@ -235,6 +243,7 @@ public class SyntaxHighlightingTab extends AbstractWorkspacePanel{
@Override
public void stopEventListeners() {
super.stopEventListeners();
+ AppSettings.getInstance().removePropertyChangeListener(AppProperty.LOGO_LANGUAGE, logoLanguageChangeListener);
AppSettings.getInstance().removePropertyChangeListener(AppProperty.SYNTAX_HIGHLIGHTING, syntaxHighlightChangeListener);
}
@@ -279,8 +288,11 @@ public class SyntaxHighlightingTab extends AbstractWorkspacePanel{
wc.getBraceColor(), wc.getBraceStyle(),
wc.getOperandColor(), wc.getOperandStyle());
-
- previewTextPane.setText(translate("pref.highlight.example"));
+ updateLogoLanguage();
+ }
+
+ protected void updateLogoLanguage(){
+ previewTextPane.setText(Primitive.EXAMPLE_PROGRAM);
}
@Override
diff --git a/logo/src/xlogo/gui/welcome/settings/tabs/WorkspaceTab.java b/logo/src/xlogo/gui/welcome/settings/tabs/WorkspaceTab.java
index 259d16d..3651568 100644
--- a/logo/src/xlogo/gui/welcome/settings/tabs/WorkspaceTab.java
+++ b/logo/src/xlogo/gui/welcome/settings/tabs/WorkspaceTab.java
@@ -44,6 +44,7 @@ import xlogo.messages.async.dialog.DialogMessenger;
import xlogo.storage.Storable;
import xlogo.storage.WSManager;
import xlogo.storage.workspace.Language;
+import xlogo.storage.workspace.LogoLanguage;
import xlogo.storage.workspace.NumberOfBackups;
import xlogo.storage.workspace.WorkspaceConfig;
@@ -54,6 +55,7 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
JLabel workspaceLabel;
JLabel wsLocationLabel;
JLabel wsLanguageLabel;
+ JLabel wsLogoLanguageLabel;
JLabel wsBackupLabel;
JLabel userLabel;
@@ -71,7 +73,8 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
JLabel wsLocation;
JFileChooser wsLocationChooser;
JComboBox<Language> languageSelection;
- JComboBox<NumberOfBackups> nOfBackupsSelecteion;
+ JComboBox<LogoLanguage> logoLanguageSelection;
+ JComboBox<NumberOfBackups> nOfBackupsSelection;
JCheckBox userCreatable;
public WorkspaceTab() {
@@ -95,6 +98,7 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
workspaceLabel = new JLabel("Workspace: ");
wsLocationLabel = new JLabel("Location: ");
wsLanguageLabel = new JLabel("Language: ");
+ wsLogoLanguageLabel = new JLabel("Logo: ");
wsBackupLabel = new JLabel("Number of Backups: ");
userLabel = new JLabel("User: ");
@@ -112,7 +116,8 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
wsLocation = new JLabel();
wsLocationChooser = new JFileChooser();
languageSelection = new JComboBox<>(Language.values());
- nOfBackupsSelecteion = new JComboBox<>(NumberOfBackups.values());
+ logoLanguageSelection = new JComboBox<>(LogoLanguage.values());
+ nOfBackupsSelection = new JComboBox<>(NumberOfBackups.values());
userCreatable = new JCheckBox("Allow the users to create new user accounts?");
populateWorkspaceList();
@@ -133,12 +138,15 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
userSelection.setMaximumSize(new Dimension(150, 25));
languageSelection.setMinimumSize(new Dimension(150, 25));
languageSelection.setMaximumSize(new Dimension(150, 25));
- nOfBackupsSelecteion.setMinimumSize(new Dimension(75, 25));
- nOfBackupsSelecteion.setMaximumSize(new Dimension(75, 25));
+ logoLanguageSelection.setMinimumSize(new Dimension(150, 25));
+ logoLanguageSelection.setMaximumSize(new Dimension(150, 25));
+ nOfBackupsSelection.setMinimumSize(new Dimension(75, 25));
+ nOfBackupsSelection.setMaximumSize(new Dimension(75, 25));
component.add(workspaceLabel);
component.add(wsLocationLabel);
component.add(wsLanguageLabel);
+ component.add(wsLogoLanguageLabel);
component.add(wsBackupLabel);
component.add(userLabel);
@@ -153,7 +161,8 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
component.add(userSelection);
component.add(wsLocation);
component.add(languageSelection);
- component.add(nOfBackupsSelecteion);
+ component.add(logoLanguageSelection);
+ component.add(nOfBackupsSelection);
GroupLayout groupLayout = new GroupLayout(component);
component.setLayout(groupLayout);
@@ -179,8 +188,11 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
groupLayout.createParallelGroup().addComponent(wsLanguageLabel)
.addComponent(languageSelection))
.addGroup(
+ groupLayout.createParallelGroup().addComponent(wsLogoLanguageLabel)
+ .addComponent(logoLanguageSelection))
+ .addGroup(
groupLayout.createParallelGroup().addComponent(wsBackupLabel)
- .addComponent(nOfBackupsSelecteion))
+ .addComponent(nOfBackupsSelection))
.addGroup(groupLayout.createParallelGroup().addComponent(userCreatable)));
groupLayout.setHorizontalGroup(groupLayout
@@ -191,7 +203,8 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
.addGroup(
groupLayout.createParallelGroup().addComponent(workspaceLabel)
.addComponent(userLabel).addComponent(wsLocationLabel)
- .addComponent(wsLanguageLabel).addComponent(wsBackupLabel))
+ .addComponent(wsLanguageLabel).addComponent(wsLogoLanguageLabel)
+ .addComponent(wsBackupLabel))
.addGroup(
groupLayout
.createParallelGroup()
@@ -214,8 +227,9 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
groupLayout.createParallelGroup()
.addComponent(importWorkspaceBtn)
.addComponent(importUserBtn)))
- .addComponent(wsLocation).addComponent(languageSelection)
- .addComponent(nOfBackupsSelecteion))).addComponent(userCreatable));
+ .addComponent(wsLocation)
+ .addComponent(languageSelection).addComponent(logoLanguageSelection)
+ .addComponent(nOfBackupsSelection))).addComponent(userCreatable));
}
@Override
@@ -303,14 +317,29 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
}).run();
}
});
+
+ /*
+ * LOGO LANGUAGE
+ */
+
+ logoLanguageSelection.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent arg0) {
+ new Thread(new Runnable(){
+ public void run() {
+ LogoLanguage lang = (LogoLanguage) logoLanguageSelection.getSelectedItem();
+ changeLogoLanguage(lang);
+ }
+ }).run();
+ }
+ });
/*
* BACKUP VERSIONS
*/
- nOfBackupsSelecteion.addActionListener(new ActionListener(){
+ nOfBackupsSelection.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent arg0) {
- NumberOfBackups n = (NumberOfBackups) nOfBackupsSelecteion.getSelectedItem();
+ NumberOfBackups n = (NumberOfBackups) nOfBackupsSelection.getSelectedItem();
WSManager.getInstance().getWorkspaceConfigInstance().setNumberOfBackups(n);
}
});
@@ -354,10 +383,12 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
// Language
languageSelection.setSelectedItem(wc.getLanguage());
+ logoLanguageSelection.setSelectedItem(wc.getLogoLanguage());
changeLanguage(wc.getLanguage());
+ changeLogoLanguage(wc.getLogoLanguage());
// Backups
- nOfBackupsSelecteion.setSelectedItem(wc.getNumberOfBackups());
+ nOfBackupsSelection.setSelectedItem(wc.getNumberOfBackups());
// User Creation
userCreatable.setSelected(wc.isUserCreationAllowed());
@@ -375,7 +406,8 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
removeUserBtn.setEnabled(false);
importUserBtn.setEnabled(false);
languageSelection.setEnabled(false);
- nOfBackupsSelecteion.setEnabled(false);
+ logoLanguageSelection.setEnabled(false);
+ nOfBackupsSelection.setEnabled(false);
userCreatable.setEnabled(false);
}
@@ -391,7 +423,8 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
removeUserBtn.setEnabled(true);
importUserBtn.setEnabled(true);
languageSelection.setEnabled(true);
- nOfBackupsSelecteion.setEnabled(true);
+ logoLanguageSelection.setEnabled(true);
+ nOfBackupsSelection.setEnabled(true);
userCreatable.setEnabled(true);
}
@@ -497,10 +530,19 @@ public class WorkspaceTab extends AbstractWorkspacePanel {
}
}
+ private void changeLogoLanguage(LogoLanguage lang) {
+ WorkspaceConfig wc = WSManager.getInstance().getWorkspaceConfigInstance();
+
+ if (wc.getLogoLanguage() != lang) {
+ wc.setLogoLanguage(lang);
+ }
+ }
+
protected void setText() {
workspaceLabel.setText(Logo.messages.getString("ws.settings.workspace"));
wsLocationLabel.setText(Logo.messages.getString("ws.settings.location"));
wsLanguageLabel.setText(Logo.messages.getString("ws.settings.language"));
+ wsLogoLanguageLabel.setText(Logo.messages.getString("ws.settings.logolanguage"));
wsBackupLabel.setText(Logo.messages.getString("ws.settings.backups"));
userLabel.setText(Logo.messages.getString("ws.settings.user"));
addWorkspaceBtn.setText(Logo.messages.getString("ws.settings.add"));
diff --git a/logo/src/xlogo/kernel/Kernel.java b/logo/src/xlogo/kernel/Kernel.java
index 2a33841..6777df6 100644
--- a/logo/src/xlogo/kernel/Kernel.java
+++ b/logo/src/xlogo/kernel/Kernel.java
@@ -33,7 +33,7 @@ import java.awt.Color;
import xlogo.kernel.userspace.UserSpace;
import xlogo.storage.user.DrawQuality;
-import xlogo.storage.workspace.Language;
+import xlogo.storage.workspace.LogoLanguage;
/**
* Title : XLogo
* Description : XLogo is an interpreter for the Logo
@@ -144,9 +144,9 @@ public class Kernel
app.getDrawPanel().initGraphics();
}
- public void buildPrimitiveTreemap(Language lang)
+ public void buildPrimitiveTreemap(LogoLanguage lang)
{
- primitive.buildPrimitiveTreemap(lang);
+ Primitive.buildPrimitiveTreemap(lang);
}
public String execute(StringBuffer st) throws LogoError
diff --git a/logo/src/xlogo/kernel/Primitive.java b/logo/src/xlogo/kernel/Primitive.java
index 2f01664..b6f2aa5 100644
--- a/logo/src/xlogo/kernel/Primitive.java
+++ b/logo/src/xlogo/kernel/Primitive.java
@@ -46,8 +46,9 @@ import java.math.BigDecimal;
import xlogo.kernel.LoopProperties;
import xlogo.messages.async.history.HistoryMessenger;
import xlogo.storage.WSManager;
-import xlogo.storage.workspace.Language;
+import xlogo.storage.workspace.LogoLanguage;
import xlogo.utils.Utils;
+import xlogo.AppSettings;
import xlogo.Application;
import java.io.*;
@@ -75,6 +76,9 @@ public class Primitive
// Treemap for primitives (better efficiency in searching)
public static TreeMap<String, String> primitives = new TreeMap<String, String>();
+ public static String EXAMPLE_PROGRAM = "repeat 4 [fd 100 rt 90]";
+ public static String TO = "to";
+ public static String END = "end";
public static Stack<LoopProperties> stackLoop = new Stack<LoopProperties>();
@@ -86,7 +90,7 @@ public class Primitive
{
this.app = app;
// build treemap for primitives
- buildPrimitiveTreemap(WSManager.getInstance().getWorkspaceConfigInstance().getLanguage());
+ buildPrimitiveTreemap(AppSettings.getInstance().getLogoLanguage());
}
/**
@@ -143,12 +147,17 @@ public class Primitive
}
// Exécution des primitives
- public static void buildPrimitiveTreemap(Language lang)
+ public static void buildPrimitiveTreemap(LogoLanguage lang)
{
// this.exportPrimCSV();
primitives = new TreeMap<String, String>();
Locale locale = lang.getLocale();
ResourceBundle prim = ResourceBundle.getBundle("primitives", locale);
+
+ EXAMPLE_PROGRAM = prim.getString("pref.highlight.example");
+ TO = prim.getString("pour");
+ END = prim.getString("fin");
+
try
{
BufferedReader bfr = new BufferedReader(new InputStreamReader(
diff --git a/logo/src/xlogo/kernel/userspace/ProcedureErrorMessage.java b/logo/src/xlogo/kernel/userspace/ProcedureErrorMessage.java
index 6e26742..c914305 100644
--- a/logo/src/xlogo/kernel/userspace/ProcedureErrorMessage.java
+++ b/logo/src/xlogo/kernel/userspace/ProcedureErrorMessage.java
@@ -31,6 +31,7 @@ import java.util.ArrayList;
import java.util.Collection;
import xlogo.Logo;
+import xlogo.kernel.Primitive;
import xlogo.kernel.userspace.procedures.ProcedureErrorType;
/**
@@ -98,7 +99,9 @@ public class ProcedureErrorMessage
sb.append(procedureDescription);
sb.append(": ");
- sb.append(Logo.messages.getString(type.getDescription()));
+ sb.append(Logo.messages.getString(type.getDescription())
+ .replace("{to}", Primitive.TO)
+ .replace("{end}", Primitive.END));
return sb.toString();
}
diff --git a/logo/src/xlogo/kernel/userspace/files/LogoFile.java b/logo/src/xlogo/kernel/userspace/files/LogoFile.java
index 4575f73..47eeeb6 100644
--- a/logo/src/xlogo/kernel/userspace/files/LogoFile.java
+++ b/logo/src/xlogo/kernel/userspace/files/LogoFile.java
@@ -43,6 +43,7 @@ import org.apache.logging.log4j.Logger;
import xlogo.Logo;
import xlogo.interfaces.ErrorDetector;
import xlogo.interfaces.ProcedureMapper;
+import xlogo.kernel.Primitive;
import xlogo.kernel.userspace.ProcedureErrorMessage;
import xlogo.kernel.userspace.procedures.ExecutablesContainer;
import xlogo.kernel.userspace.procedures.Procedure;
@@ -515,7 +516,7 @@ public class LogoFile extends StorableDocument implements ExecutablesContainer,
*/
private static String untilEnd(BufferedReader br) throws IOException
{
- String end = Logo.messages.getString("fin").toLowerCase();
+ String end = Primitive.END.toLowerCase();
StringBuffer text = new StringBuffer();
String line;
diff --git a/logo/src/xlogo/kernel/userspace/procedures/Procedure.java b/logo/src/xlogo/kernel/userspace/procedures/Procedure.java
index 2e0ec38..ab50911 100644
--- a/logo/src/xlogo/kernel/userspace/procedures/Procedure.java
+++ b/logo/src/xlogo/kernel/userspace/procedures/Procedure.java
@@ -41,7 +41,6 @@ import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.*;
-import xlogo.Logo;
import xlogo.kernel.Primitive;
import xlogo.utils.Utils;
@@ -338,7 +337,7 @@ public class Procedure
StringBuffer sb = new StringBuffer();
sb.append(comment);
- sb.append(Logo.messages.getString("pour") + " " + name);
+ sb.append(Primitive.TO + " " + name);
for (int j = 0; j < nbparametre; j++)
{
sb.append(" :");
@@ -354,7 +353,7 @@ public class Procedure
}
sb.append("\n");
sb.append(instruction);
- sb.append(Logo.messages.getString("fin"));
+ sb.append(Primitive.END);
sb.append("\n");
// System.out.println("a"+sb+"a");
return new String(sb);
@@ -448,7 +447,7 @@ public class Procedure
{
String token = st.nextToken();
- if (!token.toLowerCase().equals(Logo.messages.getString("pour").toLowerCase()))
+ if (!token.toLowerCase().equals(Primitive.TO.toLowerCase()))
{
addError(ProcedureErrorType.MISSING_TO);
return;
@@ -630,8 +629,8 @@ public class Procedure
private void parseBody(BufferedReader br) throws IOException
{
StringBuffer body = new StringBuffer();
- String to = Logo.messages.getString("pour").toLowerCase() + " ";
- String end = Logo.messages.getString("fin").toLowerCase();
+ String to = Primitive.TO.toLowerCase() + " ";
+ String end = Primitive.END.toLowerCase();
instruction = null;
String line;
String lower;
diff --git a/logo/src/xlogo/storage/workspace/WorkspaceConfig.java b/logo/src/xlogo/storage/workspace/WorkspaceConfig.java
index 7ee4f26..0f2154d 100644
--- a/logo/src/xlogo/storage/workspace/WorkspaceConfig.java
+++ b/logo/src/xlogo/storage/workspace/WorkspaceConfig.java
@@ -111,7 +111,7 @@ public class WorkspaceConfig implements Serializable, Observable<WorkspaceConfig
private Language language;
private LogoLanguage logoLanguage = LogoLanguage.ENGLISH;
private boolean allowUserCreation = true;
- private ContestConfig contestSettings; // Contest //TODO create options in workspace settings
+ private ContestConfig contestSettings;
private SyntaxHighlightConfig syntaxHighlightingStyles; // TODO = new SyntaxHighlightStyles();
private Font font; // This font is the default font for all menus ... in XLogo Application
diff --git a/logo/src/xlogo/storage/workspace/WorkspaceConfigJSONSerializer.java b/logo/src/xlogo/storage/workspace/WorkspaceConfigJSONSerializer.java
index 4bb07fe..a53fab4 100644
--- a/logo/src/xlogo/storage/workspace/WorkspaceConfigJSONSerializer.java
+++ b/logo/src/xlogo/storage/workspace/WorkspaceConfigJSONSerializer.java
@@ -25,7 +25,7 @@ public class WorkspaceConfigJSONSerializer extends JSONSerializer<WorkspaceConfi
private static final String COMMENT_STYLE = "commentStyle";
private static final String COMMENT_COLOR = "commentColor";
private static final String BRACE_STYLE = "braceStyle";
- private static final String BRACE_COLOR = "braceColor"; // TODO enable syntax highlighting
+ private static final String BRACE_COLOR = "braceColor";
private static final String IS_SYNTAX_HIGHLIGHTING_ENABLED = "isSyntaxHighlightingEnabled";
private static final String CONTEST_SETTINGS = "contestSettings";
private static final String N_OF_CONTEST_BONUS_FILES = "nOfContestBonusFiles";