useblocks / sphinx-simplepdf

A simple PDF builder for Sphinx documentations
https://sphinx-simplepdf.readthedocs.io
MIT License
35 stars 17 forks source link

Translation Issue in PDF: Japanese Unicode characters not printing #55

Closed sachin-suresh-rapyuta closed 2 years ago

sachin-suresh-rapyuta commented 2 years ago

The PDF generated from the .po files is missing some characters and is not translated properly. I am using sphinx-intl for generating the .po files.

Although the HTML seems to be fine, the PDF generated using the below command has issues.

sphinx-build -b simplepdf -D language='ja' . build/simplepdf/ja/userguide/

Sample about.po file:

#: ../../user/about.rst:8
msgid "The Rapyuta PA-AMR is a solution that is a combination of the Rapyuta AMR robot and a specially designed system for picking efficiency improvement. It combines the strengths of the existing client workforce with the benefits of robotics."
msgstr "Rapyuta PA-AMRは、Rapyuta AMRロボットと専用に設計されたシステムを組み合わせたソリューションです。ピッキング効率を向上させるために特別に設計されたシステムです。既存のワークフォースの強みを活かしつつ ピッキングの効率化を実現します。"

The PDF for the msgstr content generated is as below:

Another example:

#: ../../user/about.rst:92
msgid "The objective of the PA-AMR system is to automate order processing in warehouses by having autonomous mobile robots transport inventory around the warehouse. Following are the warehouse workflow steps for picking an order:"
msgstr "PA-AMRシステムの目的は、自律型移動ロボットが倉庫内の在庫を運搬することで、倉庫内のオーダー処理を自動化することです。以下は、オーダーをピッキングするための倉庫のワークフローのステップです"

PDF: The entire below line is missing in PDF:

PA-AMRシステムの目的は、自律型移動ロボットが倉庫内の在庫を運搬することで、倉庫内のオー

Unsure if this translation issue is only for Japanese or for all languages? OR Is there any configuration that needs to be done for simplepdf to recognize the non-English characters?

UPDATE: I notice that the Japanese Unicode characters are printing in a nonvirtual environment. But in this, as I faced earlier, I am getting an old theme. In Virtual env, I get new PDF theme, but missing Japanese Unicode.

Still unsure what is causing my path issue between virual env and non-virtual env.

danwos commented 2 years ago

Hi @sachin-suresh-rapyuta and thanks for the bug report.

To be honest I don't have any experience with translations in Sphinx and also with using another language/character-set.

To help you here, it is needed to make this behavior somehow easily reproducible for us developers. Would be it possible from your side to maybe extend our demo-project with 1-2 paragraphs and translation configs, which cover the above behavior? A PR is highly welcome for this :) This would avoid understanding all the translation logic of sphinx and we can directly start to debug the problem.

sachin-suresh-rapyuta commented 2 years ago

Sure, I am testing throughly all possible permutations on where the Unicode is breaking - is it in the new theme or old theme, in virtual env or without, etc. I will create a PR soon.

sachin-suresh-rapyuta commented 2 years ago

Fixed in https://github.com/useblocks/sphinx-simplepdf/issues/38.