wiki:TranslationIntro

Version 14 (modified by szabgab, 6 years ago) (diff)

--

Short introductory guide to translating (localizing) Padre

There are several thing that can and should be translated. They will be described on this page

  • The GUI of Padre
  • Plug-ins
  • Perl 5 diagnostics
  • Perl 5 documentation (perldoc in general)
  • Perl 5 call-tips
  • Similar things for other languages

Translating the GUI of Padre

The following is intended for people who work on unix-ish operating systems and have no fear for the command line.

But even If you do not belong to that group you have no excuse for not contributing a translation since you may use Poedit. Poedit is a graphical tool that supports extraction and translation of messages and runs on a variety of platforms including MS Windows. The author of this text, however, has not used Poedit himself and thus cannot provide a field report.

If you chose to work on the command line the following is a short intro which describes the steps I took. It does not cover all features of the tools used - please refer to the fine manuals of the respective program.

Before you begin, please make sure that you have the GNU gettext utilities installed.

  1. Check out the current sources of Padre from the subversion repository: http://svn.perlide.org/padre/trunk/
  2. Update the messages.pot file using
    perl ../tools/update_pot_file.pl
    
    This will extract all strings to be translated from the Perl modules and have them written to the message template file. Note that this command must be typed inside the 'Padre' subdirectory.
    1. In case of updating an already existing language execute
      msgmerge -o <lng>.po.new <lng>.po messages.pot
      
      This will merge the already existing translations and the new template file, resulting in a new file that you now need to edit. Be careful to check the already existing translations: The merging might produce wrong results.
    2. In case of creating a totally new translation execute
      msginit -i messages.pot -o <lng>.po -l <lng_CC>
      
      Where <lng_CC> is the locale id with language and country ids. Eg.: de_DE or en_US.
  3. Add new files to the repository or - if you don't have write access - either send the updated "messages.pot" and the .po file to the padre development mailing list or open a new ticket and attach the files to it.
perl ../tools/po_stats.pl

Will create a textual report on the status of all the existing translation files. Remember to run this under the 'Padre' subdirectory.

For MS Windows the msgftm.exe might be downloaded from here: http://gettext.sourceforge.net/ (have not tried it)

Adding a translation

  1. Check out the list of existing translations: http://svn.perlide.org/padre/trunk/Padre/share/locale/
  2. Create the .po file and add it to SVN (note: only the .po file, not the .mo one).
  3. Change lib/Padre/Locale.pm (the %SHORTNAME hash and the 'menu_view_languages' subroutine )
  4. Add yourself to lib/Padre.pm and lib/Padre/Wx/Menu/Help.pm for the credit
  5. Update the Changes file to brag about this new translation! :-)

Plug-ins

So far we have not dealt with the translation of the plug-ins. We need a plan.

Perl 5 diagnostics

We have an integration with translated versions of the perldiag.pod that comes with perl. ( http://perldoc.perl.org/perldiag.html ) Currently we only found French translation on POD2::FR (http://search.cpan.org/dist/POD2-FR).

If someone wants to have translation to any language, the right way is to start translating the perldiag.pod file of perl 5.10 and releasing it as POD2::XY Where XY is the language code.

Actually even the English version of perldiag.pod could get some improvement. The problem with it as it is with a large part of the Perl 5 documentation is that in many places it assumes prior knowledge of C or UNIX. Also in many cases it "correct but not too helpful for beginners".

e.g.

Global symbol "%s" requires explicit package name

(F) You’ve said "use strict" or "use strict vars", which indicates that all variables
must either be lexically scoped (using "my" or "state"), declared
beforehand using "our", or explicitly qualified to say which package 
the global variable is in (using "::").

A beginner probably needs something like this:

You have forgotten to declare the variable using "my" or it was declared in
another scope or it has a typo.

So the "translations" don't necessarily have to be exact translations of the English version but should be good explanations for people with not much background in Perl.

See also #169

As the content of perldiag is huge it is better to start with the most common warnings and errors. For now see the list here: http://www.perlmonks.org/?node_id=733201 (TODO: and later maybe copy that list here) (TODO: provide examples scripts generating each one of the important errors/warnings)

http://mail.perlide.org/pipermail/padre-dev/2008-December/000368.html

Perl 5 documentation (perldoc in general)

Could be translated and uploaded to CPAN as POD2::XY. We have not implemented it but we should provide and indexed access to the selected translated version of the documentation.

There are several modules on CPAN in the POD2:: name space and there is the

See also http://perldoc2.sourceforge.net/

Perl 5 call-tips

The source of the call-tips is in http://svn.perlide.org/padre/trunk/Padre/share/languages/perl5/perl5.yml We have not thought of a way how to translate these. (and even the English version needs improvement)

Similar things for other languages

We have not thought about this yet.

Language Status

In this table we'll try to collect information about the status of various languages and contact information where possible. We should also connect this with some status report on the % of translation.

No Padre GUI yet:

  • Norwegian
    • Padre GUI -
    • Diagnostics -
    • Perldoc -
  • Swedish
    • Padre GUI -
    • Diagnostics -
    • Perldoc -
  • Danish
    • Padre GUI -
    • Diagnostics -
    • Perldoc -
  • Finnish
    • Padre GUI -
    • Diagnostics -
    • Perldoc -

Attachments (5)

Download all attachments as: .zip