Discuss Scratch

mobluse
Scratcher
100+ posts

BASIC (programming language) in the Scratch 2 Editor

This should be BASIC using the Scratch 2 editor. Load the po-file below using Shift+Click on Globe (Language) and choose “import translation file”. It has been inspired by several BASICs: Sinclair BASIC for ZX81 and ZX Spectrum, MMBASIC for Maximite and Duinomite, De Re BASIC for Android, and TI-BASIC for TI-82, TI-83, and TI-84 Plus. This was made mostly for fun but it could be used by anyone who wants to learn BASIC coming from Scratch2 or vice versa.

https://raw.githubusercontent.com/mobluse/scratch-translation/master/basic/blocks/blocks.po

Problems during translation:
  1. One cannot change the order of arguments and this leads to some strange constructions.
  2. “all” is used in two different ways and needs to be differentiated:
    * delete %d.listDeleteItem of %m.list
    * stop %m.stop
  3. The arguments (starting with %) cannot be preceded or followed by any delimiter. They can be preceded by “:” and “ ” and followed by “?”, “%”, and “ ”. Is there any documentation about what works?
  4. Some arguments to the blocks, such as function names, are in the editor.po file. I copied those to the end of my po-file.

Last edited by mobluse (May 3, 2017 14:25:21)

GrannyCookies
Scratcher
100+ posts

BASIC (programming language) in the Scratch 2 Editor

Cool! I find them easier to read than normal Scratch xD
blob8108
Scratcher
1000+ posts

BASIC (programming language) in the Scratch 2 Editor

My goodness, I find this hilarious We should add this to scratchblocks…anyone want to send a Pull Request?
GunChleoc
Scratcher
500+ posts

BASIC (programming language) in the Scratch 2 Editor

Fun

I found an inconsistency (yes, programmers do nitpick):

msgid “next backdrop”
msgstr “BACKDROP+1”

msgid “next costume”
msgstr “LET COSTUME = COSTUME + 1”

So, change the first one to:

msgid “next backdrop”
msgstr “LET BACKDROP = BACKDROP + 1”
mobluse
Scratcher
100+ posts

BASIC (programming language) in the Scratch 2 Editor

GunChleoc wrote:

So, change the first one to:

msgid “next backdrop”
msgstr “LET BACKDROP = BACKDROP + 1”
Good catch! I've changed it now, and moved it to GitHub, see first post. I also changed some other inconsistent translations.

@blob8108 Can you say which file or files should be changed to add the BASIC programming language? It would be good if there where a translater from a po-file to your internal format.

Last edited by mobluse (May 3, 2017 22:27:57)

blob8108
Scratcher
1000+ posts

BASIC (programming language) in the Scratch 2 Editor

@mobluse Ah, but there already is! Have a look at this: https://github.com/scratchblocks/scratchblocks/blob/master/src/build_translations.py
Currently it downloads the po files, so it'd need some hacking to read one off the disk instead. :-)
mobluse
Scratcher
100+ posts

BASIC (programming language) in the Scratch 2 Editor

blob8108 wrote:

@mobluse Ah, but there already is! Have a look at this: https://github.com/scratchblocks/scratchblocks/blob/master/src/build_translations.py
Currently it downloads the po files, so it'd need some hacking to read one off the disk instead. :-)

I changed my repository so that it should be compatible with https://translate.scratch.mit.edu/ , then one only has to fix the url so that it gets from my repository if lang basic is not in http://translate.scratch.mit.edu/download/{lang}/{proj}/{name}.po: https://raw.githubusercontent.com/mobluse/scratch-translation/master/{lang}/{proj}/{name}.po . I think one needs nested try, but I don't know enough about Python at this time to write that.

I needed to create https://raw.githubusercontent.com/mobluse/scratch-translation/master/basic/editor/editor.po from my blocks.po since your script requires this. One could change the script so that the dictionaries blocks and editor are concatenated before, and that a missing editor.po is ignored since then all information should be in blocks.po.

I saw that https://translate.scratch.mit.edu/ is to be shut down because it's obsolete. So you may want to store the downloaded translations.

Last edited by mobluse (May 3, 2017 14:57:27)

blob8108
Scratcher
1000+ posts

BASIC (programming language) in the Scratch 2 Editor

mobluse wrote:

I saw that https://translate.scratch.mit.edu/ is to be shut down because it's obsolete.
Yeah. I'm hoping at some point someone will rewrite that script using the Transifex API :-) https://github.com/scratchblocks/scratchblocks/issues/214
GunChleoc
Scratcher
500+ posts

BASIC (programming language) in the Scratch 2 Editor

It could probably be handled the same way that meow and food languages are handled - Transifex doesn't have locales for those, so I guess they will need to be added to the repository while bypassing Transifex. I don't know which repository to hook this into though.

https://github.com/LLK

Maybe the scratch team would be interested in having this as an official joke language, since it's educational and has to do with programming?
chrisg
Scratcher
100+ posts

BASIC (programming language) in the Scratch 2 Editor

blob8108 wrote:

mobluse wrote:

I saw that https://translate.scratch.mit.edu/ is to be shut down because it's obsolete.
Yeah. I'm hoping at some point someone will rewrite that script using the Transifex API :-) https://github.com/scratchblocks/scratchblocks/issues/214

Just saw this - sorry, I was away and not checking forums. translate.scratch.mit.edu is about to be shut down mostly so that people who have missed all the messages don't keep doing translations there. It looks like you cache the translations, so the script won't break if translate.scratch.mit.edu is not available, but maybe it would be better to leave it there until a Transifex solution is ready.

The repo that is updated from Transifex is https://github.com/LLK/scratchr2_translations. The blocks and editor have been combined into one po file: https://github.com/LLK/scratchr2_translations/tree/master/legacy/editor/static/locale

It can be included either as a node module or as a git submodule. As @GunChleoc said meow and edible scratch are handled as files in this repo (they're not updated from Transifex). I'll also let the team know about the BASIC language.


Powered by DjangoBB