Skip to content

Commit

Permalink
Merge pull request modelica#3131 from HansOlsson/MakeNonNormative
Browse files Browse the repository at this point in the history
Make text format non-normative.
  • Loading branch information
HansOlsson committed May 4, 2022
2 parents 92799e0 + cf24955 commit 3a9a432
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions chapters/packages.tex
Expand Up @@ -336,23 +336,24 @@ \section{Multilingual Descriptions}\label{multilingual-descriptions}
\end{nonnormative}

The files to support translation must be provided by the developer of the library.
They must be stored in a subdirectory of the \filename{Resources} directory of the library with the name \filename{Language}.
They must be stored in the resources directory \filename{modelica://<LibraryName>/Resources/Language/}.

Two kind of files have to be provided:
\begin{enumerate}
\item Template file \filename{<LibraryName>.pot}.
\item Template file \filename{<LibraryName>.pot}, as the resource \filename{modelica://<LibraryName>/Resources/Language/<LibraryName>.pot}.
It contains all necessary information to translate all descriptions, but no translations.
The pattern \filename{<LibraryName>} denotes the toplevel class name of the library.
\item One file for each supported language with the name \filename{<LibraryName>.<language>.po}.
\item One file for each supported language with the name \filename{<LibraryName>.<language>.po}, as the resource \filename{modelica://<LibraryName>/Resources/Language/<LibraryName>.<language>.po}.
This file is a copy of the associated template file, but extended with the translations in the specified language.
The pattern \filename{<language>} stands for the ISO 639-1 language code, e.g. \filename{de} or \filename{en}.
\end{enumerate}

The files consist of a header and a body.
The detailed format of these files is described in \href{https://www.gnu.org/software/gettext/manual/gettext.pdf}{GNU gettext}.
\begin{nonnormative}
All text strings are in double quotes and encoded with UTF-8 characters.
Comments start with an \lstinline!#! and are continued until the end of line.
Spaces outside strings are ignored and used as separators.
The detailed format of these files is described in \href{https://www.gnu.org/software/gettext/manual/gettext.pdf}{GNU gettext}.

The header is marked with an empty \emph{msgid} entry and looks like this:
\begin{lstlisting}
Expand Down Expand Up @@ -384,10 +385,11 @@ \section{Multilingual Descriptions}\label{multilingual-descriptions}
msgid "<descriptive text>"
msgstr "<translation>"
\end{lstlisting}
\end{nonnormative}
Only the keywords \lstinline!msgctxt!, \lstinline!msgid! and \lstinline!msgstr! are used.

At first there can be an optional comment describing the location (file name and line number) of the text to translate.
Multiple occurences of the same string can be listed here, separated by space.
Multiple occurences of the same string can be listed here, separated by space.

The \lstinline!<context identifier>! following the keyword \lstinline!msgctxt! shall be the full name of the Modelica class (e.g., \lstinline!Modelica.Blocks.Math.Sin!) where the text appears.
Short class definitions do not appear here.
Expand Down

0 comments on commit 3a9a432

Please sign in to comment.