#!/usr/bin/perl

use lib "../..";
use common ":common";

sub get {
    my ($meta_class) = @_;
    my %compssUsersDescr;

    local *F;
    open F, "../compssUsers$meta_class" or return; #die "can't open file ../compssUsers$meta_class";
    foreach (<F>) {
	/^\s*$/ || /^#/ and next;
	s/#.*//;

	if (/^(\S.*)/) {
	    my ($icon, $descr);
	    /^(.*?)\s*\[icon=(.*?)\](.*)/  and $_ = "$1$3", $icon  = $2;
	    /^(.*?)\s*\[descr=(.*?)\](.*)/ and $_ = "$1$3", $descr = $2;
	    $compssUsersDescr{$_} = $descr; 
	}
    }
    close F;

    %compssUsersDescr;
}

foreach (uniq(get(''), get('.desktop'))) {
    s/"/\"/g;
    print qq(
#: ../../share/compssUsers
msgid "$_"
msgstr ""
);
}