Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Translated all languages, Updated Language scan script #1414

Merged
merged 5 commits into from
Feb 11, 2022

Conversation

copoer
Copy link
Contributor

@copoer copoer commented Feb 9, 2022

... This will need some QA 😅

PS. I don't speak all these languages lol

@gfwilliams
Copy link
Member

Hi! I really like the idea, but there are a few issues with this PR IMO:

  • As @myxor noted a bunch of stuff has /*LANG*/ applied (eg settings) where it shouldn't be and would break those apps
  • There's stuff like status ? "on" : /*LANG*/"off"; where on should be translated too
  • I even see cases with /*LANG*//*LANG*/"string" which is obviously broken
  • Japanese/Chinese translations won't work because the default character set on Bangle.js is ISO Latin (http://www.espruino.com/Fonts#character-sets) - it can't handle Unicode. At some point it'd be possible to render these un-displayable characters into bitmaps and place them in the string, but realistically I think that's something to handle a bit down the road.

Please could you do a PR (or update this one) with just the updated language_scan tool with the translate option for now?

  • I think the actual /*LANG*/ additions need a lot of manual vetting before we can add them. Merging something like that now would instantly break half the apps!
  • In terms of the translations, I think maybe we should have a 'template' translation file that includes all the stuff we actually want translated - then we can ensure stuff like "BTNs 1:startlap 2:exit 3:reset" doesn't get put in there, and we can use that as a basis to feed into the auto-translator?

@copoer
Copy link
Contributor Author

copoer commented Feb 10, 2022

I think the actual /LANG/ additions need a lot of manual vetting before we can add them. Merging something like that now would instantly break half the apps!

I removed the auto /LANG/ stuff. I added a couple more languages.

Japanese/Chinese translations won't work because the default character set on Bangle.js is ISO Latin (http://www.espruino.com/Fonts#character-sets) - it can't handle Unicode. At some point it'd be possible to render these un-displayable characters into bitmaps and place them in the string, but realistically I think that's something to handle a bit down the road.

Potentially we could do Romanization later. https://en.wikipedia.org/wiki/Romanization

@copoer copoer changed the title Added more /*LANG*/, Auto Translated all languages, Updated Language scan script Auto Translated all languages, Updated Language scan script Feb 10, 2022
@copoer
Copy link
Contributor Author

copoer commented Feb 10, 2022

In terms of the translations, I think maybe we should have a 'template' translation file that includes all the stuff we actually want translated - then we can ensure stuff like "BTNs 1:startlap 2:exit 3:reset" doesn't get put in there, and we can use that as a basis to feed into the auto-translator?

Since we will only translate the things with /*LANG*/ manually place at the front, we can just auto translate everything so down the road there is a large library of translations that could automatically be implemented

@gfwilliams
Copy link
Member

Looks great, thanks! Just merging! I'll add something to disable the choice for chinese/japanese, but will keep the translations in there.

Romanization is an interesting thought, although given the lack of space on the display maybe it wouldn't really be sensible.

If you fancy another challenge, it shouldn't be too bad to detect non-roman words, render them to a canvas, convert them and add them to the string with:

str += "\0"+imageconverter.canvastoString(canvas, {mode:"1bit",output:"string"});

@gfwilliams gfwilliams merged commit 8c54820 into espruino:master Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants