Skip to content

Instantly share code, notes, and snippets.

@mnjul
Created December 9, 2014 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnjul/734ed5543bc1368f38db to your computer and use it in GitHub Desktop.
Save mnjul/734ed5543bc1368f38db to your computer and use it in GitHub Desktop.
'use strict';
// put this Node JS file in ./gaia/apps/keyboard/ and run.
// this script iterates through and parses layout js files and lists if
// we support a specific keyboard layout, which IMEngine that layout uses,
// and if dictionary is available (by this auto correction and prediction works)
let fs = require('fs');
const LAYOUTS_DIR = 'js/layouts/';
// dummies
const KeyEvent = {};
const KeyboardEvent = {};
let Keyboards = {};
fs.readdirSync(LAYOUTS_DIR).forEach(function(js_filename){
let layout_js =
fs.readFileSync(LAYOUTS_DIR + js_filename, {encoding: 'utf-8'});
eval(layout_js);
});
Object.keys(Keyboards).forEach(function(key){
var layout = Keyboards[key];
console.log(key + "," +
layout.label + "," +
layout.imEngine + "," +
layout.autoCorrectLanguage);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment