You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I forked this wonderful project in order to add the Spanish translation, and today I stumbled on this. Please excuse any inaccuracies because I'm not completely familiar with the codebase yet.
As I understand the problem arises from the CM logo lexer cm/logo.js having the English keywords hardcoded. Possible solutions that come to my mind:
Add a new lexer for each language code. Cons: too much shared code.
Attempt to monkeypatch the CodeMirror mode indent() and token() after reading the l10n file to support custom regexes.
Best, I think: programmatically generate the lexer according to the selected language and lazy loading it.
Thoughts?
The text was updated successfully, but these errors were encountered:
We really only need the keywords TRUE, FALSE, ELSE, TO and END, correct? (As an aside, the interpreter doesn't treat TRUE, FALSE and TO as keywords; perhaps it should.)
Another option that comes to mind is to have the mode's lexer have hooks that index.js can interact with, much like the interpreter itself. We could assign a keyword map to the global (window) or another object and the mode's lexer could use that rather than hardcoded regular expressions. That might be simpler.
Otherwise, I agree that programmatically generating the lexer might be easiest. I'd definitely be willing to review patches here. Thank you very much for reporting this and investigating possible options!
Since Logo is aimed at introductory programming (and kids) it is often localized, even down to the level of keywords. Particularly when the procedure library is localized, the remaining keywords — and there's only a few, listed above — really stand out.
Standardization and portability of the language was never a big concern.
Hi, I forked this wonderful project in order to add the Spanish translation, and today I stumbled on this. Please excuse any inaccuracies because I'm not completely familiar with the codebase yet.
As I understand the problem arises from the CM logo lexer
cm/logo.js
having the English keywords hardcoded. Possible solutions that come to my mind:indent()
andtoken()
after reading the l10n file to support custom regexes.Thoughts?
The text was updated successfully, but these errors were encountered: