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

i18n/l10n #1

Open
Ledenel opened this issue Nov 12, 2020 · 1 comment
Open

i18n/l10n #1

Ledenel opened this issue Nov 12, 2020 · 1 comment

Comments

@Ledenel
Copy link

Ledenel commented Nov 12, 2020

Hi, I'm a latex noob and I'm planning to write a book with both English and Chinese versions. I found this template maybe useful to get start with. Does the template support maintaining language translation? If not, do you have any suggestions about doing i18n/l10n?

@albertopessia
Copy link
Owner

I never worked with multilingual TeX documents and I cannot help directly with your problem. However, I found two possible approaches you might try:

  • Convert your source language LaTeX file to a PO file with po4a, edit the PO file, re-inject the translation into a destination LaTeX file.
  • Use the \if syntax to keep both languages in the same file. The LaTeX document would look something like this (original answer):
\documentclass{article}

\newif\ifenglish

\englishtrue % Show English text only
% uncomment the following statement to show Chinese text only
%\englishfalse

\begin{document}
\ifenglish
  English text
\else 
  中文文字
\fi
\end{document}

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

No branches or pull requests

2 participants