[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3727] trunk/py/scripts/addons/modules/ rna_wiki_reference.py: commit initial support for linking to different languages from the wiki

Campbell Barton ideasman42 at gmail.com
Tue Sep 11 04:11:08 CEST 2012


Revision: 3727
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3727
Author:   campbellbarton
Date:     2012-09-11 02:11:06 +0000 (Tue, 11 Sep 2012)
Log Message:
-----------
commit initial support for linking to different languages from the wiki

Modified Paths:
--------------
    trunk/py/scripts/addons/modules/rna_wiki_reference.py

Modified: trunk/py/scripts/addons/modules/rna_wiki_reference.py
===================================================================
--- trunk/py/scripts/addons/modules/rna_wiki_reference.py	2012-09-10 23:13:44 UTC (rev 3726)
+++ trunk/py/scripts/addons/modules/rna_wiki_reference.py	2012-09-11 02:11:06 UTC (rev 3727)
@@ -5,6 +5,18 @@
 
 url_manual_prefix = "http://wiki.blender.org/index.php/Doc:2.6/Manual/"
 
+# to make international...
+# Doc:2.6 --> FR/Doc:2.6
+
+LANG = {
+    "FRENCH":   "FR",
+    "RUSSIAN":  "RU",
+}.get(__import__("bpy").context.user_preferences.system.language)
+
+url_manual_prefix = url_manual_prefix \
+    if LANG is None \
+    else url_manual_prefix.replace("Doc:2.6", "Doc:" + LANG + "/" + "2.6")
+
 # - The first item is a wildcard - typical file system globbing
 #   using python module 'fnmatch.fnmatch'
 # - Expressions are evaluated top down (include catch-all expressions last).



More information about the Bf-extensions-cvs mailing list