GNOME Bugzilla – Bug 72219
intltool should support new format glade files
Last modified: 2004-12-22 21:47:04 UTC
I just wrote a quick hack to get intltool to handle new style glade files. This is needed to handle translations in the interface files of various gnome 2.0 programs. It also makes intltool treat files with the extension glade2 like glade files (once everything settles down with the new glade, most people will just be calling them .glade files. But for now with people running libglade-convert as part of the build process, this is necessary). It just tacks on an extra check to the current glade file handling in intltool-extract. This seemed like the easiest way to fix things, and shouldn't cause any breakage.
Created attachment 6820 [details] [review] Add support for new style glade files to intltool
Looks fine to me. You have my OK to commit to intltool. You can tweak it by using the regex glade2?(\.in)* instead of making two separate cases for the glade 1 and glade 2 files. Also, this code: /<(property|atkproperty)\s+[^>]*translatable="yes"[^>]*>([^<]+)<\/(property|atkproperty)>/ has a number of weaknesses. First, you should use \1 instead of (property|atkproperty) the 2nd time -- that way it will work only if the tags match, and the regex will be shorter. But also, the use of [^>] means you'll have big problems if anyone puts a ">" character in double quotes. You can probably make a regex that will handle that better, but it's not necessary.
Oh darn, forgot the most important thing! If you add this support to intltool, you should also add a test for this type of file to the intltool test directory. Let me know if you need help figuring out how to do that.
This seems to be a duplicate of bug 69017.
*** Bug 69017 has been marked as a duplicate of this bug. ***
Checked in with Darin's change recommendations, and a test case (the simple.glade example from libglade). Marking fixed. Anyone want to verify?