Skip to content

Commit

Permalink
Adding translation ability with gettext and Transifex
Browse files Browse the repository at this point in the history
  • Loading branch information
dkastl committed Aug 2, 2013
1 parent 6e87aab commit c11a3d8
Show file tree
Hide file tree
Showing 11 changed files with 315 additions and 64 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build
.DS_Store
.vagrant
tools/vagrant/packaging.sh
doc/i18n/**/*.mo
234 changes: 234 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
[main]
host = https://www.transifex.com
type = PO

[pgrouting.doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/index.po
source_file = doc/i18n/pot/doc/index.pot
source_lang = en

[pgrouting.doc--index_man]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/index_man.po
source_file = doc/i18n/pot/doc/index_man.pot
source_lang = en

[pgrouting.doc--src--tutorial--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/tutorial/index.po
source_file = doc/i18n/pot/doc/src/tutorial/index.pot
source_lang = en

[pgrouting.doc--src--tutorial--custom_wrapper]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/tutorial/custom_wrapper.po
source_file = doc/i18n/pot/doc/src/tutorial/custom_wrapper.pot
source_lang = en

[pgrouting.doc--src--tutorial--performance]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/tutorial/performance.po
source_file = doc/i18n/pot/doc/src/tutorial/performance.pot
source_lang = en

[pgrouting.doc--src--tutorial--topology]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/tutorial/topology.po
source_file = doc/i18n/pot/doc/src/tutorial/topology.pot
source_lang = en

[pgrouting.doc--src--tutorial--recipes]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/tutorial/recipes.po
source_file = doc/i18n/pot/doc/src/tutorial/recipes.pot
source_lang = en

[pgrouting.doc--src--tutorial--custom_query]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/tutorial/custom_query.po
source_file = doc/i18n/pot/doc/src/tutorial/custom_query.pot
source_lang = en

[pgrouting.doc--src--tutorial--analytics]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/tutorial/analytics.po
source_file = doc/i18n/pot/doc/src/tutorial/analytics.pot
source_lang = en

[pgrouting.doc--src--developer--discontinued]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/developer/discontinued.po
source_file = doc/i18n/pot/doc/src/developer/discontinued.pot
source_lang = en

[pgrouting.doc--src--developer--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/developer/index.po
source_file = doc/i18n/pot/doc/src/developer/index.pot
source_lang = en

[pgrouting.doc--src--developer--sampledata]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/developer/sampledata.po
source_file = doc/i18n/pot/doc/src/developer/sampledata.pot
source_lang = en

[pgrouting.doc--src--introduction--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/introduction/index.po
source_file = doc/i18n/pot/doc/src/introduction/index.pot
source_lang = en

[pgrouting.doc--src--introduction--support]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/introduction/support.po
source_file = doc/i18n/pot/doc/src/introduction/support.pot
source_lang = en

[pgrouting.doc--src--changelog--1_x]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/changelog/1_x.po
source_file = doc/i18n/pot/doc/src/changelog/1_x.pot
source_lang = en

[pgrouting.doc--src--changelog--2_0]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/changelog/2_0.po
source_file = doc/i18n/pot/doc/src/changelog/2_0.pot
source_lang = en

[pgrouting.doc--src--installation--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/installation/index.po
source_file = doc/i18n/pot/doc/src/installation/index.pot
source_lang = en

[pgrouting.doc--src--installation--build]
file_filter = doc/i18n/<lang>/LC_MESSAGES/doc/src/installation/build.po
source_file = doc/i18n/pot/doc/src/installation/build.pot
source_lang = en

[pgrouting.src--common--doc--types]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/types.po
source_file = doc/i18n/pot/src/common/doc/types.pot
source_lang = en

[pgrouting.src--common--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/index.po
source_file = doc/i18n/pot/src/common/doc/index.pot
source_lang = en

[pgrouting.src--common--doc--legacy]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/legacy.po
source_file = doc/i18n/pot/src/common/doc/legacy.pot
source_lang = en

[pgrouting.src--common--doc--types--geom_result]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/types/geom_result.po
source_file = doc/i18n/pot/src/common/doc/types/geom_result.pot
source_lang = en

[pgrouting.src--common--doc--types--cost_result]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/types/cost_result.po
source_file = doc/i18n/pot/src/common/doc/types/cost_result.pot
source_lang = en

[pgrouting.src--common--doc--functions--versionless]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/versionless.po
source_file = doc/i18n/pot/src/common/doc/functions/versionless.pot
source_lang = en

[pgrouting.src--common--doc--functions--analyze_graph]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/analyze_graph.po
source_file = doc/i18n/pot/src/common/doc/functions/analyze_graph.pot
source_lang = en

[pgrouting.src--common--doc--functions--create_topology]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/create_topology.po
source_file = doc/i18n/pot/src/common/doc/functions/create_topology.pot
source_lang = en

[pgrouting.src--common--doc--functions--is_column_in_table]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/is_column_in_table.po
source_file = doc/i18n/pot/src/common/doc/functions/is_column_in_table.pot
source_lang = en

[pgrouting.src--common--doc--functions--version]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/version.po
source_file = doc/i18n/pot/src/common/doc/functions/version.pot
source_lang = en

[pgrouting.src--common--doc--functions--quote_ident]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/quote_ident.po
source_file = doc/i18n/pot/src/common/doc/functions/quote_ident.pot
source_lang = en

[pgrouting.src--common--doc--functions--node_network]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/node_network.po
source_file = doc/i18n/pot/src/common/doc/functions/node_network.pot
source_lang = en

[pgrouting.src--common--doc--functions--point_to_id]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/point_to_id.po
source_file = doc/i18n/pot/src/common/doc/functions/point_to_id.pot
source_lang = en

[pgrouting.src--common--doc--functions--is_column_indexed]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/is_column_indexed.po
source_file = doc/i18n/pot/src/common/doc/functions/is_column_indexed.pot
source_lang = en

[pgrouting.src--common--doc--functions--analyze_oneway]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/common/doc/functions/analyze_oneway.po
source_file = doc/i18n/pot/src/common/doc/functions/analyze_oneway.pot
source_lang = en

[pgrouting.src--driving_distance--doc--dd_points_as_polygon]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/driving_distance/doc/dd_points_as_polygon.po
source_file = doc/i18n/pot/src/driving_distance/doc/dd_points_as_polygon.pot
source_lang = en

[pgrouting.src--driving_distance--doc--dd_alphashape]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/driving_distance/doc/dd_alphashape.po
source_file = doc/i18n/pot/src/driving_distance/doc/dd_alphashape.pot
source_lang = en

[pgrouting.src--driving_distance--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/driving_distance/doc/index.po
source_file = doc/i18n/pot/src/driving_distance/doc/index.pot
source_lang = en

[pgrouting.src--kdijkstra--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/kdijkstra/doc/index.po
source_file = doc/i18n/pot/src/kdijkstra/doc/index.pot
source_lang = en

[pgrouting.src--tsp--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/tsp/doc/index.po
source_file = doc/i18n/pot/src/tsp/doc/index.pot
source_lang = en

[pgrouting.src--bd_astar--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/bd_astar/doc/index.po
source_file = doc/i18n/pot/src/bd_astar/doc/index.pot
source_lang = en

[pgrouting.src--apsp_johnson--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/apsp_johnson/doc/index.po
source_file = doc/i18n/pot/src/apsp_johnson/doc/index.pot
source_lang = en

[pgrouting.src--dijkstra--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/dijkstra/doc/index.po
source_file = doc/i18n/pot/src/dijkstra/doc/index.pot
source_lang = en

[pgrouting.src--bd_dijkstra--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/bd_dijkstra/doc/index.po
source_file = doc/i18n/pot/src/bd_dijkstra/doc/index.pot
source_lang = en

[pgrouting.src--apsp_warshall--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/apsp_warshall/doc/index.po
source_file = doc/i18n/pot/src/apsp_warshall/doc/index.pot
source_lang = en

[pgrouting.src--astar--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/astar/doc/index.po
source_file = doc/i18n/pot/src/astar/doc/index.pot
source_lang = en

[pgrouting.src--trsp--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/trsp/doc/index.po
source_file = doc/i18n/pot/src/trsp/doc/index.pot
source_lang = en

[pgrouting.src--ksp--doc--index]
file_filter = doc/i18n/<lang>/LC_MESSAGES/src/ksp/doc/index.po
source_file = doc/i18n/pot/src/ksp/doc/index.pot
source_lang = en

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0.0-beta-75-g9e801f0 develop
v2.0.0-beta-86-g0c2d62a develop
1 change: 0 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ Vagrant.configure("2") do |config|
# Create synced folder for GnuPG keys and within home directory
config.vm.synced_folder "../", "/home/vagrant/repos"
config.vm.synced_folder "~/.gnupg", "/home/vagrant/.gnupg"
config.vm.synced_folder "~/.transifexrc", "/home/vagrant/.transifexrc"

end
56 changes: 28 additions & 28 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ if(WITH_DOC)
set(SPHINX_CACHE_DIR "${PGROUTING_BINARY_DIR}/doc/_doctrees")

# HTML output directory
set(SPHINX_HTML_DIR "${PGROUTING_BINARY_DIR}/html")
set(SPHINX_HTML_DIR "${PGROUTING_BINARY_DIR}/doc/html")

# PDF output directory
set(SPHINX_LATEX_DIR "${PGROUTING_BINARY_DIR}/latex")
set(SPHINX_LATEX_DIR "${PGROUTING_BINARY_DIR}/doc/latex")

# MAN output directory
set(SPHINX_MAN_DIR "${PGROUTING_BINARY_DIR}/man")
set(SPHINX_MAN_DIR "${PGROUTING_BINARY_DIR}/doc/man")

# Localization output directory
set(SPHINX_I18N_DIR "${CMAKE_CURRENT_SOURCE_DIR}/i18n/pot")
Expand All @@ -50,55 +50,55 @@ if(WITH_DOC)

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/index.html.in"
"${PGROUTING_BINARY_DIR}/index.html")
"${SPHINX_HTML_DIR}/index.html")

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/forward.html"
"${SPHINX_HTML_DIR}/index.html")
"${SPHINX_HTML_DIR}/en/index.html")

add_custom_target(pgRoutingDocumentationlocale ALL
add_custom_target(doc_gettext ALL
${SPHINX_EXECUTABLE}
-q -b gettext
-Q -a -E -b gettext
-c "${BINARY_BUILD_DIR}"
-E
-d "${SPHINX_CACHE_DIR}"
"${PGROUTING_SOURCE_DIR}"
"${SPHINX_I18N_DIR}"
COMMENT "SPHINX Build finished. The message catalogs are in ${SPHINX_I18N_DIR}.")
COMMENT "SPHINX build finished. The message catalogs are in ${SPHINX_I18N_DIR}.")

add_custom_target(pgRoutingDocumentationhtml ALL
add_custom_target(doc_html ALL
${SPHINX_EXECUTABLE}
-q -b html
-Q -a -E -b html
-c "${BINARY_BUILD_DIR}"
-d "${SPHINX_CACHE_DIR}"
"${PGROUTING_SOURCE_DIR}"
"${SPHINX_HTML_DIR}"
COMMENT "SPHINX Build finished. The HTML pages are in ${SPHINX_HTML_DIR}.")
"${SPHINX_HTML_DIR}/en"
COMMENT "SPHINX build finished. The HTML pages are in ${SPHINX_HTML_DIR}/en.")

add_custom_target(pgRoutingDocumentationman ALL
add_custom_target(doc_man ALL
${SPHINX_EXECUTABLE}
-q -b man
-Q -a -E -b man
-c "${BINARY_BUILD_DIR}"
-E
-d "${SPHINX_CACHE_DIR}"
"${PGROUTING_SOURCE_DIR}"
"${SPHINX_MAN_DIR}"
COMMENT "SPHINX Build finished. The manual pages are in ${SPHINX_MAN_DIR}.")
"${SPHINX_MAN_DIR}/en"
COMMENT "SPHINX build finished. The manual pages are in ${SPHINX_MAN_DIR}/en.")

add_custom_target(pgRoutingDocumentationtex ALL
add_custom_target(doc_latex ALL
${SPHINX_EXECUTABLE}
-q -b latex
-Q -a -E -b latex
-c "${BINARY_BUILD_DIR}"
-E
-d "${SPHINX_CACHE_DIR}"
"${PGROUTING_SOURCE_DIR}"
"${SPHINX_LATEX_DIR}"
COMMENT "SPHINX Build finished; the LaTeX files are in ${SPHINX_LATEX_DIR}.")
"${SPHINX_LATEX_DIR}/en"
COMMENT "SPHINX build finished; the LaTeX files are in ${SPHINX_LATEX_DIR}/en.")

add_custom_command(
TARGET pgRoutingDocumentationtex POST_BUILD
COMMAND cd ${SPHINX_LATEX_DIR} && pdflatex -interaction=nonstopmode pgRoutingDocumentation.tex > /dev/null 2>&1
TARGET doc_latex POST_BUILD
COMMAND cd "${SPHINX_LATEX_DIR}/en" && pdflatex -interaction=nonstopmode pgRoutingDocumentation.tex > /dev/null 2>&1
COMMENT "Converting to PDF format with Sphinx")

add_dependencies(pgRoutingDocumentationhtml pgRoutingDocumentationlocale)
add_dependencies(pgRoutingDocumentationman pgRoutingDocumentationlocale)
add_dependencies(pgRoutingDocumentationtex pgRoutingDocumentationlocale)
add_dependencies(doc_html doc_gettext)
add_dependencies(doc_man doc_gettext)
add_dependencies(doc_latex doc_gettext)

endif(WITH_DOC)
2 changes: 1 addition & 1 deletion doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ release = '@PGROUTING_VERSION_STRING@ (@PGROUTING_VERSION_REVISION_NAME@)'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = 'en'
locale_dirs = ['i18n/pot']
locale_dirs = ['doc/i18n/']
gettext_compact = False

# There are two options for replacing |today|: either, you set today to some
Expand Down
2 changes: 1 addition & 1 deletion doc/index.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<p>This documentation is for the unreleased version currently under development, and is frequently updated and changed.</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="dev/doc/index.html">pgRouting ${PGROUTING_VERSION_STRING}</a> [<a class="reference external" href="dev/pgRoutingDocumentation.pdf">PDF</a> | <a class="reference external" href="dev/pgrouting.7.gz">MAN</a>] (${PGROUTING_VERSION_REVISION_NAME})</li>
<li class="toctree-l1"><a class="reference internal" href="dev/en/doc/index.html">pgRouting ${PGROUTING_VERSION_STRING}</a> [<a class="reference external" href="dev/en/pgRoutingDocumentation.pdf">PDF</a> | <a class="reference external" href="dev/en/pgrouting.7.gz">MAN</a>] (${PGROUTING_VERSION_REVISION_NAME})</li>
</ul>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pgRouting provides several :ref:`common functions <common>`:

../src/common/doc/functions/*

pgRouting defines a few :ref:`custom data types <common_types>`:
pgRouting introduces a few :ref:`custom data types <common_types>`:

.. toctree::
:maxdepth: 1
Expand Down Expand Up @@ -129,7 +129,7 @@ Developer
src/developer/sampledata


.. rubric:: Release Notes
.. rubric:: Release notes

.. toctree::
:maxdepth: 1
Expand Down
Loading

0 comments on commit c11a3d8

Please sign in to comment.