convert-layout icon indicating copy to clipboard operation
convert-layout copied to clipboard

Change layouts map format

Open Jokero opened this issue 10 years ago • 0 comments

Now:

var convert = require('./convert');

var map = {
    'q': 'й',
    'w': 'ц',
    'e': 'у',
    'r': 'к',
    't': 'е',
    'y': 'н',
    'u': 'г',
    'i': 'ш',
    'o': 'щ',
    'p': 'з',
    '[': 'х',
    '{': 'Х',
    ']': 'ъ',
    '}': 'Ъ',
    '|': '/',
    '`': 'ё',
    '~': 'Ё',
    'a': 'ф',
    's': 'ы',
    'd': 'в',
    'f': 'а',
    'g': 'п',
    'h': 'р',
    'j': 'о',
    'k': 'л',
    'l': 'д',
    ';': 'ж',
    ':': 'Ж',
    "'": 'э',
    '"': 'Э',
    'z': 'я',
    'x': 'ч',
    'c': 'с',
    'v': 'м',
    'b': 'и',
    'n': 'т',
    'm': 'ь',
    ',': 'б',
    '<': 'Б',
    '.': 'ю',
    '>': 'Ю',
    '/': '.',
    '?': ',',
    '@': '"',
    '#': '№',
    '$': ';',
    '^': ':',
    '&': '?'
};

module.exports = convert(map);

My suggestion (like on keyboard, easy to see missing character or mistake):

var convert = require('./convert');

/* eslint-disable max-len, indent */

var map = {
    '`': 'ё', // without Shift
    '~': 'Ё', '@': '"', '#': '№', '$': ';', '^': ':', '&': '?', // with Shift

    'q': 'й', 'w': 'ц', 'e': 'у', 'r': 'к', 't': 'е', 'y': 'н', 'u': 'г', 'i': 'ш', 'o': 'щ', 'p': 'з', '[': 'х', ']': 'ъ',
                                                                                                        '{': 'Х', '}': 'Ъ', '|': '/',

    'a': 'ф', 's': 'ы', 'd': 'в', 'f': 'а', 'g': 'п', 'h': 'р', 'j': 'о', 'k': 'л', 'l': 'д', ';': 'ж', "'": 'э',
                                                                                              ':': 'Ж', '"': 'Э',

    'z': 'я', 'x': 'ч', 'c': 'с', 'v': 'м', 'b': 'и', 'n': 'т', 'm': 'ь', ',': 'б', '.': 'ю', '/': '.',
                                                                          '<': 'Б', '>': 'Ю', '?': ','
};

/* eslint-enable max-len, indent */

module.exports = convert(map);

Jokero avatar Nov 20 '15 20:11 Jokero