Comments (6)
I would like to be able multiple languages, so please support lists.
I will use whatever mechanism you apply, but please support multiple option for each atom.
from jslogo.
See [1] for temporary usage.
[1] https://github.com/alonbl/jslogo/blob/36a988523b273a1e5ef86cd522e182e731bce861/translation.he.js
from jslogo.
The translation function in your example makes complete sense and is what I was expecting.
Can you give me an example of "multiple option for each atom" ? I think I'm misunderstanding.
from jslogo.
let's first begin with command aliases.
what I had in mind are the following changes:
- modify the "Procedures and Flow Control" section, each def() will have only one name, which probably be the long most complete one.
- add defAliases(name, aliases) method, or even better if you like metadata programming have it as defAlias(aliases) which is dictionary of lists.
- call defAliases at constructor to register language aliases.
- at localization it is possible to call defAliases to register even more, without modifying the core.
logo.defAliases({
"command1": ["alias11", "alias12"],
"command2": ["alias21", "alias22"]
});
from jslogo.
So we're talking about several different things here:
- Localizations on output; this is what the
__()
function hook would do. - Procedure aliases. There's no need for the API to support lists, you can just have multiple mappings. Under the hood this can just do the same thing as
copydef
. In your example:
copydef "alias11 "command1
copydef "alias12 "command1
copydef "alias21 "command2
copydef "alias22 "command2
I'm not opposed to exposing e.g. copydef()
on the interpreter object that does this.
Color names (which are HTML constants, not anything associated with Logo) can be handled at the turtle level, e.g. a translation function called whenever canvas_ctx.fillStyle
or canvas_ctx.strokeStyle
is being set.
Are there other inputs or outputs that need handling?
from jslogo.
The plumbing should be in place for these now. Let me know if these make sense.
from jslogo.
Related Issues (20)
- Codemirror not highlighting code in locales other than English HOT 4
- Ensure logo.js has full coverage by tests
- Proposal: multiple turtles HOT 2
- language.html translation?
- Localized TO & END replaced with English in Library HOT 1
- Editing on Android tablet is broken
- Export library to text or cookies? HOT 1
- Link to bfoit.org is broken HOT 2
- Add support for controlling a physical turtle HOT 2
- Tail recursion which doesn't terminate doesn't show output
- "Stop" button crashes the interpreter HOT 3
- forgeting space around variables silently crashes JSlogo interpreter HOT 2
- Spaces required inside the while statements HOT 1
- print issue HOT 1
- FR: make editor windows bigger/scalable
- Make https://people.eecs.berkeley.edu/~bh/logo-sample.html work
- Suggestion: query to find the screen size (or if position is onscreen/offscreen) HOT 14
- Proposal: canvas copy and paste functions
- Add support to step, trace, pause buttons and recall list box
- Add something to be able to react/process keyboard's presses - readchar maybe? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jslogo.