Skip to content

Commit

Permalink
[doc] Try to fix Arabic PDF generation
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Oct 14, 2024
1 parent 27df558 commit 96a3fc0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
5 changes: 4 additions & 1 deletion documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@
latex_elements = {
'babel': '', # Disable babel because we'll use polyglossia
'fontpkg': r'''
\setmainfont{../client/app/fonts/Inter-Regular.ttf}
\setmainfont{Inter-Regular}[ % No .ttf extension here
Path=../client/app/fonts/, % Path to the font folder
Extension=.ttf, % Font file extension
]
''',
'preamble': r'''
\usepackage{polyglossia}
Expand Down
27 changes: 27 additions & 0 deletions documentation/scripts/update_locales.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Set the directory where your translation files are located
TRANSLATION_DIR="../client/app/assets/data_src/pot/"

# Define the list of languages and corresponding .po files to merge
LANGUAGES=("it" "en" "fr" "es" "de" "ru" "ar" "zh_CN")

# Path to the gettext .pot template file generated by Sphinx
POT_FILE="_build/gettext/sphinx.pot"

# Check if the .pot file exists, if not generate it
if [ ! -f "$POT_FILE" ]; then
echo "Generating .pot file with Sphinx"
sphinx-build -b gettext . _build/gettext
fi

# Initialize translations for each language if not already initialized
for LANG in "${LANGUAGES[@]}"; do
echo "Initializing translations for language: $LANG"

# Initialize language directory with sphinx-intl
sphinx-intl update -p _build/gettext -l $LANG
done

# Compile .po files into .mo files for Sphinx to use
sphinx-intl build

0 comments on commit 96a3fc0

Please sign in to comment.