Marguerite Su <[email protected]> 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, 玛格丽特 · 苏 <[email protected]>"
>
> to
>
> 2013, 玛格丽特 · 苏 <ulink url="mailto:[email protected]"/>
>
> 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: [email protected]
To contact the owner, e-mail: [email protected]

Reply via email to