MozillaZine

[Ext] TabLang - separate keyboard layout for tabs and urlbar

Announce and Discuss the Latest Theme and Extension Releases.
Crazy-EyE
 
Posts: 397
Joined: February 24th, 2008, 6:27 am
Location: Moscow, Russia

Post Posted May 2nd, 2011, 6:11 am

Unfortunately I have no much free time now, and I didn't finish the update work when I had. What I have is almost updated OS-related parts for Windows and Linux, but I even didn't try updating browser-related part. If anyone wishes to help me, please write here. Very sorry, guys.

Crazy-EyE
 
Posts: 397
Joined: February 24th, 2008, 6:27 am
Location: Moscow, Russia

Post Posted June 14th, 2011, 4:36 pm

Finally TabLang 0.4 with Firefox 4+ and Linux 64bit support is out. You can download it either from TabLang website or from TabLang AMO page. Any bug reports are welcome.

natong
 
Posts: 34
Joined: June 4th, 2008, 9:51 am

Post Posted August 28th, 2011, 7:39 am

It did work well on firefox v3.1.x but after v3.6.xx, 4, 5, 6 it can't force URL bar to english.

CleverClogs
 
Posts: 3
Joined: December 2nd, 2011, 3:53 pm

Post Posted December 2nd, 2011, 4:18 pm

@Crazy-EyE, are you still actively developing this add-on?
If so, here are a few ideas to take TabLang to the next level:

1. In the add-on options dialog, if possible specify not just the languages, but also the exact names of the installed keyboard definitions for each language. In my set-up right now the selection box lists two times "English (United States)" and three times "Chinese (Simplified, PRC)" without providing a clue which of those identical items belongs to which keyboard.

2. Allow the user to define a list of websites that always require a specific keyboard definition.

3. In the search bar, make the default keyboard dependent on the language of that specific search engine. This will allow for easy data entry into foreign dictionaries.

I hope you like the ideas.

orid
 
Posts: 1
Joined: May 20th, 2012, 2:25 am

Post Posted May 20th, 2012, 2:35 am

Hi
I am using Tablang for a few years and it is great. Thanks!

I am at FF 3.x with Tablang 0.3 and have to move to FF 13 or 13.

I tested FF 12 with Tablang 0.4 at another PC and I am not sure why
but my JS code does not work any more.

Here is the code:
var switcher = Components.classes["tablang@mozdev.org/tablangswitcher;1"]
.getService(Components.interfaces.ITabLangSwitcher);

Thanks
Ori

Crazy-EyE
 
Posts: 397
Joined: February 24th, 2008, 6:27 am
Location: Moscow, Russia

Post Posted May 25th, 2012, 2:30 pm

New interface is here: http://www.mozdev.org/source/browse/tablang/src/chrome/content/TablangKbSwitcher.js?rev=1.2

To use it write
Code: Select all
Components.utils.import("chrome://tablang/content/TablangKbSwitcher.js");

then use TablangKbSwitcher object

goryh
 
Posts: 1
Joined: July 4th, 2012, 10:25 am

Post Posted July 4th, 2012, 10:50 am

I am grateful to have your extension. I was wondering how you tell windows to switch the keyboard.

My wife and I use different layouts and I am trying default keyboards for different programs. I am spent several hours on the internet and your extension is the only useful thing I found. Now I can get Firefox to start in my keyboard while chrome starts in hers. If I knew how you tell windows to make the switch I think I could get it to work when other programs start.

Thank you

Crazy-EyE
 
Posts: 397
Joined: February 24th, 2008, 6:27 am
Location: Moscow, Russia

Post Posted July 5th, 2012, 4:44 pm

goryh wrote:I am grateful to have your extension. I was wondering how you tell windows to switch the keyboard.

My wife and I use different layouts and I am trying default keyboards for different programs. I am spent several hours on the internet and your extension is the only useful thing I found. Now I can get Firefox to start in my keyboard while chrome starts in hers. If I knew how you tell windows to make the switch I think I could get it to work when other programs start.

Thank you

Hi

I use ActivateKeyboardLayout winapi function. You can get more tips viewing TablangKbSwitcher-win.js (though it calls C functions from JavaScript using jsctypes, it's almost the same in C/C++)

dr_st
 
Posts: 7
Joined: July 27th, 2013, 12:57 am

Post Posted July 27th, 2013, 1:07 am

So, just reiterating what was said a number of times:

While TabLang works now in FF4+, in the sense that it remembers layouts for each tab, the feature that controls the URL bar language separately does not work, at all.

I've done some digging and it seems that the problem is as follows:

The TabLang code that remembers and restores the URL bar language, relies on "focus" and "blur" events for the URL bar. Here is the code (from TabLang.js):
Code: Select all
      // Urlbar
      
      var urlbar = win.document.getElementById("urlbar").inputField;
      urlbar.addEventListener(
         "focus",
         function tablang_urlbar_focus(event) {
            var browser = win.gBrowser.selectedBrowser;
            log("focus urlbar " + (browser.currentURI ? browser.currentURI.spec : "(new tab)"));
            tablang.switchTo(browser.tablangUrlbarObject, false);
         },
         false);
      
      urlbar.addEventListener(
         "blur",
         function tablang_urlbar_blur(event) {
            if (tablang.currentObject && "urlbarBrowser" in tablang.currentObject) {
               var browser = tablang.currentObject.urlbarBrowser;
               log("blur urlbar " + (browser.currentURI ? browser.currentURI.spec : "(new tab)"));
               tablang.switchTo(null, false);
            }
         },
         false);


Now what happens, is that these events never arrive. I tested it with Mozilla console prints, and while I see the events each time a tab gets in/out of focus, there are never any events for the URL bar.

It seems like either there is something wrong with the way TabLang attempts to register to these events, or maybe the interface was changed for FF4+, but in any case - that's the issue.

Unfortunately, with 0 experience developing stuff for Firefox, I am out of my depth as to how to actually solve it. :(

I'm hoping it can be a simple fix for this otherwise great and functional addon.

Vavooon
 
Posts: 3
Joined: February 21st, 2016, 5:29 am

Post Posted February 21st, 2016, 5:33 am

Hi. Unfortunately extension doesn't work any more in newer Ubuntu versions, because they switched to storing layouts configurations in GSettings.
I already wrote a code in C++ which can read available layouts, get and set active one. But i have no experience with js-ctypes. Couldn't you help me with this?

Vavooon
 
Posts: 3
Joined: February 21st, 2016, 5:29 am

Post Posted February 22nd, 2016, 10:24 am

Yesterday i`ve managed to make it working.
Here`s modified file for Linux which uses GSettings API instead af XKB.
https://drive.google.com/open?id=0ByZsA ... XJVdW9MZ2M
I hope addon author will add this code (or tell me what should i do in order to prepare my patch) and update the extension.

Vavooon
 
Posts: 3
Joined: February 21st, 2016, 5:29 am

Post Posted May 31st, 2016, 11:05 am

Sorry 2 all who tried to open the link.

Here is new URL.

https://drive.google.com/file/d/0ByZsAv ... sp=sharing

Yamatos
 
Posts: 1
Joined: November 15th, 2017, 4:58 am

Post Posted November 15th, 2017, 5:13 am

Been using TabLang for ages and I can't imagine my work without it.

Is there a chance we'll see a Webextention port for FF 57 ?

Thanks

nilsonleow
 
Posts: 3
Joined: November 28th, 2017, 1:36 am

Post Posted November 28th, 2017, 1:38 am

Please... back Tablang to new FF!?

malliz
Folder@Home

User avatar
 
Posts: 43325
Joined: December 7th, 2002, 4:34 am
Location: Australia

Post Posted November 28th, 2017, 2:59 am

Last updated
6 years ago (Jun 29, 2011)

Not much hope
What sort of man would put a known criminal in charge of a major branch of government? Apart from, say, the average voter.
"Terry Pratchett"

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 2 guests