Some people have been running into issues with the PHP Gettext extension. The problem is that to use the extension right, it requires that a lot of server environmental variables to be tinkered just right. And I’m not even sure it works on Windows (to be honest, I don’t test on Windows servers at all).
However, I was looking at the MO format specification and it is pretty easy to parse, so I wrote a custom implementation of Gettext in PHP. This custom implementation does not rely on the Gettext extension at all, so this will also solve the problem for people who need to localize and don’t have the extension installed.
Because I didn’t want to introduce such a sweeping change in a point-release, this is currently disabled. With a hidden toggle and a simple query, you can try out the new localization feature if Gettext is giving you trouble.
Steps to enable the new MOReader localization system:
- Open includes/config.php and add this line anywhere in the file:
$debug = 1;
-
Go to Administration –> Bugdar Settings and find the setting labeled “Custom Gettext Localizer” and enable it.
-
Run this SQL query to clear the template cache (and thus all the calls to the old localization system):
TRUNCATE TABLE template
- Back in includes/config.php, remove the line you added above. Debug mode should not be used in a production environment.
This hidden toggle will disappear in 2.0 because it will be the default (and only) translation system. But like I said, it was too big to make the default in a maintenance release. You will only have to enable this once (it will stick across upgrades, etc.). If you want to disable it, just follow the above steps, but just flip the switch to “No.”
Regarding Thursday’s announcement of an iPhone SDK:
I am most certainly interested in writing iPhone apps. The beautiful device tempts me. Thankfully, however, I do not have any ideas for phone apps at the moment (which means no new ideas in the pipeline). I’ll update if anything strikes me. And until that point, I won’t be shelling out the $99 for a certificate.
Posted on February 28, 2008 at 20:59 UTC,
filed under the category
Uncategorized.
Tags:
Bugdar,
free time,
ISSO,
MacGDBp,
mkrcpt,
MyWishlist,
NewzGrab,
pipeline,
WebFreeChart,
It’s time to talk pipelines. Initially, I was going to talk timelines. But timelines have the problem of addressing time, which is very difficult when you have 40+ hours of activities and school to do during the week. So, pipelines.
I’d like to start by announcing the completion of ISSO3. I’ll go into the details of why it took so incredibly long to finish in a future post, but you should know that it is finally done. What does the completion of ISSO3 mean? It means that all PHP projects can now resume development and use this framework. ISSO3 also requires PHP 5.2, which means that any future major releases of PHP projects will require PHP5.
That’s one less thing in the pipeline!
But what else is in this (expansive) pipeline? (Note: This is roughly in order of when the items will be finished. I very may well skip around and work on various projects when I feel like it, but this order is based on how much work is done versus how much has to be done).
mkrcpt
I compile a lot of open source projects myself rather than using ports or fink. Many people are familiar with the make; make install
process. One of the problems with make, though, is that there’s no uninstaller. This to me is a problem. So I decided to solve said problem. Enter two very small C programs: mkrcpt and unrcpt. Instead of typing make install
, you would invoke mkrcpt. What mkrcpt does is it index all of the items in the installation path by last modified date, then runs make install
for you, and reruns the index algorithm. It then stores all the changed files in a receipt file. If you ever want to uninstall a program, just run unrcpt.
What’s left: Testing and a few fixes to the receipt file format.
MacGDBp
PHP developers have access to a really cool extension called Xdebug that has remote debugging functionality via a protocol called GDBp. Both Windows and Linux have GUI clients for this protocol, but the Mac does not. The lack of a client irked me because the functionality is quite helpful.
What’s left : The basic functionality is all done, but there’s still a bit left to do to make it useable. Those items are: adding line numbers to source views, adding breakpoints (currently you use the xdebug_break() function in your code), and making an icon.
CMS
No, I’m not writing another CMS solution to compete with Joomla, ExpressionEngine, etc.. This is a private project for my university’s TV station. The website is going to be completely redone to allow for modular content blocks and dynamic templates. The project looks fairly straightforward, so it shouldn’t block things in the pipeline.
What’s left: I haven’t started writing a single line of code yet, but it’s completely planned out.
Bugdar 2
I am very excited about working on Bugdar 2, but as you can see, there are a lot of things in the pipeline. I’ll post more about this as the pipeline start’s clearing up and work begins.
What’s left: Everything.
NewzGrab
This is another Mac app that will take in Newzbin (.nzb) files and download them from your favorite NNTP server. I’ve only mapped out the classes and hand-drawn a mockup interface. More on this will be posted as work commences.
What’s left: Everything.
MyWishlist
A while ago I had a project called MyWishlist that allowed you to setup a wishlist site for you and your friends/family. I won’t go into the details here, but I’m rewriting it to be a hosted application as opposed to a downloaded one. Don’t expect it anytime soon because it’s a very low-priority item.
What’s left: Deciding what language to write it in. Ruby? PHP? Python? Who knows?!
WebFreeChart
This is a PHP5 OOP charting library. It’s boring to work on. But I need it. It’ll happen… eventually.
What’s left: Almost everything.
So, the above is a list of all the projects I’m juggling. It’s a lot. There is no timeline as to when things will be done. I wish I could give one, but with the amount of Real Life ™ things I have to do, I just work when I’m not tired, I’m in the mood, and I have free time. If those three stars align, progress gets made. I’ll keep you guys updated on any major developments. Your patience is appreciated.
I’ve recently been doing some work on WebKit and I want to run the latest nightly builds of Safari/WebKit so I’m no longer plagued by a bug I patched. I don’t want to have to manually download the most recent nightly build and place it in my Applications folder, I want it done for me.
According to the WebKit FAQ, there’s software to do this for you, but it didn’t work for me when I downloaded it (I don’t think the symlink to the latest build works, which is what it relied on). So, I wrote my own cron script to do it.
The script is written in Ruby and I have my cronjob set up like such:
30 21 * * * ~/Library/Shell/webkit-download.rb
Basic operation of the script:
- Grab the contents of nightly.webkit.org
- Find the path to the latest DMG
- Download and mount the DMG
- Move the old /Applications/WebKit.app to the trash and date-stamp it
- Copy the latest WebKit.app from the DMG and then umount
If you’re interested, you can get the script here:
webkit-download.rb (~1.4 KB)
Last weekend my friends and I discovered the Scrabulous application on Facebook. Personally, I am very bad at Scrabble, but my friends insisted that I play. The game was starting to hurt my head and I was getting frustrated, so I wrote a program to do the thinking for me. Enter Scrabbalize.
Scrabbalize is quite simple. You type in all the letters (“tiles”) for your game into the text box as one long string. Press go, and then the program will run through a dictionary, finding all the words that have some or all of your letters. It then sorts the words by length so you can see your best options.
It is written in Cocoa and it requires Mac OS X 10.5 beacuse I wanted to try garbage collection and fast enumeartion. Both of these things make my life significantly easier, so expect all future Mac OS X applications to require 10.5. Of course, the source code is available if you want to take a gander.