Xubuntu (XFCE), startxfce4: X server already running on display :0
Έχω ένα πρόβλημα με ένα σύστημα Xubuntu, όπου δούλευε για πολύ καιρό ενώ τώρα ξαφνικά δε μπορεί να εμφανίσει στο γραφικό περιβάλλον το window manager μαζί με τα εικονίδια/κτλ.
Καθώς ξεκινά το σύστημα, ο υπολογιστής φτάνει στο σημείο να δείχνει μόνο το παρασκήνιο της επιφάνειας εργασίας
και τίποτα άλλο.
Πρόκειται για Xubuntu 6.10 (ναι!) σε υπολογιστή που συντηρώ απομακρυσμένα.
Είχα ενεργό το Beryl (6.10!) το οποίο απενεργοποίησα τώρα.
Τα σχετικά μηνύματα στο .xsession-errors είναι
/etc/gdm/PreSession/Default: Registering your session with wtmp and utmp
/etc/gdm/PreSession/Default: running: /usr/X11R6/bin/sessreg -a -w /var/log/wtmp -u /var/run/utmp -x "/var/lib/gdm/:0.Xservers" -h "" -l ":0" "ubuntuuser"
/etc/gdm/Xsession: Beginning session setup...
libGL warning: 3D driver claims to not support visual 0x4b
/usr/bin/startxfce4: X server already running on display :0
libGL warning: 3D driver claims to not support visual 0x4b
Το ps δείχνει ότι ο διαχειριστής παραθύρων του XFCE έχει φορτωθεί, οπότε είναι πιθανό να έχει φορτωθεί στο :1 (αντί στο τυπικό DISPLAY :0);
Με προβληματίζει ότι έχει εκείνο το μήνυμα για libGL warning, σα να τρέχει το X server με υποστήριξη 3D που μπορεί να δημιουργήσει πρόβλημα.
Η κάρτα γραφικών είναι μια Intel, νομίζω 855GM.
(x-posted)
Update (15 Dec 08): Problem solved.
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.
Localisation Sprint 2004
Κατά τη διάρκεια του προηγούμενου Σ/Κ είχα την ευκαιρία να παρεβρεθώ στο Localisation Sprint 2004 (http://www.localisationdev.org), που έγινε στη Βαρσοβία στις 20-22 Νοεμβρίου 2004.
Στόχος της εγχειρήματος ήταν να μαζευτούν άτομα από διαφορετικούς χώρους της τοπικοποίησης ελεύθερου λογισμικού και να συντάξουν υλικό για να χρησιμοποιηθεί από μη-κερδοσκοπικές εταιρίες & NGO. Μη-κερδοσκοπικές εταιρίες και NGO έχουν κάθε λόγο να μειώσουν τα έξοδά τους, οπότε το τοπικοποιημένο ελεύθερο λογισμικό είναι πολύ δελεαστικό.
Έμαθα πολλά πράγματα από τα άτομα που ήταν εκεί, και συγκεκριμένα ο Dwayne Bailey από το translate.org.za μεταφράζει ελεύθερο λογισμικό στις 11 επίσημες γλώσσες της Νότιας Αφρικής. Έχουν φτιάξει μια σειρά από προγράμματα για να κάνουν τη δουλειά ευκολότερη. Ιδιαίτερη σημασία έχει το πρόγραμμα εντολών για τη μετατροπή των αρχείων προς μετάφραση του Mozilla στη μορφή .po. Το ίδιο και για OOo.
Είναι ενδιαφέρον το ότι κάνουν την ίδια δουλειά για υποστήριξη γλώσσας επί 11 γλώσσες. Για παράδειγμα, εδώ φαίνεται η αποστολή των locales, όλα με την μία. Έφτιαξαν το pootle, που επιτρέπει τη μετάφραση μέσα από το φυλλομετρητή. Μπορεί και κάποιο ελληνικό έργο να γραφτεί στο Pootle για να γίνει η μετάφραση με το τρόπο αυτό. Για παράδειγμα, αν μας ακούει κάποιος από το XFCE, η μετάφρασή του σε πολλές γλώσσες γίνεται από το Pootle. Τα ελληνικά λείπουν.
Ο Kaladan από τη Βουλγαρία μεταφράζει το GNOME καθώς και άλλες εφαρμογές. Ανήκει σε μια μη-κερδοσκοπική μη-τρομοκρατική
οργάνωση που βοηθάει άλλες μη-κερδοσκοπικές εταιρίες σε θέματα πληροφορικής, δίνοντας έμφαση στο ελεύθερο λογισμικό. Είχαμε συζήτηση για το θέμα της Φυρομίας. Έχουν παρόμοια προβλήματα διότι οι Σκοπιανοί διεκδικούν εκτάσεις και από τη Βουλγαρία! Γλωσσικά, η φυρομιακή γλώσσα είναι ταυτόσιμη με τη Βουλγαρική, οι Βούλγαροι μπορούν να διαβάσουν/μιλήσουν φυρομιακά. Γενικά οι Βούλγαροι δε γνωρίζουν την ελληνική ευαισθησία για το θέμα του ονόματος, ύστερα από συζήτηση όμως το θέμα ξεκαθαρίστηκε. Έχουν καλό δικτυακό για το GNOME, κάποιος το έφτιαξε με το χέρι με χρήση DHTML/CSS. Ζήτησαν από το δικτυακό τόπο της Σερβίας τον κώδικα, τους είπαν όχι και το έφτιαξαν από την αρχή. Είναι αστείο διότι και εμείς κινηθήκαμε στην κατεύθυνση αυτή και τελικά καταλήξαμε να το κάνουμε μόνοι μας (=Πέτρος) με mambo. Αλήθεια, δεν υπάρχουν αρκετά άτομα με γνώσεις DHTML/CSS που να κάνουν όμορφους δικτυακούς τόπους τσάμπα.
Ο Sunil Abraham από το IOSN. Θα δημοσιοποιήσουν σε λίγες μέρεςεβδομάδες ένα οδηγό για τη τοπικοποίηση (Localisation Primer). Διάβασα μια σχεδόν τελική έκδοση πριν πάει προς πιεστήριο και συμπεριλαμβάνει όλα όσα χρειάζονται για να καταλάβει κανείς την
τοπικοποίηση. Αν και έχουν case studies για γλώσσες της Νοτιοανατολικής Ασίας, θα το χαρακτήριζα required reading για την τοπικοποίηση. Αν πάτε στο LocalisazionDev.org Wiki θα βρείτε μια ξεχασμένη έκδοση του final draft
. Το IOSN έχει εκδόσει μια σειρά από Primer για τα οποία έχει γίνει αναφορά σε ελληνικούς δικτυακούς τόπους.
Γενικά τα ελληνικά δεν έχουν μεγάλη πολυπλοκότητα στη γραφή. Αντίθετα, η γλώσσα khmer (Καμπότζη) είναι τόσο παράξενη που προβληματίζονται με το πως θα την κάνουν να δουλέψει. Δεν υπάρχει η έννοια του διαστήματος για να ξεχωρίζουν οι λέξεις. Ακόμα, για κάποιο λόγο είναι δύσκολο να ταξινομήσουν λέξεις στη γλώσσα αυτή διότι όταν συμπτυχθούν δύο/τρία γράμματα μαζί, προκύπτει νέο γράμμα. Ο Ξαβιέρ Σολά κάνει πολύ καλή δουλειά στην υποστήριξη της γλώσσας.
Έκανε τρομερό κρύο με χιόνια στην Πολωνία και δυστυχώς δεν υπήρχε χρόνος για τουρισμόπολιτισμικές ανταλλαγές
. To highlight ήταν ένα βράδυ που πήγαμε σε ένα τοπικό κέντρο και έτυχε να έχει βραδιά Gothic. Κάτσαμε και μετά από λίγο άρχισαν και καλλιστεία Gothic! Αν ξέρετε το mulled wine, στην πολωνία υπάρχει mulled beer. Είναι πολύ ωραίο.
Στην ανακοίνωση που έστειλα πριν λίγο στις γνωστές λίστες συνδρομητών γίνεται αναφορά στον Πλανήτη Localisation που συγκεντρώνει ιστολόγια σχετικά με την τοπικοποίηση. Υπάρχει πολύ υλικό για τοπικοποίηση, Unicode, κτλ που δύσκολα το βρίσκεις συγκεντρωμένα αλλού.
Ο δικτυακός τόπος έχει και Wiki, το LocalisationDev.org Wiki. Κατά τη διάρκεια του workshop το Wiki εμπλουτίστηκε με υλικό για την τοπικοποίηση. Τις επόμενες εβδομάδες θα συνεχίσει να εμπλουτίζεται. Όπως κάθε Wiki, είναι ελεύθερη η προσθήκη πληροφοριών, ιδίως ιστοσελίδων που έχουν παραληφθεί.
Είναι σημαντικό να αναφερθεί ότι το συγκεκριμένο Wiki ονομάζεται μωβ wiki. Έχει κάποιες επιπλέον λειτουργίες όπως τη δυνατότητα για αναφορά σε παράγραφο σελίδας. Η διαδραστικότητά του είναι αρκετά καλή.
Το υλικό του Wiki διατίθεται κάτω από την άδεια Creative Commons.