badconker / ctrl-w

Userscript pour le jeu web Mush (mush.vg)
MIT License
12 stars 20 forks source link

Gettext & others #6

Closed mjohnson9 closed 10 years ago

mjohnson9 commented 10 years ago

This implements #5.

It also adds:

badconker commented 10 years ago

Good job :). I didn't know there is a javascript equivalent of Gettext :o). On the other side, i think so i had compatibility issue when i used ressource metadata. I will test your patch.

badconker commented 10 years ago

However you don't must delete "Fix chrome" comments.

I have already tried to merge the two version (Firefox and Chrome) into one but using unsafeWindow on old Firefox version does not work. So two versions of the script are necessary :/

mjohnson9 commented 10 years ago

That's odd. That fix is working fine for me in both Chrome 31 and Firefox 26.

mjohnson9 commented 10 years ago

Oh. Sorry. I missed the "old" part. I'll return the comments when I'm next at my computer.

mjohnson9 commented 10 years ago

There. :)

badconker commented 10 years ago

Why did you removed some "\r" ?

mjohnson9 commented 10 years ago

They're unnecessary and gettext complains about them. \r is a carriage return, used only in Windows plaintext documents.

badconker commented 10 years ago

Have you tested your code with the last commit ( b3653ae ) ? It don't work for me :/. I think, if you use "resource" you must use unsafeWindow in Firefox but there is issues with unsafeWindow and old Firefox version... When i tried to merge the two version like you into one some people encountered problems.

One player on :

Firefox: 16.0.2 GreaseMonkey: 1.11 Mac OS X: 10.5.8

He can't update because it's Mac OS X

and another on linux and old firefox version too.

He can't update because it's company computer...

If you have a solution... :)

mjohnson9 commented 10 years ago

I'm afraid that I'm not familiar enough with userscripts to know any workarounds for the resource issue specifically.

One alternative to using resources is to convert the .po files to JSON and then simple use a require statement to include them. How does this sound?

badconker commented 10 years ago

Have you tested your last commit on the last Firefox version ? Maybe it's me. If we use json conversion, it will add a new step to do a translation... :( Maybe i can automatically create a third version for old Firefox like i create the chrome version (^^').

For the moment, i'm waiting your test with the commit b3653ae ;)

mjohnson9 commented 10 years ago

I'll test it with Firefox, although I'm even less familiar with debugging in Firefox.

mjohnson9 commented 10 years ago

I've had no luck debugging the script in Firefox, but it doesn't seem to be working.

badconker commented 10 years ago

Can you send me the script file that you used ? (by mail if you want) (in the pull request the resource files doesn't exist for example ^^)

badconker commented 10 years ago

I have the error : Main is not defined CTRLW.user.js:16 (on Firefox 26) . You haven't error you ? The custom main menu is correctly displayed ?

badconker commented 10 years ago

Oops i didn't read you correctly "it doesn't seem to be working." So you confirm, it doesn't work on Firefox ?

mjohnson9 commented 10 years ago

That's correct.

badconker commented 10 years ago

Ok i will try to do something :)

badconker commented 10 years ago

hi :) I didn't forget your patch ^^. What software did you use to create .po file ?

mjohnson9 commented 10 years ago

I used pybabel to create the .pot file and then msginit to create the .po file. After the .po file was created, I used msgmerge to merge in the new strings.

badconker commented 10 years ago

Branch merged ! (I rebased it so i wasn't able to merge it with GitHub :/ )