Re: Translation of the Guix manual & node names

2019-05-13 Thread Meiyo Peng
Hi Julien,

Julien Lepiller writes:

> Le 24 avril 2019 09:08:34 GMT+02:00, Meiyo Peng  a écrit :
>>Hi Julien,
>>
>>Julien Lepiller writes:
>>
>>> No, we have a small script that takes care of this. As long as the
>>node
>>> name is translated somewhere near the beginning of the file, it is
>>also
>>> automatically translated in the rest of the file. So that shouldn't
>>> cause an issue. Maybe there's an error in the script?
>>>
>>> Look at xref_command in doc/local.mk
>>
>>The xref_command is too complex for me to understand.  Do you mean we
>>don't need to translate all the reference strings in @ref{}, @xref{}
>>and
>>@pxref{} as long as the target node name after "@node" is translated?
>>That will be a good news.
>
> Yes exactly! What this command does is to look for any ref, xref and pxref 
> command and look for the translation of its content in the po file for the 
> language.

I just find out that the @pxref{Packages with Multiple Outputs} in
doc/contributing.texi has to be translated.  Or I will get an error
while running make:

#+begin_example
  doc/contributing.zh_CN.texi:567: @pxref reference to nonexistent node 
`Packages with Multiple Outputs'
#+end_example

I guess it's because the node name is in doc/guix.texi (another file
than doc/contributing.texi).  Any idea?


--
Meiyo Peng
https://www.pengmeiyu.com/



Re: Translation of the Guix manual & node names

2019-04-26 Thread Miguel
El Tue, 23 Apr 2019 18:56:42 -0300
Laura Lazzati  escribió:
> Hi!

Hi Laura,
 
> I'm always late :S
>  Do you need help with the Spanish translations?

I'm not sure how would be the coordination (send me a mail in private
if you are interested in that), but at least reviewing of the document
and the executable translations would be awesome.

Best regards,
Miguel



Re: Translation of the Guix manual & node names

2019-04-25 Thread Ludovic Courtès
"pelzflorian (Florian Pelz)"  skribis:

> On Wed, Apr 24, 2019 at 09:31:59AM +0200, Julien Lepiller wrote:
>> #. type: Plain text
>> #: doc/guix.texi:7
>> msgid "@documentencoding UTF-8"
>> msgstr ""
>> "@documentencoding UTF-8\n"
>> "@documentlanguage fr\n"
>> "@frenchspacing on"
>> 
> I already use this.  The French manual is affected too.  When you do
> `info guix.fr` or use emacs to open the manual, do you see French
> “voir: Quelque section” or English “note: Quelque section”?

My understanding is that the Info format expects a literal “Note:”
regardless of the language.  It wasn’t designed with i18n in mind I
guess.

Ludo’.



Re: Translation of the Guix manual & node names

2019-04-24 Thread pelzflorian (Florian Pelz)
On Wed, Apr 24, 2019 at 11:24:52AM +0200, Julien Lepiller wrote:
> that only tp/Texinfo/Convert/HTML.pm seems to have translations

I will stop using @ref for everything once info works.  (I only
yesterday learned that translation of HTML works.)

Regards,
Florian



Re: Translation of the Guix manual & node names

2019-04-24 Thread Julien Lepiller
Le Wed, 24 Apr 2019 10:51:55 +0200,
"pelzflorian (Florian Pelz)"  a écrit :

> On Wed, Apr 24, 2019 at 09:31:59AM +0200, Julien Lepiller wrote:
> > #. type: Plain text
> > #: doc/guix.texi:7
> > msgid "@documentencoding UTF-8"
> > msgstr ""
> > "@documentencoding UTF-8\n"
> > "@documentlanguage fr\n"
> > "@frenchspacing on"
> >   
> I already use this.  The French manual is affected too.  When you do
> `info guix.fr` or use emacs to open the manual, do you see French
> “voir: Quelque section” or English “note: Quelque section”?
> 
> Regards,
> Florian

Indeed, you're right. I think it's an issue in texinfo. If you take a
look at po files in po_document in texinfo's sources, you'll notice
that only tp/Texinfo/Convert/HTML.pm seems to have translations
available, but the info manual is generated with
tp/Texinfo/Convert/Info.pm. You'll also notice the Up:, Next: and Prev:
links for instance.

The *Note seems to come from tp/Texinfo/Convert/Plaintext.pm but I'm
not entirely sure.



Re: Translation of the Guix manual & node names

2019-04-24 Thread pelzflorian (Florian Pelz)
On Wed, Apr 24, 2019 at 09:31:59AM +0200, Julien Lepiller wrote:
> #. type: Plain text
> #: doc/guix.texi:7
> msgid "@documentencoding UTF-8"
> msgstr ""
> "@documentencoding UTF-8\n"
> "@documentlanguage fr\n"
> "@frenchspacing on"
> 
I already use this.  The French manual is affected too.  When you do
`info guix.fr` or use emacs to open the manual, do you see French
“voir: Quelque section” or English “note: Quelque section”?

Regards,
Florian



Re: Translation of the Guix manual & node names

2019-04-24 Thread Julien Lepiller
Le Wed, 24 Apr 2019 08:44:14 +0200,
"pelzflorian (Florian Pelz)"  a écrit :

> On Wed, Apr 24, 2019 at 02:11:23AM +0800, Meiyo Peng wrote:
> > I will improve the manual gradually.  As I said before, I have no
> > experience with i18n.  I only learned the usage of @ref, @xref and
> > @pxref until yesterday.  And there are still many new things to
> > learn. 
> 
> I wonder what is correct.  @xref is for “*Note Some section”, @pxref
> is for “*note: Some section“ and @ref is for … “*note: Some section”
> as well?  I started to translate all @xref and @pxref with @ref but it
> still produces the English word “note” in the Info reader.

That's probably because the language is still declared as English. As
soon as you declare the language as something else, these generated
texts should be OK too. If you look at the French po, you will find
this:

#. type: Plain text
#: doc/guix.texi:7
msgid "@documentencoding UTF-8"
msgstr ""
"@documentencoding UTF-8\n"
"@documentlanguage fr\n"
"@frenchspacing on"

@documentlanguage … is what you want to add. @frenchspacing is for
displaying only one space between sentences in generated files which is
the correct way to do it in French.

Maybe we could automate that a bit?

> 
> Regards,
> Florian
> 




Re: Translation of the Guix manual & node names

2019-04-24 Thread Julien Lepiller
Le 24 avril 2019 09:08:34 GMT+02:00, Meiyo Peng  a écrit :
>Hi Julien,
>
>Julien Lepiller writes:
>
>> No, we have a small script that takes care of this. As long as the
>node
>> name is translated somewhere near the beginning of the file, it is
>also
>> automatically translated in the rest of the file. So that shouldn't
>> cause an issue. Maybe there's an error in the script?
>>
>> Look at xref_command in doc/local.mk
>
>The xref_command is too complex for me to understand.  Do you mean we
>don't need to translate all the reference strings in @ref{}, @xref{}
>and
>@pxref{} as long as the target node name after "@node" is translated?
>That will be a good news.

Yes exactly! What this command does is to look for any ref, xref and pxref 
command and look for the translation of its content in the po file for the 
language.

>
>> Also look at fr.po, I haven't translated most of the node names.
>
>By saying "most of the node names" have not been translated, do you
>mean
>some of the reference strings in @ref{}, @xref{} and @pxref{} should be
>translated?

No, sorry for the confusion. At the very beginning we didn't have that command 
so some of the strings have translated references in them, but you shouldn't do 
that anymore.

>
>
>--
>Meiyo Peng
>https://www.pengmeiyu.com/

Hi,



Re: Translation of the Guix manual & node names

2019-04-24 Thread Meiyo Peng
Hi Julien,

Julien Lepiller writes:

> No, we have a small script that takes care of this. As long as the node
> name is translated somewhere near the beginning of the file, it is also
> automatically translated in the rest of the file. So that shouldn't
> cause an issue. Maybe there's an error in the script?
>
> Look at xref_command in doc/local.mk

The xref_command is too complex for me to understand.  Do you mean we
don't need to translate all the reference strings in @ref{}, @xref{} and
@pxref{} as long as the target node name after "@node" is translated?
That will be a good news.

> Also look at fr.po, I haven't translated most of the node names.

By saying "most of the node names" have not been translated, do you mean
some of the reference strings in @ref{}, @xref{} and @pxref{} should be
translated?


--
Meiyo Peng
https://www.pengmeiyu.com/



Re: Translation of the Guix manual & node names

2019-04-24 Thread pelzflorian (Florian Pelz)
On Wed, Apr 24, 2019 at 02:11:23AM +0800, Meiyo Peng wrote:
> I will improve the manual gradually.  As I said before, I have no
> experience with i18n.  I only learned the usage of @ref, @xref and
> @pxref until yesterday.  And there are still many new things to learn.
>

I wonder what is correct.  @xref is for “*Note Some section”, @pxref
is for “*note: Some section“ and @ref is for … “*note: Some section”
as well?  I started to translate all @xref and @pxref with @ref but it
still produces the English word “note” in the Info reader.

Regards,
Florian



Re: Translation of the Guix manual & node names

2019-04-23 Thread Ludovic Courtès
Hello,

Julien Lepiller  skribis:

> Le Tue, 23 Apr 2019 15:33:32 +0200,
> Ludovic Courtès  a écrit :

[...]

>> What happens in your case is that there is no “Packaging Guidelines”
>> node—instead, it’s called “Guías de empaquetamiento” or “打包指导”.
>> Thus, Texinfo fails to build the translated manual.
>
> No, we have a small script that takes care of this. As long as the node
> name is translated somewhere near the beginning of the file, it is also
> automatically translated in the rest of the file. So that shouldn't
> cause an issue. Maybe there's an error in the script?

Oops indeed, I had misunderstood what was going on.

I applied the Spanish translation and everything went fine.

Then I looked more closely at the Simplified Chinese translation, and I
found a couple of minor issues that I modified locally for the sake of
being able to bootstrap things:

  
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3068509ac12df6f2fc6e500019a4d8bbf75d32a2

Meiyo, could you take these changes in the official PO file?

Anyway, after ‘guix pull’, “info guix.zh_CN” should also work.  :-)

Thank you, and sorry for the confusion, Julien!

Ludo’.



Re: Translation of the Guix manual & node names

2019-04-23 Thread Julien Lepiller
Le Tue, 23 Apr 2019 23:48:13 +0200,
Miguel  a écrit :

> El Tue, 23 Apr 2019 15:52:19 +0200
> Julien Lepiller  escribió:
> > Le Tue, 23 Apr 2019 15:33:32 +0200,
> > Ludovic Courtès  a écrit :
> >   
> > > Hello Miguel & Meiyo,  
> 
> Hi!
> 
> > > Thanks a lot for your translations of the Guix manual!  
> 
> Thank you too for your effort and kindness.
> 
> > > (...)
> > > If we look at these, you both translated, for example, the
> > > “Packaging Guidelines” string.  However, you also left, in your
> > > translations, things like “@pxref{Packaging Guidelines}”.
> > > (...)  
> > No, we have a small script that takes care of this. As long as the
> > node name is translated somewhere near the beginning of the file, it
> > is also automatically translated in the rest of the file. So that
> > shouldn't cause an issue. Maybe there's an error in the script?
> > 
> > Look at xref_command in doc/local.mk
> >
> > Also look at fr.po, I haven't translated most of the node names.  
> 
> It took me some time getting that, by example from fr.po, of course,
> but I think there are some errors or warnings related when you do it
> wrong. AFAIK the only problem are some @ref or @xref entries that
> contain the link and some text, that actually must be translated. I
> have to double check them this week on the translation.
> 
> > > Could you please translate all the node names, and make sure that
> > > all the cross-reference commands use the same names?  (The plan is
> > > to release Guix 1.0 in one week, so it would be great if you could
> > > send an updated PO file by then!)  
> 
> I hope having more than only the node names this week. Pretty sure it
> won't be the full translation, but I hope reaching 70% at least for
> 1.0. We'll see...

The attached python script (it requires python and python-polib) might
get you closer by automatically translating some very common strings.

So you have to change these lines:

regexps.append([re.compile('English regexp'), 'Translate string'])

#1, #2 etc. are replaced by the content of the matches in the English
regexp.

I don't know if you'll use it, but I hope it will be of some help to
you. Good luck with the translation!

> 
> Happy hacking,
> Miguel

#!/usr/bin/python3
# -*- coding: utf-8 -*-

#Template Translator v0.1
#Traduit automatiquement certaines chaine de caractères des paquets

#Publié par roptat  le 8 août 2016
#sous la licence gnu General Public License version 3 pubilée par la Free Software Foundation.
#Visitez  pour obtenir la licence.


import sys
import re
import polib

files = sys.argv
files.pop(0)

def convert(entry, regexp, template):
	m = regexp.match(entry.msgid)
	# do not modify anything if the translation is already correct
	if m and ("fuzzy" in entry.flags or not entry.msgstr):
		msgstr = template
		try:
			msgstr = msgstr.replace("#1", m.group(1))
			msgstr = msgstr.replace('#2', m.group(2))
			msgstr = msgstr.replace('#3', m.group(3))
			msgstr = msgstr.replace('#4', m.group(4))
		except:
			x=1
		entry.msgstr = msgstr
		if "fuzzy" in entry.flags:
			entry.flags.remove("fuzzy")


# regexps
regexps = []

regexps.append([re.compile('{Scheme Procedure} (.*)$'), '{Procédure Scheme} #1'])
regexps.append([re.compile('{Scheme Variable} (.*)$'), '{Variable Scheme} #1'])
regexps.append([re.compile('{Data Type} (.*)$'), '{Type de données} #1'])
regexps.append([re.compile('@code{([^}]*)} \\(default:? #t\\)$'),
'@code{#1} (par défaut : #t)'])
regexps.append([re.compile('@code{([^}]*)} \\(default:? ([0-9]*)\\)$'),
'@code{#1} (par défaut : #2)'])
regexps.append([re.compile('@code{([^}]*)} \\(default:? @code{([^}]*)}\\)$'),
'@code{#1} (par défaut : @code{#2})'])
regexps.append([re.compile('@code{([^}]*)} \\(default:? @var{([^}]*)}\\)$'),
'@code{#1} (par défaut : @var{#2})'])
regexps.append([re.compile('@code{([^}]*)} \\(default:? "([^"]*)"\\)$'),
'@code{#1} (par défaut : "#2")'])
regexps.append([re.compile('{@code{([^}]*)} parameter} ([^ ]*) ([^ ]*)$'), '{paramètre de @code{#1}} #2 #3'])
regexps.append([re.compile('The ([^ ]*) package to use.$'), 'Le paquet #1 à utiliser.'])
regexps.append([re.compile('Defaults to @samp{([^}]*)}.$'), 'La valeur par défaut est @samp{#1}.'])
regexps.append([re.compile('Available @code{(.*)} fields are:$'), 'Les champs de @code{#1} disponibles sont :'])


po = polib.pofile(files[0])

for entry in po:
	for reg in regexps:
		convert(entry, reg[0], reg[1])
po.save()



Re: Translation of the Guix manual & node names

2019-04-23 Thread Laura Lazzati
Hi!

I'm always late :S
 Do you need help with the Spanish translations?

Kind regards :)
Laura



Re: Translation of the Guix manual & node names

2019-04-23 Thread Miguel
El Tue, 23 Apr 2019 15:52:19 +0200
Julien Lepiller  escribió:
> Le Tue, 23 Apr 2019 15:33:32 +0200,
> Ludovic Courtès  a écrit :
> 
> > Hello Miguel & Meiyo,

Hi!

> > Thanks a lot for your translations of the Guix manual!

Thank you too for your effort and kindness.

> > (...)
> > If we look at these, you both translated, for example, the
> > “Packaging Guidelines” string.  However, you also left, in your
> > translations, things like “@pxref{Packaging Guidelines}”.
> > (...)
> No, we have a small script that takes care of this. As long as the
> node name is translated somewhere near the beginning of the file, it
> is also automatically translated in the rest of the file. So that
> shouldn't cause an issue. Maybe there's an error in the script?
> 
> Look at xref_command in doc/local.mk
>
> Also look at fr.po, I haven't translated most of the node names.

It took me some time getting that, by example from fr.po, of course, but
I think there are some errors or warnings related when you do it wrong.
AFAIK the only problem are some @ref or @xref entries that contain the
link and some text, that actually must be translated. I have to double
check them this week on the translation.

> > Could you please translate all the node names, and make sure that
> > all the cross-reference commands use the same names?  (The plan is
> > to release Guix 1.0 in one week, so it would be great if you could
> > send an updated PO file by then!)

I hope having more than only the node names this week. Pretty sure it
won't be the full translation, but I hope reaching 70% at least for
1.0. We'll see...

Happy hacking,
Miguel



Re: Translation of the Guix manual & node names

2019-04-23 Thread Meiyo Peng
Hi Ludovic,

Ludovic Courtès writes:

> Hello Miguel & Meiyo,
>
> Thanks a lot for your translations of the Guix manual!
>
> I found an issue with the translations that prevents us from including
> them:
>
>   https://translationproject.org/latest/guix-manual/es.po
>   https://translationproject.org/latest/guix-manual/zh_CN.po
>
> If we look at these, you both translated, for example, the “Packaging
> Guidelines” string.  However, you also left, in your translations,
> things like “@pxref{Packaging Guidelines}”.
>
> Texinfo has a notion of “node” (roughly a node is a chapter, section, or
> sub-section.)  Each node has a name that can be used in cross-references
> commands @ref, @xref, or @pxref.  However, Texinfo errors out when a
> cross-reference command refers to a non-existent node name.
>
> What happens in your case is that there is no “Packaging Guidelines”
> node—instead, it’s called “Guías de empaquetamiento” or “打包指导”.
> Thus, Texinfo fails to build the translated manual.

The zh_CN version guix manual that I uploaded earlier is a test with the
TranslationProject.org robot.  It's not supposed to be used as a
suitable translation.  I should have notified you in the mailing list.

I will improve the manual gradually.  As I said before, I have no
experience with i18n.  I only learned the usage of @ref, @xref and
@pxref until yesterday.  And there are still many new things to learn.

> Could you please translate all the node names, and make sure that all
> the cross-reference commands use the same names?  (The plan is to
> release Guix 1.0 in one week, so it would be great if you could send an
> updated PO file by then!)
>
> I’m attaching the complete list of node names below; “Top” is an
> exception, it must _not_ be translated.

OK.  I will do my best.  However, my translation progress will be slow.
It's 02:00 in China now and I am still in my office working on my job!
I won't have much time recently, but I will do as much as I can.

I feel excited for the Guix 1.0 release and also regret that I cannot
translate the Guix manual before that date.  The translation work can be
finished in two or three months, I guess.  It's extremely difficult to
translate technical English manuals into Chinese.  Many technical
English words has no suitable Chinese translation.  Besides, I have
never ever used a Chinese version GNU/Linux distro or ever read the
Chinese version manuals, so I am unfamiliar with the corresponding
Chinese words.  This makes the translation work even harder for me.
However, I am sure a bundled Chinese manual in the Guix 1.0 release
tarball or ISO file won't matter much.  We can release an updated
Chinese manual on our website later.  The web version will be what most
people will use.

Thank you for your understanding.


--
Meiyo Peng
https://www.pengmeiyu.com/



Re: Translation of the Guix manual & node names

2019-04-23 Thread Julien Lepiller
Le Tue, 23 Apr 2019 15:33:32 +0200,
Ludovic Courtès  a écrit :

> Hello Miguel & Meiyo,
> 
> Thanks a lot for your translations of the Guix manual!
> 
> I found an issue with the translations that prevents us from including
> them:
> 
>   https://translationproject.org/latest/guix-manual/es.po
>   https://translationproject.org/latest/guix-manual/zh_CN.po
> 
> If we look at these, you both translated, for example, the “Packaging
> Guidelines” string.  However, you also left, in your translations,
> things like “@pxref{Packaging Guidelines}”.
> 
> Texinfo has a notion of “node” (roughly a node is a chapter, section,
> or sub-section.)  Each node has a name that can be used in
> cross-references commands @ref, @xref, or @pxref.  However, Texinfo
> errors out when a cross-reference command refers to a non-existent
> node name.
> 
> What happens in your case is that there is no “Packaging Guidelines”
> node—instead, it’s called “Guías de empaquetamiento” or “打包指导”.
> Thus, Texinfo fails to build the translated manual.

No, we have a small script that takes care of this. As long as the node
name is translated somewhere near the beginning of the file, it is also
automatically translated in the rest of the file. So that shouldn't
cause an issue. Maybe there's an error in the script?

Look at xref_command in doc/local.mk

Also look at fr.po, I haven't translated most of the node names.

> 
> Could you please translate all the node names, and make sure that all
> the cross-reference commands use the same names?  (The plan is to
> release Guix 1.0 in one week, so it would be great if you could send
> an updated PO file by then!)
> 
> I’m attaching the complete list of node names below; “Top” is an
> exception, it must _not_ be translated.
> 
> Thanks in advance,
> Ludo’.