Bug 144073 - glibc patch needed for Feature #110086 (LDK/Aftermarket Translations)
Summary: glibc patch needed for Feature #110086 (LDK/Aftermarket Translations)
Status: RESOLVED FIXED
: 193098 (view as bug list)
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Development (show other bugs)
Version: Beta 1
Hardware: Other Linux
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Petr Baudis
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-19 12:41 UTC by Mike Fabian
Modified: 2006-09-25 15:19 UTC (History)
9 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
glibc-2.4-message-catalog-shadow.diff (832 bytes, patch)
2006-01-19 12:43 UTC, Mike Fabian
Details | Diff
locale-langpack patch (1.18 KB, text/x-patch)
2006-01-26 07:51 UTC, Thorsten Kukuk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Fabian 2006-01-19 12:41:53 UTC
glibc patch needed for Feature #110086 (LDK/Aftermarket Translations)
Comment 1 Mike Fabian 2006-01-19 12:43:27 UTC
Created attachment 63983 [details]
glibc-2.4-message-catalog-shadow.diff

suggested patch for glibc.
Comment 2 Mike Fabian 2006-01-19 12:58:24 UTC
Reason for this patch:

Many packages contain translations for many languages directly in the
main package. For example most Gnome packages are like this.
For example gedit contains .mo files for all languages gedit is translated to
in files like

/opt/gnome/share/locale/zh_CN/LC_MESSAGES/gedit.mo

which are part of the "gedit" package.

Therefore it is currently not possible to update translations for
"gedit" without touching the "gedit" package itself. As this problem
exists for hundreds of packages in the distribution, updating
translations for a specific language because of an attractive deal
*after* a product is already released is difficult.

The above patch to glibc tries to make this easier. With this patch,

/opt/gnome/share/locale/zh_CN/LC_MESSAGES/gedit.mo.shadow

is preferred over

/opt/gnome/share/locale/zh_CN/LC_MESSAGES/gedit.mo

if the former exists.

Therefore it becomes possible to create an additional package
like "new-translations-for-big-OEM-deal-simplified-Chinese.rpm" which updates
most or even all translations in the distribution for simplified Chinese.
Comment 3 Mike Fabian 2006-01-19 13:06:29 UTC
Thorsten just told me that he sees the following problem with
the approach described above:

If a service pack (say SP1) is released), it may contain updates of
the original .mo files. It can happen then that such updates are
ignored because older .mo.shadow files might exist.
Comment 4 Mike Fabian 2006-01-19 13:10:43 UTC
To avoid that the problem described in comment #3 occurs, it would
be necessary to integrate the updated translations into the packages
which are updated in SP1.

For example, if "gedit" is updated for SP1, it would be necessary to
remove the updated translations for "gedit" from the special
translation update package and integrate them into the "gedit"
package.

Thorsten believes this process is tedious and error prone.
Comment 5 Stephan Kulow 2006-01-19 13:15:10 UTC
then add a stat if the .shadow file is newer than the "original"?
Comment 6 Mike Fabian 2006-01-19 13:20:28 UTC
Yes, I already talked to Thorsten a few minutes ago and suggested that,
he was afraid that an extra stat would cost too much time.
Comment 7 Mike Fabian 2006-01-19 13:21:03 UTC
Thorsten suggested that it might be a better idea to overwrite the
old .mo files with the new ones with the updated translations.

For example, the package with the translation updates could come with
a SuSEconfig script which copies all translation updates to the
correct place.

A disadvantage is that the MD5 sums of the .mo files which belong to
the rpms will be different then. Therefore rpm verify commands like
"rpm -V gedit" will report this, which is annoying.

But Thorsten said he considers this less serious than having to make
sure that the right translations are removed from the translation
update package and integrated into the individual packages when SP1 is
released.
Comment 8 Mike Fabian 2006-01-19 13:29:21 UTC
Of course a SuSEconfig script copying updated translations to the
correct place would also need to check time stamps to avoid
overwriting updated translations.

But this would need to happen only once and not always at runtime.

Comment 9 Mike Fabian 2006-01-19 13:32:57 UTC
Because a SuSEconfig script would need to do it's work only once,
it would be possible to do a more careful check which translation
is newer.

Looking only at the time stamp of the file might be misleading because
the time stamp of an .mo file might change if a package is rebuild
even though the translations have not been updated.

A script which copies could for example check the "PO-Revision-Date":

mfabian@magellan:~$ msgunfmt /opt/gnome/share/locale/zh_CN/LC_MESSAGES/gedit.mo | grep PO-Revision-Date
"PO-Revision-Date: 2005-09-03 19:37+0800\n"
mfabian@magellan:~$

Checking this at runtime from glibc is probably too costly performance wise.

Comment 10 Mike Fabian 2006-01-19 13:35:30 UTC
A SuSEconfig script copying translation files might be ne necessary
for non-gettext based translation systems anyway. For some translation
systems it is not as easy as for gettext based translation to prefer a
.shadow file. For some systems it might be even impossible.
Comment 11 Thorsten Kukuk 2006-01-26 07:47:36 UTC
I don't like this .shadow suffix, but the much better idea Ubuntu is using does not work for translated shared libraries :(

So I will use the attached patch, map all locale prefix to /usr/share/locale-langpack/. The only situation where this will not work is if the package has a specialized translation (for example for de_DE), while the langpack has only a general one (for example de). But Mikes patch suffers from the same problem.
Comment 12 Thorsten Kukuk 2006-01-26 07:51:56 UTC
Created attachment 65109 [details]
locale-langpack patch
Comment 13 Thorsten Kukuk 2006-01-26 07:55:35 UTC
applied.
Comment 15 Petr Baudis 2006-08-22 23:35:31 UTC
Can I get a SWAMP id, please? Also, will that cover just enabling patch 32 or also disabling patch 31? (Patch 31 has also supposedly already caused us bug 193098 in the meantime, but that's not confirmed yet.)
Comment 16 Anja Stock 2006-08-23 14:08:39 UTC
aj, could you please have a look at this?
Comment 17 Andreas Jaeger 2006-08-23 15:06:14 UTC
Thorsten should comment on #15.
Comment 19 Petr Baudis 2006-08-31 11:41:19 UTC
Anja, can I get the SWAMP id, please? Note that we might want to bundle this also with the fix for bug 199699 (currently in the process of testing by the customer).
Comment 21 Petr Baudis 2006-08-31 11:46:18 UTC
*** Bug 193098 has been marked as a duplicate of this bug. ***
Comment 26 Anja Stock 2006-09-04 14:17:36 UTC
Petr, SWAMPID for this is 5990
Comment 27 Petr Baudis 2006-09-07 02:06:35 UTC
Created patchinfo file as /work/src/done/PATCHINFO/glibc.patch.maintained. (BTW, what should the bug status become at this point?)
Comment 29 Anja Stock 2006-09-25 15:19:09 UTC
released