maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   Howto: Limit swype to the languages you use (https://talk.maemo.org/showthread.php?t=80582)

Vaskinn 2011-12-02 18:26

Howto: Limit swype to the languages you use
 
Doing this wrong may mess up your swype keyboard, seriously messing it up may even break the regular keyboard and leave you with a phone that is unusable without a reflash.

At the time of writing this has seen very little testing and there may be issues that haven't yet been found. If you don't feel confident you'll be able to reflash your phone if you need to, don't do this yet.

You need developer mode for this method. It may be doable with file browsers and text editors but I haven't tried that (please post instructions if you do and make it work)

0: Back up everything, copy the backup off the phone (to a computer or similar)
1: Open xterm
2: devel-su
3: provide the password (rootme)
4: cd /usr/share/swype/data
5: cp languages.lst languages.lst.bak
6: edit languages.lst in your favorite editor (real men use vi) to remove unwanted/unused languages. Don't use Nano. Nano does unmentionable things* to unmentionable objects**, and will make swype have an error.
7: enjoy



*: Changes encoding and/or adds byte order marker and/or adds helpful line breaks. Or something like that.
**: Files

Losap1 2011-12-03 09:49

Re: Howto: Limit swype to the langueges you use
 
Wrong thread...

flof 2011-12-03 12:39

Re: Howto: Limit swype to the langueges you use
 
I'm getting a Swype Database error when I try to choose the last language in my list (German,EnglishUS). Does anyone have an idea what I did wrong?

ossipena 2011-12-03 13:46

Re: Howto: Limit swype to the langueges you use
 
Quote:

Originally Posted by flof (Post 1132638)
I'm getting a Swype Database error when I try to choose the last language in my list (German,EnglishUS). Does anyone have an idea what I did wrong?

you're probably getting wrong one thing: this doesn't work so well, it is quick and dirty hack that probably doesn't work if you delete stuff between some languages...

F2thaK 2011-12-03 13:53

Re: Howto: Limit swype to the langueges you use
 
I dont really see the point of deleting the unused languages anyway. Id rather remove the languages button.

Vaskinn 2011-12-03 18:39

Re: Howto: Limit swype to the langueges you use
 
Quote:

Originally Posted by flof (Post 1132638)
I'm getting a Swype Database error when I try to choose the last language in my list (German,EnglishUS). Does anyone have an idea what I did wrong?

The original languages.lst doesn't have a comma after the last character. Dis you leave the one that was behind your last language?

I also made sure to use the regular keyboard while making the changes. I don't know how this will behave if you change the file while using swype.

Quote:

Originally Posted by ossipena (Post 1132662)
you're probably getting wrong one thing: this doesn't work so well, it is quick and dirty hack that probably doesn't work if you delete stuff between some languages...

Yep. Quick and dirty. But working without problems for me so far. I'll edit the original post to add appropriate warnings. If anyone is having problems after doing this I recommend putting back the copy of languages.lst, if it still fails after that: attempt to reinstall swype packages, or reflash.

Quote:

Originally Posted by F2thaK (Post 1132665)
I dont really see the point of deleting the unused languages anyway. Id rather remove the languages button.

Some of us use more than one language. If you use only one I can see why you'd prefer to get rid of the button, but I have no idea how to do that. (Except the first step: back up everything. Because if you manage to break the regular keyboard in the process you'll pretty much have to reflash)

flof 2011-12-03 23:04

Re: Howto: Limit swype to the langueges you use
 
Quote:

Originally Posted by Vaskinn (Post 1132763)
The original languages.lst doesn't have a comma after the last character. Dis you leave the one that was behind your last language?

I also made sure to use the regular keyboard while making the changes. I don't know how this will behave if you change the file while using swype.

I tried both with and without trailing comma, also looked for whitespace or line breaks, all makes no difference.

Tried again with Swype disabled in System preferences during the change, same outcome.

It's a pity, changing between 2 languages with a short press of the button would be extremely handy (also I'm used to being able to pick my languages from Swype on Android).

Vaskinn 2011-12-04 09:44

Re: Howto: Limit swype to the langueges you use
 
Does it work properly if you restore the file as before?

When exactly do you get the error message?

What is your version of swype? ("dpkg -s swype-keyboard")

flof 2011-12-04 10:38

Re: Howto: Limit swype to the langueges you use
 
Quote:

Originally Posted by Vaskinn (Post 1133001)
Does it work properly if you restore the file as before?

When exactly do you get the error message?

What is your version of swype? ("dpkg -s swype-keyboard")

After restoring the backup file, it works fine again.

The error pops up when I choose the last language in the list, no matter whether I'm cycling through languages with short presses on the language button or picking it from the language list after a long press.

When I append a third language to the list, the second one works, but the third one throws the error.

Swype version is 1.19.33902+0m6

mikhas 2011-12-04 13:03

Re: Howto: Limit swype to the languages you use
 
Please use the public bugtracke if you think there's a bug in the language configuration of Swype: https://harmattan-bugs.nokia.com/

Vaskinn 2011-12-04 13:18

Re: Howto: Limit swype to the languages you use
 
Same exact version as me., so that's not the cause of us seeing different behaviour.

I've checked and there is no line break, or space, after the list, both in the original and my modified version.

I used "vi" to edit. Did you use this or some other editor that may have "helped" by adding a line break for you?

Could you have added words to the dictionary of one of the languages that is now disabled? What happens if you restore the original and then remove just one language? If it works try removing one language at a time until you find which one makes things fail.

I see from your earlier post that your second language is US-english. I've been using norwegian and UK english. Maybe US has some kind of dependency to UK, what happens if you keep both?

Vaskinn 2011-12-04 13:38

Re: Howto: Limit swype to the languages you use
 
Quote:

Originally Posted by mikhas (Post 1133051)
Please use the public bugtracke if you think there's a bug in the language configuration of Swype: https://harmattan-bugs.nokia.com/

According to swype.com, selecting languages is a feature in swype 3.26, currently in beta. So I guess it's a missing feature, and if the version we get is updated one this is out of beta then this hack won't be nessessary. Not a bug per se.

flof 2011-12-04 16:48

Re: Howto: Limit swype to the languages you use
 
Quote:

Originally Posted by Vaskinn (Post 1133058)
I've checked and there is no line break, or space, after the list, both in the original and my modified version.

I used "vi" to edit. Did you use this or some other editor that may have "helped" by adding a line break for you?

Could you have added words to the dictionary of one of the languages that is now disabled? What happens if you restore the original and then remove just one language? If it works try removing one language at a time until you find which one makes things fail.

I see from your earlier post that your second language is US-english. I've been using norwegian and UK english. Maybe US has some kind of dependency to UK, what happens if you keep both?

I tried all combinations of line break and space (and lack thereof) - I used nano, because I can't find vi in the repositories (which surprised me).

There's only words added in German and English US - as that one works once it's not last in the list it must be something else. Dependency: Unlikely - when I had German, US English and UK English, US all of a sudden worked but UK showed the error because it was last in list.

I guess I'll have to live with the long press and list selection to change language for now, will try again with PR1.2 (and maybe throw in a factory reset while I'm at it).

Thanks for all your help :-)

ajalkane 2011-12-04 17:00

Re: Howto: Limit swype to the languages you use
 
Thanks, this is exactly what I've been missing as I constantly have to switch between two languages.

Vaskinn 2011-12-05 15:59

Re: Howto: Limit swype to the languages you use
 
Quote:

Originally Posted by flof (Post 1133122)
I tried all combinations of line break and space (and lack thereof) - I used nano, because I can't find vi in the repositories (which surprised me).

Good news. I have now reproduced the problem: By copying the original language file into place, and then editing with nano I get the error. If you edit with vi you should be good.

vi has to be part of either developer mode, or the Utilities package you can install after activating developer mode. (Otherwise it's a mystery where I got it from, bacause I haven't installed anything else that could account for it)

ossipena 2011-12-05 17:20

Re: Howto: Limit swype to the languages you use
 
Quote:

Originally Posted by Vaskinn (Post 1133548)
Good news. I have now reproduced the problem: By copying the original language file into place, and then editing with nano I get the error. If you edit with vi you should be good.

vi has to be part of either developer mode, or the Utilities package you can install after activating developer mode. (Otherwise it's a mystery where I got it from, bacause I haven't installed anything else that could account for it)

I can confirm, nano is quilty, or atleast after editing with vi, no database errors occur anymore....

caco3 2011-12-05 18:04

Re: Howto: Limit swype to the languages you use
 
Quote:

Originally Posted by ossipena (Post 1133585)
I can confirm, nano is quilty, or atleast after editing with vi, no database errors occur anymore....

That sounds very strange!
Why should nano break something?
I use it all the time on my PC, N900 and also N9 to edit config files and never had any issue.

OT:
Is there a way to remove entries from the dictionary I occidentally added?

flof 2011-12-05 19:15

Re: Howto: Limit swype to the languages you use
 
Quote:

Originally Posted by Vaskinn (Post 1133548)
Good news. I have now reproduced the problem: By copying the original language file into place, and then editing with nano I get the error. If you edit with vi you should be good.

vi has to be part of either developer mode, or the Utilities package you can install after activating developer mode. (Otherwise it's a mystery where I got it from, bacause I haven't installed anything else that could account for it)

Vaskinn, you're right on both - I have a working 2 languages setup now - and even better, I have my beloved vi (actually I had it all along, but hadn't seen it listed in the utilities package). Thanks so much :-)

Vaskinn 2011-12-05 19:51

Re: Howto: Limit swype to the languages you use
 
Quote:

Originally Posted by caco3 (Post 1133600)
Why should nano break something?
I use it all the time on my PC, N900 and also N9 to edit config files and never had any issue.

I can think of a few ways.

Maybe nano saves in a different format ("plain" text files are nowhere near as plain as you'd think) and swype is being picky because we're not really supposed to edit that file. (I'd have to examine the files in a hex editor to see)

Or perhaps instead of saving over the contents of the existing file nano does a "delete-create" when saving, losing a file system attribute or something similar in the process.

(my money is on encoding, linefeeds or byte order mark)

Edit:
And the winner is linefeed. Added by nano without asking.

caco3 2011-12-05 22:43

Re: Howto: Limit swype to the languages you use
 
Quote:

Originally Posted by Vaskinn (Post 1133644)
And the winner is linefeed. Added by nano without asking.

Do you mean the line feed at the end of the line?
Most linux programs actually give out a warning if the config file misses an empty line at its end. i.e. fstab (http://www.linuxquestions.org/questi...-fstab-241806/)
Because of that I am very used to end a config file with an ending line.
Now, we could argue if it is right from nano to add one without asking, but it seems to be usual (http://lists.gnu.org/archive/html/he.../msg00009.html).
I wouldnt see it really as a bug in nano but more as a Swype being too picky!

/OT

Vaskinn 2011-12-06 17:55

Re: Howto: Limit swype to the languages you use
 
It's an expectation thing.

On linux I would expect the system to do what it's told, no questions asked. That includes saving without a linefeed at the end, even if that will often cause problems for the program reading the file. It's not the responsibility of the editor to guess what my intention is because that can lead to problems, just like this time.

Manatus 2012-01-25 08:58

Re: Howto: Limit swype to the languages you use
 
FYI for people not very familiar with Vi editor:

Line endings are mentioned before but I'd like to emphasize that even when you use Vi you still have to be careful not to touch line ending / line feed.
It is safest to delete the words by using 'dw' (=delete word) and 'x' (=delete character).

Removing that last character in last word is cumbersome in 'insert' mode and you may get temptation to add line change in frustration, as I did, and even after removing the new line the database was still corrupt according to swype settings.


All times are GMT. The time now is 07:37.

vBulletin® Version 3.8.8