litan / kojo

The Kojo Learning Environment
http://www.kogics.net/kojo
Other
68 stars 22 forks source link

localize worksheet REPL output #18

Open bulent2k2 opened 3 years ago

bulent2k2 commented 3 years ago

In Turkish, a simple example from the scala tutorial is:

val n = new Nokta(3, 4) //> val n: Nokta = Nokta@98f03a4
n.x //> val res1: TurkishAPI.Sayı = 3

It would help readability to remove TurkishAPI. and return only the type alias (type Sayı = Int and Nokta is Turkish for Point) as follows: p.x //> val res1: Sayı

I hope this is not too involved? Either way, please let me know a few pointers and I can work on it..

litan commented 3 years ago

This is coming from the scala interpreter. To remove it, we will have to filter the interpreter output text. How important is this for your use-case?

bulent2k2 commented 3 years ago

It's cosmetic only. Not urgent. I would like to get to it eventually to reduce the clutter and keep things neat.

bulent2k2 commented 3 years ago

By the way, even for English, it would be good to filter out the UserCode.this. prefix from the type info we get with control-t (great feature BTW!). E.g.. in tangle, the last example from the tutorial, the type info on a couple of variables shows up as:

[type] p : scala.collection.immutable.Vector[UserCode.this.NodeP]
[type] edges : scala.collection.immutable.Vector[UserCode.this.EdgeP]

It would be nicer to have the simpler:

[type] p : scala.collection.immutable.Vector[NodeP]
[type] edges : scala.collection.immutable.Vector[EdgeP]