I have no clue how RSS feeds are supposed to work, however when fixing just a typo in Mr. PratchetT's name ;-) in this post (written in quite a stress just before leaving for vacation in certain warm-climate country), it got pushed into RSS anew. Oh well, sorry for bothering with that boring real-life joke again ... But that's not what I wanted to write about. Some small bits and pieces from my YaST development agenda accumulated over the time. None of them deserves a separate entry though, so I'm placing them all here.
First some bad news for 11.1 openSUSErs (SLES/D ones, on the other hand, can celebrate):
It has always been fascinating for me to observe computer naming schemes people choose. Middle-Earth geography, hard-to-pronounce spider genus names (a colleague of mine is a devout spider breeder), coolo's female characters from Shakespeare plays ...
When it comes to setting the hostname of your machine so that it fits your naming scheme :-) there were two important milestones in YaST development:
Fortunately, allowing to change hostname in YaST is a question of un-disabling two widgets (compared to more work with adding related UI to NM connection editor). Don't be scarred off by this pop-up message:

Just switch to Hostname/DNS tab and set the hostname of your choice:

But unfortunately, only in SLES/D 11 and in openSUSE 11.2. It was too late for 11.1 :-(
If the world was ideal (in this particular case - composed of ASCII-characters only ;-)), it would be certainly quite boring. As non-ASCII characters in hostname and domain name would drive hostname resolvers crazy, smart people came up with punycode, which is a schema for converting such hostnames into RFC-compliant character set. Thus, a domain names příliš.žluťoučký.kůň.cz * or 我爱你.zh ** become, after converting to punycode xn--pli-rma35ctb.xn--luouk-uva4it5a4g.xn- -k-qla0j.cz or xn--6qq986b3xl.zh respectively. Which is certainly more machine- than human-readable. Good news is that SLES/D 11 YaST will now do the conversion for you:

Many thanks to Lukas for this Punycode YCP module (originally written for yast2-dns-server, because we support punycode in DNS zones, too), without it, it would be much more difficult to add punycode support to hostnames configuration. And again, this candy is only for SLES/D users :-( (or those patient enough to wait for 11.2)
The key to make strings from both sources correctly translated is not to overwrite textdomain to 'yast2-apparmor' on global level, but to use customized gettext function for YaST UI strings and 'apparmor-utils' otherwise (globally). In case you'll ever need it, here is 'mygettext', doing the job:
*) it means 'a horse too yellow' - not very meaningful phrase even in czech, but it is used to demonstrate as many accented czech letters in as few words as possible
**) decrypting this is a homework for watchful reader :-)
***) if you use some interesting host naming schemes, you can drop me a comment :)
First some bad news for 11.1 openSUSErs (SLES/D ones, on the other hand, can celebrate):
Changing hostname with YaST
It has always been fascinating for me to observe computer naming schemes people choose. Middle-Earth geography, hard-to-pronounce spider genus names (a colleague of mine is a devout spider breeder), coolo's female characters from Shakespeare plays ...
When it comes to setting the hostname of your machine so that it fits your naming scheme :-) there were two important milestones in YaST development:
- Since 11.0 you can opt for installation with automatic configuration. In other words, the installer asks minimum of questions and proposes some reasonable default values otherwise, so you don't have to click 'Next-Next-Accept' so much.
- YaST and NetworkManager marriage tied together via sysconfig bound has been officially divorced in 11.1. NetworkManager now uses its own settings system independent of system-wide /etc/sysconfig. Therefore, if NetworkManager is in charge of controlling the network and you run YaST network configuration module, most of the fields for inputting some values will be greyed-out.
Fortunately, allowing to change hostname in YaST is a question of un-disabling two widgets (compared to more work with adding related UI to NM connection editor). Don't be scarred off by this pop-up message:
Just switch to Hostname/DNS tab and set the hostname of your choice:
But unfortunately, only in SLES/D 11 and in openSUSE 11.2. It was too late for 11.1 :-(
Punycode? What the ...
If the world was ideal (in this particular case - composed of ASCII-characters only ;-)), it would be certainly quite boring. As non-ASCII characters in hostname and domain name would drive hostname resolvers crazy, smart people came up with punycode, which is a schema for converting such hostnames into RFC-compliant character set. Thus, a domain names příliš.žluťoučký.kůň.cz * or 我爱你.zh ** become, after converting to punycode xn--pli-rma35ctb.xn--luouk-uva4it5a4g.xn-
Many thanks to Lukas for this Punycode YCP module (originally written for yast2-dns-server, because we support punycode in DNS zones, too), without it, it would be much more difficult to add punycode support to hostnames configuration. And again, this candy is only for SLES/D users :-( (or those patient enough to wait for 11.2)
i18n in yast2-apparmor - saga continues
Ok, so I thought I was particularly smart when I thought I made yast2-apparmor finally see the right translated strings, as I describe it here. Well, not surprisingly, I wasn't. Two programs - AppArmor UI frontend (YaST) and AppArmor CLI backend (genprof & friends) - talk to each other, but use different textdomains (originally, they didn't, I changed it in order to have yast2-apparmor pot files generated together with those of other YaST modules).The key to make strings from both sources correctly translated is not to overwrite textdomain to 'yast2-apparmor' on global level, but to use customized gettext function for YaST UI strings and 'apparmor-utils' otherwise (globally). In case you'll ever need it, here is 'mygettext', doing the job:
setlocale(LC_MESSAGES, "");
my $dom = Locale::gettext->domain_raw("yast2-apparmor");
$dom->dir("/usr/share/YaST2/locale");
$dom->codeset("UTF-8");
#bubli's own variation of gettext, because we need to
#translate strings in two textdomains
sub mygettext
{
my $msgid = shift;
return $dom->get("$msgid");
}
Oh, and if you happen to see the strings coming out in incorrect encoding, please vote for this bug.*) it means 'a horse too yellow' - not very meaningful phrase even in czech, but it is used to demonstrate as many accented czech letters in as few words as possible
**) decrypting this is a homework for watchful reader :-)
***) if you use some interesting host naming schemes, you can drop me a comment :)
- Mood:
pessimistic


Comments