Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

pt-BR scratch blocks error #400

Closed
freyjaodds opened this issue Feb 1, 2016 · 15 comments · Fixed by RaspberryPiFoundation/pandoc_scratchblocks#11
Closed

pt-BR scratch blocks error #400

freyjaodds opened this issue Feb 1, 2016 · 15 comments · Fixed by RaspberryPiFoundation/pandoc_scratchblocks#11

Comments

@freyjaodds
Copy link
Contributor

Practically all the scratch blocks in the new pt-BR projects are red, but the translations seem to be correct according to the scratch translation tool. I thought perhaps it's because these are the first pt-BR projects and that all of the blocks are turning out red, but then I found a couple that appear in Rock Band in the right colour so that's not the case. I guess @andylolz will take a one quick look at this and tell me the obvious error as usual :) No pressure though!

screen shot 2016-02-01 at 12 45 12

http://scratchblocks.codeclub.org.uk/translator/#script=when%20flag%20clicked%0A%09%09forever%0A%09%09%09hide%0A%09%09%09wait%20(1)%20secs%0A%09%09%09show%0A%09%09%09wait%20(1)%20secs%0A%09%09end&from=en&to=pt_BR

screen shot 2016-02-01 at 12 52 04

@freyjaodds
Copy link
Contributor Author

FYI @lgmoneda

@andylolz
Copy link
Contributor

andylolz commented Feb 1, 2016

I’m not sure… But I suspect the language in the project frontmatter needs to be set to pt_BR rather than the current pt-BR. So an underscore rather than a hyphen. I’ll test that out now to check.

UPDATE: Yeppers – ^^ it’s this ^^

@martinpeck
Copy link
Contributor

That sounds wrong. Locales use hyphens, not underscores.
Why is pr_BR considered correct here?

@andylolz
Copy link
Contributor

andylolz commented Feb 1, 2016

Locales use hyphens, not underscores.

ISO 15897 and BCP 47 seem to disagree with one another on this point.

Why is pr_BR considered correct here?

It comes from the language segment of the URLs used here:
http://translate.scratch.mit.edu

e.g.:
http://translate.scratch.mit.edu/pt_BR/

Scratchblocks adheres to the same standard:
https://github.com/tjvr/scratchblocks/blob/master/src/build_translations.py#L16-L24

…so it has propagated from there.

@martinpeck
Copy link
Contributor

So, which project front matter do you think needs updating?
All of our current project front matter has hyphens, not underscores.
Perhaps I'm missing something.

@andylolz
Copy link
Contributor

andylolz commented Feb 1, 2016

All of our current project front matter has hyphens, not underscores.

Yes. In most cases you get away with it, because of this horrible indexOf hack used here:
https://github.com/CodeClub/pandoc_scratchblocks/blob/master/scratch_template.html#L42

Another option would be to add another hack to this template, to substitute underscores for hyphens (see RaspberryPiFoundation/pandoc_scratchblocks#10.)

The least hacky solution might be to add a scratch_language_code to each of the language files here:
https://github.com/CodeClub/lesson_format/tree/master/assets/languages
…and then send that through to pandoc_scratchblocks.

@martinpeck
Copy link
Contributor

The specific example you mentioned above (Ghost Busters?) looks fixed, as do many other scratch block instances:

http://projects.codeclubworld.org/pt-BR/01_scratch_01/03/Ghostbusters.html

However, some are not:

http://projects.codeclubworld.org/pt-BR/01_scratch_01/04/ChatBot.html

@martinpeck
Copy link
Contributor

Paint Box shows that it's only certain blocks that are being missed:
http://projects.codeclubworld.org/pt-BR/01_scratch_01/05/Paint%20Box.html

@andylolz
Copy link
Contributor

andylolz commented Feb 4, 2016

Paint Box shows that it's only certain blocks that are being missed

This is a separate bug. It’s because this:
https://github.com/CodeClub/pandoc_scratchblocks/blob/master/scratchblocks2/translations-all.js

…doesn’t match this:
https://github.com/CodeClub/scratchblocks2/blob/gh-pages/translations-all.js

They probably both need updating.

@andylolz
Copy link
Contributor

andylolz commented Feb 4, 2016

Merging the following should fix the problem:

As an alternative to the last of these, the submodule could just be updated.

Also, merging CodeClub/scratchblocks2#4 will update http://scratchblocks.codeclub.org.uk/translator/ so it’s in sync.

@andylolz
Copy link
Contributor

andylolz commented Feb 8, 2016

Oops I didn’t mean to trigger this to close!

It should be fixed, but I guess lesson_format will need to be re-run for the changes to take effect.

@freyjaodds
Copy link
Contributor Author

Not to worry, Rik and I are keeping an eye on it tomorrow and we will re-open if there's still an issue :) Thanks!

@andylolz
Copy link
Contributor

This doesn’t seem to be fixed. The example @martinpeck posted above, for instance:
http://projects.codeclubworld.org/pt-BR/01_scratch_01/05/Paint%20Box.html

It works on scratchblocks translator, though. I think the current master of lesson_format should work, so I guess the version on heroku needs updating?

@rikcross rikcross reopened this Feb 17, 2016
@freyjaodds
Copy link
Contributor Author

@lgmoneda we believe this has been fixed now - I will check it tomorrow morning to make sure no red scratch blocks remain.

@andylolz thank you, you are a star!

@andylolz
Copy link
Contributor

Nice one – looks fixed to me! 🍰

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants