Bug 157780

Summary: s-c-b 4.0 not fully gettextized
Product: [Fedora] Fedora Reporter: Ronny Buchmann <ronny-rhbugzilla>
Component: system-config-bindAssignee: Jason Vas Dias <jvdias>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: bgroh, mitr, sarahs
Target Milestone: ---Keywords: Translation
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: system-config-bind-4.0.0-44.fc6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-01 05:58:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch for po/Makefile
none
patch implenting the Makefile change described
none
patch for po/Makefile
none
patch for NamedConfOptions.py
none
patch changing textdomain
none
patch changing textdomain none

Description Ronny Buchmann 2005-05-15 09:48:48 UTC
Created attachment 114394 [details]
patch for po/Makefile

Comment 1 Ronny Buchmann 2005-05-15 09:48:48 UTC
Description of problem:
hm, what do I say /po is almost empty...

Version-Release number of selected component (if applicable):
4.0.0-16

I attach a patch for the Makefile to actually do something useful (almost
completely copied from anaconda)

Comment 2 Ronny Buchmann 2005-05-15 09:59:18 UTC
I think s-c-b should get a proper place in CVS (elvis), it seems you were
confused about the CVS servers (elvis.redhat.com(aka i18n.redhat.com) vs.
cvs.fedora.redhat.com, sorry I only know the external view of things)

Comment 3 Jason Vas Dias 2005-05-16 12:33:04 UTC
I don't understand what the problem is here .

All text strings in s-c-b are translatable by gettext, and the 
Makefile extracts them and writes them to the .pot file OK .

1. Currently, there is nothing "useful" for a po/Makefile to do, as
   there are no translations for s-c-b yet.
   All s-c-b can do currently is build its .pot file and .desktop
   file, which it does correctly .
   When there are translations, a po/Makefile will be submitted to
   turn them into .gmo files and install them in /usr/share/locale/...

2. s-c-b is checked into CVS on the host "elvis.redhat.com" ,
   which is the same host as "rhlinux.redhat.com", using the
   $CVSROOT: :ext:rhlinux.redhat.com:/usr/local/CVS .
   If it is meant to be checked in somewhere else, please let me 
   know .




Comment 4 Ronny Buchmann 2005-05-16 13:16:53 UTC
Oh, I didn't see that the toplevel Makefile generates the pot (a bit unusual I
think). I would not recommend to use POTFILES as it puts extra work on you.
Please have a look at the patch.

to 2
I see s-c-b in system-config-bind/devel/system-config-bind-4.0.0/
and in rpms/system-config-bind/devel/system-config-bind-4.0.0/

It should be directly in system-config-bind. (the .spec too)
(the common, devel stuff is for cvs.fedora.redhat.com)

When you move it, I'll ask Sarah to add it to the translation status page. (I
assume few translators noticed that there is replacement for bindconf)

btw, it's really nice to have a working bind configuration tool now

Comment 5 Jason Vas Dias 2005-05-16 13:47:09 UTC
Yes, s-c-b-4+ has a slightly different build directory structure. 
Its Makefile depends on ../common/Makefile.common and hence 
needs to be in a subdirectory, in accordance with how the
modern CVS system operates .  I don't want to make a special
version of s-c-b that does not use ../common/Makefile.common
just for the rhlinux.redhat.com CVS - the version submitted there
should the same as that used for the distribution builds .  
So the directory structure it has currently is required and will
remain . 
As soon as some .po translation files are submitted for a po/Makefile
to operate upon, I'll submit a Makefile that will turn them into .gmo 
files and package them up. Your po/Makefile patch is appreciated and may
be useful when there are .po files to package - thank you . There is 
also a generic Makefile used for this purpose that was in the previous
s-c-b version - I removed it because it failed with an error due to lack
of .po files. As there are currently no .po files, any po/Makefile that
requires them would have problems.

 

Comment 6 Miloslav Trmač 2005-05-16 15:18:43 UTC
Jason, the translators expect that _you_ add (empty) .po files to the elvis
CVS; AFAIK they aren't allowed to add new files to CVS at all.

Comment 7 Ronny Buchmann 2005-05-16 15:35:06 UTC
rhlinux.redhat.com is for the upstream sources - not the build environment

I don't see the point in mixing things up.
some issues:
 * make tar from a cvs.fedora.redhat.com checkout is pointless because there is
no subdir
 * common is redhat internal view from cvs.devel.redhat.com (external is different)
 * rpm release is for versioning the package, not the sources

I'd like to propose the following
 * put tar and srpm generation in s-c-b-4.0/Makefile
 * use common/cvs-import.sh to import it to cvs.devel.redhat.com
 * move s-c-b-4.0 to toplevel s-c-b (in rhlinux.redhat.com)

Comment 8 Ronny Buchmann 2005-05-16 15:36:10 UTC
Created attachment 114425 [details]
patch implenting the Makefile change described

Comment 9 Ronny Buchmann 2005-05-16 15:38:41 UTC
something the original problem: system-config-bind.pot should be checked in.

Comment 10 Ronny Buchmann 2005-05-16 15:44:30 UTC
comment #6:
Miloslav, it seems you are right

[ronny@bserv po]$ cvs ci de.po
Testing de.po...
**** Access allowed: ronny is in ACL for
system-config-bind/devel/system-config-bind-4.0.0/po.
RCS file:
/usr/local/CVS/system-config-bind/devel/system-config-bind-4.0.0/po/de.po,v
done
cvs server: ERROR: cannot write file
/usr/local/CVS/system-config-bind/devel/system-config-bind-4.0.0/po/de.po,v:
Permission denied
cvs server: Couldn't open rcs file
`/usr/local/CVS/system-config-bind/devel/system-config-bind-4.0.0/po/de.po,v':
No such file or directory
cvs server: cannot remove
/usr/local/CVS/system-config-bind/devel/system-config-bind-4.0.0/po/de.po,v: No
such file or directory


Comment 11 Jason Vas Dias 2005-05-16 16:50:11 UTC
OK, sorry - I didn't know that. 

Where are these translations CVS requirements documented ? 

I'll create the empty .po files and see if I can figure out a way to move 
the system-config-bind/devel/system-config-bind-4.0.0/* files up to 
system-config-bind .



Comment 12 Ronny Buchmann 2005-05-16 17:20:23 UTC
> Where are these translations CVS requirements documented ? 

I fear they are not documented.
My reasoning was building upon common usage (I have a complete checkout of the
rhlinux cvs for translations and bug fixing)

There are of course also some special cases (like specspo or comps-po) which are
not upstream sources but only for translations.
Everything else seems to be upstream sources (including translations).

> I'll create the empty .po files and see if I can figure out a way to move 
> the system-config-bind/devel/system-config-bind-4.0.0/* files up to 
> system-config-bind .
Someone whith shell access to rhlinux.redhat.com could be of help here to
preserve the history. Maybe Bernd Groh (translation team)?

Comment 13 Jason Vas Dias 2005-05-16 17:27:21 UTC
 po/*.po files now created. 
 
 I'm now working on integrating the suggested po/Makefile changes .

 I really don't see the point in moving everything up two directory
 levels. This is not simple with CVS .  

 Unless there's a really compelling reason not to do so 
 (like it breaks something) I'd prefer to leave the directory
 structure as is .

 RE: Comment #9: system-config-bind.pot should be checked in.
   Are you sure ? This file is generated from the *.py, .glade,
   and .desktop source files, with the make command "make pot" .
   Whenever the source files change, this file may change. I
   thought like other files generated from source that this 
   should not be a cvs object.


Comment 14 Miloslav Trmač 2005-05-16 17:37:24 UTC
(In reply to comment #13)
>  po/*.po files now created. 
>  
>  I'm now working on integrating the suggested po/Makefile changes .
Thanks.

>  RE: Comment #9: system-config-bind.pot should be checked in.
>    Are you sure ? This file is generated from the *.py, .glade,
>    and .desktop source files, with the make command "make pot" .
>    Whenever the source files change, this file may change. I
>    thought like other files generated from source that this 
>    should not be a cvs object.
The .pot file is usually in CVS, but I can't think of a reason
why it is needed.  Perhaps it is just a historical relict from
the times the translators could add their translations.

Another thing that might not be documented elsewhere: 
The package maintainer is expected to msgmerge ("make -C po update-po"
with the standard gettext makefiles) and commit all .po files after
string chages, and to keep the LINGUAS list up-to-date.


Comment 15 Jason Vas Dias 2005-05-17 20:20:28 UTC
There is now a fully gettext-ized Makefile in 
system-config-bind-4.0.0/po/Makefile .
It provides all the targets in your Makefile attachment,
and some functionality from the /usr/share/gettext/po/Makefile.in.in
template - please check it out and let me know of any issues.
RHL CVS tag: system-config-bind-4_0_0-16

 

Comment 16 Sarah Wang 2005-05-18 01:22:29 UTC
Is it possible to put .pot file to CVS?
The status page on fedora translation project depends on .pot file,
and in the future any automation process on merge/reuse/statistic
generation etc would also depend on this file.

Sarah

Comment 17 Jason Vas Dias 2005-05-18 01:41:54 UTC
system-config-bind.pot has now been added to CVS.


Comment 18 Ronny Buchmann 2005-05-18 16:56:23 UTC
Jason, only a minor issue:

the report target doesn't work for me ("nothing to be done"), same for
xx.report, but I have now idea what's wrong.

I am closing this bug now, as the translation stuff is fixed.

Comment 19 Ronny Buchmann 2005-05-18 22:16:03 UTC
The .pot file is missing strings from .glade due to an error in the
Makefile.

There is another problem in NamedConfOptions.py \n is not properly
escaped.

I've also found the problem for c#18:
declaring pattern rules as PHONY doesn't seem to work

please see the patches for details


Comment 20 Ronny Buchmann 2005-05-18 22:19:04 UTC
Created attachment 114540 [details]
patch for po/Makefile

fixing the report and pot targets

Comment 21 Ronny Buchmann 2005-05-18 22:19:48 UTC
Created attachment 114541 [details]
patch for NamedConfOptions.py

Comment 22 Ronny Buchmann 2005-05-18 22:24:08 UTC
please do an update-po afterwards and commit all .po files

Comment 23 Ronny Buchmann 2005-05-18 22:41:26 UTC
The permission problem from comment #10 may have a different reason
than cvs add

Testing de.po...
**** Access allowed: ronny is in ACL for
system-config-bind/devel/system-config-bind-4.0.0/po.
Checking in de.po;
/usr/local/CVS/system-config-bind/devel/system-config-bind-4.0.0/po/de.po,v
 <--  de.po
new revision: 1.6; previous revision: 1.5
cvs [server aborted]: could not open lock file
`/usr/local/CVS/system-config-bind/devel/system-config-bind-4.0.0/po/,de.po,':
Permission denied
cvs commit: saving log message in /tmp/cvsPWZSEV


Comment 24 Ronny Buchmann 2005-05-18 22:42:41 UTC
Sarah, Bernd can one you of fix this and possibly also move files on
the CVS server (see comment #7 and comment #13)?


Comment 25 Jason Vas Dias 2005-05-18 23:18:47 UTC
Hi Ronny - please get the latest version from CVS .

I've fixed the "report" and "missing" targets in the po/Makefile.

The NamedConfOptions.py '\\r'/'\\n's I fixed a couple of days ago
and was fixed in the latest CVS version.
 
I tested building the .pot with your suggested -LPython xgettext
addition, and without, but "diff" reported no differences, and
I checked that the glade strings are in the .pot with the original
xgettext command - "grep 'All Options' system-config-bind.pot" .

The s-c-b.pot is in CVS now, with the .po files generated from it - check them
out to a clean directory.

It could have been a bug in the version of gettext you use. 
xgettext seems to correctly recognize .py files as being Python
and .h files as being C .

Giving xgettext the "-LPython" or "-LC" arguments makes it treat
ALL files as being of that language - the *glade.h file is not
Python . I can split up the xgettext commands into two, one for
the C, and one for the Python - but again, doing that produced
no differences in the generated .pot files .


Comment 26 Ronny Buchmann 2005-05-19 12:48:12 UTC
Hi Jason,

the -LPython was left over from a test, sorry. The import change is s/-k=/-k/.
But it may really depend on the xgettext version (mine is gettext-0.14.1-12).
The safest choice may be to use long options like --keyword=.

> I checked that the glade strings are in the .pot with the original
> xgettext command - "grep 'All Options' system-config-bind.pot" .
'All Options' is also in EditDialog.py, you should grep for 'glade',
so system-config-bind.pot (r1.1) is still incomplete.

Thanks for your patience with me.

Comment 27 Jason Vas Dias 2005-05-19 13:40:28 UTC
Makefile now checked in with xgettext '-k=' -> '--keyword=' - sorry!
Thanks for your patience also.


Comment 28 Ronny Buchmann 2005-05-22 08:44:19 UTC
please also run update-po and checkin .po files

Comment 29 Ronny Buchmann 2005-05-22 10:34:02 UTC
Created attachment 114686 [details]
patch changing textdomain

s-c-b still uses bindconf as textdomain

I'm attaching a patch changing this to system-config-bind and fixing the
localedir.
And it has a little fix for the Makefile: invoke ln -s with -f to overwrite
existing links.

Now I get a translation, yeah!

Comment 30 Ronny Buchmann 2005-05-22 10:44:54 UTC
Jason, I have one important request regarding translations:
Please don't split strings (i.e. sentences) but use format strings instead.
Otherwise a good translation is impossible.

For example in BIND.py(172):
                    self.gui.error(_('DNS Configuration Initialisation Error:'),
                                   _('Access control list')+ ' "' + acl + '" ' +
                                   _('contains a reference to an undefined ACL')
+ ' "' +
                                   e.name + '".',True
                                  )
should be:
                    self.gui.error(_('DNS Configuration Initialisation Error:'),
                                   _('Access control list "%s"                 
                  contains a'
                                     'reference to an undefined ACL "%s".') % 
                                     (acl, e.name), True
                                  )


Comment 31 Ronny Buchmann 2005-05-22 17:20:03 UTC
Created attachment 114690 [details]
patch changing textdomain

gtk.glade.textdomain() was missing

Comment 32 A S Alam 2006-08-01 05:58:42 UTC
hi Ronny,
po files for s-c-b are available for translation. Can you please reopen the bug,
if you facing any problem.
Test with:
system-config-bind-4.0.0-44.fc6