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

Adapted from Argentina to all Spanish countries #423

Open
wants to merge 693 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
693 commits
Select commit Hold shift + click to select a range
75ffc8d
Not show fullscreen option in challenges.
Apr 13, 2016
b36408d
Merge pull request #326 from andreiconstantinescu/fix-web-team-202
Apr 13, 2016
1e4095b
Added missing LICENSE file
skarbat Feb 8, 2016
66682f4
Fixed a termination issue that left the UI process running
skarbat Mar 15, 2016
1701192
Offline: Prevent error on exit
tombettany Apr 7, 2016
4f5e42c
Proof of concept for internationalization
japonophile Apr 27, 2016
1ee50ed
Fix issue with different paths for challenge and HTML
japonophile Apr 27, 2016
777ba40
GTM tag
Apr 28, 2016
c58d346
Merge pull request #327 from arifshanji/master
walbell May 4, 2016
cf2fb67
Continue translation of views
japonophile May 6, 2016
2f1e044
Continue translation of views
japonophile May 6, 2016
8fbce38
Continue translation of views and challenges
japonophile May 6, 2016
83680aa
Translate basic challenges
japonophile May 6, 2016
1a7374c
Translate views
japonophile May 6, 2016
2130336
Translate documentation and views
japonophile May 7, 2016
94340c7
Translate challenge
japonophile May 7, 2016
da29cae
Fix issue with docs. Translate medium challenges.
japonophile May 8, 2016
b7edc62
Complete translation of medium challenges
japonophile May 9, 2016
841647c
Start translating Pixel Hack challenges
japonophile May 10, 2016
cc4519a
Finish first translation of Pong
japonophile May 11, 2016
32daca4
Virtual page tracking with GA
May 11, 2016
a2f8fa4
Remove tracking js - unused
May 11, 2016
ef94636
Push japanese translations
japonophile May 12, 2016
e08a896
tracking calls modified
May 13, 2016
957fe9e
Proof of concept for internationalization
japonophile Apr 27, 2016
879dd98
Fix issue with different paths for challenge and HTML
japonophile Apr 27, 2016
67fb9bc
Continue translation of views
japonophile May 6, 2016
3bb4865
Continue translation of views
japonophile May 6, 2016
ed98fed
Continue translation of views and challenges
japonophile May 6, 2016
303d6bd
Translate basic challenges
japonophile May 6, 2016
c40f85b
Translate views
japonophile May 6, 2016
7a236a1
Translate documentation and views
japonophile May 7, 2016
5aa2602
Translate challenge
japonophile May 7, 2016
b37f882
Fix issue with docs. Translate medium challenges.
japonophile May 8, 2016
5a41d86
Complete translation of medium challenges
japonophile May 9, 2016
ca47fac
Start translating Pixel Hack challenges
japonophile May 10, 2016
9f46d6b
Finish first translation of Pong
japonophile May 11, 2016
41df993
Push japanese translations
japonophile May 12, 2016
b34ccea
Merge branch 'japanese_translation' of https://github.com/japonophile…
japonophile May 13, 2016
d787eb9
Add instructions regarding translations
japonophile May 13, 2016
60f4d48
Change Pong to Pon in Japanese
japonophile May 17, 2016
173370f
Merge remote-tracking branch 'upstream/jessie' into jessie
japonophile May 17, 2016
f5368a2
Merge branch 'jessie' into japanese_translation
japonophile May 17, 2016
d301a64
Ensure we have a path set before tracking
May 24, 2016
98722a3
Merge pull request #328 from arifshanji/virtualPageTracking
andreiconstantinescu May 25, 2016
4fea9fc
Changed icon background colour for Kano Apps https://github.com/KanoC…
Jun 9, 2016
3e54c89
Merge pull request #331 from radujipa/kano-apps-colour-change
pazdera Jun 9, 2016
87bf19a
Merge remote-tracking branch 'upstream/jessie' into jessie
japonophile Jul 6, 2016
2f9026d
Merge branch 'jessie' into japanese_translation_jessie
japonophile Jul 6, 2016
b9a5f8e
Ignore locales
jkimbo Aug 22, 2016
3a00e43
Return gulp stream to ensure correct timing
jkimbo Aug 22, 2016
46c0dd9
Added some tests for the i18n module
jkimbo Aug 22, 2016
dc93888
Allow overriding language using query param
jkimbo Aug 22, 2016
509f306
Added supported language list
jkimbo Aug 22, 2016
2a4c0e9
Fixed some formatting
jkimbo Aug 22, 2016
ea0e226
Define supported locales instead of just languages
jkimbo Aug 22, 2016
67d24c8
Merge pull request #332 from KanoComputing/i18n-ja-translations
jkimbo Aug 23, 2016
15e0d96
adding rgb and rgba color functions for more straightforward color cr…
alecmolloy Aug 28, 2016
f99da23
add a transparent `"rgba(0,0,0,0)"` color
alecmolloy Aug 31, 2016
69c247b
new ozwald boateng challenges
alecmolloy Sep 1, 2016
a1f1512
fixed some validator issues
alecmolloy Sep 1, 2016
5822156
Merge pull request #1 from alecmolloy/rgb+rgba
alecmolloy Sep 1, 2016
aef9a06
replacing tabs with spaces
alecmolloy Sep 1, 2016
8e2e82c
Merge pull request #333 from alecmolloy/rgb+rgba
rcocetta Sep 5, 2016
0107acb
Merge pull request #337 from KanoComputing/jessie
rcocetta Sep 5, 2016
80f7e28
Merge pull request #336 from alecmolloy/ozwaldboateng
Sep 5, 2016
e718fde
small fixes in boateng challenge copy
mikegreer Sep 6, 2016
de1ed99
fixing small copy error
alecmolloy Sep 6, 2016
a59b81e
Added translations for basic worlds
jkimbo Sep 12, 2016
67b72ce
Added translations for medium challenges
jkimbo Sep 12, 2016
24cea24
Added messages.pot file
jkimbo Sep 13, 2016
8f0f128
Added es_AR po file
jkimbo Sep 13, 2016
7194a3b
Fix up po file
jkimbo Sep 13, 2016
9e7a4c9
Added some helper scripts
jkimbo Sep 13, 2016
ff2c7b6
Fix up extract strings to include full location
jkimbo Sep 13, 2016
7e9e0b3
Added tool to extract doc strings
jkimbo Sep 13, 2016
e3fa89e
Updated scripts
jkimbo Sep 13, 2016
953a762
Added script to convert po to docs json
jkimbo Sep 13, 2016
79e1d0b
Added spanish translations
jkimbo Sep 14, 2016
eabeb6f
Moved scripts to po folder
jkimbo Sep 14, 2016
04794bb
Updated docs with translations
jkimbo Sep 14, 2016
6ce3d22
Added spanish translations
jkimbo Sep 14, 2016
ca2c8bc
Fixed json
jkimbo Sep 14, 2016
a8743b0
Added es-AR to gulpfile
jkimbo Sep 14, 2016
25c9d36
Updated docs translations
jkimbo Sep 14, 2016
ac80e6f
Added some missing translations
jkimbo Sep 14, 2016
fa7084e
Fixed some translations
jkimbo Sep 14, 2016
76e4809
Updated translations
jkimbo Sep 14, 2016
ce7fde9
Revert "Added some missing translations"
jkimbo Sep 14, 2016
be84cac
Revert "Updated translations"
jkimbo Sep 14, 2016
114a1d1
Updated the docs
jkimbo Sep 14, 2016
3cf7f09
Very minor typos on Spanish literals, fixed and validated json formats.
skarbat Sep 21, 2016
d5cbf31
Merge pull request #339 from KanoComputing/spanish-translations
Sep 21, 2016
d760c9c
Allow Summer camp all the time
Sep 21, 2016
61847bb
Merge pull request #340 from arifshanji/alwaysSummer
Sep 22, 2016
e0733f9
SDK upgrade to get SSO
Sep 27, 2016
6f1e34a
sdk get latest
Sep 27, 2016
034d78a
Merge pull request #341 from arifshanji/sdkUpgradeForSSO
Sep 27, 2016
9f39263
Merge pull request #338 from alecmolloy/patch-1
Sep 27, 2016
94069f0
add jenkinsfile
Oct 4, 2016
a9fe802
add compress task and compress dependencies
Oct 4, 2016
c4e020e
Some fixes to restore building on the kit.
Ealdwulf Oct 21, 2016
d021be2
Fixed
etamity Nov 7, 2016
e3e3d79
Fixed Cannot share if not-logged in from Make Art
etamity Nov 7, 2016
cfe50ba
Updated Hour of Code
etamity Nov 8, 2016
253477d
Merge pull request #345 from etamity/master
etamity Nov 8, 2016
a3acf6f
Return the gulp stream.
Ealdwulf Nov 8, 2016
c04b06c
Fixed staging api url
etamity Nov 8, 2016
1bfedb8
Merge pull request #346 from etamity/stage
Nov 8, 2016
b2ccef0
Replace ‘source’ to ‘.’
etamity Nov 8, 2016
bcdeb4e
Merge pull request #347 from etamity/staging
Nov 8, 2016
e3c3bfc
Another try with ‘load’
etamity Nov 8, 2016
3452bd5
Merge pull request #348 from etamity/staging
Nov 8, 2016
037df2a
Merge pull request #342 from KanoComputing/fix_kit_build
Nov 14, 2016
dab1c80
[For review and QA only]: Add modified kano-nav-bar to Make Art for t…
Nov 16, 2016
db7e4c0
[For review and QA only]: Update Readme to include Bower install
Nov 16, 2016
11d731f
Push to datalayer events fired from sdk
Nov 17, 2016
c2e4a72
use latest sdk
Nov 17, 2016
ac8d207
Merge pull request #351 from arifshanji/trackSignups
Nov 17, 2016
4f70381
Add new hero header for the PixelHack challenges
Nov 21, 2016
e7b2328
Update kano-nav dependencies with new repos, and rename components an…
Nov 22, 2016
81efca9
Add setting to config
etamity Nov 23, 2016
9042776
Merge pull request #352 from etamity/staging
Nov 23, 2016
61bec95
Merge pull request #349 from abridger/navigation-updates
Nov 23, 2016
2b4b862
Fix missing dependencies and build steps
Nov 23, 2016
28a62be
Merge branch 'master' of github.com:KanoComputing/make-art into navig…
Nov 23, 2016
6b0b6da
Merge pull request #353 from abridger/navigation-updates
Nov 24, 2016
70dd33e
Fix navigation issues
Nov 24, 2016
caa6c24
Update World URL to use config value
Nov 29, 2016
23fd260
Merge pull request #354 from abridger/navigation-fixes
Nov 29, 2016
d74d385
Challenge fix
Nov 30, 2016
c60cb62
code formatting
Nov 30, 2016
ee5c399
Merge pull request #355 from arifshanji/fixPHchallenge
pazdera Nov 30, 2016
8ae2562
Move component import to index head
Nov 30, 2016
3aee9b3
Merge pull request #356 from abridger/master
Nov 30, 2016
ec54fc3
Challenge fixes
Nov 30, 2016
c58ff56
formatting
Nov 30, 2016
a29070f
Merge pull request #357 from arifshanji/fixChallenges
vikdoro Nov 30, 2016
b50e7d3
More challenge fixes with validation
Dec 1, 2016
ebe44c6
Merge pull request #358 from arifshanji/fixChallenges
vikdoro Dec 1, 2016
182ee17
Fixes to challenges
Dec 1, 2016
332eb12
Merge pull request #359 from arifshanji/fixChallenges
Dec 1, 2016
777042d
Fix challenge
Dec 1, 2016
ec468af
Merge pull request #360 from arifshanji/fixChallenges
Dec 1, 2016
834150b
Challenge fix bow and arrow
Dec 1, 2016
ec5c7fd
Merge pull request #361 from arifshanji/fixChallenges
Dec 1, 2016
ccb8b53
fishing challenge fix
Dec 1, 2016
00e7664
Merge pull request #362 from arifshanji/fixChallenges
Dec 1, 2016
19efdcd
Hiking challenge fix
Dec 1, 2016
3735532
Merge pull request #363 from arifshanji/fixChallenges
Dec 1, 2016
94783f4
CLI: Provide CLI args for challenges/playground launch
tombettany Nov 16, 2016
4de7f55
Added one-pager about the pixel hack
Dec 5, 2016
557eab4
Merge pull request #364 from arifshanji/PixelHackOnePager
Dec 5, 2016
3b14fda
Filename update
Dec 5, 2016
52f97f7
Merge pull request #365 from arifshanji/PixelHackOnePager
Dec 5, 2016
dd2d31c
Adding a priority field for Dashboard apps order
skarbat Dec 7, 2016
ce5476c
Adding kano-app-launcher wrapper
skarbat Dec 7, 2016
0c759da
Merge pull request #366 from KanoComputing/dashboard-order
skarbat Dec 7, 2016
47ae7b2
Icon: Update icon for one originally in Dashboard
tombettany Dec 9, 2016
969533e
Fire page tracking only if the route is valid, with content – ie. not…
Dec 15, 2016
eec2ec3
Bump kano-world-sdk dependency
pazdera Dec 21, 2016
be26e01
Merge pull request #369 from KanoComputing/pazdera-patch-1
Dec 21, 2016
25dbf83
Merge pull request #368 from abridger/tracking
Dec 22, 2016
03821ba
Fix auth issues on staging
vikdoro Jan 6, 2017
9ca722b
Merge pull request #370 from vikdoro/logout-issue-staging
Jan 6, 2017
e6dca39
Update sdk
vikdoro Jan 10, 2017
815c21f
Merge pull request #371 from vikdoro/sdk-update
Jan 10, 2017
c5ce266
Update tracking
Jan 11, 2017
9d10721
Merge pull request #372 from abridger/tracking
vikdoro Jan 12, 2017
717a94e
Remove trackEvent listener
Jan 13, 2017
757086b
Merge pull request #373 from abridger/tracking
vikdoro Jan 13, 2017
9e9af21
Add google-site-verification tag
Jan 17, 2017
d273b52
Merge pull request #374 from abridger/meta
etamity Jan 19, 2017
4139906
Export pot files to a new package.
Ealdwulf Jan 23, 2017
bf8a342
Merge pull request #378 from KanoComputing/generate_pot
Jan 27, 2017
8c3d9be
Change Kano World landing URL
vikdoro Jan 27, 2017
f51ce22
Merge pull request #379 from vikdoro/world-redirection-fix
Jan 27, 2017
fbed325
Standardise avatars used with other properties
Feb 1, 2017
3fce349
Fix authentication issues
Feb 1, 2017
dd9269f
Add signup link to the nav
Feb 3, 2017
9424d54
“by” translated in share cards
brandonjackson Feb 3, 2017
a1b205f
splash screen translation added
brandonjackson Feb 3, 2017
484f019
new translated challenges added
brandonjackson Feb 4, 2017
2e68e28
final challenge translations
brandonjackson Feb 6, 2017
b509c94
Merge pull request #380 from abridger/avatars
vikdoro Feb 6, 2017
5174301
Merge pull request #381 from abridger/auth
vikdoro Feb 6, 2017
f85105c
pixel hack update form removed from translated page
brandonjackson Feb 6, 2017
b4a42d0
lang translations added to locale json files (still not in PO files!)
brandonjackson Feb 6, 2017
135b39e
removing PO outdated files…
brandonjackson Feb 6, 2017
3e6fc31
Merge pull request #383 from brandonjackson/final-i18n
Feb 6, 2017
208c554
Fix conflicts
Feb 6, 2017
fafe873
Resolve conflicts
Feb 6, 2017
33ec66d
Remove those pesky hashes
Feb 6, 2017
6adfacc
Merge pull request #382 from abridger/nav-bar
pazdera Feb 6, 2017
0cd8993
Load splash in the view
Feb 6, 2017
42c4af0
Merge pull request #384 from paulvarache/i18n
brandonjackson Feb 7, 2017
ab9df0e
utf-8 encoding added to all argentina challenge files
brandonjackson Feb 7, 2017
553f174
Merge pull request #385 from brandonjackson/utf8-fix
Feb 7, 2017
03d1899
Force user update after signup, and call loadUserProfile & loadProgre…
Feb 8, 2017
164cdab
Merge pull request #386 from abridger/auth-fixes
Feb 8, 2017
fdc01b0
Fix auth issues
Feb 8, 2017
95ed015
Update login methods, to simply save the user and token that have alr…
Feb 9, 2017
78f5a40
Remove console log
Feb 9, 2017
90211ba
Merge pull request #387 from abridger/auth-fixes
vikdoro Feb 9, 2017
2eceb58
Prevent splash modal displaying more than once per session, and only …
Feb 9, 2017
11b01b6
Merge branch 'master' into popup
Feb 9, 2017
883f675
Merge pull request #388 from abridger/popup
Feb 9, 2017
84d871f
Ensure that pop-up fires
Feb 9, 2017
479d7aa
Merge branch 'popup' of github.com:abridger/make-art into popup
Feb 9, 2017
0e4c13b
Merge branch 'master' of github.com:KanoComputing/make-art into popup
Feb 9, 2017
ae9477e
Remove log
Feb 9, 2017
ffbe31b
Merge pull request #389 from abridger/popup
Feb 9, 2017
d0e3a2e
Add missing dependency
Feb 13, 2017
0ffa6ad
Merge pull request #390 from abridger/master
vikdoro Feb 13, 2017
3647cc2
Add other missing dependency
Feb 13, 2017
08d1386
Merge pull request #391 from abridger/master
vikdoro Feb 13, 2017
3ea7502
RPi: Fix build for Kano OS
tombettany Feb 15, 2017
b2b5c1e
Merge pull request #393 from KanoComputing/fix-kit-build
Feb 15, 2017
10b59ea
Add Spanish .app file
Ealdwulf Feb 15, 2017
f1939d4
fixed json for medium challenge 1
brandonjackson Feb 22, 2017
f345562
Merge pull request #395 from KanoComputing/fix-shrinking-challenge
brandonjackson Feb 22, 2017
43f25dd
changes made to validation code in es_AR challenges
brandonjackson Feb 22, 2017
b54ecbe
i18n error messages
brandonjackson Feb 23, 2017
c7925b8
translated “you’ve earned {int} XP”
brandonjackson Feb 24, 2017
69b7033
Removed text from splash asset for i18n (#399)
skarbat Feb 24, 2017
8f74c86
Merge pull request #398 from KanoComputing/i18n-xp
brandonjackson Feb 24, 2017
ac69f5f
Merge pull request #397 from KanoComputing/error-i18n
Feb 24, 2017
8ca0691
Restored English text on splash screen
May 3, 2017
9a3277d
Removed app dialog before the app itself (Make/Play/Social)
May 10, 2017
da8000b
Speed up load times (#404)
skarbat Jun 7, 2017
2e03e1a
i18n: Port Pixel Hack en_US validation fixes to es_AR
tombettany Jul 25, 2017
ca18c8e
i18n: Fix spelling of "ellipse" in es_AR
tombettany Jul 25, 2017
0d4422e
Debian: Bump package version
tombettany Jul 25, 2017
578fc8e
Debian: Bump package version
tombettany Jul 25, 2017
969c475
Updated es_AR trasnlations of nearly all challenges
Oct 16, 2017
ab5ac7a
Bumped changelog with applied changes from v3.9.2 es_AR backports
Oct 16, 2017
369d7e2
Replaced splash window for animation (#411)
skarbat Nov 16, 2017
0c5e3cd
RPi: Serve homepage for /challenge/.* routes
tombettany Nov 30, 2017
c647817
Change to 6.10.x of node.
Ealdwulf Dec 4, 2017
281a712
RPi: Build using Node 6
tombettany Dec 7, 2017
bc909f4
Bower: Resolve bower install conflicts
tombettany Dec 15, 2017
dd80ab3
Update dependency instead of providing a resolution
pazdera Dec 22, 2017
572df15
Merge pull request #416 from KanoComputing/fix_build
Dec 22, 2017
1272922
Fix instruction to press BACKSPACE rather than type it
radujipa Dec 21, 2017
0f33499
Disabled calls to kano.profiling
radujipa Jan 31, 2018
c2029f1
Fixing the build
pazdera Feb 16, 2018
590ea1f
Merge branch 'master' into fix-build
pazdera Feb 16, 2018
1b4e9ba
Merge pull request #420 from pazdera/fix-build
tombettany Feb 16, 2018
40c7539
It is better to use "es" instead of "es-AR" in order to have automati…
carlogarro Feb 22, 2018
25261f9
I also had to modify all the directories and some files with the "es-…
carlogarro Feb 22, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ root = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,json}]
[*.{js,json, styl, jade}]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
insert_final_newline = true
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
www/*.html
www/*/*.html
www/**/*.html
www/css/*.css
www/js/index.js
www/assets/challenges/descriptors
www/components/**/**
.tmp
node_modules
npm-debug.log
**.DS_Store
**.sublime-workspace
*.pyc
*.swp
dist
dist
bower_components
55 changes: 55 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!groovy
node {
stage('check environment') {
if (env.BRANCH_NAME=="master" || env.BRANCH_NAME=="jenkins") {
env.NODE_ENV = "staging"
} else if (env.BRANCH_NAME=="prod") {
env.NODE_ENV = "production"
}

if (env.NODE_ENV == "staging") {
load "/var/lib/jenkins/userContent/make-art-config/staging.env"
} else if (env.NODE_ENV == "production") {
load "/var/lib/jenkins/userContent/make-art-config/prod.env"
}
}

stage('checkout') {
checkout scm
}

stage('clean') {
sh "rm -rf node_modules"
}

stage('install dependencies') {
sh "npm install --ignore-scripts"
sh "bower i"
}

stage('build') {
sh "gulp default"
}

stage('compress') {
sh "gulp compress"
}

stage('deploy') {
if (env.BRANCH_NAME == "jenkins") {
echo 'deploy skipped'
} else if (env.NODE_ENV=="staging") {
deploy_staging()
} else if (env.NODE_ENV=="production") {
deploy_prod()
}
}
}

def deploy_staging() {
sh 'aws s3 sync ./www s3://art-staging.kano.me --region eu-west-1 --cache-control "max-age=600"'
}

def deploy_prod() {
sh 'aws s3 sync ./www s3://make-art-site-prod --region us-west-1 --cache-control "max-age=600"'
}
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ You can try the app [here »](http://art.kano.me/)
git clone [email protected]:KanoComputing/make-art.git
cd make-art
npm install
bower install

## Build

Expand All @@ -29,3 +30,24 @@ Open your browser at [http://localhost:3000](http://localhost:3000)
Run the watch script when developing

npm run watch

## Offline

To build in the offline mode for Kano OS add these ENV vars:

OFFLINE=true NODE_ENV=production gulp

Since Node JS isn't included by default on the kit and the offline backend is
[implemented in Python](/kano_draw/server.py), the easiest way to
debug on the kit is to build the static assets on your machine and rsync them
over to the kit as follows:

rsync -av make-art "user@ip:~/make-art"

On Kano OS, go to the `bin/` directory and launch the `kano-draw` script
which will start the server and open a
[python-webkit](https://wiki.python.org/moin/PythonWebKit) browser with Make
Art.

user@kano-os ~ $ cd ~/make-art/bin
user@kano-os ~ $ cd ./kano-draw
52 changes: 52 additions & 0 deletions TRANSLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Translation

Translation files are found in the following directories:
- `lib/challenges/locales`: translation of the challenges
- `locales`: translation of the views
- `content/docs.json`: translation of the documentation

## i18n not released yet

Kano OS is not fully i18n-aware and locales are not installed for end users, yet. You can translate this application, but as of now, users will still see the default English message strings.

## Build

Translations are part of the normal build process: when you type `npm run build`, the translated challenges and docs will be copied in the `www` directory; and the view templates will be localized by mapping the resources _for each language_. So it means that all resources (views, challenges and docs translations) are prepared in advance.

## Runtime

At runtime, the proper translation will be picked based on the browser language.

## How to add a new translation

You need to add the new language in 4 places:

1. Create `lib/challenges/locales/<locale>` and copy the whole `worlds` directory and `index.json`
These are the translations of the challenges, the main content of Make-Art.

2. Create new .po files for each locale - one from the `messages.pot` and one
from the `messages-doc.pot`. These are the translations of the views and
documentation.

3. After translation run the `po/lang-po-to-json` and `po/lang-docs-po-to-json`
to create the necessary json files from the po files.

4. Add your language to `SUPPORTED_LOCALES` array in `lib/i18n.js`

## How to make sure your code is i18n-aware

For the challenges, if you create a new challenge in English, there is nothing special to do, it can be translated to other languages by copying the .json file to the other locales directories.

For the views (jade templates), you need to enclose all your strings in `${{` and `}}$` as this is the convention used by gulp-html-i18n plugin to find and replace the messages in the view templates. Then, you need to add the new string to the corresponding .json file in the (top-level) `locales` directory. Let's say you want to add a string "Happy Birthday" to the challenge.jade template; you would write it as follows in the challenge.jade: `${{ challenge.hapy_birthday }}$`. Then, you would add an entry to the challenge.json map, like:
```
{
...
"happy_birthday": "Happy Birthday"
}
```

Finally, for the documentation, if you add / modify text in `content/docs.json` the translations will need to be added for other languages, in the same file.

## To-Do

Tool to make it easier to add new languages.
87 changes: 76 additions & 11 deletions bin/kano-draw
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
#!/usr/bin/kano-splash /usr/share/kano-draw/media/splash.png /usr/bin/env python
#!/usr/bin/kano-splash loader-animation /usr/bin/env python

# kano-draw
#
# Copyright (C) 2014 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
# Copyright (C) 2014-2018 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# The Draw App implementation
#

# Before loading anything else, declare a profiling timepoint
from kano.profiling import declare_timepoint
declare_timepoint("load",True)
# from kano.profiling import declare_timepoint
# declare_timepoint("load", True)

import os
import sys
import multiprocessing
import signal
import time
import atexit

if __name__ == '__main__' and __package__ is None:
DIR_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
Expand All @@ -26,14 +28,56 @@ if __name__ == '__main__' and __package__ is None:
from kano_profile.tracker import Tracker
kanotracker = Tracker()

from kano.utils import run_cmd
from kano.logging import logger
from kano_draw.video import play_intro
from kano_draw.draw import Draw
from kano_draw.draw import start_draw
import kano_draw.server

SERVER_PROC = None
UI_PROC = None


def _kill_subprocess(proc_handle):
if proc_handle is not None and proc_handle.is_alive():
proc_handle.terminate()
os.kill(proc_handle.pid, signal.SIGKILL)


def _kill_lingering_processes():
""" Look for processes still attached to port 8000 whose name starts with
'dbus-' and kill them
"""
pid_no, dummy, dummy2 = run_cmd(
"lsof -i :8000 | grep 'dbus-' | awk '{ print $2 }'"
)
if pid_no:
pids = pid_no.splitlines()
for pid in pids:
try:
os.kill(int(pid), signal.SIGTERM)
except ValueError:
pass


def _at_exit_hook():
""" Ensure that the two subprocesses are killed before this process exits
"""
_kill_subprocess(UI_PROC)
# Give the server subprocess 10 secs to die
SERVER_PROC.join(5)
# Now kill it anyway
_kill_subprocess(SERVER_PROC)
# Cleanup the lingering processes (usually produced by omxplayer)
_kill_lingering_processes()


# At this point cleaning up just exits. This is triggered once the server
# (which is a child process) notifies us to exit
def cleanup(signum, frame):
sys.exit(0)

atexit.register(_at_exit_hook)
signal.signal(signal.SIGINT, cleanup)

play_intro()
Expand All @@ -44,12 +88,33 @@ SERVER_PROC = multiprocessing.Process(target=kano_draw.server.start,
kwargs={
'parent_pid': APP_PID
})
SERVER_PROC.daemon = True
SERVER_PROC.start()

# Init the web app
kwargs = {}
if len(sys.argv) > 1:
DRAW = Draw(load_path=sys.argv[1])
else:
DRAW = Draw()
DRAW.run()
arg = sys.argv[1]

if arg == 'make':
kwargs['make'] = True
elif arg == 'play':
kwargs['play'] = True
else:
kwargs['load_path'] = arg

UI_PROC = multiprocessing.Process(target=start_draw, kwargs=kwargs)

UI_PROC.daemon = True
UI_PROC.start()

# This process is really a factory/watchdog process. It launches the UI and
# server processes as children and makes sure to terminate both once they have
# one of them has been terminated
try:
while UI_PROC.is_alive() and SERVER_PROC.is_alive():
time.sleep(3)
sys.exit(0)
except Exception as exc:
# the SIGINT handler has executed here
logger.error('Error while in the main waiting loop: [{}]'.format(exc))
sys.exit(0)
28 changes: 28 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "make-art",
"description": "App to learn programming using a basic CoffeeScript drawing API",
"main": "lib/index.js",
"authors": [
"Kano Computing"
],
"license": "MIT2",
"homepage": "http://art.kano.me/challenges",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"web-components": "[email protected]:KanoComputing/web-components",
"iron-image": "PolymerElements/iron-image#^1.2.5"
},
"resolutions": {
"iron-image": "^2.1.2",
"iron-flex-layout": "^2.0.0",
"polymer": "1.9 - 2",
"webcomponentsjs": "^v1.0.19"
}
}
Loading