Skip to content

Commit

Permalink
put more format description into nonnormative text
Browse files Browse the repository at this point in the history
  • Loading branch information
gkurzbach committed May 5, 2022
1 parent 3a9a432 commit 764d284
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chapters/packages.tex
Expand Up @@ -388,20 +388,24 @@ \section{Multilingual Descriptions}\label{multilingual-descriptions}
\end{nonnormative}
Only the keywords \lstinline!msgctxt!, \lstinline!msgid! and \lstinline!msgstr! are used.

\begin{nonnormative}
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.
\end{nonnormative}

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.
Texts in such classes belong to the enclosing full class definition.

\begin{nonnormative}
After the \lstinline!msgid! keyword the text string which shall be translated follows.
\end{nonnormative}
It should contain the original string from the Modelica text representation.
\begin{nonnormative}
Since in Modelica control sequences also start with a backslash and another backslash is used to use sequences literally or to hide double quotes, no change is required here.
But Modelica allows strings to go over more than one line, gettext does not.
Therefore, line breaks in Modelica must be encoded with \lstinline!"\n"! for gettext.

\begin{nonnormative}
In order to avoid long lines in the translated strings (following \lstinline!msgid! or \lstinline!msgstr!), strings may be split into smaller parts given on consecutive lines, e.g.
\begin{lstlisting}
"A
Expand All @@ -414,12 +418,12 @@ \section{Multilingual Descriptions}\label{multilingual-descriptions}
\end{lstlisting}
These strings are concatenated when read.
Please regard that if a \lstinline!msgid! string is given more than once in the same context, all occurrences are translated with the same (last) translation!
\end{nonnormative}

The keyword \lstinline!msgstr! is followed by the translation of \lstinline!msgid!.
With regard to control characters and line breaks, the same rules apply as for \lstinline!msgid!.
In the template file this string is empty by definition.
If this is empty in a language specific file the contents of \lstinline!msgid! may be used instead.
\end{nonnormative}

The texts in following Modelica constructs should be translated:
\begin{itemize}
Expand Down

0 comments on commit 764d284

Please sign in to comment.