Jump to content


Important Announcement!

Please read this post about our new Privacy Policy


Photo
- - - - -

Developing Externalize extension


  • Please log in to reply
87 replies to this topic

#41 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 07 October 2006 - 08:31 AM

QUOTE
problem doesn't depend by Externalize


Of course you are right : even manually I could not succeed mellow.gif
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#42 Pedro

Pedro

    eXtenZilla IT Member

  • Members
  • 711 posts
  • Gender:Male
  • Location:Ferrara - Italia


  • Extension Developer: No
  • Translation Credits to Luca Pedrazzi - www.extenzilla.org

Posted 07 October 2006 - 10:10 AM

Hi guys,

don't break your head with this extension tongue.gif

I re-try to contact the author of the extension and ask him smile.gif

Thanks a lot for your interest biggrin.gif
Are you sure that I am a translator? Have you seen my english? IPB Image
IPB Image IPB Image IPB Image
Goofy's corrections © inside. The dog with the glasses has come back.

#43 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 07 October 2006 - 07:30 PM

A little observation while testing Externalize .js parser on Platypus extension :

It detects also strings into " " in the comments laugh.gif (not a bug of course, only useless)

Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#44 dafi

dafi

    WTS Developer

  • WTS Developer
  • PipPipPip
  • 498 posts
  • Gender:Male
  • Location:Palermo (Italy)


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Some bonsai extensions

Posted 08 October 2006 - 07:29 AM

QUOTE(Goofy @ Oct 7 2006, 20:30) View Post

A little observation while testing Externalize .js parser on Platypus extension :

It detects also strings into " " in the comments laugh.gif (not a bug of course, only useless)

Oh Goofy, I know it and I consider it a bug.
Honestly I've tried to fix it but with poor results.
please.gif Please wait some time before this bug can be fixed sad.gif

Open bugs and improvents (please add yours if I missed someone)
Higher priority
* generate unique name when same string is present more than once
* fix report counters for JS files
* xml externalization can show the same "choose strings" dialog used by JS
* skip strings into JS comments


Lower priority
* make the .txt files editable and customizable throughout the extension interface
* definition files can be downloaded from a well known repository (similar to an update system)
* externalize starts from a given directory and its subdirectory getting all files (e.g. xml, js)

Davide Ficano
Author of the ViewSourceWith extension
http://dafizilla.sou.../viewsourcewith

#45 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 08 October 2006 - 08:08 AM

smile.gif Ah this time I think there is a probable bug in the way the variables are named (Localizing platypus again)

After the automatic naming,

these variables of the js file
QUOTE
var platypusitdoesntappeart22 = myoverlaystrings.GetStringFromName("platypusitdoesntappeart22");
var platypusokayimoccasional23 = myoverlaystrings.GetStringFromName("platypusokayimoccasional23");

are supposed to be related with these properties variables :

QUOTE
platypusitdoesntappeart70=It doesn't appear to me that you've actually recorded anything, and I'm rarely wrong about things like that.
platypusokayimoccasional71=Okay, I'm *occasionally* wrong.


I am not 100% sure I did not make a mistake when testing. Just wait, I test on another file. Note that there is no problem inside the js file itself : the name of the variable is unchanged in the same js where the variables are used.
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#46 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 08 October 2006 - 08:19 AM

smile.gif I confirm when testing on a very simple file with only two strings to localize (one is a copyright, the other a confirm message) : externalize changes the number appended to the variable name when writing in the .properties file.
See attached the testcase with the original file, the modified one and the properties one.

Attached Files


Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#47 dafi

dafi

    WTS Developer

  • WTS Developer
  • PipPipPip
  • 498 posts
  • Gender:Male
  • Location:Palermo (Italy)


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Some bonsai extensions

Posted 08 October 2006 - 08:21 AM

QUOTE(Goofy @ Oct 8 2006, 09:19) View Post

smile.gif I confirm when testing on a very simple file with only two strings to localize (one is a copyright, the other a confirm message) : externalize changes the number appended to the variable name when writing in the .properties file.
See attached the testcase with the original file, the modified one and the properties one.

Ok now I try to fix it.

I've found another bug, too.
Some strings are not property replaced (always in JS).

stay tuned wink.gif
Davide Ficano
Author of the ViewSourceWith extension
http://dafizilla.sou.../viewsourcewith

#48 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 08 October 2006 - 08:25 AM

--- another test with same file

Now I have changed the variable name using Externalize feature, so it is valid in the js file :

QUOTE
var avzcopyright = mystrings.GetStringFromName("avzcopyright");

gives :
QUOTE

alert(avzcopyright);


but still unchanged in the properties : rolleyes.gif

QUOTE
avzavzxulmail10ncopyrigh5=AVZ XULMail 1.0\nCopyright Avhaz 2006.\nhttp://avhaz.zeeblo.com/xpi/

Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#49 dafi

dafi

    WTS Developer

  • WTS Developer
  • PipPipPip
  • 498 posts
  • Gender:Male
  • Location:Palermo (Italy)


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Some bonsai extensions

Posted 08 October 2006 - 08:37 AM

QUOTE(Goofy @ Oct 8 2006, 09:25) View Post

--- another test with same file

Now I have changed the variable name using Externalize feature, so it is valid in the js file :
gives :
but still unchanged in the properties : rolleyes.gif

Now should be fixed [attachmentid=1851]

Attached Files


Davide Ficano
Author of the ViewSourceWith extension
http://dafizilla.sou.../viewsourcewith

#50 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 08 October 2006 - 08:57 AM

sad.gif I am sorry same bug again. (to be confirmed)

smile.gif Oh my mistake this time, everything is ok now ! biggrin.gif

Thanks so much for your wizzard flash debugging !
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#51 dafi

dafi

    WTS Developer

  • WTS Developer
  • PipPipPip
  • 498 posts
  • Gender:Male
  • Location:Palermo (Italy)


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Some bonsai extensions

Posted 08 October 2006 - 09:00 AM

QUOTE(Goofy @ Oct 8 2006, 09:57) View Post

sad.gif I am sorry same bug again. (to be confirmed)

My heartbeat has stopped for some seconds, you are gone near to lost a bonsai programmer surprise.gif

QUOTE(Goofy @ Oct 8 2006, 09:57) View Post

smile.gif Oh my mistake this time, everything is ok now ! biggrin.gif

Thanks so much for your wizzard flash debugging !

Good

I've found a strange bug I hope to fix it ASAP ranting2.gif
Davide Ficano
Author of the ViewSourceWith extension
http://dafizilla.sou.../viewsourcewith

#52 dafi

dafi

    WTS Developer

  • WTS Developer
  • PipPipPip
  • 498 posts
  • Gender:Male
  • Location:Palermo (Italy)


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Some bonsai extensions

Posted 08 October 2006 - 12:42 PM

New build:
- report fixed for JS
- remove duplicate elements
- when user changes generated name the element is automatically selected.
I suppose user changes name for elements he/she want to externalize

If this build passes Goofy hard tests then I upload on dafizilla tongue.gif
[attachmentid=1852]

Attached Files


Davide Ficano
Author of the ViewSourceWith extension
http://dafizilla.sou.../viewsourcewith

#53 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 10 October 2006 - 06:49 AM

smile.gif dear Davide
Thanks for the new features! I used Externalize to localize Platypus, an extension with many xul and many js files, and it was working fine.
* Accurate report for the js string count
* Good detection of duplicate strings (listed like e.g "Platypus Help on lines 223, 257, 670")
* no problem to change the variable names

I suggest it is satisfactory and should be uploaded on dafzilla smile.gif

--------about comments

If we have this kind of codelines :
CODE
        //alert(itemFrames.length);
        //alert(itemiFrames.length);
        var frame, iframe;
        if (itemFrames.length > 0)
        {
            for (var i = 0; i< itemFrames.length; i++)
            {
                frame = itemFrames[i].contentDocument;
                this.CheckFrames(frame, id); // recursion for frames
            }
        }
        if (itemiFrames.length > 0)
        {
            for (var i = 0; i < itemiFrames.length; i++)
            {
                iframe = itemiFrames[i].contentDocument;
                this.CheckFrames(iframe, id); // recursion for iframes
            }
        }
    }
    this.onToolsMenu=function()    //open setting dialog!
    {
        var win=window.openDialog("chrome://batchdownload/content/config.xul",
                      "Batchdownload", "chrome,centerscreen",null);
        win.focus();


I suppose it will not be difficult to declare :
if // is detected then skip this line and go to the next one
but then a line with an address including double slash will be skipped too with possible string on the same line being ignored... Unless some declaration tells :
- ignore double slash inside " " quotation marks.

...but I am sure you have already thought of all that before me and much more accurately. rolleyes.gif
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#54 dafi

dafi

    WTS Developer

  • WTS Developer
  • PipPipPip
  • 498 posts
  • Gender:Male
  • Location:Palermo (Italy)


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Some bonsai extensions

Posted 10 October 2006 - 07:03 AM

QUOTE(Goofy @ Oct 10 2006, 07:49) View Post

* Accurate report for the js string count
* Good detection of duplicate strings (listed like e.g "Platypus Help on lines 223, 257, 670")
* no problem to change the variable names

I suggest it is satisfactory and should be uploaded on dafzilla smile.gif

Very good news biggrin.gif
Ok I upload on dafizilla ASAP.


QUOTE(Goofy @ Oct 10 2006, 07:49) View Post

If we have this kind of codelines :

[CUT]

I suppose it will not be difficult to declare :
if // is detected then skip this line and go to the next one
but then a line with an address including double slash will be skipped too with possible string on the same line being ignored... Unless some declaration tells :
- ignore double slash inside " " quotation marks.

...but I am sure you have already thought of all that before me and much more accurately. rolleyes.gif

Detect comments ins't difficult but there are two types of comment:
1. inline comment starting with //
2. multiple line comment starting with /* and ending with */

Detecting inline comment is easy, detecting multiple line is a bit more complicated due to my extraction strings algorithm.
I need to change algorithm and this is a bit invaside.
As you know I'm working to fix this problem that fortunately is affordable wink.gif
Davide Ficano
Author of the ViewSourceWith extension
http://dafizilla.sou.../viewsourcewith

#55 dafi

dafi

    WTS Developer

  • WTS Developer
  • PipPipPip
  • 498 posts
  • Gender:Male
  • Location:Palermo (Italy)


  • Translator for [No translator]
  • Extension Developer: Yes
  • Extensions: Some bonsai extensions

Posted 10 October 2006 - 10:53 AM

On BabelWiki I read:

QUOTE
ToDo List
* avoid entitizing of isolated numbers, considering they need not to be translated


This should be fixed in 0.0.41, may you confirm me?
Davide Ficano
Author of the ViewSourceWith extension
http://dafizilla.sou.../viewsourcewith

#56 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 10 October 2006 - 11:25 AM

QUOTE(dafi @ Oct 10 2006, 11:53) View Post

On BabelWiki I read:
This should be fixed in 0.0.41, may you confirm me?


Oh yes I may smile.gif
Sorry for being lazy : I should have updated the wiki page... but your are too fast with new builds evry now and then smile.gif

@Pedro : if you have one moment left, would you please get another screenshot for step 8, considering the interface has changed (check all/uncheck all, rename...). thanks in advance smile.gif
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#57 Pedro

Pedro

    eXtenZilla IT Member

  • Members
  • 711 posts
  • Gender:Male
  • Location:Ferrara - Italia


  • Extension Developer: No
  • Translation Credits to Luca Pedrazzi - www.extenzilla.org

Posted 10 October 2006 - 12:58 PM

QUOTE(Goofy @ Oct 10 2006, 12:25) View Post

@Pedro : if you have one moment left, would you please get another screenshot for step 8, considering the interface has changed (check all/uncheck all, rename...). thanks in advance smile.gif


Of course! biggrin.gif I will do it this evening wink.gif
Are you sure that I am a translator? Have you seen my english? IPB Image
IPB Image IPB Image IPB Image
Goofy's corrections © inside. The dog with the glasses has come back.

#58 Pedro

Pedro

    eXtenZilla IT Member

  • Members
  • 711 posts
  • Gender:Male
  • Location:Ferrara - Italia


  • Extension Developer: No
  • Translation Credits to Luca Pedrazzi - www.extenzilla.org

Posted 10 October 2006 - 08:46 PM

Well Jean Bernard, the screnshoots are updated wink.gif

I have uploaded two images for step eight, if you want you can add some text between them... I am not the better man for doing that biggrin.gif

A little question... how can I delete, from wiki database, not used images? blink.gif

Bye bye tongue.gif
Are you sure that I am a translator? Have you seen my english? IPB Image
IPB Image IPB Image IPB Image
Goofy's corrections © inside. The dog with the glasses has come back.

#59 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 10 October 2006 - 09:18 PM

Thanks for your nice screenshots, dear Pedro smile.gif
(I have added some lines)

- You cannot delete wiki pages throughout the interface (I supose it is the same with uploaded files). In case of error you can just edit and save a previous version, see history tab).
To really delete something you must do it in the database I think. Don't worry for your old images, there is still room left on BabelWiki wink.gif




Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox

#60 Goofy

Goofy

    Advanced Member

  • Super Mod
  • 8,437 posts
  • Gender:Male
  • Location:GoofyLand


  • Translator for French (fr)
  • Extension Developer: Yes
  • Extensions: BabelZillaMenu-BabelZilla Glossary-OpenTran...
  • Translation Credits to Goofy
  • My OS Gnu/Linux

Posted 22 October 2006 - 09:02 AM

smile.gif This week I reached my 62nd extension localized with the precious help of this extension. Just to let you know how efficient and useful it is.

I have noticed there are still sometimes double similar entities created with same name and same strings, I don't know why because generally there is the appending number that allows entity names to be different, but sometimes there is no such number.

In a distant future, it would be good to have this feature :
For xml files, the user should have the choice between
- automatic detecting and replacement (just as it works fine now)
- selection of items to be transferred just as it works fine for .js files now

Thank you again, dear Davide, for the very kind and smart work you have done smile.gif !
Think Global, Make Locales!


Sometimes I am on irc://moznet/BabelZilla
but you can also drop a word in the shoutbox


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users