-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] Try to fix Arabic PDF generation
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |