Closed Bug 1046900 Opened 7 years ago Closed 7 years ago

Add a Telugu Keyboard to Firefox OS in keyboard locales

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ShellHacker, Assigned: dev.tech24, Mentored)

References

Details

(Whiteboard: [l10n:te])

Attachments

(1 file, 1 obsolete file)

The Telugu (l10n:te) keyboard isn't available yet on gaia, The community wishes to take it forward and build this.
Hey sudheesh, I can help you in this. Let me know how can i help you build this.
The following code :

keys: [
    [
      { value: 'q' }, { value: 'w' }, { value: 'e' } , { value: 'r' },
      { value: 't' } , { value: 'y' }, { value: 'u' } , { value: 'i' },
      { value: 'o' }, { value: 'p' }
    ], [
      { value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
      { value: 'g' } , { value: 'h' }, { value: 'j' }, { value: 'k' },
      { value: 'l' }
    ], [
      { value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
      { value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
      { value: 'b' }, { value: 'n' }, { value: 'm' },
      { value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
    ], [
      { value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
      { value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
    ]
  ]

Is basically the keys of the QWERTY keyboard , we have to replace the keys with the telugu equivalents on a similar keyboard.
Telugu Keyboard : http://ascii-table.com/keyboard.php/473 and http://gate2home.com/Telugu-Keyboard
For eg. Q =>  ౌ in lowercase and ఔ in uppercase.
Flags: needinfo?(vikas.burri)
Hey sudheesh,

This is confusing me a lot. Tried to use the android keyboard, it was a failure.
Flags: needinfo?(vikas.burri)
Mentor: sudheesh1995
Whiteboard: [l10n:te]
Vikas,

Maybe this is of more help. In the upperCase, fill in the corresponding values which are left blank.
Reference : http://www.branah.com/telugu 

Keyboards.te = {
  label: 'Telugu',
  shortLabel: 'te',
  imEngine: 'india',
  menuLabel: 'తెలుగు',
  secondLayout: true,
  alternateLayoutKey: '?౧౨౩',
  basicLayoutKey: 'అఆఇ',
  types: ['text', 'url', 'email'],
  width: 11,
  keyClassName: 'telugu',
  upperCase: {
    'ౌ':'ఔ',
    'ై':'',
    'ా':'',
    'ీ':'',
    'ూ':'',
    'బ':'',
    'హ':'',
    'గ':'',
    'ద':'',
    'జ':'',
    'డ':'',

    'ో':'',
    'ే':'',
    '్':'',
    'ి':'',
    'ు':'',
    'ప':'',
    'ర':'',
    'క':'',
    'త':'',
    'చ':'',
    'ట':'',

    'ృ':'ఋ',
    'ं':'',
    'మ':'',
    'న':'',
    'వ':'',
    'ల':'',
    'స':'',
    'య':'',
    '़':''
  },
  keys: [
    [
      { value: 'ౌ' }, { value: 'ై' }, { value: 'ా' }, { value: 'ీ' },
      { value: 'ూ' }, { value: 'బ' }, { value: 'హ' }, { value: 'గ' },
      { value: 'ద' }, { value: 'జ' }, { value: 'డ' }
    ], [
      { value: 'ో' }, { value: 'ే' }, { value: '్' }, { value: 'ి' },
      { value: 'ు' }, { value: 'ప' }, { value: 'ర' }, { value: 'క' },
      { value: 'త' }, { value: 'చ' }, { value: 'ట' }
    ], [
      { value: '⇪', keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
      { value: 'ృ' }, { value: 'ं' }, { value: 'మ' }, { value: 'న' },
      { value: 'వ' }, { value: 'ల' }, { value: 'స' }, { value: 'య' },
      { value: '़' }, { value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
    ], [
      { value: '&nbsp', ratio: 9, keyCode: KeyboardEvent.DOM_VK_SPACE },
      { value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
    ]
  ],

needinfo me in case once you're done with this part in a file called te.js, we'll look into the numbers section.
Flags: needinfo?(vikas.burri)
I want to work on this
Hi Dev,

Vikas is willing to hand over the bug. Could you look through Comment 4 and see if you understand what exactly has to be done.

In comment 4, the code is the layout map of the QWERTY keyboard in Telugu. In the uppercase the format
LHS : RHS is similar to an english keyboard saying a : A , i.e. RHS is nothing but (Shift + Key)

So if you notice 'ౌ':'ఔ', simply pressing the location where Q key is present on a telugu keyboard results in 'ౌ' and when the same key is pressed using Shift, it results in 'ఔ' Could you fill the rest of them up which has been left ?

The codebase is present at : https://github.com/mozilla-b2g/gaia
Add a new file in the folder : 	apps/keyboard/js/layouts/te.js , make the file te.js along with many other locale files which will be present in the layouts folder.

The instructions to set the codebase up is in the github link provided. Let me know in case of any details.

Also please set a needinfo flag after you type the comment in the checkbox below which says 
Need more information from <other>/<mentor>/...

Assigning the bug to you.
Assignee: nobody → dev.tech24
Flags: needinfo?(vikas.burri) → needinfo?(dev.tech24)
Flags: needinfo?(dev.tech24)
OS: Mac OS X → Linux
Telugu Keyboard added..pull request has been setup
Added te.js file to "apps/keyboard/js/layouts/ " .changes can be seeb at  https://github.com/mozilla-b2g/gaia/pull/22950
Great work Devendra. Just a few things on the pull request. We generally don't mess with the master branch and try to keep it clean with the main upstream codebase, so all the patches are written in branch and a pull request is sent from a branch.

A few things to do step by step would be:
1. Close the existing Pull request since you're doing it from the master branch. but this would make you lose the file te.js, so the file is here : https://gist.github.com/sudheesh001/add53c03ab7bf8d6bb8b
2. Revert the last two commits you made, stash all changes and pull back from the upstream master.

So to do this assuming that you have set the upstream in the .git/config folder do the following.

Once you revert the last two commits. You could do the following

git checkout -b Patch_1046900

Now add the te.js in the required folder location.

git add /path/to/te.js

git commit -m "Fixes Bug 1046900, Add a l10n:te keyboard"

git push origin Patch_1046900

Then go to your github account to DevendraDora/gaia/Patch_1046900 and make a pull request to mozilla-b2g/gaia/master

To know about how git revert works : https://asciinema.org/a/6479
Squashing two commits into one : https://asciinema.org/a/11269

Also please post screenshot of the l10n:te keyboard
Flags: needinfo?(dev.tech24)
OS: Linux → All
Hardware: x86 → All
Fixed the Bug 1046900 - Added a Telugu Keyboard to Firefox OS in keyboard locales https://github.com/mozilla-b2g/gaia/pull/23150.
Flags: needinfo?(dev.tech24)
Devendra could you rebase your changes with the latest upstream and post the screens for the keyboard ?
Flags: needinfo?(dev.tech24)
Flags: needinfo?(dev.tech24)
Devendra, This looks good. How about adding a screenshot ?
Flags: needinfo?(dev.tech24)
Tim, Could you review this patch. Devendra has finished this and has sent a PR initially which was closed, I've sent a pull request again on behalf of him.
Attachment #8525072 - Attachment is obsolete: true
Attachment #8534845 - Flags: review?(timdream)
Looks like there are some bits missing, and this is breaking my builds as documented in bug 1111352 attachment 8536179 [details]
Flags: needinfo?(timdream)
Flags: needinfo?(sudheesh1995)
It's seem you forget adding your layout in build/config/keyboard-layouts.json
Oh man, would you mind help and back out the patch? Sorry about it.
Flags: needinfo?(timdream)
Flags: needinfo?(sudheesh1995)
Flags: needinfo?(dev.tech24)
Keywords: checkin-needed
Could someone revert the patch, I'd be more than happy to send the updated patch with the updated keyboard layout in the build config.
Reverted: https://github.com/mozilla-b2g/gaia/commit/71952ca2a2bd169b657d759dd3bb79d5f56d16c5
Status: RESOLVED → REOPENED
Flags: needinfo?(sudheesh1995)
Resolution: FIXED → ---
(In reply to dattaz from comment #18)
> It's seem you forget adding your layout in build/config/keyboard-layouts.json

Actually, I don't understand why failed to do that will break the build. That's probably not the reason.
Rudy, do you know?
Flags: needinfo?(rlu)
I don't think this is related to build/config/keyboard-layouts.json.
And I just grab this change into my own repo and did not see any build failure.

I would suspect the build failure was caused by a local config in bug 1111352.
Flags: needinfo?(rlu)
Rudy, did you built as I documented on bug 1111352 ?
Flags: needinfo?(rlu)
No, I just built it within my own Gaia repo with te layout included.
I thought it would be equivalent as yours.

If you have any specific steps that we could take to repro this issue within Gaia repo, please share with us.
Thanks.
Flags: needinfo?(rlu)
Does this still need an updated patch with the changes to keyboard-layouts.json as pointed out by Alexandre ?
Flags: needinfo?(sudheesh1995)
The script is at bug 1111352 comment 8.
Flags: needinfo?(rlu)
Actually, the script simply list all the layouts.

The error log is here:
https://bug1111352.bugzilla.mozilla.org/attachment.cgi?id=8536179
Ah, thanks for the pointers, I thought I have tried those commands but not sure why I did not catch the same error yesterday.

Now, I could reproduce exactly the same failure and I'll open anther bug to fix it.
Thanks again.
Flags: needinfo?(rlu)
reland since bug 1112020 has landed,

https://github.com/mozilla-b2g/gaia/commit/01c733e1e8833bbb52b9fe644adbc5730ac4b771
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.