Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-doc
Navigation:
Lists: gentoo-doc: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-doc@g.o
From: Xavier Neys <neysx@g.o>
Subject: Re: Referencing English files instead of translated ones
Date: Fri, 22 Jul 2005 23:25:14 +0200
Jan Kundrát wrote:
> Hi all,
> as I wanted to find out something I can slap rane (Polish translator)
> with, I've written small script that checks if you are referencing
> English file from other files even if you have given doc translated. My
> simple script doesn't use metadoc.xml, so it will warn you if you have
> some file in CVS but without metadoc.xml entry as well.
> 
> Anyway, I've found out that Polish docs were up-to-date while Czech ones
> weren't (not my fault, they were added before I became Lead Translator
> for CS), but don't laugh at me, they have been fixed :-).
> 
> In fact, it's not a script, only a simple line of bash, designed to be
> run in gentoo/xml/htdocs/doc/$LANG/:
> 
> for f in *.xml */*.xml; do grep -Rn en/`echo $f | sed "s:\./::"` .; done


Better use one that does not check comments, does not yield unwanted false 
positives (a wanted one would be a mention of the main English index with a 
link to /doc/en/index.xml eg.), does not forget handbook/2005.0, knows that a 
link to a dir is actually a link to {dir}/index.xml and outputs something 
readable.

neysx@basil ~/gentoo.org/gentoo/xml/htdocs/doc/cs $ ../cl.rb
./handbook/hb-working-features.xml::/doc/en/distcc.xml
./handbook/index.xml::/doc/en/handbook/handbook-alpha.xml
./handbook/hb-install-about.xml::/doc/en/faq.xml
./handbook/handbook.xml::/doc/en/handbook/handbook-alpha.xml

Looks like you should have been slapped twice as much, or twice as hard, as 
rane, not even mentioning a Russian slap for closing a bug without pinging the 
assignee, and one more from releng, and... now my catfish needs a rest,  the 
drought has made him weary.

cl.rb should be run from /doc/$LANG
Just leave it in /doc and use "../cl.rb" from your /doc/$LANG.
"../cl.rb|grep -v 2004" would hide unmaintained old books.


Cheers,
-- 
/  Xavier Neys
\_ Gentoo Documentation Project
/  French & Internationalisation Lead
\  http://www.gentoo.org/doc/en
/\
#!/usr/bin/ruby
# Check docs for links to .../en/... for docs that exist in $LANG
# Usage: run cl.rb from .../doc/$LANG
require 'rexml/document'
require 'find'
d=`pwd`.strip.split('/')[-1]
raise 'Having a bit of fun?' if d == 'en'
Find.find('.'){|f|
 if f =~ /\.xml$/ then
  x=REXML::Document.new(File.new(f))
  xp = x.root.name=='metadoc' ? '/metadoc/files/file' : '//uri'
  REXML::XPath.each(x, xp){|el|
    link=el.attributes['link'] ? el.attributes['link'] : el.text
    if link =~ /\/en\// then
      cf = "../.." + link.sub("http://www.gentoo.org/","/")
      cf << "/index.xml" if File.directory?(cf)
      puts "#{f}::#{link}" if File.file?(cf.sub(/\/en\//,"/#{d}/"))
    end
  }
 end
}
References:
Referencing English files instead of translated ones
-- Jan Kundrát
Navigation:
Lists: gentoo-doc: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Referencing English files instead of translated ones
Next by thread:
[no subject]
Previous by date:
Referencing English files instead of translated ones
Next by date:
[no subject]


Updated Jun 17, 2009

Summary: Archive of the gentoo-doc mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.