Bug 297680

Summary: YaST - dgettext buil-in - Evaluate bindtextdomain(...) return value
Product: [openSUSE] openSUSE 11.0 Reporter: Lukas Ocilka <locilka>
Component: YaST2Assignee: E-mail List <bnc-team-screening>
Status: RESOLVED WONTFIX QA Contact: Jiri Srain <jsrain>
Severity: Enhancement    
Priority: P5 - None CC: mvidner
Version: Alpha 2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: test program
core/libycp/src/YCode0.diff - preparatory refactoring
core/libycp/src/YCode1.diff - The fix

Description Lukas Ocilka 2007-08-06 09:04:02 UTC
Please, do not set
setDomainStatus (domain, true);
for domain where bindtextdomain(...) couldn't succeed
(e.g., missing .mo files)

The current solution:
Core remembers that the domain has been already initialized and doesn't allow to reinitialize it. If the domain is initialized with (yet) missing .mo files and another gettext call tries to reinitialize with .mo files already accessible, it just can't be successful despite having everything it needs.

See bug #280828

If it was possible, I'd like to see the fix also in SLES10 SP2.
Comment 1 Martin Vidner 2007-08-20 13:22:29 UTC
Created attachment 158447 [details]
test program

Unfortunately it is not as simple. bindtextdomain returns the directory even if the message catalog is not present. But it seems that I can check whether dgettext(domain, "") returns a non-"" (the translation of "" is reserved for the translation metadata).
Comment 2 Martin Vidner 2007-09-12 16:05:20 UTC
Created attachment 163616 [details]
core/libycp/src/YCode0.diff - preparatory refactoring
Comment 3 Martin Vidner 2007-09-12 16:07:02 UTC
Created attachment 163617 [details]
core/libycp/src/YCode1.diff - The fix
Comment 4 Martin Vidner 2007-09-12 17:56:48 UTC
Grr, well that code works, but it still does not fix the bug. The problem is that gettext internally remembers that the file was not found and it does not want to retry.
I'm afraid I cannot fix that unless I reimplement a nontrivial part of the gettext internals.
Comment 5 Lukas Ocilka 2007-09-12 18:36:27 UTC
Thanks for trying, anyway :)
Comment 6 Lukas Ocilka 2007-09-12 18:37:50 UTC
10.3 ---> 11.0 (+Enhancement)
Now, feel free to close it as WONTFIX or solve via FATE ;)
Comment 7 Lukas Ocilka 2007-09-12 18:38:49 UTC
---> LATER
Comment 8 Martin Vidner 2007-09-13 08:55:49 UTC
No, this is a real WONTFIX, not a temporary one.
We have clarified that the original bug 280828 has alternative fixes, so we don't need to push for black magic here.
Comment 9 Martin Vidner 2007-09-13 08:56:20 UTC
So.
Comment 10 Martin Vidner 2008-02-04 14:55:57 UTC
Maybe _nl_msg_cat_cntr can invalidate the caches: http://www.linux-foundation.org/spec/refspecs/LSB_1.2.0/gLSB/baselib--nl-msg-cat-cntr.html