FikaScript lets you write JavaScript in Swedish; Finally there is a way for Swedes to code in their native language!
It is named after fika, the sacred Swedish coffee break.
See it in action here.
- Include fikascript.js and fikascript.browser.js.
- Make sure your html is set to allow utf-8 characters (add
<meta charset="utf-8">
in the<head>
).
FikaScript supports the text/fikascript
MIME type. Any script tag with that type will be compiled and run automatically:
<script type="text/fikascript">
om (x < 5) {
konsol.log("hej!");
} annars {
konsol.log("nej!");
}
</script>
You can also specify a src
for your script tags:
<script type="text/fikascript" src="snaps.fika"></script>
FikaScript.swedishToEnglish(code); // returns a string representing the translated code
FikaScript.englishToSwedish(code); // returns a string representing the translated code
You can see the translations over here. Feel free to submit a pull request!
###TO-DOs
- Syntax highlighting for unicode chars
- npm support for command line compiling
- Add more translations!!! (ex: Array.pop, push, etc...)