http://www.perlmonks.org?node_id=343223

giulienk has asked for the wisdom of the Perl Monks concerning the following question:

I just found last week that the POD for my Audio::Beep module has been translated into Japanese by the perldoc.jp project. So I offered them to include their translation into my CPAN release of the module. Now for a few questions: Maybe something coded along the lines of the following pseudo-code could do the trick:
if (shell is interactive) { if (ask "Do you want to install Japanese docs?") { install japanese_docs; } else { install standard_docs; } } else { if (check_locale == 'jp') { install japanese_docs; } else { install standard_docs; } }
What you think? Any better ideas or any guidelines or already defined standards? Thanks.


$|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g

Replies are listed 'Best First'.
Re: Policy for installing multilingual documentation
by Abigail-II (Bishop) on Apr 07, 2004 at 09:09 UTC
    • Would it be acceptable to render Makefile.PL interactive and ask which version of the documentation to install? Could it broke non-interactive installations by CPAN Testers?
    • What about checking some locale variable to automatically make a choice? But my guess is it could be error prone, so i'm not sure.
    I'd advice against both of those options, especially the last one, and that's because they make choice - or let the installer make a choice. It might be ok for a machine where there's just one user, and said user does the installation himself, but it's not a useful solution for a multiuser machine. What to do on box where some of the developers prefer to have the documentation in Japanese, others don't speak Japanese, and the installers happens to have his locale set to Japanese?

    I'd say, install both. Now, you might wonder where. Well, that problem has already been solved. From the manual page of "man":

       LANG   If  LANG  is set, its value defines the name of the
              subdirectory where man first looks for  man  pages.
              Thus,  the  command  `LANG=dk man 1 foo' will cause
              man   to   look   for   the   foo   man   page   in
              .../dk/man1/foo.1,  and  if  it  cannot find such a
              file, then in .../man1/foo.1, where ... is a direc-
              tory on the search path.
    
    So, if the 'normal' man pages go to say, /usr/local/man/man3, the Japanese pages would go to /usr/local/man/jp/man3. Unfortunally, I don't think MakeMaker has default support for this, nor will I guarantee that all man implementations support this.

    Abigail

Re: Policy for installing multilingual documentation
by PodMaster (Abbot) on Apr 07, 2004 at 09:09 UTC
    What's the best place to install the Japanese documentation? My first thought was to install it as Audio::Beep_jp, but i'm not sure that's correct.
    If I were you, I'd have two files containing pod, One in English, one in Japanese, and at Makefile.PL time I'd copy one of them to the appropriate spot (lib/Audio/Beep.pod)
    Would it be acceptable to render Makefile.PL interactive and ask which version of the documentation to install?
    Yes, but be sure to have a default
    Could it broke non-interactive installations by CPAN Testers?
    Absolutely. You'll be fine as long as you use ExtUtils::MakeMaker's prompt function or its equivalent.
    What about checking some locale variable to automatically make a choice? But my guess is it could be error prone, so i'm not sure.
    Locale isn't neccessarily revealing, and even if you do some detecting, you should still prompt.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.