Page Index Toggle Pages: [1] 2 3 ... 5
Topic Tools
Very Hot Topic (More than 25 Replies) Optimizing .lng files (Read 19,624 times)
cepheid
Senior Member
****
Offline



Posts: 516
Re: Optimizing .lng files
Reply #60 - Jan 10th, 2010 at 7:38am
Post Tools
Much of this should probably go into CVS... language cleanup I would personally consider a "bug fix" since it helps make things clearer, plus the minor bugfix for the Collapse/Expand links.
  
Back to top
WWW  
IP Logged
 
Unilat
Development Team
Theme Team
****
Offline



Posts: 1,047
Location: Columbus Ohio, USA
Re: Optimizing .lng files
Reply #59 - Jul 8th, 2009 at 10:09pm
Post Tools
I'm not sure how I got those backwards. It must have been right as some point or I would of noticed in the several months its been live  Cheesy

I must be going crazy.
  
Back to top
 
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Optimizing .lng files
Reply #58 - Jul 8th, 2009 at 10:01pm
Post Tools
cepheid wrote on Jul 8th, 2009 at 9:42pm:
also, this makes the function call consistent with SendRequest

I don't see any need for this consistency.

Done back in some parts. New
cgi-bin/yabb2/Sources/BoardIndex.pl

public_html/yabbfiles/ajax.js
in SVN.

The fix for the backward alt I overtook, also for the title. Thanks!

cepheid wrote on Jul 8th, 2009 at 9:42pm:
In reality, both of them could be rewritten to only take a single argument.

I don't think so. Unilat did a good job when he wrote this. For the Collapse_All we have two buttons in the BoardIndex.pl but for the SendRequest we only have one, so we need two arguments for it. Wink
« Last Edit: Jul 8th, 2009 at 10:05pm by deti »  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Optimizing .lng files
Reply #57 - Jul 8th, 2009 at 9:42pm
Post Tools
deti wrote on Jul 8th, 2009 at 9:04pm:
Hmmmm, can you tell me why you added this

Because the code was written backwards... when you clicked "Collapse All," the ALT tag was turned into "Collapse" instead of "Expand."  Vice-versa for "Expand All."  The "lng" variable was always there, but was being set backwards.  This could have been fixed by simply changing "Collapse" to "Expand" in the function call within BoardIndex.pl, but then it would have looked weird... also, this makes the function call consistent with SendRequest, which was also done backwards.

(The easiest way to see this is to use the Firebug extension to Firefox.  Right-click on the collapse-box and select "Inspect Element."  Then, watch what happens to the code as you repeatedly collapse/expand the category, and/or as you use the Collapse All button.)

In reality, both of them could be rewritten to only take a single argument.  Would you like me to rewrite them both to do that?  I can.  In the meantime, though, I recommend applying the patches as-is, because it does fix the existing bug (that the ALT tags are set backwards).  It also adds code to set the TITLE tag properly, which was not done at all by either SendRequest or CollapseAll - that is actually important, because the mouseover tooltips are determined by the TITLE tag, and they weren't being changed at all.
« Last Edit: Jul 8th, 2009 at 9:46pm by cepheid »  
Back to top
WWW  
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: Optimizing .lng files
Reply #56 - Jul 8th, 2009 at 9:34pm
Post Tools
I noticed that, but didn't read into it enough to notice what it was doing. What is the reasoning for that?
  

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Optimizing .lng files
Reply #55 - Jul 8th, 2009 at 9:04pm
Post Tools
@ cepheid

Hmmmm, can you tell me why you added this
Code
Select All
function Collapse_All (url,action,imgdir,lng_collapse,lng_expand) { 


in your patch?

As far as I can see this is not needed! It was OK as it was before
Code
Select All
function Collapse_All (url,action,imgdir,lng) { 


Because if action is 1 then lng == Collapse and if
action is 0 then lng == Expand.

So, no need for your additional code in ajax.js and BoardIndex.pl.

Huh
  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Optimizing .lng files
Reply #54 - Jul 8th, 2009 at 6:57pm
Post Tools
Matt Siegman wrote on Jul 8th, 2009 at 2:37pm:
Then again, TortoiseSVN creates diffs based on different version with the same filename, so they might have gotten their thinking confused when it came to patches.

It's possible, I'm not certain.  Since it's an SVN program, they have a different mentality when it comes to filenames... everything has the same name - that's what versioning is for. Smiley  I don't know if I'd call it a bug more than a different philosophy of applying patches.  I guess I'd call it "wrong" in the sense that it's completely backwards from how most other patch utilities work.

If you're going to be using Tortoise for future patches, I can edit the patch files to remove the .bak, maybe that will work better.  Of course, if you just approve me as a dev, I can apply the patches myself. Wink Grin
  
Back to top
WWW  
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: Optimizing .lng files
Reply #53 - Jul 8th, 2009 at 2:37pm
Post Tools
The TortoiseSVN patcher seems to look for the old file instead of the new file. I wonder if that's a bug or something.

Then again, TortoiseSVN creates diffs based on different version with the same filename, so they might have gotten their thinking confused when it came to patches.
  

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Optimizing .lng files
Reply #52 - Jul 8th, 2009 at 5:43am
Post Tools
Matt Siegman wrote on Jul 8th, 2009 at 2:40am:
For some reason, they were set to modify ".bak" versions of the file

They work just fine on this end.  How were you applying them?  If you do "patch -p0 < patchfile" then it will recognize the filenames automatically and will work just fine.  I ran the patches this way (as I do every time I submit them) and they always work just fine...

The "old" file is named .bak, but the patch utility ignores the filename of the old (---) file; it uses only the filename of the new (+++) file, which is correct in all the patchfiles submitted.

So, basically, this is standard behavior with patchfiles... at least, where I come from. Wink
  
Back to top
WWW  
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: Optimizing .lng files
Reply #51 - Jul 8th, 2009 at 2:40am
Post Tools
I applied the patches, which I downloaded this evening. For some reason, they were set to modify ".bak" versions of the file, you should look into fixing that with however you're doing diff Wink
  

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Optimizing .lng files
Reply #50 - Jul 7th, 2009 at 6:21pm
Post Tools
deti wrote on Jul 7th, 2009 at 1:05pm:
Hmmmm, are you able to make a zip with the modified files in it, and attach it here?

The reason I use a patch file (a "unified diff" file, created with 'diff') is because it can apply even if other changes have been made to the file (kind of the way BoardMod works), as long as those changes aren't around the lines that are included in the patch.  Generally, patches can be applied in one go, which saves you the work of having to go through each individual change using WinMerge.

If you prefer whole files, I'll do that in the future, but the patches should be easier... TortoiseSVN should be able to apply them - I'm surprised it's not working.  Did you get a specific error?  I can try a different format for the patch file (e.g. a context diff instead of a unified diff), if so.

You might also want to look at the GnuTools link I posted earlier, especially the 'patch' utility.  As a programmer, I rely on those tools daily, and they save me a heck of a lot of time!  Obviously, you have your own workflow and you might not like or need those tools; I'm just suggesting them.

deti wrote on Jul 7th, 2009 at 3:33pm:
"Sent Box" everywhere - as it is at the moment.

I happen to be from the generation that thinks of it as an Outbox, rather than Zoro, who is of the generation that thinks of it otherwise... Wink  But I've changed it back to Sent Box (with proper capitalization); I understand wanting to keep that way.

I've changed the patch.

deti wrote on Jul 7th, 2009 at 3:33pm:
Hmmm, "group information" in the Members folder? Better this?:

Well, there is "group information" - memberinfo.txt indicates to which group any member belongs.  It's not info about the specific group, but it is "group info" in the sense that this is the only place that indicates a member's group affiliation.

But, I've changed it as you recommended, since it's more complete.

Please re-download the two patches before applying. Smiley
« Last Edit: Jul 7th, 2009 at 6:29pm by cepheid »  
Back to top
WWW  
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Optimizing .lng files
Reply #49 - Jul 7th, 2009 at 3:33pm
Post Tools
Can you do it please Matt? I can make the SVN-tool run but it doens't apply the patch ...

Some things must be modified in the patches:
Languages/English/BoardIndex.lng
Code
Select All
-'320' => 'Sent box',
+'320' => 'Outbox', 


This is not correct. See:
http://www.yabbforum.com/community/YaBB.pl?num=1237485777
Please let it be consistent:
"Sent Box" everywhere - as it is at the moment.

Languages/English/Backup.lng
Code
Select All
-'9', '(contains all the member profiles)',
+'7', '-- (contains category and board information and indexes)',
+'8', '-- (contains all threads/topics and included posts)',
+'9', '-- (contains member profiles and group information)', 


Hmmm, "group information" in the Members folder? Better this?:
'-- (contains member profiles, member logs and private messages)'
« Last Edit: Jul 7th, 2009 at 3:34pm by deti »  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
Matt Siegman
YaBB Legends (Inactive)
*
Offline



Posts: 3,380
Location: Wichita, KS
Re: Optimizing .lng files
Reply #48 - Jul 7th, 2009 at 2:33pm
Post Tools
deti, TortoiseSVN seems to have patching built in.

Here is the info:
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-patch.html#tsvn-dug-...

If you can't get the patch put in, I can add it tonight. Let me know.
« Last Edit: Jul 7th, 2009 at 2:33pm by Matt Siegman »  

-- Matt Siegman 8) Wish List
Back to top
 
IP Logged
 
deti
Legacy Dev Team
Development Team
****
Offline



Posts: 2,650
Location: Prien am Chiemsee, Germany
Re: Optimizing .lng files
Reply #47 - Jul 7th, 2009 at 1:05pm
Post Tools
Hmmmm, are you able to make a zip with the modified files in it, and attach it here? This would be easier for us. The differences in the files I then can see easily using WinMerge, a file comparing program. Thanks!
« Last Edit: Jul 7th, 2009 at 1:06pm by deti »  

Was immer Du tun kannst
oder erträumst tun zu können,
beginne es.
Kühnheit besitzt Genie,
Macht und magische Kraft.
Beginne es jetzt.
Whatever you can do
or dream you can,
begin it.
Boldness has genius,
power and magic in it.
Begin it now.
J. W. Goethe
Back to top
WWW  
IP Logged
 
cepheid
Senior Member
****
Offline



Posts: 516
Re: Optimizing .lng files
Reply #46 - Jul 7th, 2009 at 12:23pm
Post Tools
deti wrote on Jul 7th, 2009 at 11:31am:
Is there a program to apply the patch automatically?

If you're using Linux, yes: 'patch' ... I don't know about Windows.  I'm sure there must be some utility that can apply "unified diff" files as patches, but I use Linux/Mac so I don't really know.  I think your SVN program may be able to apply it... are you using TortoiseSVN?  The help files should explain how to apply a patch.  Or, you can download a Windows version of 'patch' here, along with a bunch of other Gnu tools. Smiley
« Last Edit: Jul 7th, 2009 at 12:26pm by cepheid »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 2 3 ... 5
Topic Tools
 
  « Board Index ‹ Board  ^Top