\documentclass{beamer}


\mode<presentation>
{
  \usetheme{Warsaw}
  % or ...

  \setbeamercovered{transparent}
  % or whatever (possibly just delete it)
}


\usepackage[english]{babel}
% or whatever

\usepackage{pdfpages}

\usepackage{ucs}
\usepackage[utf8x]{inputenc}
% or whatever

\usepackage{times}
\usepackage[T1]{fontenc}


\title[programs, debconf, man pages translation using gettext] % (optional, use only with long paper titles)
{Programs, debconf, man pages translation using gettext : a tutorial for skilled and less skilled Debian developers and translators}

\author[bubulle] % (optional, use only with lots of authors)
{Christian ~Perrier}
% - Give the names in the same order as the appear in the paper.
% - Use the \inst{?} command only if the authors have different
%   affiliation.

% - Use the \inst command only if there are several affiliations.
% - Keep it simple, no one is interested in your street address.

\date[Debconf 5] % (optional, should be abbreviation of conference name)
{5th Debian Conference, Helsinki,\\ Finland}
% - Either use conference name or its abbreviation.
% - Not really informative to the audience, more for people (including
% yourself) who are reading the slides online




\pgfdeclareimage[height=2cm]{debian-logo}{debian-swirl}
\logo{\pgfuseimage{debian-logo}}



% Delete this, if you do not want the table of contents to pop up at
% the beginning of each subsection:
\AtBeginSection[]
{
  \begin{frame}<beamer>
    \frametitle{Outline}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}

\AtBeginSubsection[]
{
  \begin{frame}<beamer>
    \frametitle{Outline}
    \tableofcontents[currentsection,currentsubsection]
  \end{frame}
}


% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command: 

%\beamerdefaultoverlayspecification{<+->}


\begin{document}

\begin{frame}
  \titlepage
  \begin{center}
    \small{This work is dedicated to René Cougnenc}
  \end{center}
\end{frame}

\begin{frame}
	\tableofcontents
\end{frame}

%%%%%%%%%%%%%%%%%

\section{Tutorial structure}

\begin{frame}
  \frametitle{What is in this tutorial?}
	\begin{itemize}[<+->]
	\item
	handling localisation in already internationalised software
	\item
	handling Debian specific localisation in packages
	\item
	a too short tutorial
	\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%

\begin{frame}
  \frametitle{What is NOT in this tutorial?}
	\begin{itemize}[<+->]
	\item
	internationalising software (NOT a gettext course)
	\item
	character encodings explanations
	\item
	it is INFORMAL...
	\item
	...and badly prepared
	\end{itemize}
\end{frame}

\begin{frame}
  \frametitle{A few reminders}
  \begin{itemize}
  \item<2->
    Internationalisation (i18n)
    \begin{itemize}
    \item<2->
      Get software ready to work with different languages in different countries
      %\pause
    \end{itemize}
  \item<3->
    Localisation (l10n)
    \begin{itemize}
    \item<3->
      Translate software and documentation to different languages
      %\pause
    \end{itemize}
  \item<4->
    Multilingualisation (m17n)
    \begin{itemize}
    \item<4->
      Get software ready to be used in several languages at the same time
      %\pause
    \end{itemize}
  \item<5->
    Globalisation (g11n)
    \begin{itemize}
    \item<5->	
	The whole picture      
    \end{itemize}
  \item<6->
    Bubullisation (b11n)
    \begin{itemize}
    \item<5->	
	The pain for you to be here and listen to me talking tooo much
      %\pause
    \end{itemize}
    \end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%

\section{Digging in the dirt}

\begin{frame}
  \frametitle{Let's find the places we'll get hurt}
    \begin{itemize}
    \item<2->
	GNU hello 
	    \begin{itemize}
		    \item<2->
			a good example of an already i18n'ed software.
		    \item<2->
			a good example of Debian package
	    \end{itemize}
    \end{itemize}

\end{frame}

\subsection{Programs translations}

\begin{frame}
  \frametitle{Hello compilation and i18n}
    \begin{itemize}
    \item
	Let's dig in it NOW
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{LESSON Nr. 1}

    \begin{itemize}
    \item<2->
	Software author: thou shalt comment the source
    \item<3->
	Translator: thou shalt whine and request comments
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{The mysterious PO files}
    \begin{itemize}
	    \item<2->
		Usually lie in a po/ directory
	\item<3->
		PO==Portable Object files
	    \begin{itemize}
		    \item<3->
			\texttt{msgfmt} compile to MO files
	    \end{itemize}
    \item<4->
	Advantages:
	    \begin{itemize}[<+->]
		    \item<4->
			text files
		    \item<4->
			simple format
			    \begin{itemize}
				    \item<4->
					header: file contents and information about translator(s)
				    \item<4->
					strings: the msgid/msgstr couple
			    \end{itemize}
	    \end{itemize}
    \item<5->
	Caveat(s):
	    \begin{itemize}[<+->]
		    \item<5->
			depends on English for string IDs
	    \end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Important files in a po/ directory}

    \begin{itemize}
    \item<2->
	\texttt{LINGUAS}
	    \begin{itemize}
		    \item<2->
			Lists the supported languages (PO-->MO)
		    \item<2->
			Depending on build process, also see \texttt{LINGUAS} or \texttt{ALL\_LINGUAS} variables
		\end{itemize}
    \item<3->
	\texttt{POTFILES\{.in\}}
	    \begin{itemize}
		    \item<3->
			Defines WHICH files contain translatable material
			\item<3->
			Reference for (auto)build tools to list the supported languages
		\end{itemize}
    \item<4->
	The POT file
	    \begin{itemize}
		    \item<4->
			PO ``template'' file
			\item<4->
			Contains the translatable material (list of msgids)
		\end{itemize}
    \item<5->
	The PO files
	    \begin{itemize}
		    \item<5->
			One per language (ISO-639 code AND NOTHING ELSE)
			\item<5->
			Contains the translations
			\item<5->
			May use various encodings. DO NOT MESS THEM.
		\end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{LESSON Nr. 2}

    \begin{itemize}
    \item<2->
	Thou shalt not change msgstr
    \item<3->
	Thou shalt not change encoding without reason
    \item<4->
	Thou shalt not use xx\_YY file names except:
    	\begin{itemize}
    	\item<4->
		pt\_BR/pt
    	\item<4->
		zh\_CN/zh\_TW
    	\item<4->
		pa\_IN/pa\_PK
    	\end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Let's translate Hello to Klingon}

    \begin{itemize}[<+->]
    \item
	ISO code name?
	    \begin{itemize}
		    \item
			\texttt{grep -i klingon /usr/share/iso-codes/iso\_639.tab}
		\end{itemize}
    \item
	\texttt{cp hello.pot tlh.po}
    \item
	Header fields 
	\end{itemize}
\end{frame}

%\begin{frame}
%  \frametitle{PO files headers (Enrico-compliant slide)}

%    \begin{itemize}
%    \item
%	Project-Id-Version
%	    \begin{itemize}
%		    \item
%			  not well standardized use. Package or program name \dots
%		\end{itemize}
%    \item
%	Report-Msgid-Bugs-To : 
%	    \begin{itemize}
%		    \item
%			  e-mail address where errors in ORIGINAL text should be  reported
%		\end{itemize}
%    \item
%	POT-Creation-Date: 
%	    \begin{itemize}
%		    \item
%		  date of the last update of the POT
%		\end{itemize}
%st    \item
%	PO-Revision-Date: 
%	    \begin{itemize}
%		    \item
%  		MUST BE CHANGED by translators for each update
%		\end{itemize}
%    \item
%	Last-Translator: 
%	    \begin{itemize}
%		    \item
%		 Contact for this translation. VERY IMPORTANT.
%		\end{itemize}
%    \item
%	Language-Team:
%	    \begin{itemize}
%		    \item
%	 Often used as backup contact. Opened or moderated list preferrably
%		\end{itemize}
%    \item
%	MIME fields:
%	    \begin{itemize}
%		    \item
% 		Replace CHARSET by the real charset in the file
%		\end{itemize}
%	\end{itemize}
%\end{frame}

\begin{frame}
  \frametitle{LESSON Nr. 3}

    \begin{itemize}[<+->]
    \item
	Properly fill in the header fields
    \item
	DO NOT change header fields
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Status of translations}

The magic \texttt{msgfmt} utility:
    \begin{itemize}
    \item
	\texttt{msgfmt --check}
    \item
	\texttt{msgfmt --statistics}
    \item
Fuzzy? Untranslated?
    \item
Changing upstream strings ``fuzzies'' the translations
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Other useful utilities}

    \begin{itemize}[<+->]
    \item<2->
	\texttt{msgcat}
	    \begin{itemize}
    		\item<2->
			Reformat and/or concatenate files
	    \end{itemize}
    \item<3->
	\texttt{msgmerge}
	    \begin{itemize}
    		\item<3->
			Merge msgids of a POT file into a PO file
	    \end{itemize}
    \item<4->
	\texttt{msgattrib}
	    \begin{itemize}
    		\item<4->
			Manipulate translation attributes (fuzzy/untranslated/obsoleted)
	    \end{itemize}
    \item<5->
	\texttt{msgfilter}
	    \begin{itemize}
    		\item<5->
			Apply a filter to all translations of a translation catalog
	    \end{itemize}
    \item<6->
	\texttt{msguniq}
	    \begin{itemize}
    		\item<6->
			Deal with duplicates msgid's
	    \end{itemize}
    \item<7->
	\texttt{msguntypot}
	    \begin{itemize}
    		\item<7->
			NOT IN GETTEXT: deal with typo corrections
	    \end{itemize}
    \end{itemize}
\end{frame}

\subsection{Debconf translations}

\begin{frame}
  \frametitle{What's involved?}
    \begin{itemize}
    \item
	\texttt{*.templates} file : the reference file(s)
    \item
	po directory
    \item
	\texttt{debconf-updatepo}
    \item
	\texttt{dh\_installdebconf} magic
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{LESSON Nr. 4}

    \begin{itemize}
    \item<2->
	Write good English in templates
	    \begin{itemize}
    		\item<2->
			\texttt{debian-l10n-english}
	    \end{itemize}
    \item<3->
	Use consistent style
	    \begin{itemize}
    		\item<3->
			Read the Developer's Reference!
	    \end{itemize}	
    \item<4->
	Make more use of common templates
	    \begin{itemize}
    		\item<4->
			www-config
    		\item<4->
			dbconfig-common
	    \end{itemize}	
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{A few tricks with debconf templates}

    \begin{itemize}
    \item<2->
	podebconf-display-po
	    \begin{itemize}
    		\item<2->
			Display translated debconf templates as they should be
	    \end{itemize}
    \item<3->
	podebconf-report-po
	    \begin{itemize}
    		\item<3->
			Warn translators about needed updates
	    \end{itemize}	
    \end{itemize}
\end{frame}

\subsection{Man pages translations}

\begin{frame}
  \frametitle{Why are man pages translations painful?}
    \begin{itemize}
    \item<2->
	Many translation projects outside projects
    \item<3->
	Traditional model: maintenance is painful
    \item<4->
	No relation between original and translation
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Thou shalt use PO}
    \begin{itemize}
    \item<2->
	Translators are used to PO files
    \item<3->
	Good tools exist
	    \begin{itemize}
		    \item<3->
			po4a
		    \item<3->
			xml2po (gnome-doc-utils)
		    \item<3->
			poxml
	    \end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{po4a: Martin and Denis save our souls}
    \begin{itemize}
    \item<2->
	Strings are extracted from the original
    \item<3->
	Translated into the PO
    \item<4->
	Reinject translations in a new document
    \item<5->
	    \begin{itemize}
		    \item<5->
			\huge{po4a ROCKS}
	    \end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{The journey of a translated man page}
    \begin{itemize}[<+->]
    \item<2->
	Re-use an existing translation: \texttt{po4a-gettextize}
    \item<3->
	Update the PO file wrt original: \texttt{po4a-updatepo}
    \item<4->
	Complete/Correct/Break the PO file
    \item<5->
	Generate the translated man page: \texttt{po4a-translate}
    \item<6->
	    \begin{itemize}
		    \item<6->
			\huge{po4a ROCKS}
	    \end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{po4a towards World Domination}
    \begin{itemize}[<+->]
    \item<2->
	Very few packages use po4a for man pages	
	    \begin{itemize}
		    \item<2->
			apt-show-versions
		    \item<2->
			po4a
	    \end{itemize}
    \item<3->
	Internally used in the French team
    \item<4->
	Thou shalt be po4ayed
	    \begin{itemize}
		    \item<4->
			dpkg
		    \item<4->
			apt
	    \end{itemize}
    \item<5->
	    \begin{itemize}
		    \item<5->
			\huge{po4a ROCKS}
	    \end{itemize}
    \end{itemize}
\end{frame}


\begin{frame}
  \frametitle{LESSON Nr. 5}

    \begin{itemize}
    \item<2->
	Thou shalt switch thy man page to po4a
	    \begin{itemize}
    		\item<2->
			Ask for help on \texttt{debian-i18n} mailing list
	    \end{itemize}
    \item<3->
	    \begin{itemize}
		    \item<3->
			\huge{po4a ROCKS}
	    \end{itemize}
    \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{PO rUleZ}
    \begin{itemize}
	\item<1->
		\huge{Just Po It}
    \item<2->
	    \begin{itemize}
		    \item<2->
			\huge{po4a ROCKS}
	    \end{itemize}
    \end{itemize}
\end{frame}


\end{document}
 	
