Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5e05531
Renaming basic/chapter4 -> basic/data
cvvergara Sep 29, 2025
640597f
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
6d740b5
Renaming basic/chapter_5 -> basic/pedestrian
cvvergara Sep 29, 2025
02e5d69
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
7ba726c
Renaming basic/chapter_6 -> basic/vehicles
cvvergara Sep 29, 2025
43d3aef
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
c43bf04
Renaming basic/chapter_8 -> basic/plpgsql_function
cvvergara Sep 29, 2025
101d402
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
b6d93e8
(doc) Renaming basic/graph_views -> basic/graphs
cvvergara Sep 29, 2025
163b685
Separating code that belongs to graphs from chapter_7
cvvergara Sep 29, 2025
9d4ce69
Adjusting build and doc because of name changes & separation
cvvergara Sep 29, 2025
db15b5a
Renaming basic/chapter_7 -> basic/sql_function
cvvergara Sep 29, 2025
19bc903
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
a81e421
Removing unused images
cvvergara Sep 29, 2025
627625d
Renaming images/chapter4 -> images/data
cvvergara Sep 29, 2025
f3ea77d
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
316cd8f
Renaming images/chapter5 -> images/pedestrian
cvvergara Sep 29, 2025
82c72a9
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
0a29377
Renaming images/chapter6 -> images/vehicle
cvvergara Sep 29, 2025
c72ea99
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
13af81f
Separating images that belongs to graphs from chapter7
cvvergara Sep 29, 2025
327679d
Adjusting build and doc because of name changes & separation
cvvergara Sep 29, 2025
ff1ab0b
Renaming images/chapter7 -> images/sql_function
cvvergara Sep 29, 2025
a2e9b7c
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
b662d85
Renaming images/chapter8 -> images/plpgsql_function
cvvergara Sep 29, 2025
f388018
Adjusting build and doc because of name changes
cvvergara Sep 29, 2025
3866676
(locale) chapter_5 -> pedestrian
cvvergara Sep 30, 2025
e999a71
Removing unused files
cvvergara Sep 30, 2025
bead724
(build) Using sphinx-flags
cvvergara Sep 30, 2025
5e32488
(CI/locale) adjusting locale.yml to changes
cvvergara Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/scripts/update_locale.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
# ------------------------------------------------------------------------------
# /*PGR-GNU*****************************************************************
# File: update_locale.sh
# Copyright (c) 2021 pgRouting developers
Expand All @@ -17,32 +16,34 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# ********************************************************************PGR-GNU*/
# ------------------------------------------------------------------------------

DIR=$(git rev-parse --show-toplevel)

pushd "${DIR}" > /dev/null || exit 1

mkdir -p build
pushd build > /dev/null || exit 1
cmake -DLOCALE=ON ..
cmake -DBUILD_HTML=OFF -DBUILD_LOCALE=ON ..

make locale
popd > /dev/null || exit 1

# List all the files that needs to be committed in build/docs/locale_changes.txt
awk '/^Update|^Create/{print $2}' build/docs/locale_changes.txt > build/docs/locale_changes_po.txt # .po files
cp build/docs/locale_changes_po.txt build/docs/locale_changes_po_pot.txt
perl -ne '/\/en\// && print' build/docs/locale_changes_po.txt | \

if [ -s build/docs/locale_changes_po.txt ]; then

perl -ne '/\/en\// && print' build/docs/locale_changes_po.txt | \
perl -pe 's/(.*)en\/LC_MESSAGES(.*)/$1pot$2t/' >> build/docs/locale_changes_po_pot.txt # .pot files

# Do not create empty translation files
git status locale/es --porcelain | awk 'match($1, "?"){print $2}' | xargs -r rm -rf
git status locale/ja --porcelain | awk 'match($1, "?"){print $2}' | xargs -r rm -rf
fi

# Remove obsolete entries #~ from .po files
bash .github/scripts/remove_obsolete_entries.sh
find locale -type f -name '*.po' -exec sh -c '
msgattrib --no-obsolete -o "$1" "$1"
' sh {} \;

cat build/docs/locale_changes_po_pot.txt | xargs -I {} sh -c "(ls {} >> /dev/null 2>&1 && git add {} )"
while read -r f; do git add "$f"; done < build/docs/locale_changes_po_pot.txt

popd > /dev/null || exit 1
2 changes: 0 additions & 2 deletions .github/workflows/locale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ jobs:
sudo -u postgres psql -c 'CREATE ROLE "user" SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN PASSWORD $$user$$;' -d setup
echo :5432:*:user:user >> .pgpass
mkdir build
cd build
cmake -DLOCALE=ON ..
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
Expand Down
159 changes: 0 additions & 159 deletions .tx/config

This file was deleted.

95 changes: 50 additions & 45 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,68 +43,73 @@ add_subdirectory(_themes)
set(SPHINX_DOCUMENTATION_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(SPHINX_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")

foreach (format ${PGR_WORKSHOP_DOC_TARGETS})

# build the locale files
if (LOCALE)
add_custom_target(locale ALL
COMMAND ${SPHINX_EXECUTABLE}
message(STATUS "format=${format}")
if ("${format}" STREQUAL "locale")

-b gettext
find_program(SPHINX_INTL_EXECUTABLE
NAMES sphinx-intl
DOC "Sphinx Documentation Builder (sphinx-doc.org)"
)

# the location of the documentation to be build
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_SOURCE_DIR}/locale/pot"
if (SPHINX_INTL_EXECUTABLE)

COMMAND sphinx-intl update -d ${CMAKE_SOURCE_DIR}/locale -l ${SPHINXINTL_LANGUAGE} > locale_changes.txt
DEPENDS "conf.py"
add_custom_target(locale
COMMAND ${SPHINX_EXECUTABLE}
-b gettext
-c "${SPHINX_DOCUMENTATION_DIR}"
"${SPHINX_DOCUMENTATION_DIR}"
"${CMAKE_SOURCE_DIR}/locale/pot"

COMMENT "Generating POT & PO files ..."
)
add_dependencies(locale examples general-intro advanced appendix basic un_sdg scripts interactions)
add_dependencies(doc locale)
endif()
COMMAND ${SPHINX_INTL_EXECUTABLE} update
-d ${CMAKE_SOURCE_DIR}/locale
-l en > locale_changes.txt

COMMENT "Generating POT and PO files"
SOURCES ${PROJECT_DOC_FILES})

add_dependencies("${format}" examples general-intro advanced appendix basic un_sdg scripts interactions)
add_dependencies(doc "${format}")

foreach (target ${PGR_WORKSHOP_DOC_TARGETS})
add_custom_target(${target} ALL
COMMENT "Building documentation with Sphinx")
else()

configure_file("forward.html" "${SPHINX_BUILD_DIR}/${target}/index.html")
message(WARNING "sphinx-intl not found.
Not building the pot and po locale files")

foreach (lang ${PGR_WORKSHOP_BUILD_LANGUAGES})
if (lang STREQUAL "en")
set(WARNINGS_TO_ERRORS "")
else()
set(WARNINGS_TO_ERRORS "")
endif()
message(STATUS "lang ${lang}")
message(STATUS "WARNINGS_TO_ERRORS ${WARNINGS_TO_ERRORS}")

else()

add_custom_target(
"${target}-${lang}"
COMMAND ${SPHINX_EXECUTABLE}
add_custom_target("${format}"
COMMENT "Building ${format} documentation with Sphinx")

-b ${target}
-c "${CMAKE_CURRENT_BINARY_DIR}"
-D language='${lang}'
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/forward.html"
"${SPHINX_BUILD_DIR}/${format}/index.html")

# Convert warnings to errors
${WARNINGS_TO_ERRORS}
foreach (lang ${PGR_WORKSHOP_BUILD_LANGUAGES})

# the location of the documentation to be build
"${CMAKE_CURRENT_BINARY_DIR}"
add_custom_target(
"${format}-${lang}"
COMMAND ${SPHINX_EXECUTABLE}
-c ${CMAKE_CURRENT_BINARY_DIR}
-d ${CMAKE_CURRENT_BINARY_DIR}/doctrees
-b ${format}
-D language='${lang}'
${sphinx_flags}
"${CMAKE_CURRENT_BINARY_DIR}"
"${SPHINX_BUILD_DIR}/${format}/${lang}"

#where the documentations is written
"${SPHINX_BUILD_DIR}/${target}/${lang}"
COMMENT "Generating ${format}/${lang} documentation"
DEPENDS "conf.py"
)
add_dependencies("${format}-${lang}" examples general-intro advanced appendix basic un_sdg scripts interactions)
add_dependencies("${format}" "${format}-${lang}")
endforeach()

COMMENT "Generating ${target}/${lang} documentation ${WARNINGS_TO_ERRORS}..."
add_dependencies(doc "${format}")

endif()

DEPENDS "conf.py"
)
add_dependencies("${target}-${lang}" examples general-intro advanced appendix basic un_sdg scripts interactions)
add_dependencies("${target}" "${target}-${lang}")
endforeach()
add_dependencies(doc "${target}")
endforeach()
Loading