Index: [Article Count Order] [Thread]

Date:  Sat, 3 Nov 2007 20:27:44 +0200
From:  Michael Stauber <bq (at mark) solarspeed.net>
Subject:  [coba-e:11080] Re: BlueQuartz translation project - web frontent available
To:  coba-e (at mark) bluequartz.org
Message-Id:  <200711031927.44191.bq (at mark) solarspeed.net>
In-Reply-To:  <9FF13DC9-EE99-43A9-B216-463744CF186A (at mark) alpha.or.jp>
References:  <200711022003.04686.bq (at mark) solarspeed.net> <9FF13DC9-EE99-43A9-B216-463744CF186A (at mark) alpha.or.jp>
X-Mail-Count: 11080

Hi Hisao,

> And, which language file is based for translation?
> I mean we need to decide a language for original, and my opinion
> English is good for the base.

Yes, I think we should use English as base for the translation. Pootle 
determines the progress of a translation by comparing other languages *.po 
files against the English version to see how many strings are empty or full.

> So, if we add new feature or new message, we need to add English
> message at least and translate to the other language.

At the moment (as Taco already noticed) the text files for the new languages 
are empty. Aside from the "msgid" and and empty "msgstr" there is nothing in 
it. Can't really make the software to show the English text there, because 
then the software would "think" that it already has been translated.

So people have to pull up two browsers side by side. One that shows the 
English original and one that shows the same *.po file in the language they 
want to translate.

> Anyway, we need to clean up the message file that has some unused
> message and add header for gettext like as encoding and more
> information.

Pootle adds the correct gettext header to the *.po files automatically, which 
really helps a lot. That's why the Japanese files could not be imported 
correctly, as they were all missing the gettext headers.

Hisao, when we add the extra languages (doesn't matter which first) to the 
SVN, we will have to make minor changes to a lot of the UI code anyway. You 
see, the gettext header is added to a *.po file like this:

------------------------------------de/Merlot.po----------------------------------------
# 
msgid ""
msgstr ""
"Project-Id-Version: Merlot\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-10-31 20:32+0200\n"
"PO-Revision-Date: 2007-11-02 04:06+0100\n"
"Last-Translator: Michael Stauber <mstauber (at mark) solarspeed.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms:  nplurals=2; plural=(n != 1);\n"

msgid "Merlot"
msgstr "Merlot"
--------------------------------------------------------------------------------------------

As you can see, it uses an empty msgid for adding the header. Unfortunately 
some GUI pages (example: /usr/sausalito/ui/web/base/am/amStatus.php ) use an 
empty msgid as well for the first table row in the header of scroll-lists 
(through the function 'getScrollList'):

--------------------------base/am/amStatus.php----------------------------
    $syslist->setDefaultSortedIndex(1);
    $syslist->setColumnWidths($colwidths);
    $syslist->setAlignments($alignments);

    $servlist = $factory->getScrollList(
        "amServClients",     // Header label (i18n tag)
        array(         // The column headers
            "" , // <--- PROBLEM !!!!!
            "amClientName",
            "action"
        ),
        array(0, 1)
    );
    $servlist->setDefaultSortedIndex(1);
    $servlist->setColumnWidths($colwidths);
    $servlist->setAlignments($alignments);
---------------------------------------------------------------------------------------

See the line above that I marked with the "// <--- PROBLEM !!!!! " comment. 

The UI then fills that blank with the empty msgid from the *.po file, which 
will insert the entire header into a space in the webpage that by design 
should be empty. That really dissorts the rendering of the page in question.

The fix is very simple. That line (just one line!) need to be changed to this:

-------------------------------------------------------------------------------------------
        array(         // The column headers
            " " , // <--- PROBLEM FIXED
            "amClientName",
            "action"
        ),
-------------------------------------------------------------------------------------------

This turns the empty msgid "" into one with a whitespace " " and that solves 
the issue. 

The problem is not only in base/am/amStatus.php, but also in all other pages 
that use 'ScrollList', but its easy to fix. I'll go over the latest SVN code 
during the next few days to track all these lines down and to fix them. I 
already tested some of that new code on a test server where I played around 
with the German language files.

-- 
With best regards,

Michael Stauber