Workaround for bad fonts in Google Earth 5 (Linux)
So you just installed Google Earth 5 and you can’t figure out what’s wrong with the fonts? If your language does not use the Latin script, you cannot see any text?
Here is the workaround. The basic info comes from this google earth forum post and the reply that suggests to mess with the QT libraries.
Google Earth 5 is based on the Qt library, and Google is using their own copies of the Qt libraries. This means that the customisation (including fonts) that you do with qtconfig-qt4 does not affect Google Earth. Here we use Ubuntu 8.10, and we simply installed the Qt libraries in order to use some Qt programs. You probably do not have qtconfig-qt4 installed, so you need to get it.
So, by following the advice in the post above and replacing key Qt libraries from Google Earth with the ones provided by our distro, solves (read: workaround) the problem. Here comes the science:
If you have a 32-bit version of Ubuntu,
cd /opt/google-earth/ sudo mv libQtCore.so.4 libQtCore.so.4.bak sudo mv libQtGui.so.4 libQtGui.so.4.bak sudo mv libQtNetwork.so.4 libQtNetwork.so.4.bak sudo mv libQtWebKit.so.4 libQtWebKit.so.4.bak sudo ln -s /usr/lib/libQtCore.so.4.4.3 libQtCore.so.4 sudo ln -s /usr/lib/libQtGui.so.4.4.3 libQtGui.so.4 sudo ln -s /usr/lib/libQtNetwork.so.4.4.3 libQtNetwork.so.4 sudo ln -s /usr/lib/libQtWebKit.so.4.4.3 libQtWebKit.so.4
If you have the 64-bit version of Ubuntu, try
cd /opt/google-earth/
sudo getlibs googleearth-bin
sudo mv libQtCore.so.4 libQtCore.so.4.bak
sudo mv libQtGui.so.4 libQtGui.so.4.bak
sudo mv libQtNetwork.so.4 libQtNetwork.so.4.bak
sudo mv libQtWebKit.so.4 libQtWebKit.so.4.bak
sudo ln -s /usr/lib32/libQtCore.so.4.4.3 libQtCore.so.4
sudo ln -s /usr/lib32/libQtGui.so.4.4.3 libQtGui.so.4
sudo ln -s /usr/lib32/libQtNetwork.so.4.4.3 libQtNetwork.so.4
sudo ln -s /usr/lib32/libQtWebKit.so.4.4.3 libQtWebKit.so.4
Requires to have getlibs installed, and when prompted, install the 32-bit versions of the packages as instructed.
Now, with qtconfig-qt you can configure the font settings.
Playing with Git
Git is a version control system (VCS) software that is used for source code management (SCM). There are several examples of VCS software, such as CVS and SVN. What makes Git different is that it is a distributed VCS, that is, a DVCS.
Being a DVCS, when you use Git you create fully capable local repositories that can be used for offline work. When you get the files of a repository, you actually grab the full information (this makes the initial creation of local repositories out of a remote repository slower, and the repositories are bigger).
You can install git by installing the git package. You can test it by opening a terminal window, and running
git clone git://github.com/schacon/whygitisbetter.git
The files appear in a directory called whygitisbetter. In a subdirectory called .git/,git stores all the controlling information it requires to manage the local repository. When you enter the repository directory (whygitisbetter in our case), you can issue commands that will figure out what’s going on because of the info in .git/.
With git, we create local copies of repositories by cloning. If you have used CVS or SVN, this is somewhat equivalent to the checkout command. By cloning, you create a full local repository. When you checkout with CVS or SVN, you get the latest snapshot only of the source code.
What you downloaded above is the source code for the http://www.whygitisbetterthanx.com/ website. It describes the relative advantages of git compared to other VCS and DVCS systems.
Among the different sources of documentation for git, I think one of the easiest to read is the Git Community Book. It is consise and easy to follow, and it comes with video casting (videos that show different tasks, with audio guidance).
You can create local repositories on your system. If you want to have a remote repository, you can create an account at GitHub, an attractive start-up that offers 100MB free space for your git repository. Therefore, you can host your pet project on github quite easily.
GitHub combines source code management with social networking, no matter how strange that may look like. It comes with tools that allows to maintain your own copies of repositories (for example, from other github users), and helps with the communication. For example, if I create my own copy of the whygitisbetter repository and add something nice to the book, I can send a pull request (with the click of a button) to the maintainer to grab my changes!
If you have already used another SCM tool (non-distributed), it takes some time to get used to the new way of git. It is a good skill to have, and the effort should pay off quickly. There is a SVN to Git crash course available.
If you have never used an SCM, it is cool to go for git. There is nothing to unlearn, and you will get a new skill.
Git is used for the developement of the Linux kernel, the Perl language, Ruby On Rails, and others.
How to install the 64-bit Adobe Flash Player 10 for Linux in Ubuntu Linux?
Update 2 May 2010: There is a repository for Flash 64bit at https://launchpad.net/~sevenmachines/+archive/flash Though I have not tried this, I suggest to give it a try. I tried this and it works like a charm. Uninstall flashplugin-nonfree, add the new PPA repository with sudo add-apt-repository ppa:sevenmachines/flash and then install flashplugin64-nonfree.
Again, the commands are
sudo apt-get remove flashplugin-nonfree
sudo add-apt-repository ppa:sevenmachines/flash
sudo apt-get install flashplugin64-nonfree
Original post: So you just read the announcement from Adobe for the alpha version of the 64-bit Flash Player 10 for Linux and you want to install in Ubuntu Linux?
Here is how to do it.
- First, we understand that the flashplugin-nonfree package that is currently available to those with 64-bit Ubuntu Linux, installs the 32-bit version of Flash and uses the nspluginwrapper tool to make it work.
- After some time, I expect that the flashplugin-nonfree will stop using nspluginwrapper and will simply install Adobe Flash Player 10 (64-bit) for Linux. So you need to have a look in your package manager and the package description in case flashplugin-nonfree has already been updated. If flashplugin-nonfree has been updated, stop reading now.
- Close Mozilla Firefox.
- Uninstall the flashplugin-nonfree package using your package manager, or simply running sudo apt-get remove flashplugin-nonfree
- Download the alpha version of the 64-bit Adobe Flash Player 10 for Linux and extract the file from the archive. You will get a libflashplayer.so file, which is about 10MB is size.
- If you want all users in your system to have this alpha version of Adobe Flash Player 10 for Linux, copy the libflashplayer.so file to /usr/lib/mozilla/plugins/. The command is sudo cp libflashplayer.so /usr/lib/mozilla/plugins/
- If you want just the current user to try out the Flash player, copy the libflashplayer.so file to /home/yourUSERNAME/.mozilla/plugins/. The command is cp libflashplayer.so ~/.mozilla/plugins/
- Check that in ~/.mozilla/plugins/ there is no dormant file with the name npwrapper.libflashplayer.so. A common issue with people who migrate their profiles is to perform a simply copy of the profile. The effect of this is sometimes there is an actual file called npwrapper.libflashplayer.so instead of a symbolic link. The result is that these people would end up using some old buggy version of nspluginwrapper which might be the cause of Firefox crashes! When you backup, use cp -a, so symbolic links remain symbolic links.
- You can now start Mozilla Firefox. Visit about:plugins and verify that the version of Flash is something like Shockwave Flash 10.0 d20. Make sure there is no remnant of any other previous Flash player.
- If you want to return back to the 32-bit Flash Player with emulation, remove the file we just added and install again the flashplugin-nonfree package.
The instructions for other distributions should be fairly similar.
Εγκατάσταση του Ubuntu 8.04
Ολοκλήρωσα πριν λίγο την εγκατάσταση του Ubuntu 8.04 (έκδοση 64bit). Περιγράφω παρακάτω τις επιλογές που έκανα και τα τυχόν προβλήματα που αντιμετώπισα.
Αν και είχα Ubuntu 7.10, επέλεξα να κάνω εγκατάσταση από την αρχή, διότι έχω κάνει τόσες αλλαγές στο σύστημα που είναι πολύ πιθανό η αναβάθμιση να μη λειτουργήσει. Ωστόσο, ο πιο σημαντικός λόγος της εγκατάστασης ξανά είναι να γλιτώσω από τη σαβούρα που μαζεύεται στην εγκατάσταση μετά από χρήση πολλών μηνών.
Έκανα λοιπόν εκκίνηση του υπολογιστή μου από το DVD του Ubuntu 8.04 (64bit), και εκτέλεσα το Σύστημα/Διαχείριση συστήματος/Partition editor. Εδώ, επέλεξα να κρατήσω αντίγραφο ασφαλείας της κατάτμησης / σε εξωτερικό δίσκο, σε περίπτωση που χρειαστώ να γυρίσω ξανά πίσω στο 7.10. Αυτό βοηθάει ακόμα για να δω λεπτομέρειες από την προηγούμενη εγκατάσταση, που πολύ πιθανό να χρειαστώ. Αργότερα είδα ότι το Ubuntu 8.04 κατάλαβε ότι υπάρχει εγκατάσταση 7.10 και την έβαλε στο μενού της εκκίνησης του υπολογιστή. Έτσι, έχω την επιλογή να μπω σε 7.10 πολύ εύκολα, με εκκίνηση στον εξωτερικό δίσκο USB.
Αυτό το καιρό έχω δύο κατατμήσεις, μια για το / και μια για /home. Έτσι, επέλεξα κατά την εγκατάσταση να μορφοποιηθεί η κατάτμηση για το /, ενώ να διατηρηθεί ως έχει το /home. Ακόμα, μιας και θέλω να ξεκαθαρίσω τα αρχεία μου στον κατάλογο χρήστη, επέλεξα διαφορετικό όνομα χρήστη. Έτσι, μετά το τέλος της εγκατάστασης έχω ένα καθαρό λογιαριασμό, και είμαι σε θέση να μεταφέρω (mv) καταλόγους ρυθμίσεων και αρχεία από τον παλαιό κατάλογο χρήστη κατά βούληση.
Με αυτό το τρόπο, πέρασα την αλληλογραφία μου με την εντολή
mv /home/oldaccount/.mozilla-thunderbird ~
Με τον ίδιο τρόπο μετέφερα το προφίλ μου για το Firefox. Πριν είχα Firefox 2.0, και στην μεταφορά έγινε ενημέρωση του προφίλ για το Firefox 3 του Ubuntu 8.04. Φυσικά ο Firefox πετάει αλλά αυτό το έχετε ακούσει από παντού.
Μετά εγκατέστησα το VirtualBox (πλήρη έκδοση, με υποστήριξη USB). Η βασική εγκατάσταση και χρήση μπορεί να γίνει εξ ολοκλήρου από το γραφικό περιβάλλον, και έτσι το έκανα. Κάνουμε τη λήψη του .deb (για τώρα επιλέγουμε την έκδοση για gutsy), και από την επιφάνεια εργασίας κάνουμε διπλό κλικ για να εγκατασταθεί το πακέτο. Μόλις ενημερωθεί το virtualbox.org με το νέο αποθετήριο για το Ubuntu 8.04, τότε μπορούμε να αποφύγουμε τη διαδικασία αυτή με προσθήκη του virtualbox στους τρίτους κατασκευαστές (third party), στις πηγές λογισμικού του Ubuntu Linux.
Χρειάζεται να προσθέσουμε τους χρήστες του συστήματός μας στην ομάδα vboxusers (γίνεται από το Σύστημα/Διαχείριση/Χρήστες και ομάδες) και μετά αποσύνδεση και σύνδεση ξανά.
Για να ενεργοποιήσουμε την υποστήριξη USB, χρειάζεται να περάσουμε στο τερματικό και να κάνουμε τις απαραίτητες τροποποιήσεις για τα αρχεία /etc/init.d/mountdevsusbfs.sh, /etc/init.d/mountkernfs.sh και /etc/fstab (τα δύο τελευταία είναι για ενεργοποίηση συσκευών όπως εξωτερικοί δίσκοι USB και άλλες πολλές συσκευές). Μετά θέλει επανεκκίνηση του συστήματος.
Η εγκατάσταση του Skype 2.0 σε 64-bit είναι γενικά μπελάς. Αυτό που έκανα είναι να προσθέσω το αποθετήριο medibuntu στις πηγές λογισμικού, τρίτους κατασκευαστές, και μετά να βάλω το πακέτο Skype. Κανένα πρόβλημα.
Εγκατέστησα και το Google Earth από το medibuntu, αλλά τίποτα άλλο. Είδα τα υπόλοιπα πακέτα του medibuntu, και αποφάσισα να απενεργοποιήσω για τώρα το αποθετήριο αυτό.
Ένα σημαντικό που δε δούλεψε με τη μια είναι ο ήχος. Διαβάζοντας από εδώ και εκεί, είδα αναφορές για λήψη του πηγαίου κώδικα της Alsa και μεταγλώττιση ξανά. Αυτό το πράγμα χρειαζόταν για το Ubuntu 7.10, ωστόσο ήμουν σίγουρος ότι δεν χρειάζεται πλέον για την κάρτα μου (snd-hda-intel). Με λίγο ψάξιμο είδα ότι απλά χρειάζεται να προστεθεί στο /etc/modprobe.d/alsa-base η γραμμή
options snd-hda-intel model=lenovo
και μετά επανεκκίνηση. Αυτό ήταν.
Αντίθετα με ότι κάνουν άλλοι χρήστες, προσωπικά δε θα βάλω χύμα κόντεκ για τις διάφορες μορφές πολυμέσων. Με χρήση των εφαρμογών Αναπαραγωγής ήχου και βίντεο, το σύστημα προτρέπει κάθε φορά να γίνει εγκατάσταση των απαιτούμενων πακέτων, αυτόματα.
Κοιτώντας την γενική υποστήριξη ελληνικών στο Ubuntu 8.04, πρέπει να πω ότι είναι αρκετά ευχαριστημένος. Έχει γίνει σημαντική δουλειά σε κάθε σημείο, από την αρχική οθόνη που ξεκινά ο υπολογιστής με το CD/DVD του Ubuntu μέχρι την επιφάνεια εργασίας. Στην οθόνη εκκίνησης έχουμε όλα (σχεδόν!) τα μηνύματα στα ελληνικά, εκτός από δύο (π.χ. Test memory, ήμουν σίγουρος ότι το έλεγξα αυτό αλλά δεν μπήκε στην τελική έκδοση!).
Στα παιχνίδια του Ubuntu, λάβαμε την απόφαση να έχουμε τα ονόματα στα ελληνικά (έτσι, Τετραβέξ αντί Tetravex). Αυτό είναι καλό μιας και τα παιδιά και οι δημόσιοι υπάλληλοι θα παίζουν αποκλειστικά τα παιχνίδια. Αφού και ο db0 δεν χρησιμοποιεί το ελληνικό περιβάλλον, δεν θα υπάρχει σχόλιο ούτε από την πλευρά του. Πάντως, αυτό που συνέβει είναι δύο παιχνίδια βγήκαν αμετάφραστα (Same GNOME, Gnometris) που χαλάνε κάπως τη λίστα, και θα διορθωθούν σε επόμενη έκδοση.
Στη μικροεφαρμογή του ρολογιού είναι δυνατόν να βάλει κάποιος την πόλη του, και το σύστημα θα δείξει την ώρα και τις καιρικές συνθήκες. Δοκιμάστε με πόλεις όπως Θεσσαλονίκη, Καβάλα, Ρόδος, Χανιά, κτλ.
Μιας ακόμα αλλαγή είναι στη συντόμευση για την ελληνική γλώσσα, στην μικροεφαρμογή για την ένδειξη πληκτρολογίου. Τώρα βάλαμε ΕΛΛ (για Ελλάδα), αντί του προηγούμενου Ελλ. Έτσι, συμβαδίζει με το αμερικάνικο πληκτρολόγιο και την ένδειξη ΗΠΑ. Σε επόμενη έκδοση του Ubuntu θα δείχει ΑΓΓ για κάθε αγγλική διάταξη πληκτρολογίου, και αυτό θα γίνει στο πακέτο μετάφρασης για την ελληνική γλώσσα.
Ενημέρωση #1: Ένα πρόβλημα που αντιμετώπισα στην αρχή ήταν η κάρτα γραφικών. Δεν ήταν ζήτημα με τη βασική υποστήριξη της καρτάς γραφικών. Μιας και έχω κάρτα γραφικών Intel, το σύστημα ενεργοποίησε από τη πρώτη στιγμή ακόμα και 3D. Το ζήτημα είχε να κάνει με τη χρήση της εκτεταμμένης επιφάνειας εργασίας (dual head). Για τη χρήση δύο οθονών έπρεπε να επέμβω με το χέρι στο αρχείο ρυθμίσεων /etc/X11/xorg.conf και να καθορίσω το μέγεθος της ιδεατής (Virtual) οθόνης. Δεν κατάφερα να βρω τρόπο για να κάνω το ίδιο πράγμα χωρίς να μπω σε τερματικό.
Create flash videos of your desktop with recordmydesktop
John Varouhakis is the author of recordmydesktop and gtk-recordmydesktop (front-end) which is a tool to help you record a session on your Linux desktop and save it to a Flash video (.flv).
To install, click on System/Administration/Synaptic Package Manager, and search for gtk-recordmydesktop. Install it. Then, the application is available from Applications/Sound&Video/gtkRecordMyDesktop.
Before you are ready to capture your Flash video, you need to select the video area. There are several ways to do this; the most common is to click on Select Window, then click on the Window you want to record. A common mistake is that people try to select the window from the preview above. If you do that, when you would have selected the recorder itself to make a video of, which is not really useful. You need to click on the real window in order to select it; then, in the desktop preview you can see the selected window. In the above case, I selected the OpenOffice Writer window.
Assuming that you do not need to do any further customisation, you can simple press Record to start recording. Generally, it is good to check the recording settings using the GNOME Sound recorder beforehand. While recording, you can notice a special icon on the top panel. This is gtk-recordmydesktop. Once you press it, recording stops and the program will do the post-processing of the recording. The resulting file goes into your home folder, and has the extension .ogv.
Some common pitfalls include
- I did not manage to get audio recording to work well for my system; I had to disable libasound so that the audio recording would not skip. With ALSA, sound skips while with OSS emulation it does not. Weird. Does it work for you?
- The post-processing of the recording takes some time. If you have a long recording, it may take some time to show that it makes progress, so you might think it crashed. Have patience.
I had made one such recording, which can be found at the Greek OLPC mailing list. John told me that the audio part of the video was not loud enough, and one can use extra post-processing to make it sound better. For example, one could extract the audio stream of the video, remove the noise, beautify (how?) and then add back to the video.
It’s good to try out gtk-recordmydesktop, even for a small recording. Do you have some cool tips from your Linux desktop that you want to share? Record your desktop!
StixFonts, finally available (beta)!
The STIX Fonts project (website) has been developing for over 10 years a font suitable to be used in academic publications. It boasts support from Elsevier, IEEE and other academic publishers or associations.
A few days ago, they published a beta version of the font in an effort to get public feedback. The beta period runs until the 15th December.
![]() |
| STIX Fonts Beta showing Greek (Regular), from STIX Fonts Beta |
STIX Fonts Beta currently support modern Greek. An effort to get support for Greek Polytonic did not work out well a few years back.
![]() |
| STIX Fonts Beta showing Greek (Italic), from STIX Fonts Beta |
The main benefit of STIX Fonts is the support for mathematical and other technical symbols. This helps when writing academic publications and other technical documents.
![]() |
| STIX Fonts Beta showing Greek (Bold), from STIX Fonts Beta |
STIX Fonts have extensive support of mathematical symbols, symbols that exist in Unicode Plane-1.
![]() |
| STIX Fonts Beta showing Greek (Bold Italic), from STIX Fonts Beta |
If there is any modification that we would like to have in STIX fonts, we should do now. Once they are released, they will be widely distributed. Currently, Fedora has packaged STIX Fonts and made them available already.
One-line hardware support (USB Wireless Adapter)
I got recently a USB Wireless Adaptor, produced by Aztech. It was a good buy for several reasons:
- It advertised Linux support
- It was affordable
- It had good quality casing; you can step on it and it won’t break
- It had the Penguin on the box and was really really cheap
When I plugged it in on my Linux system, it did not work out of the box. The kernel acknowledged that a USB device was inserted (two lines in /var/log/messages) but no driver claimed the device.
With the package came a CD which had drivers for several operating systems, including Linux. Apparently one would need to install the specific driver. I think the driver was available in both source code and as a binary package (for some kernel version).
The kernel module on the CD was called zd1211, so I checked whether my kernel had such a module installed. To my surprise, there was such a kernel module, called zd1211rw. I hope you have better chance with the URL because now the website appears to be down (Error 500).
Therefore, what was wrong with my zd1211rw kernel module? Reading the documentation of project website, I figured out that you have to report the ID (called the USB ID) of your adapter so that it is included in the kernel module, and when you plug in your device, it will be automatically detected.
You can find the USB ID by running the command lsusb. Then, it is a one-line patch for the zd1211rw driver to add support for the device,
— zd1211rw.linux2.6.20/zd_usb.c 2007-09-25 14:48:06.000000000
+0300
+++ zd1211rw/zd_usb.c 2007-09-28 11:35:51.000000000 +0300
@@ -64,6 +64,7 @@
{ USB_DEVICE(0x13b1, 0×0024), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0×0586, 0x340f), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x0baf, 0×0121), .driver_info = DEVICE_ZD1211B },
+ { USB_DEVICE(0x0cde, 0x001a), .driver_info = DEVICE_ZD1211B },
/* “Driverless” devices that need ejecting */
{ USB_DEVICE(0x0ace, 0×2011), .driver_info = DEVICE_INSTALLER },
{ USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER },
What Aztech should have done is to submit the USB ID to the developers of the zd1211rw driver. In this way, any Linux distribution that comes out with the updated kernel will have support for the device.
It is very important to get the manufacturers to change mentality. From offering a CD with “drivers”, for free and open-source software they should also work upstream with the device driver developers of the Linux kernel. The effort is small and the customer benefits huge.
Greek OLPC localisation status
The Greek OLPC localisation effort is ongoing and here is a report of the current status.
For discussions, reading discussion archives and commenting, please see the Greek OLPC Discussion Group.
We are localising two components, the UI (User Interface) and applications of the OLPC, and the main website at http://www.laptop.org/
The UI is currently being translated at the OLPC Wiki, at OLPC_Greece/Translation. At this page you can see the currently available packages, what is pending and which is the page that you also can help translate.
At this stage we need people with skills in music terminology to help out with the localisation of TamTam. In addition, there are more translations that need review and comments before they are sent upstream.
Moreover, if you find a typo and a better suggestion for a term in the submitted translations, feel free to tell us at the Greek OLPC Discussion Group.
The other project we are working on is the localisation of the Greek version of www.laptop.org. The pages are not 100% translated yet, so if you want to finish the difficult parts, see the Web translation page of laptop.org.
The translators that helped up to now have done an amazing job.
Important MO file optimisation for en_* locales, and partly others
During GUADEC, Tomas Frydrych gave a talk on exmap-console, a cut-down version of exmap that can work well on mobile devices.
During the presentation, Tomas showed how to use the tool to find the culprits in memory (ab)use on the GNOME desktop. One issue that came up was that the MO files taking up space though the desktop showed English. Why would the MO translation files loaded in memory be so big in size?
gtk20.mo : VM 61440 B, M 61440 B, S 61440 B atk10.mo : VM 8192 B, M 8192 B, S 8192 B libgnome-2.0.mo : VM 28672 B, M 24576 B, S 24576 B glib20.mo : VM 20480 B, M 16384 B, S 16384 B gtk20-properties.mo : VM 128 KB, M 116 KB, S 116 KB launchpad-integration.mo : VM 4096 B, M 4096 B, S 4096 B
A translation file looks like
msgid “File”
msgstr “”
When translated to Greek it is
msgid “File”
msgstr “Αρχείο”
In the English UK translation it would be
msgid “File”
msgstr “File”
This actually is not necessary because if you leave those messags untranslated, the system will use the original messages that are embedded in the executable file.
However, for the purposes of the English UK, English Canadian, etc teams, it makes sense to copy the same messages in the translated field because it would be an indication that the message was examined by the translation. Any new messages would appear as untranslated and the same process would continue.
Now, the problem is that the gettext tools are not smart enough when they compile such translation files; they replicate without need those messages occupying space in the generated MO file.
Apart from the English variants, this issue is also present in other languages when the message looks like
msgid “GConf”
msgstr “GConf”
Here, it does not make much sense to translate the message in the locale language. However, the generated MO file contains now more than 10 bytes (5+5) , plus some space for the index.
Therefore, what’s the solution for this issue?
One solution is to add to msgattrib the option to preprocess a PO file and remove those unneeded copies. Here is a patch,
— src.ORIGINAL/msgattrib.c 2007-07-18 17:17:08.000000000 +0100
+++ src/msgattrib.c 2007-07-23 01:20:35.000000000 +0100
@@ -61,7 +61,8 @@
REMOVE_FUZZY = 1 << 2,
REMOVE_NONFUZZY = 1 << 3,
REMOVE_OBSOLETE = 1 << 4,
- REMOVE_NONOBSOLETE = 1 << 5
+ REMOVE_NONOBSOLETE = 1 << 5,
+ REMOVE_COPIED = 1 << 6
};
static int to_remove;
@@ -90,6 +91,7 @@
{ “help”, no_argument, NULL, ‘h’ },
{ “ignore-file”, required_argument, NULL, CHAR_MAX + 15 },
{ “indent”, no_argument, NULL, ‘i’ },
+ { “no-copied”, no_argument, NULL, CHAR_MAX + 19 },
{ “no-escape”, no_argument, NULL, ‘e’ },
{ “no-fuzzy”, no_argument, NULL, CHAR_MAX + 3 },
{ “no-location”, no_argument, &line_comment, 0 },
@@ -314,6 +316,10 @@
to_change |= REMOVE_PREV;
break;
+ case CHAR_MAX + 19: /* –no-copied */
+ to_remove |= REMOVE_COPIED;
+ break;
+
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
@@ -436,6 +442,8 @@
–no-obsolete remove obsolete #~ messages\n”));
printf (_(“\
–only-obsolete keep obsolete #~ messages\n”));
+ printf (_(“\
+ –no-copied remove copied messages\n”));
printf (“\n”);
printf (_(“\
Attribute manipulation:\n”));
@@ -536,6 +544,21 @@
: to_remove & REMOVE_NONOBSOLETE))
return false;
+ if (to_remove & REMOVE_COPIED)
+ {
+ if (!strcmp(mp->msgid, mp->msgstr) && strlen(mp->msgstr)+1 >= mp->msgstr_len)
+ {
+ return false;
+ }
+ else if ( strlen(mp->msgstr)+1 < mp->msgstr_len )
+ {
+ if ( !strcmp(mp->msgstr + strlen(mp->msgstr)+1, mp->msgid_plural) )
+ {
+ return false;
+ }
+ }
+ }
+
return true;
}
However, if we only change msgattrib, we would need to adapt the build system for all packages.
Apparently, it would make sense to change the default behaviour of msgfmt, the program that compiles PO files into MO files.
An e-mail was sent to the email address for the development team of gettext regarding the issue. The development team does not appear to have a Bugzilla to record these issues. If you know of an alternative contact point, please notify me.
Update #1 (23Jul07): As an indication of the file size savings, the en_GB locale on Ubuntu in the installation CD occupies about 424KB where in practice it should have been 48KB.
A full installation of Ubuntu with some basic KDE packages (only for the basic libraries, i.e. KBabel – (ls k* | wc -l = 499)) occupies about 26MB of space just for the translation files. When optimising in the MO files, the translation files occupy only 7MB. This is quite important because when someone installs for example the en_CA locale, all en_?? locales are added.
The reason why the reduction is more has to do with the message types that KDE uses. For example,
msgid “”
“_: Unknown State\n”
“Unknown”
msgstr “Unknown”
I cannot see a portable way to code the gettext-tools so that they understand that the above message can be easily omitted. For the above reduction to 7MB, KDE applications (k*) occupy 3.6MB. The non-KDE applications include GNOME, XFCE and GNU traditional tools. The biggest culprits in KDE are kstars (386KB) and kgeography (345KB).
Update #2 (23Jul07): (Thanks Deniz for the comment below on gweather!) The po-locations translations (gnome-applets/gweather) of all languages are combined together to generate a big XML file that can be found at usr/share/gnome-applets/gweather/Locations.xml (~15MB).
This file is not kept in memory while the gweather applet is running.
However, the file is parsed when the user opens the properties dialog to change the location.
I would say that the main problem here is the file size (15.8MB) that can be easily reduced when stripping copied messages. This file is included in any Linux distribution, whatever the locale.
The po-locations directory currently occupies 107MB and when copied messages are eliminated it occupies 78MB (a difference of 30MB). The generated XML file is in any case smaller (15.8MB without optimisation) because it does not include repeatedly the msgid lines for each language.
I regenerated the Locations.xml file with the optimised PO files and the resulting file is 7.6MB. This is a good reduction in file space and also in packaging size.
Update #3 (25Jul07): Posted a patch for gettext-tools/msgattrib.c. Sent an e-mail to the kde-i18n-doc mailing list and got good response and a valid argument for the proposed changes. Specifically, there is a case when one gives custom values to the LANGUAGE variable. This happens when someone uses the LANGUAGE variable with a value such as “es:fr” which means show me messages in Spanish and if something is untranslated show me in French. If a message has msgid==msgstr for Spanish but not for French, then it would show in French if we go along with the proposed optimisation.
OpenVistA information system for hospitals and medical care
It is quite common to expect the availability of free and open-source software for common needs, such as an operating system and an office suite. What is the situation when your needs are much more advanced? Such as, when you are looking for an information system for a hospital?
Luckily, there is such a software package for an information system for hospital needs, called OpenVistA. OpenVistA comes from VistA, a public-funded medical system for the United States Department of Veterans Affairs. Due to the source of the funding, the source code of the medical system has been available with a liberal license, and gave birth to OpenVistA.
An interesting issue with OpenVistA is that the backend is written with the MUMPS programming language. This programming language is quite old with syntax dissimilar to modern languages. However, MUMPS has become popular in medical care systems and especially VistA. There are people that criticize the programming language; it is important to understand that a big piece of software working well has much more weight over the language preferences. In addition, the front-end is what the end-user uses, and in our case it is written with modern programming languages.

Traditionally, the major front-end of OpenVistA was written in Delphi. Quite recently, a new front-end has been written, in Mono. Thanks to Mono, the front-end is cross-platform and supports i18n (the front-end can be translated in many written languages).
You can try out OpenVistA straight away by downloading the OpenVistA VMWare appliance (image file that contains an installation of an operating system, configured and ready to use). The specific VMWare appliance is based on Xubuntu.
Software for hospitals is quite expensive, and is a lucrative business for software houses. However, when one takes into account that in many countries hospitals are public-funded, it is easy to understand how important it is to use free and open-source software in this case. Sadly, in many cases, hospitals make ad-hoc agreements for such software, resulting to inefficient use of public funds.





