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

Translation of keys #267

Open
yeco96 opened this issue May 8, 2017 · 0 comments
Open

Translation of keys #267

yeco96 opened this issue May 8, 2017 · 0 comments

Comments

@yeco96
Copy link

yeco96 commented May 8, 2017

Edit the map variable in the function symbolize, as is already templateTitle, cheatSheetDescription, etc.


hotkeysProvider.mapInit = {
command: '\u2318', // ⌘
shift: '\u21E7', // ⇧
left: '\u2190', // ←
right: '\u2192', // →
up: '\u2191', // ↑
down: '\u2193', // ↓
'return': '\u23CE', // ⏎
backspace: '\u232B', // ⌫
home: 'Inicio',
end: 'Fin',
space: 'Espacio',
f2: 'F2'
};


  var mapaInit = this.mapInit; // define in config

  function symbolize (combo) {
  -->  var map = mapaInit;

    combo = combo.split('+');

    for (var i = 0; i < combo.length; i++) {
      // try to resolve command / ctrl based on OS:
      if (combo[i] === 'mod') {
        if ($window.navigator && $window.navigator.platform.indexOf('Mac') >=0 ) {
          combo[i] = 'command';
        } else {
          combo[i] = 'ctrl';
        }
      }

      combo[i] = map[combo[i]] || combo[i];
    }

    return combo.join(' + ');
  }
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

No branches or pull requests

1 participant