[PATCH 4 of 4] i18n: update configuration settings

Thomas De Schampheleire patrickdepinguin at gmail.com
Sat Jun 17 20:32:48 UTC 2017


# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1497729204 -7200
#      Sat Jun 17 21:53:24 2017 +0200
# Node ID b3142b7999c190310aabb3bfb509ca430889f837
# Parent  5e8d981053e390d630fbeb867e8d61858f836cf1
i18n: update configuration settings

Following changes are made:
- Remove list of available translations: severely outdated and hard to
  maintain.
- Replace lang with i18n.lang, reasons:
  - Follow TurboGears2 conventions
  - Align with 'i18n.enabled' which cannot be shortened
  - Scoped settings provide grouping and are more clear
  The old 'lang' is still recognized though, so no upgrade issue.
- Introduce/document i18n.enabled

Comments are intentionally kept concise in favor of the documentation.

diff --git a/development.ini b/development.ini
--- a/development.ini
+++ b/development.ini
@@ -180,9 +180,13 @@ use = egg:kallithea
 
 full_stack = true
 static_files = true
-## Available Languages:
-## cs de fr hu ja nl_BE pl pt_BR ru sk zh_CN zh_TW
-lang =
+
+## Internationalization (see documentation for details)
+## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n):
+i18n.lang =
+## To disable automatic language detection, set i18n.enabled to false
+#i18n.enable = false
+
 cache_dir = %(here)s/data
 index_dir = %(here)s/data/index
 
diff --git a/kallithea/lib/paster_commands/template.ini.mako b/kallithea/lib/paster_commands/template.ini.mako
--- a/kallithea/lib/paster_commands/template.ini.mako
+++ b/kallithea/lib/paster_commands/template.ini.mako
@@ -181,9 +181,13 @@ use = egg:kallithea
 
 full_stack = true
 static_files = true
-<%text>## Available Languages:</%text>
-<%text>## cs de fr hu ja nl_BE pl pt_BR ru sk zh_CN zh_TW</%text>
-lang =
+
+<%text>## Internationalization (see documentation for details)</%text>
+<%text>## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n):</%text>
+i18n.lang =
+<%text>## To disable automatic language detection, set i18n.enabled to false</%text>
+#i18n.enable = false
+
 cache_dir = %(here)s/data
 index_dir = %(here)s/data/index
 
diff --git a/kallithea/tests/test.ini b/kallithea/tests/test.ini
--- a/kallithea/tests/test.ini
+++ b/kallithea/tests/test.ini
@@ -177,9 +177,13 @@ use = egg:kallithea
 
 full_stack = true
 static_files = true
-## Available Languages:
-## cs de fr hu ja nl_BE pl pt_BR ru sk zh_CN zh_TW
-lang =
+
+## Internationalization (see documentation for details)
+## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n):
+i18n.lang =
+## To disable automatic language detection, set i18n.enabled to false
+#i18n.enable = false
+
 #cache_dir = %(here)s/data
 cache_dir = %(here)s/../../data/test/cache
 #index_dir = %(here)s/data/index


More information about the kallithea-general mailing list