Doc enhancement: how to change the displayed book name and insert a translator credit page?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Doc enhancement: how to change the displayed book name and insert a translator credit page?

Marguerite Su
Hi, Thomas & listmates,

I published a preview version of openSUSE startup doc on forum.suse.org.cn

And here're the feedbacks I collected:

1. The book name is displayed as "openSUSE startup", some sections are
displayed as "KDE Quick Start", "Installation Quick Start"...

There're more suitable/readable names in Chinese, so I want to replace them.

I tried to change entity-decl.ent in xml directory, regenerate xmls,
and `daps` again, but the names didn't change.

I can't find any other places defined the name...

2. I set up and used transifex to help gathering enough translators.

So I can't just add a few lines to the acknowledgement page after Linus.

It is possible that some kind guys writing some perl scripts to
extract the translator credits in every po, generate a new xml, and
integrate it into our existing documentation?

I think this way of saying thanks may be better, XD.

Or I'll have to read about 50 po files, note them, and hack
xml...which is a lot of work and hard to maintain.


Greetings

Marguerite
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Marguerite Su
PS:

Our team translated the entire GPL and GFDL, but at the last appendix,
it still uses the English version.

Is it possible to use the Chinese version? I have added some links to
the original online version, so using localized version can't miss
useful informations.

Greetings

Marguerite
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Marguerite Su
On Wed, Jul 3, 2013 at 11:49 PM, Marguerite Su <[hidden email]> wrote:
> Our team translated the entire GPL and GFDL, but at the last appendix,
> it still uses the English version.

ignore this, it was my shell script missing to pull the translation.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Stefan Knorr
In reply to this post by Marguerite Su
Hi Marguerite,


On Mi, 2013-07-03 at 23:46 +0800, Marguerite Su wrote:
> I tried to change entity-decl.ent in xml directory, regenerate xmls,
> and `daps` again, but the names didn't change.
>
>I can't find any other places defined the name...

You may want to try doing
 $ rm -r build
before building… that helped me trough some problems. Although, actually
it should not work, since Daps is supposed to regenerate the profiled
sources whenever they change. So if it does work, that should be a bug.

***

Re: the Chinese license (ianal, and not too knowledgeable about
licenses): I don't think any other localisation team has translated the
license, and the English license is probably the official version.
Also, it is apparently not allowed to "outsource" the GFDL to a(nother)
website – it has to be in the document itself which is probably the only
reason why we put it after every ever-so-short article. So, I tend to
think you need to stick with the English version (but this is just my
guess).

Hope that helps.

Stefan.

--
SUSE LINUX GmbH, Maxfeldstraße 5, D-90409 Nürnberg
Geschäftsführer: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 21284 (AG Nürnberg)

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Marguerite Su
Hi, Stefan,

On Thu, Jul 4, 2013 at 12:10 AM, Stefan Knorr <[hidden email]> wrote:
> You may want to try doing
>  $ rm -r build
> before building… that helped me trough some problems. Although, actually
> it should not work, since Daps is supposed to regenerate the profiled
> sources whenever they change. So if it does work, that should be a bug.
>

'build' deletion doesn't work in this case...

Let's simplify it:

eg: the first page of the doc has content:

openSUSE 12.3
Start-Up
7 04, 2013

Where can I replace the text "Start-Up" to eg:

openSUSE 12.3
上手指南
7 04, 2013

> I don't think any other localisation team has translated the
> license, and the English license is probably the official version.

Ha! So we're the first? I didn't notice that 'coz I saw a
common_gfdl1.2_i.xml.zh_CN.po and thought we should translate it.

And there're still no unofficial Chinese version of GFDL. I thought it
might be also good to help upstream...

> Also, it is apparently not allowed to "outsource" the GFDL to a(nother)
> website

Oh? I don't know this before, thank you~

Then I think I can tweak it a little to add both versions with Chinese
marked as "unofficial".

PS:

I find the way to get all the "translator-credits" out from all POs.

Now I'm working on testing and make scripts.

Later I'll commit it to 50-tools, XD


Marguerite
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Marguerite Su
On Thu, Jul 4, 2013 at 3:12 AM, Marguerite Su <[hidden email]> wrote:

> Let's simplify it:
>
> eg: the first page of the doc has content:
>
> openSUSE 12.3
> Start-Up
> 7 04, 2013
>
> Where can I replace the text "Start-Up" to eg:
>
> openSUSE 12.3
> 上手指南
> 7 04, 2013

This bug is because when generating the localized xml, it uses
"en/xml/entity-decl.ent" instead of "$lang/xml/entity-decl.ent", so
the real names that macros point to are always English.

A quick fix is to make soft links.

> PS:
>
> I find the way to get all the "translator-credits" out from all POs.
>
> Now I'm working on testing and make scripts.
>
> Later I'll commit it to 50-tools, XD
>

It's done. I'm testing it in zh_CN branch.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Frank Sundermeyer
In reply to this post by Marguerite Su
On Wed, 3 Jul 2013 23:46:17 +0800 Marguerite Su wrote:

Hi,

> 1. The book name is displayed as "openSUSE startup", some sections are
> displayed as "KDE Quick Start", "Installation Quick Start"...
>
> There're more suitable/readable names in Chinese, so I want to
> replace them.

this is resolved, correct?
 
> 2. I set up and used transifex to help gathering enough translators.
>
> So I can't just add a few lines to the acknowledgement page after
> Linus.
>
> It is possible that some kind guys writing some perl scripts to
> extract the translator credits in every po, generate a new xml, and
> integrate it into our existing documentation?

I've never worked with -po files so far, but I am willing to try this.
Where are your .po files located and what parts need to be extracted?

--
Regards
        Frank

Frank Sundermeyer, Technical Writer, Documentation
SUSE Linux Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
Tel: +49-911-74053-0, Fax: +49-911-7417755;  http://www.opensuse.org/
SUSE Linux Products GmbH, GF:
Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
"Reality is always controlled by the people who are most insane" Dogbert
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Marguerite Su
Hi, Frank,

On Thu, Jul 4, 2013 at 9:52 PM, Frank Sundermeyer <[hidden email]> wrote:
>> There're more suitable/readable names in Chinese, so I want to
>> replace them.
>
> this is resolved, correct?
>

Ja!


>> It is possible that some kind guys writing some perl scripts to
>> extract the translator credits in every po, generate a new xml, and
>> integrate it into our existing documentation?
>
> I've never worked with -po files so far, but I am willing to try this.
> Where are your .po files located and what parts need to be extracted?
>

my po files here:

http://svn.opensuse.org/svn/opensuse-doc/trunk/documents/distribution/zh_CN/po/

And I wanted to extract from eg: systemd.xml.zh_CN.po

msgid "translator-credits"
msgstr "2013, 玛格丽特 · 苏 <[hidden email]>"

to

2013, 玛格丽特 · 苏 <ulink url="mailto:[hidden email]"/>

Currently I'm using shell script to do this:

http://svn.opensuse.org/svn/opensuse-doc/trunk/documents/distribution/zh_CN/extract-translators.sh

But because I use `tail -1`, so my script can only extract the last
one who added his name to the msgstr...so I think other powerful
scripting language may do a lot better but it's out of my ability...

Thanks

Marguerite
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Karl Eichwalder
Marguerite Su <[hidden email]> writes:

> my po files here:
>
> http://svn.opensuse.org/svn/opensuse-doc/trunk/documents/distribution/zh_CN/po/
>
> And I wanted to extract from eg: systemd.xml.zh_CN.po
>
> msgid "translator-credits"
> msgstr "2013, 玛格丽特 · 苏 <[hidden email]>"
>
> to
>
> 2013, 玛格丽特 · 苏 <ulink url="mailto:[hidden email]"/>
>
> Currently I'm using shell script to do this:
>
> http://svn.opensuse.org/svn/opensuse-doc/trunk/documents/distribution/zh_CN/extract-translators.sh
>
> But because I use `tail -1`, so my script can only extract the last
> one who added his name to the msgstr...so I think other powerful
> scripting language may do a lot better but it's out of my ability...

I think with using gettext runtime tools this pipe would do the trick:

msggrep -K -e translator-credits FILE.po \
  | msgexec cat \
  | sed -n '/^[[:digit:]]\+/p' \
  | sed 's/<\(.*\)>/<ulink url="mailto:\1"\/>/'

--
Karl Eichwalder                              SUSE LINUX Products GmbH
R&D / Documentation                          Maxfeldstraße 5
                                             90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Frank Sundermeyer
In reply to this post by Marguerite Su
On Thu, 4 Jul 2013 22:22:40 +0800 Marguerite Su wrote:

Hi Marguerite,

> >> It is possible that some kind guys writing some perl scripts to
> >> extract the translator credits in every po, generate a new xml, and
> >> integrate it into our existing documentation?

Attached is a shell script that, sort of, does what you want--based on
the existing data.

The biggest problem with your .po files is the inconsistency of the
Translators data. Some translator credits are added as comments at the
beginning of the file, whereas others are mentioned in the
"translator-credits" section. Combination of both exists, too.

The "translator credit" section contains the data in a number of
varieties that makes them difficult to parse (there are even two
different commas!). Single authors also entered their credits
differently from file to file (there are, for example, nine different
credits from yourself ;-)).

Interestingly, there is almost no occurrence of multi-line data in the
"translator-credits" section. (a fact I made use of).

The fact that the data is inconsistent also makes the msggrep output
useless for your purpose. It typically looks like this:

 > msggrep -K -e 'translator-credits' po/zypper.xml.zh_CN.po
#
# Translators:
#   <[hidden email]>, 2013.
# Guo Yunhe <[hidden email]>, 2013.
msgid ""
msgstr ""
"Project-Id-Version: opensuse-manuals\n"
"POT-Creation-Date: 2013-03-17 02:02+0800\n"
"PO-Revision-Date: 2013-03-02 03:36+0000\n"
"Last-Translator: guoyunhebrave <[hidden email]>\n"
"Language-Team: Chinese (China)
(http://www.transifex.com/projects/p/opensuse-"
"manuals/language/zh_CN/)\n" "Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#. Put one translator per line, in the form of NAME <EMAIL>, YEAR1,
YEAR2 #: zypper.xml:0(None)
msgid "translator-credits"
msgstr "Sign Guo Yunhe <[hidden email]>"

Parsing that output is not much different from parsing the complete .po
file, therefore I did not make use of it.

My script focuses on the "translator-credits" (ignoring the comments)
and tries unify the existing variants - just a quick hack that allows
you to quickly make use of the data without having to do too much
manual work.

This version assumes that multiple entries occur on one line and are
separated by ";" - that is the case in all but three files.
It converts all usable data to

<member>2012, 玛丽苏 <ulink url="mailto:[hidden email]"/></member>

which allows you to just Cut & Paste it into a <simplelist>. The output
can easily be changed by adjusting the script.

Errors and missing data is reported at STDERR--that will hopefully help
fixing the data.

To run it, go to the po/ and run the script like this:

extract-translators.sh 2>translator_errors.txt | sort -u

That will put the data on STDOUT (sorted, with duplicates removed) and
the errors to translator_errors.txt.

For better results, the translator data needs to be cleaned up (at
least the comments from the top of the files need to be moved to the
"translator-credits" section). And as long as there is no way or tool
that lets you properly extract the "translator-credits" section from
the .po file, I suggest to put the data in one line separated by a
RECORD_DELIMITER (see line 4 in the script).

Hope this helps.

--
Regards
        Frank

Frank Sundermeyer, Technical Writer, Documentation
SUSE Linux Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
Tel: +49-911-74053-0, Fax: +49-911-7417755;  http://www.opensuse.org/
SUSE Linux Products GmbH, GF:
Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
"Reality is always controlled by the people who are most insane" Dogbert

extract-translators.sh (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Doc enhancement: how to change the displayed book name and insert a translator credit page?

Frank Sundermeyer
On Fri, 5 Jul 2013 14:56:40 +0200 Frank Sundermeyer wrote:

Hi,

> The fact that the data is inconsistent also makes the msggrep output
> useless for your purpose.

Karl rightfully pointed out that this is not true ;-), because there
are several syntax alternatives which would make my egrep fail...
So I had a second look at msggrep...

msggrep  will not only normalize the data so it can reliably be parsed,
it can also be called with --no-wrap, which will put the whole msgstr
into a single line. That in turn will make sure my script works
even if the original data is spread over several lines.  

The modified script attached will make use of that and hopefully will
turn the script into a reliable solution to extract and parse the
needed data.

BUT (yes, of course there is a downside ;-)) it will definitely require
a separator at the end of each translator record - otherwise it will not
be possible to determine where a record begins or ends.
Another possibility would be to require each record to begin with a
4-digit year entry, but IMHO a separator would be more flexible.
The following data is correctly parsed by the attached script
(delimiter is ";"):

msgid
"translator-credits"
msgstr "玛丽苏 <[hidden email]>,2012 - 2013;"
"Sign Guo Yunhe "
"<[hidden email]>;"
"oxbambooxo <[hidden email]>, 2013;"
"2012-2013"
"Guo Yunhe"
"<[hidden email]>;"
"戴唯思 <[hidden email]>,2012,2013"

Result:

<member>2012-2013, Guo Yunhe <ulink
  url="mailto:[hidden email]"/></member>
 <member>2012-2013,
  戴唯思 <ulink url="mailto:[hidden email]"/></member>
<member>2012-2013, 玛丽苏 <ulink
  url="mailto:[hidden email]"/></member>
<member>2013, oxbambooxo
  <ulink url="mailto:[hidden email]"/></member>
<member>Sign Guo Yunhe <ulink
 url="mailto:[hidden email]"/></member>

--
Regards
        Frank

Frank Sundermeyer, Technical Writer, Documentation
SUSE Linux Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
Tel: +49-911-74053-0, Fax: +49-911-7417755;  http://www.opensuse.org/
SUSE Linux Products GmbH, GF:
Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
"Reality is always controlled by the people who are most insane" Dogbert

extract-translators.sh (3K) Download Attachment
Loading...