angular-material-keyboard
angular-material-keyboard copied to clipboard
change language
This more of a doubt. May i know how to change the language of the keyboard? in the original project for the we can pass lang as attribute to the tag and the keyboard language changes.
how can i do that here? can you please help me?
@praveens96 What do you mean with
the original project
?
what i see from demo.html is that, use-keyboard is being used for changing the keyboard. when i pass a language name or code as in the original project's file its not reflecting. for ex: for getting the telugu keyboard, if i give use-keyboard="Telugu" or use-keyboard="Tl" is not showing keyboard in telugu.
where as in original project there is if you pass this way, telugu keyboard will be shown. i want to achieve that. can you help me with that? and i am trying to use it in an ionic 3 application i.e. angular 4 app.
partially got it. now need to see how to use it inmy angular 4 app. this is what i have done:
<md-input-container flex>
<label>Use default keyboard</label>
<input type="text" class="md-input" ng-model="text" use-keyboard="Telugu">
</md-input-container>
in js: added keyboard layout telugu.
$mdKeyboardProvider.addLayout('Telugu', {
'name': "Telugu",
'keys': [
[
["\u0C4A", "\u0C12"],
["1", "", "\u0C67"],
["2", "", "\u0C68"],
["3", "\u0C4D\u0C30", "\u0C69"],
["4", "", "\u0C6A"],
["5", "\u0C1C\u0C4D\u0C1E", "\u0C6B"],
["6", "\u0C24\u0C4D\u0C30", "\u0C6C"],
["7", "\u0C15\u0C4D\u0C37", "\u0C6D"],
["8", "\u0C36\u0C4D\u0C30", "\u0C6E"],
["9", "(", "\u0C6F"],
["0", ")", "\u0C66"],
["-", "\u0C03"],
["\u0C43", "\u0C0B", "\u0C44"],
["Bksp", "Bksp"]
],
[
["Tab", "Tab"],
["\u0C4C", "\u0C14"],
["\u0C48", "\u0C10", "\u0C56"],
["\u0C3E", "\u0C06"],
["\u0C40", "\u0C08", "", "\u0C61"],
["\u0C42", "\u0C0A"],
["\u0C2C"],
["\u0C39", "\u0C19"],
["\u0C17", "\u0C18"],
["\u0C26", "\u0C27"],
["\u0C1C", "\u0C1D"],
["\u0C21", "\u0C22"],
["", "\u0C1E"]
],
[
["Caps", "Caps"],
["\u0C4B", "\u0C13"],
["\u0C47", "\u0C0F", "\u0C55"],
["\u0C4D", "\u0C05"],
["\u0C3F", "\u0C07", "", "\u0C0C"],
["\u0C41", "\u0C09"],
["\u0C2A", "\u0C2B"],
["\u0C30", "\u0C31"],
["\u0C15", "\u0C16"],
["\u0C24", "\u0C25"],
["\u0C1A", "\u0C1B"],
["\u0C1F", "\u0C25"],
["Enter", "Enter"]
],
[
["Shift", "Shift"],
["\u0C46", "\u0C0E"],
["\u0C02", "\u0C01"],
["\u0C2E", "\u0C23"],
["\u0C28", "\u0C28"],
["\u0C35"],
["\u0C32", "\u0C33"],
["\u0C38", "\u0C36"],
[",", "\u0C37"],
["."],
["\u0C2F"],
["Shift", "Shift"]
],
[
[" ", " ", " ", " "],
["AltGr", "AltGr"]
]
],
'lang': ["te"]
});
ok, thank you