Help - Search - Members - Calendar
Full Version: Developing Externalize extension
BabelZilla Board > General > Help
Pages: 1, 2
Goofy
smile.gif This new topic is dedicated to the work on Davide Ficano's Externalize extension. This very good tool was originally requested by me (see on this topic ) and I tested it successfully since May '06 on more than 45 extensions which were lacking a locale structure, a good number of them were submitted on BZ by their devs afterwards (see this topic of the moderators corner)
I also began a babelwiki page which is uncomplete and needing screenshots among others.



biggrin.gif Good news are coming. Dafi has now some time to spare on this extension. Just to remember, I put here some kind of wishlist by order of priority (imho) :


[color=#FF0000]* trim the length of the created entities to a customized number of characters. In the current version there is manual work to limit the length to something reasonable. So the entitizing process itself is very quick and spares much time, but you have to check every file afterwards for empty strings and too long entity names.
* add the extension name (or first chars of it) at the beginning of entity names (as it is common use for most of manually created entities)
* detect empty strings from the xul files and avoid creating empty useless entities
* make the .txt files editable and customizable throughout the extension interface
* fix a kind of mess that may happen when creating the doctype line in case there already is one (a "public" one, referring to FF chrome itself)

* add an extra dialog popping when a file is processed, telling "Strings from this file are now successfully entitized, do you want to process another file ? (Y/N)" . When there are numerous files to "externalize", user has to restart the main dialog for each file, it would be quicker to leave the main dialog (file selector) open as long as there are files to process
dafi
QUOTE(Goofy @ Sep 19 2006, 08:10) [snapback]19046[/snapback]

I put here some kind of wishlist by order of priority (imho) :
* trim the length of the created entities to a customized number of characters. In the current version there is manual work to limit the length to something reasonable. So the entitizing process itself is very quick and spares much time, but you have to check every file afterwards for empty strings and too long entity names.
* add the extension name (or first chars of it) at the beginning of entity names (as it is common use for most of manually created entities)
* detect empty strings from the xul files and avoid creating empty useless entities
* make the .txt files editable and customizable throughout the extension interface
* fix a kind of mess that may happen when creating the doctype line in case there already is one (a "public" one, referring to FF chrome itself)


I also would add:
- 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)
- allow to extract from JS files (maybe need a new definition file) (adding stringbundle into xul file)

any hint is welcommed wink.gif
Goofy
QUOTE
definition files can be downloaded from a well known repository (similar to an update system)


If you speak of the 3 .txt files with tags to detect I am not sure that linking an online source would be a good thing. I would prefer have them more user-customizable and "inside" the extension itself.
From experience, i know the items of these files must be "adapted" sometimes according to every extension (and dev's fantasy rolleyes.gif ). To give a simple example :
I recently localized Grimholtz' big Passwordmaker extension, using my "usual" tag lists, then I realized there were tags I had never encountered before : "pickertooltiptext" blink.gif so I was glad to add it on my list and not to wait for an online update.
- just my 2 eurocents
dafi
QUOTE(Goofy @ Sep 19 2006, 11:30) [snapback]19060[/snapback]

If you speak of the 3 .txt files with tags to detect I am not sure that linking an online source would be a good thing. I would prefer have them more user-customizable and "inside" the extension itself.
From experience, i know the items of these files must be "adapted" sometimes according to every extension (and dev's fantasy rolleyes.gif ). To give a simple example :
I recently localized Grimholtz' big Passwordmaker extension, using my "usual" tag lists, then I realized there were tags I had never encountered before : "pickertooltiptext" blink.gif so I was glad to add it on my list and not to wait for an online update.
- just my 2 eurocents

You are right but I think an official taglist can be more useful.
At least (but not necessary in next release) we can combine an official list plus an user list (any duplcate can be safety removed by Externalize).
Goofy
Yes you are wise, let's have an "official" list (or set of lists) to give an example or a default package, just as you did for me when you released the early version + the ability to edit files for the user. smile.gif
Pedro
QUOTE(Goofy @ Sep 19 2006, 08:10) [snapback]19046[/snapback]
...I also began a babelwiki page which is uncomplete and needing screenshots among others.


I can do it for you... let me know what kind of image you need wink.gif
dafi
QUOTE(Pedro @ Sep 19 2006, 15:31) [snapback]19063[/snapback]

I can do it for you... let me know what kind of image you need wink.gif

Consider I would change UI...
Pedro
QUOTE(dafi @ Sep 19 2006, 19:27) [snapback]19072[/snapback]

Consider I would change UI...

I will wait the new UI... tongue.gif laugh.gif
dafi
Another brick in the wall.

Here you find the new patch.

Bugs that should be fixed

[x] trim the length of the created entities to a customized number of characters.
The algorithm used is very brutal but works fine, any hint is welcommed
[x] fix a kind of mess that may happen when creating the doctype line in case there already is one
(a "public" one, referring to FF chrome itself)
Now should work better
[x] add the extension name (or first chars of it) at the beginning of entity names
(as it is common use for most of manually created entities)
Are really useful?
[x] detect empty strings from the xul files and avoid creating empty useless entities
No more entities generated when value is empty
[x] add an extra dialog popping when a file is processed, telling "Strings from this file are
now successfully entitized, do you want to process another file ? (Y/N)" .
The dialog doesn't close, user must click on close button. I think is now more usable.
[x] Redesigned UI
Rationalized splitting in tabs
[x] Print a simple report about entities processed
Goofy
rockon.gif amazing work and improvements, dear Davide smile.gif ! many thanks for that.

I have been performing a first series of tests and found everything working fine up to know.

Especially

QUOTE
[x] trim the length of the created entities to a customized number of characters.
The algorithm used is very brutal but works fine, any hint is welcommed

Yes it works smile.gif . I noticed it added a number at the end of the entity name, I don't know if it is deliberate. see example of the increasing number list :
CODE

<!ENTITY lkwd.toolbarbutton.add.curren1 "Add current tab to a wad in your collection. CTRL+UP ARROW">
<!ENTITY lkwd.toolbarbutton.open "Open ">
<!ENTITY lkwd.toolbarbutton.open.a.wad2 "Open a wad from your collection. ALT+L">
<!ENTITY lkwd.toolbarbutton.save "Save ">
<!ENTITY lkwd.toolbarbutton.add.this.w3 "Add this wad to your collection. CTRL+S">
<!ENTITY lkwd.toolbarbutton.clear "Clear ">
<!ENTITY lkwd.toolbarbutton.close.all.4 "Close all tabs and return to home page. CTRL+ALT+Q">
<!ENTITY lkwd.toolbarbutton.options "Options  ">
<!ENTITY lkwd.menuitem.update.cache "Update Cache">
<!ENTITY lkwd.menuitem.update.your.cac5 "Update your cached account data when switching between computer systems.">
<!ENTITY lkwd.menuitem.add.url "Add URL">
<!ENTITY lkwd.menuitem.add.current.tab6 "Add current tab to a wad in your collection. CTRL+UP ARROW">
<!ENTITY lkwd.menuitem.delete.wad "Delete Wad">
<!ENTITY lkwd.menuitem.remove.current.7 "Remove current wad from your collection. ALT+DEL">
<!ENTITY lkwd.menuitem.log.in "Log In">
<!ENTITY lkwd.menuitem.log.in.to.your.8 "Log in to your account.">
<!ENTITY lkwd.menuitem.log.out "Log Out">
<!ENTITY lkwd.menuitem.log.out.of.your9 "Log out of your account.">
<!ENTITY lkwd.menuitem.report.a.bug "Report a Bug">
<!ENTITY lkwd.menuitem.file.a.bug.rep10 "File a bug report via email.">
<!ENTITY lkwd.menuitem.settings "Settings">
<!ENTITY lkwd.menuitem.set.account.in11 "Set account info and user preferences.">


QUOTE
[x] fix a kind of mess that may happen when creating the doctype line in case there already is one
(a "public" one, referring to FF chrome itself)
Now should work better


yes it seems ok now, though I have not yet tested the relative function. It seems to add the 2nd locale address correctly. See output example :
CODE
<!DOCTYPE dialog SYSTEM 'chrome://browser/locale/bookmarks/addBookmark.dtd'
[
<!ENTITY % bookmarkreviewerDTD SYSTEM "chrome://bookmarkreviewer/locale/addbmk.dtd" >
%bookmarkreviewerDTD;
]>




QUOTE
[x] add the extension name (or first chars of it) at the beginning of entity names
(as it is common use for most of manually created entities)
Are really useful?

Yes it works and it is useful when testing various extensions. When you test iand a parsing error occurs, you see generally the entity name where the prob is, but first thing to know is which extension is creating the problem.

QUOTE
[x] add an extra dialog popping when a file is processed, telling "Strings from this file are
now successfully entitized, do you want to process another file ? (Y/N)" .
The dialog doesn't close, user must click on close button. I think is now more usable.
[x] Redesigned UI
Rationalized splitting in tabs
[x] Print a simple report about entities processed


very good usability improvements , thanks again !
dafi
QUOTE(Goofy @ Sep 23 2006, 14:27) [snapback]19166[/snapback]

Yes it works smile.gif . I noticed it added a number at the end of the entity name, I don't know if it is deliberate. see example of the increasing number list :

To be sure to generate an unique name an incremental value is added, this solution is known as quick and dirty tongue.gif .

Goofy
QUOTE(dafi @ Sep 23 2006, 14:34) [snapback]19167[/snapback]

To be sure to generate an unique name an incremental value is added, this solution is known as quick and dirty tongue.gif .


yes I like it : quick and dirty EFFICIENT ! just fine smile.gif


in the present state of the extension, you should release it on addons.moz ! I am pretty sure many devs will like it and find it time-saving (for a number of them, localizing task is just boring or ignored)
Goofy
smile.gif Just to remember :
you added this line in the wishlist
QUOTE
- allow to extract from JS files (maybe need a new definition file) (adding stringbundle into xul file)


You know the stringbundle can be created on top of the .js itself, it will spare a step in the process.
See my tiny howto :
http://www.babelzilla.org/index.php?option...=15&Itemid=
smile.gif

Thinking over this problem, if there are only alert ("messages") I suppose they will be easy to detect. But devs use various kinds of words to deal with messages to display (throw, dump,...) and most of the time, messages are viciously entangled with variables of all kinds... ranting2.gif
I suspect it will be quite difficult...
Though probably "heavy" in terms of code, what with the idea of a "step by step" editing of items ?
I mean :
When the user starts the process to parse a js file, every time a new message to localize is detected, a window pops up with the original line of the .js, asking "Do you want to localize this line? (Yes/No/Cancel). Thus the user may see if the "message" is a real message to be displayed in the interface or some kind of code between quotation marks.
dafi
QUOTE(Goofy @ Sep 28 2006, 23:54) [snapback]19450[/snapback]

smile.gif Just to remember :
you added this line in the wishlist
You know the stringbundle can be created on top of the .js itself, it will spare a step in the process.
See my tiny howto :
http://www.babelzilla.org/index.php?option...=15&Itemid=
smile.gif

Oh yes, I'm working on it but I've found some problem on parser so I delayed the release.

QUOTE(Goofy @ Sep 28 2006, 23:54) [snapback]19450[/snapback]

Thinking over this problem, if there are only alert ("messages") I suppose they will be easy to detect. But devs use various kinds of words to deal with messages to display (throw, dump,...) and most of the time, messages are viciously entangled with variables of all kinds... ranting2.gif

Another good shot Goofy wink.gif
Your solution is good, JS string extraction is a less automatic task.
The steps should be:
1. detect every single and double quoted string (eg. 'Hello' or "Hello")
2. When all strings are found in file I show a summary dialog where you check which string externalize
[ ] Hello found at line 3
[x] Quick brown fox found at line 5

With a row below showing original line (useful to understand where string has been found)
3. Externalize selected strings
Goofy
biggrin.gif

QUOTE
The steps should be:
1. detect every single and double quoted string (eg. 'Hello' or "Hello")
2. When all strings are found in file I show a summary dialog where you check which string externalize
[ ] Hello found at line 3
[x] Quick brown fox found at line 5

With a row below showing original line (useful to understand where string has been found)
3. Externalize selected strings

That is exacltly what I was dreaming of!

You are really Great !
It is very pleasant for me to have someone who can make something vague and messy in my mind become rational and structured as you are doing.smile.gif
dafi
QUOTE(Goofy @ Sep 29 2006, 07:33) [snapback]19456[/snapback]

biggrin.gif
That is exacltly what I was dreaming of!

You are really Great !
It is very pleasant for me to have someone who can make something vague and messy in my mind become rational and structured as you are doing.smile.gif

Please help me to test this version ([attachmentid=1823])
that contains javascript file strings extraction.
Some bugs are present and I know their presence, like
- variable name is generated valid but not clever like for xml files
- strings on multiple lines are not handled (please ignore it surprise.gif )

Consider this an alpha version, I think is usable but requires a better debug tracing (I hope this night), help me to discover regression and/or new bugs wink.gif
Goofy
biggrin.gif Wow impressive stuff again.
First tests seem to give good results smile.gif

My observations :
- there seem to be a useless detection of linebreakers recognized as strings, there are displayed thus : '\n'
I suggest they should not break the process, because the sentence is going on in the same string. (no need to break and begin a new string)

- the customized name at the beginning og the variable seems to duplicate itself, e.g :
CODE
var linkalertlinkalertfinding3
(name originally given : "linkalert" (once)
but it is possible I made some error while testing (?)
[2nd test : I confirm duplication of initial part of variable name)

Just as it is, and considering the user must know what he is doing whan choosing strings to process or not, it is already very efficient ! Many thanks again smile.gif caro amico palermitano smile.gif
dafi
QUOTE(Goofy @ Sep 30 2006, 17:26) [snapback]19503[/snapback]

- there seem to be a useless detection of linebreakers recognized as strings, there are displayed thus : '\n'
I suggest they should not break the process, because the sentence is going on in the same string. (no need to break and begin a new string)

I'm a bit confused, please may you make an example?

QUOTE(Goofy @ Sep 30 2006, 17:26) [snapback]19503[/snapback]

- the customized name at the beginning og the variable seems to duplicate itself, e.g :
CODE
var linkalertlinkalertfinding3
(name originally given : "linkalert" (once)
but it is possible I made some error while testing (?)
[2nd test : I confirm duplication of initial part of variable name)

Yes, confirmed bug.
I've already fixed it, I hope to upload on dafizilla a more usable version.

Goofy
smile.gif I attach here a zipped .js file for testing purpose and you will see what I mean about linebreakers \n and other signs.
Here is a screenshot too.

By the way, the line numbers are entirely wrong laugh.gif
dafi
QUOTE(Goofy @ Sep 30 2006, 19:27) [snapback]19513[/snapback]

smile.gif I attach here a zipped .js file for testing purpose and you will see what I mean about linebreakers \n and other signs.
Here is a screenshot too.

Now is clear, ok I can exclude all single char strings and escape sequences.

QUOTE(Goofy @ Sep 30 2006, 19:27) [snapback]19513[/snapback]

By the way, the line numbers are entirely wrong laugh.gif

Oh my God this is true surprise.gif
Ok next build will fix also this wink.gif
dafi
You can find a new build here.
Fixed bugs described in previous posts and added the ability to pass a file containing regular expressions used to exclude strings to externalize in JS files.

The file is not mandatory, if not passed a default set is used that removes escape sequences and single chars surronded by whitespaces.

Goofy I think only you and me use Externalize sad.gif
Goofy
smile.gif yes successful first test (see attachment with original js file / modded file / output properties one)

The useless characters and signs did not appear in the list. Fine. Some little things now :

1. I think it should be "on line 32" instead of "at line 32" (just a detail, sorry for annoying you)
2. The xml parser should :
- Not localize numbers in lines like
CODE
label value="30"

- still localize lines like
CODE
label value="30 seconds"
(it does it well already)


QUOTE
Goofy I think only you and me use Externalize

Dear Davide smile.gif
Please consider that indirectly you are giving great help to developers. Last night I Externalized another extension (#55) and sent it to the author. I generally receive enthusiastic feedback and heaps of thanks that YOU deserve !

What you MUST do NOW :
1. Post a message and link on this Moz'ine forum
http://forums.mozillazine.org/viewforum.php?f=19
with a short explanation
2. Submit your extension on Moz addons.

I know your arguments, here are my answers :
- But Goofy this extension is under development,I cannot make it public before it is perfect!
- Oh yes you can! I am testing new submitted extensions every day and i can tell you half of them are badly working, very uncomplete or just silly. Externalize is working now, is very advanced now, and a smart process.
- But Goofy, I have serious work to do, and few free time to manage this extension and its release process
- Consider the time you have already spent on it (because of my insistence dry.gif ) : it is nothing to spend 30 minutes to release it as official. I am sure you are too modest, you are not a bonsai programer : your work deserves public recognition smile.gif
- OK, Goofy, I shall do that
- Good Davide, now you are reasonable biggrin.gif



Now just say OK wink.gif
dafi
QUOTE(Goofy @ Oct 1 2006, 10:21) [snapback]19547[/snapback]

1. I think it should be "on line 32" instead of "at line 32" (just a detail, sorry for annoying you)

Oh yes, I think both forms are legal but "on line 32" sounds well.

QUOTE(Goofy @ Oct 1 2006, 10:21) [snapback]19547[/snapback]

2. The xml parser should :
- Not localize numbers in lines like
CODE
label value="30"

- still localize lines like
CODE
label value="30 seconds"
(it does it well already)

You are right, maybe must be defined an exclusion list based on value.
Now JS has an regular expression oriented exclusion list that can be shared by xml.

QUOTE

Please consider that indirectly you are giving great help to developers. Last night I Externalized another extension (#55) and sent it to the author. I generally receive enthusiastic feedback and heaps of thanks that YOU deserve !

I'm not sure blink.gif

QUOTE

What you MUST do NOW :
1. Post a message and link on this Moz'ine forum
http://forums.mozillazine.org/viewforum.php?f=19
with a short explanation

I think MozillaZine guys are not interested to this work, but I can try, the discussion is located here.

QUOTE

2. Submit your extension on Moz addons.

This requires too much work, I must create an homepage and a serious deployment process.
Considering the low user feedback this can be a waste time.

QUOTE

I know your arguments, here are my answers :

Oh oh, you know me too much well surprise.gif
Pedro
QUOTE(dafi @ Oct 1 2006, 09:37) [snapback]19546[/snapback]
Goofy I think only you and me use Externalize sad.gif



No! You aren't alone tongue.gif !

I am trying, from some day, to understand precisely how it works wink.gif ...but I never will be a great tester as JB ops.gif

Bye bye
Goofy
No dear friend there is nothing difficult in its use/test, I should have written a proper howto guide, sorry for being lazy...
Pedro
QUOTE(Goofy @ Oct 1 2006, 15:14) [snapback]19560[/snapback]

No dear friend there is nothing difficult in its use/test, I should have written a proper howto guide, sorry for being lazy...

laugh.gif laugh.gif laugh.gif

You are lazy? mellow.gif You aren't right!!! biggrin.gif

I am lazy and I read slowly you wiki page tongue.gif
Pedro
Great job JeanBernard: your new improvements on the wiki page are understandable for me too laugh.gif

Thank you very much biggrin.gif
dafi
Another little fix.

Now xml and js share the exclusion values list.
The default regular expression has been updated to match string containing only digits.
This means that now values containing only digits are skipped for DTD and properties files.

I've modified some Externalize label to better describe the behaviour.

You can find new build here

I have added Externalize to WTS

Goofy
smile.gif Very good news again, thanks so much Davide!
(very minor) the localized description line in english should mention js files as well.

@Pedro : now the interface (in english) is more stable, maybe you can make a set of screenshots (if you have time) to match the "ten easy steps" wiki section (?). You have just to register on the wiki then use "Upload files" in the left-hand menu. You can add images wherever you want and save : it is a wiki, feel free to use it smile.gif
Thanks.
Pedro
Sure Jean Bernard IPB Image

If it's on time I will do it this night IPB Image

I send you a PM if I find some problem with the wiki, ok? tongue.gif

Bye bye smile.gif
Goofy
QUOTE(Pedro @ Oct 2 2006, 10:12) [snapback]19590[/snapback]

Sure Jean Bernard IPB Image

If it's on time I will do it this night IPB Image

I send you a PM if I find some problem with the wiki, ok? tongue.gif

Bye bye smile.gif


Just fine, thanks. There is no hurry smile.gif

Goofy
hello Davide smile.gif

I copy for you some bits of our exchanges with Pedro (who stuffed the wiki page with nice screenshots smile.gif ), he is also testing the extension now.
we agree below on :
1. The items listed for js file should be UN-checked by default
2. The report counter is disabled for js files


QUOTE
Message Forwarded From Pedro

[snip]
QUOTE
btw : I think that considering the great number of detected items in every js file and the limited number of those who deserve to be localized, the default setting for each item should be "UN-notched" (so that we have to notch only the few ones).
Tell me what you think and we will report to Dafi.

see you soon smile.gif
- jean-bernard


I think your point of view is right! I was becaming crazy to uncheck all the items... and this files are really small tongue.gif

Another thing...
In my sistem, parsing the .js file nothing is displayed in the dialog box : Entities created 0 ; Tags/Attributes blank: 0 ; Tags/Attributes ignored: 0
The same for you?
dafi
QUOTE(Goofy @ Oct 2 2006, 23:37) [snapback]19626[/snapback]

hello Davide smile.gif

I copy for you some bits of our exchanges with Pedro (who stuffed the wiki page with nice screenshots smile.gif ), he is also testing the extension now.

Thanks to Pedro to create the screenshots (wow they are impressive) and to test Externalize.

QUOTE

we agree below on :
1. The items listed for js file should be UN-checked by default

Well I can add two buttons:
1. uncheck all
2. check all

so you can choose what to do.

Should be useful a third button? Invert selection (so unchecked became checked and checked became unchecked) please tell me what do you think about Invert button/

QUOTE

2. The report counter is disabled for js files

Oh yes, but this is a minor bug wink.gif

I'm working to fix an annoying behaviour: group together equals strings.

Goofy
QUOTE
Well I can add two buttons:
1. uncheck all
2. check all


Very good smile.gif
It will be largely sufficient, no need of a 3rd button, thanks ! smile.gif


QUOTE
Oh yes, but this is a minor bug

yes of course smile.gif. let's say that considering people will check the very items they want to localize, it is not necessary

QUOTE

I'm working to fix an annoying behaviour: group together equals strings


ah, you mean when there are 3 or 4 times the same string in a js, and it is unnecessary to write 3-4 times the same codeline to localize it ?

------something else
Pedro is currently testing the localization of measureit extension and got problems with the .js file strings. I tested too with similar failure.
I suspect the very place in the file where the variables are defined is not satisfactory because their value is "undefined" when testing the extension.

To help you see with your expert eagle eyes, I attach here the extension. the problem is in the measureitOverlay.js file (also aincluded : measureitOverlayOriginal.js obviously the original unchanged file)

(Basic use : displays a scale to measure anything in px. )

- The tooltip messages for the customized toolbar button (Measure it on / measure it off) are displaying OK (on lines 23 and 33)
- The other messages that produce undefined error are :
"H" (for height) variable on line 289
"W" (for Width) variable on line 292
"Click to remove this" variable on line 185

(I have tried to set the variable substitution lines at some other places without success.)

Sorry for annoying you once again. Pedro is as convinced as I am that you are really performing a great useful job here.smile.gif




dafi
QUOTE(Goofy @ Oct 3 2006, 08:10) [snapback]19633[/snapback]

ah, you mean when there are 3 or 4 times the same string in a js, and it is unnecessary to write 3-4 times the same codeline to localize it ?

Exactly.

QUOTE(Goofy @ Oct 3 2006, 08:10) [snapback]19633[/snapback]

------something else
[SUPER-MEGA-CUT]

Dafi debug mode enabled, please wait some other days, actually I'm very busy sad.gif

QUOTE

Sorry for annoying you once again. Pedro is as convinced as I am that you are really performing a great useful job here.smile.gif

You don't annoy me wink.gif
Please wait some days so I can investigate the problem, the problem actually is out of sight.

On WTS I've uploaded a version with select/unselect buttons and an extra button that allows to change the generated name.


Pedro
Thanks Davide biggrin.gif

I download it immediately tongue.gif
Goofy
Grazie mille Davide biggrin.gif
dafi
About measureit.

The problem is the drag&drop measureit code.

I've made a simple and innocent modification to measureit downloaded from addon.mozilla.org.
Into measureitOverlay.js I've added on top the following line that write a debug message on javascript console

CODE

        Components.classes["@mozilla.org/consoleservice;1"]
        .getService(Components.interfaces.nsIConsoleService)
            .logStringMessage("test");


This generates the same error generated by bundle code.
Actually I can't test but probably adding a <stringbundle/> into xul file can work.
Goofy
QUOTE
probably adding a <stringbundle/> into xul file can work

sad.gif i have tried to define the stringbundle in the xul file
with the old way :

CODE

<stringbundleset id="stringbundleset">
   <stringbundle id="extname-strings" src="chrome://extname/locale/extname.properties"/>
</stringbundleset>

and

var message = document.getElementById('extname-strings').getString("PropName");





... but without success. dry.gif I am not qualified enough to debug. Sorry.
dafi
QUOTE(Goofy @ Oct 6 2006, 20:32) [snapback]19817[/snapback]

sad.gif i have tried to define the stringbundle in the xul file
with the old way :

CODE

<stringbundleset id="stringbundleset">
   <stringbundle id="extname-strings" src="chrome://extname/locale/extname.properties"/>
</stringbundleset>

and

var message = document.getElementById('extname-strings').getString("PropName");


... but without success. dry.gif I am not qualified enough to debug. Sorry.

I'm sorry but problem doesn't depend by Externalize, IMHO author must be contacted sad.gif
Goofy
QUOTE
problem doesn't depend by Externalize


Of course you are right : even manually I could not succeed mellow.gif
Pedro
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
Goofy
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)
dafi
QUOTE(Goofy @ Oct 7 2006, 20:30) [snapback]19866[/snapback]

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)
Goofy
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.
Goofy
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.
dafi
QUOTE(Goofy @ Oct 8 2006, 09:19) [snapback]19887[/snapback]

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
Goofy
--- 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/
dafi
QUOTE(Goofy @ Oct 8 2006, 09:25) [snapback]19889[/snapback]

--- 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]
Goofy
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 !
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.