[Groonga-commit] groonga/groonga [master] [doc] support other language link.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 5月 20日 (金) 19:09:03 JST


Kouhei Sutou	2011-05-20 10:09:03 +0000 (Fri, 20 May 2011)

  New Revision: e43e4dc79860360fbfac0f6f745a63af238b3fe5

  Log:
    [doc] support other language link.

  Added files:
    doc/themes/groonga/static/jp.png
    doc/themes/groonga/static/us.png
  Modified files:
    build/makefiles/sphinx-build.am
    doc/source/conf.py
    doc/themes/groonga/layout.html

  Modified: build/makefiles/sphinx-build.am (+1 -1)
===================================================================
--- build/makefiles/sphinx-build.am    2011-05-20 09:14:54 +0000 (6ed3ce5)
+++ build/makefiles/sphinx-build.am    2011-05-20 10:09:03 +0000 (52ce260)
@@ -11,7 +11,7 @@ ALLSPHINXOPTS   = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(abs_top_srcdir)/doc/sourc
 
 SPHINX_DIR = $(abs_top_builddir)/doc/sphinx
 SPHINX_BUILD = $(SPHINX_DIR)/sphinx-build.py
-SPHINX_BUILD_COMMAND = PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH" python $(SPHINX_BUILD)
+SPHINX_BUILD_COMMAND = LOCALE="$(LOCALE)" PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH" python $(SPHINX_BUILD)
 
 .PHONY: sphinx-ensure-updated
 

  Modified: doc/source/conf.py (+3 -1)
===================================================================
--- doc/source/conf.py    2011-05-20 09:14:54 +0000 (0913507)
+++ doc/source/conf.py    2011-05-20 10:09:03 +0000 (985b90f)
@@ -92,7 +92,7 @@ locale_dirs = ["../locale"]
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
-#language = None
+language = os.environ['LOCALE']
 
 # There are two options for replacing |today|: either, you set today to some
 # non-false value, then it is used:
@@ -148,6 +148,8 @@ html_theme_options = {
   'bodyfont': '#666666',
 }
 
+html_context = {"language": language}
+
 # Add any paths that contain custom themes here, relative to this directory.
 html_theme_path = ["../themes"]
 

  Modified: doc/themes/groonga/layout.html (+10 -0)
===================================================================
--- doc/themes/groonga/layout.html    2011-05-20 09:14:54 +0000 (fb10d0f)
+++ doc/themes/groonga/layout.html    2011-05-20 10:09:03 +0000 (dc4aeef)
@@ -9,3 +9,13 @@
 #}
 {% extends "default/layout.html" %}
 {% set favicon = "favicon.ico" %}
+
+{% block rootrellink %}
+{%- if language != "en" %}
+  <li class="other-language"><a href="{{ pathto('../../en/html/', 1) }}{{ pathto(pagename, 0, '.') }}"><img src="{{ pathto('_static/us.png', 1) }}" alt="英語"></a></li>
+{%- endif %}
+{%- if language != "ja" %}
+  <li class="other-language"><a href="{{ pathto('../../ja/html/', 1) }}{{ pathto(pagename, 0, '.') }}"><img src="{{ pathto('_static/jp.png', 1) }}" alt="日本語"></a></li>
+{%- endif %}
+  {{ super() }}
+{% endblock %}

  Added: doc/themes/groonga/static/jp.png (+0 -0) 100644
===================================================================
(Binary files differ)

  Added: doc/themes/groonga/static/us.png (+0 -0) 100644
===================================================================
(Binary files differ)




Groonga-commit メーリングリストの案内
Back to archive index