Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explanation of translations in manual #24

Closed
marijnschraagen opened this issue Jun 4, 2019 · 1 comment · May be fixed by #52
Closed

Explanation of translations in manual #24

marijnschraagen opened this issue Jun 4, 2019 · 1 comment · May be fixed by #52

Comments

@marijnschraagen
Copy link

The current manual (v5.8b 2017/08/28) explains the use of the \DeclareChemTranslation macro on page 31 (section 6.5.2). It states:

\DeclareChemTranslation{language}{key}{translation}

In the table with available translation keys (Table 3 on page 31) the keys scheme-name, scheme and Scheme are listed, among many others.

However, given the following MWE (see https://tex.stackexchange.com/questions/494010/chemmacros-scheme-translation):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}

\usepackage{chemmacros}
\chemsetup{modules={scheme}}

\DeclareChemTranslation{spanish}{scheme-name}{Esquema} % 1
\DeclareChemTranslation{scheme-name}{spanish}{Esquema} % 2
\DeclareChemTranslation{spanish}{scheme}{Esquema}      % 3
\DeclareChemTranslation{scheme}{spanish}{Esquema}      % 4

\begin{document}

    \begin{scheme}
        \caption{Lorem ipsum}
    \end{scheme}

\end{document}

Variant 1 and 3, which should be valid according to the manual, fail with an error ! Package translations Error: Unknown language `scheme-name'. and Unknown language `scheme'. In

the order is stated as

% #1: key
% #2: lang
% #3: translation

but the code the call to \declaretranslation uses the arguments in the order 2, 1, 3. So maybe the manual should be updated, or the code, I'm not sure what would be the easiest or best solution.

For the other two variants in the MWE the redefinition of scheme does not work, there are no errors but the caption of scheme environments remains in English, or in German if that is the language of the document. The variant that redefines scheme-name works as expected (no errors and the caption changes). Possibly the manual could clarify which translation key should be used?

@cgnieder
Copy link
Owner

That's an error in the manual. correct is:

% #1: key
% #2: lang
% #3: translation

I'll fix this for the next update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants