[Bf-translations-svn] SVN commit: /data/svn/bf-translations [534] trunk/po/tools: Changed settings system, now settings.py (previously the template) is used , and it tries to import user_settings.py to override its default values.

bf-translations at blender.org bf-translations at blender.org
Sat Apr 14 16:31:44 CEST 2012


Revision: 534
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-translations&revision=534
Author:   mont29
Date:     2012-04-14 14:31:44 +0000 (Sat, 14 Apr 2012)
Log Message:
-----------
Changed settings system, now settings.py (previously the template) is used, and it tries to import user_settings.py to override its default values. So you can now put into user_settings only the options you have to modify...

Also fixed xgettext keywords to make them work with context version of macros (CTX_IFACE_, etc.)

Added Paths:
-----------
    trunk/po/tools/append_messages.txt
    trunk/po/tools/settings.py

Removed Paths:
-------------
    trunk/po/tools/settings_template.py

Property Changed:
----------------
    trunk/po/tools/


Property changes on: trunk/po/tools
___________________________________________________________________
Modified: svn:ignore
   - settings.py
__pycache__

   + user_settings.py
user_settings.py
user_settings.py
settings.py
__pycache__


Added: trunk/po/tools/append_messages.txt
===================================================================
--- trunk/po/tools/append_messages.txt	                        (rev 0)
+++ trunk/po/tools/append_messages.txt	2012-04-14 14:31:44 UTC (rev 534)
@@ -0,0 +1,5 @@
+#~ bpy.types.WM_OT_console_toggle
+MSGCTXT:Operator
+Toggle System Console
+#~ bpy.types.WM_OT_console_toggle
+Toggle System Console

Copied: trunk/po/tools/settings.py (from rev 532, trunk/po/tools/settings_template.py)
===================================================================
--- trunk/po/tools/settings.py	                        (rev 0)
+++ trunk/po/tools/settings.py	2012-04-14 14:31:44 UTC (rev 534)
@@ -0,0 +1,195 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+# <pep8 compliant>
+
+# Global settings used by all scripts in this dir.
+# XXX Before any use of the tools in this dir, please make a copy of this file
+#     named "setting.py"
+# XXX This is a template, most values should be OK, but some you’ll have to
+#     edit (most probably, BLENDER_EXEC and SOURCE_DIR).
+
+import os.path
+
+
+###############################################################################
+# MISC
+###############################################################################
+
+# The min level of completeness for a po file to be imported from /branches
+# into /trunk, as a percentage. -1 means "import everything".
+IMPORT_MIN_LEVEL = -1
+
+# The comment prefix used in generated messages.txt file.
+COMMENT_PREFIX = "#~ "
+
+# The comment prefix used in generated messages.txt file.
+CONTEXT_PREFIX = "MSGCTXT:"
+
+# Default context.
+CONTEXT_DEFAULT = ""
+
+# The gettext domain.
+DOMAIN = "blender"
+
+# The gettext keywords.
+GETTEXT_KEYWORDS = ("IFACE_", "CTX_IFACE_:1c,2", "TIP_", "CTX_TIP_:1c,2",
+                    "N_", "CTX_N_:1c,2")
+
+# Should po parser warn when finding a first letter not capitalized?
+WARN_MSGID_NOT_CAPITALIZED = True
+
+# Strings that should not raise above warning!
+WARN_MSGID_NOT_CAPITALIZED_ALLOWED = {
+    "",  # Simplifies things... :p
+    "sin(x) / x",
+    "fBM",
+    "sqrt(x*x+y*y+z*z)",
+    "iTaSC",
+    "bItasc",
+    "px",
+    "mm",
+    "fStop",
+    "sRGB",
+    "iso-8859-15",
+    "utf-8",
+    "ascii",
+    "re",
+    "y",
+    "ac3",
+    "flac",
+    "mkv",
+    "mp2",
+    "mp3",
+    "ogg",
+    "wav",
+    "iTaSC parameters",
+    "vBVH",
+    "rv",
+    "en_US",
+    "fr_FR",
+    "it_IT",
+    "ru_RU",
+    "zh_CN",
+    "es",
+    "zh_TW",
+    "ar_EG",
+    "pt",
+    "bg_BG",
+    "ca_AD",
+    "hr_HR",
+    "cs_CZ",
+    "nl_NL",
+    "fi_FI",
+    "de_DE",
+    "el_GR",
+    "id_ID",
+    "ja_JP",
+    "ky_KG",
+    "ko_KR",
+    "ne_NP",
+    "fa_IR",
+    "pl_PL",
+    "ro_RO",
+    "sr_RS",
+    "sr_RS at latin",
+    "sv_SE",
+    "uk_UA",
+    "tr_TR",
+    "available with",                # Is part of multi-line msg.
+    "virtual parents",               # Is part of multi-line msg.
+    "description",                   # Addons' field. :/
+    "location",                      # Addons' field. :/
+    "author",                        # Addons' field. :/
+    "in memory to enable editing!"}  # Is part of multi-line msg.
+
+
+###############################################################################
+# PATHS
+###############################################################################
+
+# The tools path, should be OK.
+TOOLS_DIR = os.path.join(os.path.dirname(__file__))
+
+# The Python3 executable.You’ll likely have to edit it if you’re under Windows.
+PYTHON3_EXEC = "python3"
+
+# The Blender executable!
+# This is just an example, you’ll most likely have to edit it!
+BLENDER_EXEC = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..",
+                                            "build_cmake_msgs", "bin", "blender"))
+
+# The xgettext tool. You’ll likely have to edit it if you’re under Windows.
+GETTEXT_XGETTEXT_EXECUTABLE = "xgettext"
+
+# The gettext msgmerge tool. You’ll likely have to edit it if you’re under
+# Windows.
+GETTEXT_MSGMERGE_EXECUTABLE = "msgmerge"
+
+# The gettext msgfmt "compiler". You’ll likely have to edit it if you’re under
+# Windows.
+GETTEXT_MSGFMT_EXECUTABLE = "msgfmt"
+
+# The FriBidi C compiled library (.so under Linux, .dll under windows...).
+# You’ll likely have to edit it if you’re under Windows.
+FRIBIDI_LIB = "libfribidi.so.0"
+
+# The name of the (currently empty) file that must be present in a po's
+# directory to enable rtl-preprocess.
+RTL_PREPROCESS_FILE = "is_rtl"
+
+# The Blender source root path.
+# This is just an example, you’ll most likely have to edit it!
+SOURCE_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..",
+                                          "blender_msgs"))
+
+# The /branches path, should be OK.
+BRANCHES_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..",
+                                            "branches"))
+
+# The /trunk path, should be OK.
+TRUNK_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", ".."))
+
+# The /trunk/po path, should be OK.
+TRUNK_PO_DIR = os.path.join(TRUNK_DIR, "po")
+
+# The /trunk/mo path, should be OK.
+TRUNK_MO_DIR = os.path.join(TRUNK_DIR, "locale")
+
+# The file storing Blender-generated messages.
+FILE_NAME_MESSAGES = os.path.join(TRUNK_PO_DIR, "messages.txt")
+
+# The Blender source path to check for i18n macros.
+POTFILES_SOURCE_DIR = os.path.join(SOURCE_DIR, "source")
+
+# The "source" file storing which files should be processed by xgettext,
+# used to create FILE_NAME_POTFILES
+FILE_NAME_SRC_POTFILES = os.path.join(TRUNK_PO_DIR, "_POTFILES.in")
+
+# The final (generated) file storing which files
+# should be processed by xgettext.
+FILE_NAME_POTFILES = os.path.join(TRUNK_PO_DIR, "POTFILES.in")
+
+# The template messages file.
+FILE_NAME_POT = os.path.join(TRUNK_PO_DIR, ".".join((DOMAIN, "pot")))
+
+# Override with custom user settings, if available.
+try:
+    from user_settings import *
+except:
+    pass

Deleted: trunk/po/tools/settings_template.py
===================================================================
--- trunk/po/tools/settings_template.py	2012-04-14 12:33:50 UTC (rev 533)
+++ trunk/po/tools/settings_template.py	2012-04-14 14:31:44 UTC (rev 534)
@@ -1,189 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-# <pep8 compliant>
-
-# Global settings used by all scripts in this dir.
-# XXX Before any use of the tools in this dir, please make a copy of this file
-#     named "setting.py"
-# XXX This is a template, most values should be OK, but some you’ll have to
-#     edit (most probably, BLENDER_EXEC and SOURCE_DIR).
-
-import os.path
-
-
-###############################################################################
-# MISC
-###############################################################################
-
-# The min level of completeness for a po file to be imported from /branches
-# into /trunk, as a percentage.
-IMPORT_MIN_LEVEL = 80
-
-# The comment prefix used in generated messages.txt file.
-COMMENT_PREFIX = "#~ "
-
-# The comment prefix used in generated messages.txt file.
-CONTEXT_PREFIX = "MSGCTXT:"
-
-# Default context.
-CONTEXT_DEFAULT = ""
-
-# The gettext domain.
-DOMAIN = "blender"
-
-# The gettext keywords.
-GETTEXT_KEYWORDS = ("IFACE_", "CTX_IFACE_", "TIP_", "CTX_TIP_", "N_")
-
-# Should po parser warn when finding a first letter not capitalized?
-WARN_MSGID_NOT_CAPITALIZED = True
-
-# Strings that should not raise above warning!
-WARN_MSGID_NOT_CAPITALIZED_ALLOWED = {
-    "",  # Simplifies things... :p
-    "sin(x) / x",
-    "fBM",
-    "sqrt(x*x+y*y+z*z)",
-    "iTaSC",
-    "bItasc",
-    "px",
-    "mm",
-    "fStop",
-    "sRGB",
-    "iso-8859-15",
-    "utf-8",
-    "ascii",
-    "re",
-    "y",
-    "ac3",
-    "flac",
-    "mkv",
-    "mp2",
-    "mp3",
-    "ogg",
-    "wav",
-    "iTaSC parameters",
-    "vBVH",
-    "rv",
-    "en_US",
-    "fr_FR",
-    "it_IT",
-    "ru_RU",
-    "zh_CN",
-    "es",
-    "zh_TW",
-    "ar_EG",
-    "pt",
-    "bg_BG",
-    "ca_AD",
-    "hr_HR",
-    "cs_CZ",
-    "nl_NL",
-    "fi_FI",
-    "de_DE",
-    "el_GR",
-    "id_ID",
-    "ja_JP",
-    "ky_KG",
-    "ko_KR",
-    "ne_NP",
-    "fa_IR",
-    "pl_PL",
-    "ro_RO",
-    "sr_RS",
-    "sr_RS at latin",
-    "sv_SE",
-    "uk_UA",
-    "tr_TR",
-    "available with",                # Is part of multi-line msg.
-    "virtual parents",               # Is part of multi-line msg.
-    "description",                   # Addons' field. :/
-    "location",                      # Addons' field. :/
-    "author",                        # Addons' field. :/
-    "in memory to enable editing!"}  # Is part of multi-line msg.
-
-
-###############################################################################
-# PATHS

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-translations-svn mailing list