summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorptomulik <ptomulik@meil.pw.edu.pl>2012-06-18 02:35:11 (GMT)
committerptomulik <ptomulik@meil.pw.edu.pl>2012-06-18 02:35:11 (GMT)
commit5b83cf3b2af8b25093ff15960fbc5a86ed3062b3 (patch)
treee01d677c815b0bd2e498bef9207d4a3f394a43d3 /src
parent6a587bf579a5c57e713668a5538d4591ca81db92 (diff)
downloadSCons-5b83cf3b2af8b25093ff15960fbc5a86ed3062b3.zip
SCons-5b83cf3b2af8b25093ff15960fbc5a86ed3062b3.tar.gz
SCons-5b83cf3b2af8b25093ff15960fbc5a86ed3062b3.tar.bz2
Changes in gettext tool - tests refactored, small changes in sources.
Diffstat (limited to 'src')
-rw-r--r--src/engine/SCons/Tool/GettextCommon.py14
-rw-r--r--src/engine/SCons/Tool/gettext.py4
-rw-r--r--src/engine/SCons/Tool/gettext.xml38
-rw-r--r--src/engine/SCons/Tool/msgfmt.py3
-rw-r--r--src/engine/SCons/Tool/msgfmt.xml1
-rw-r--r--src/engine/SCons/Tool/msginit.py5
-rw-r--r--src/engine/SCons/Tool/msginit.xml1
-rw-r--r--src/engine/SCons/Tool/msgmerge.py3
-rw-r--r--src/engine/SCons/Tool/msgmerge.xml1
9 files changed, 12 insertions, 58 deletions
diff --git a/src/engine/SCons/Tool/GettextCommon.py b/src/engine/SCons/Tool/GettextCommon.py
index af506d7..86d7eaf 100644
--- a/src/engine/SCons/Tool/GettextCommon.py
+++ b/src/engine/SCons/Tool/GettextCommon.py
@@ -362,20 +362,6 @@ def _init_po_files(target, source, env):
#############################################################################
#############################################################################
-def _install_mo_files( env, localedir, source, domain, category="LC_MESSAGES"
- , *args, **kw):
- """ Function for `InstallMOFiles` pseudo-builder """
- import SCons.Util
- import os
- nodes = []
- for src in source:
- lang = SCons.Util.splitext(os.path.basename(str(src)))[0]
- tgt = os.path.join(localedir, lang, category, domain + "$MOSUFFIX")
- nodes.extend(env.InstallAs(tgt, src, *args, **kw))
- return nodes
-#############################################################################
-
-#############################################################################
def _detect_xgettext(env):
""" Detects *xgettext(1)* binary """
if env.has_key('XGETTEXT'):
diff --git a/src/engine/SCons/Tool/gettext.py b/src/engine/SCons/Tool/gettext.py
index 42fafd7..dd336b6 100644
--- a/src/engine/SCons/Tool/gettext.py
+++ b/src/engine/SCons/Tool/gettext.py
@@ -29,12 +29,10 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
def generate(env,**kw):
import SCons.Tool
from SCons.Tool.GettextCommon \
- import _translate, _install_mo_files, tool_list
+ import _translate, tool_list
for t in tool_list(env['PLATFORM'], env):
env.Tool(t)
env.AddMethod(_translate, 'Translate')
- # This is not ready yet
- # env.AddMethod(_install_mo_files, 'InstallMOFiles')
#############################################################################
#############################################################################
diff --git a/src/engine/SCons/Tool/gettext.xml b/src/engine/SCons/Tool/gettext.xml
index 54ed1d6..3a9a78d 100644
--- a/src/engine/SCons/Tool/gettext.xml
+++ b/src/engine/SCons/Tool/gettext.xml
@@ -162,35 +162,6 @@ running <command>scons '.'</command>.</para></note>
</summary>
</builder>
-<!--
-<builder name="InstallMOFiles">
-<summary>
-This is not implemented yet.
-Install <literal>MO</literal> catalog files into system directories.
-
-The parameters are:
-- <literal>localedir</literal> - system locale base directory, e.g. <literal>/usr/share/locale</literal>
-- <literal>source</literal> - list of <literal>MO</literal> files to install
-- <literal>domain</literal> - domain, i.e. your package/program name
-- <literal>category</literal> - locale category, e.g. <literal>LC_MESSAGES</literal>
-
-The installation goes in standard way. For example, if
-<literal>localedir="/usr/share/locale"</literal>, <literal>domain="program1"</literal>,
-<literal>category="LC_MESSAGES"</literal>, <literal>sources=['en.mo', 'fr.mo']</literal>, then the
-installation goes as follows:
-<example>
-en.mo ===&gt; /usr/share/locale/en/LC_MESSAGES/program1.mo
-fr.mo ===&gt; /usr/share/locale/fr/LC_MESSAGES/program1.mo
-</example>
-The <literal>InstallMOFiles</literal> builder uses internaly <literal>InstallAs</literal> builder, so all
-the features of <literal>InstallAs</literal> (e.g. <literal>xxinstall-sandbox</literal>) should work.
-<example>
-TODO:
-</example>
-</summary>
-</builder>
--->
-
<cvar name="POTDOMAIN">
<summary>
The &cv-POTDOMAIN; defines default domain, used to generate
@@ -227,12 +198,3 @@ default file named
</summary>
</cvar>
-
-<scons_function name="Dummy">
-<arguments>
-TODO: Try to remove me.
-</arguments>
-<summary>
-TODO: Try to remove me.
-</summary>
-</scons_function>
diff --git a/src/engine/SCons/Tool/msgfmt.py b/src/engine/SCons/Tool/msgfmt.py
index cdbc4ed..83b54f7 100644
--- a/src/engine/SCons/Tool/msgfmt.py
+++ b/src/engine/SCons/Tool/msgfmt.py
@@ -82,7 +82,8 @@ def generate(env,**kw):
MSGFMTFLAGS = [ SCons.Util.CLVar('-c') ],
MSGFMTCOM = '$MSGFMT $MSGFMTFLAGS -o $TARGET $SOURCE',
MSGFMTCOMSTR = '',
- MOSUFFIX = '.mo'
+ MOSUFFIX = ['.mo'],
+ POSUFFIX = ['.po']
)
env.Append( BUILDERS = { 'MOFiles' : _create_mo_file_builder(env) } )
#############################################################################
diff --git a/src/engine/SCons/Tool/msgfmt.xml b/src/engine/SCons/Tool/msgfmt.xml
index d72cc47..3c5db8f 100644
--- a/src/engine/SCons/Tool/msgfmt.xml
+++ b/src/engine/SCons/Tool/msgfmt.xml
@@ -17,6 +17,7 @@ MSGFMT
MSGFMTCOM
MSGFMTCOMSTR
MSGFMTFLAGS
+POSUFFIX
</sets>
<uses>
LINGUAS_FILE
diff --git a/src/engine/SCons/Tool/msginit.py b/src/engine/SCons/Tool/msginit.py
index 28bcde1..87b3eec 100644
--- a/src/engine/SCons/Tool/msginit.py
+++ b/src/engine/SCons/Tool/msginit.py
@@ -82,8 +82,11 @@ def generate(env,**kw):
env['MSGINIT'] = _detect_msginit(env)
msginitcom = '$MSGINIT ${_MSGNoTranslator(__env__)} -l ${_MSGINITLOCALE}' \
+ ' $MSGINITFLAGS -i $SOURCE -o $TARGET'
+ # NOTE: We set POTSUFFIX here, in case the 'xgettext' is not loaded
+ # (sometimes we really don't need it)
env.SetDefault(
- POSUFFIX = '.po',
+ POSUFFIX = ['.po'],
+ POTSUFFIX = ['.pot'],
_MSGINITLOCALE = '${TARGET.filebase}',
_MSGNoTranslator = _optional_no_translator_flag,
MSGINITCOM = msginitcom,
diff --git a/src/engine/SCons/Tool/msginit.xml b/src/engine/SCons/Tool/msginit.xml
index 1827d35..612b9d9 100644
--- a/src/engine/SCons/Tool/msginit.xml
+++ b/src/engine/SCons/Tool/msginit.xml
@@ -19,6 +19,7 @@ MSGINITFLAGS
POAUTOINIT
POCREATE_ALIAS
POSUFFIX
+POTSUFFIX
_MSGINITLOCALE
</sets>
<uses>
diff --git a/src/engine/SCons/Tool/msgmerge.py b/src/engine/SCons/Tool/msgmerge.py
index 49ab651..78eb2c5 100644
--- a/src/engine/SCons/Tool/msgmerge.py
+++ b/src/engine/SCons/Tool/msgmerge.py
@@ -72,7 +72,8 @@ def generate(env,**kw):
from SCons.Tool.GettextCommon import _detect_msgmerge
env['MSGMERGE'] = _detect_msgmerge(env)
env.SetDefault(
- POSUFFIX = '.po',
+ POTSUFFIX = ['.pot'],
+ POSUFFIX = ['.po'],
MSGMERGECOM = '$MSGMERGE $MSGMERGEFLAGS --update $TARGET $SOURCE',
MSGMERGECOMSTR = '',
MSGMERGEFLAGS = [ ],
diff --git a/src/engine/SCons/Tool/msgmerge.xml b/src/engine/SCons/Tool/msgmerge.xml
index c2018b1..69c848b 100644
--- a/src/engine/SCons/Tool/msgmerge.xml
+++ b/src/engine/SCons/Tool/msgmerge.xml
@@ -16,6 +16,7 @@ MSGMERGECOM
MSGMERGECOMSTR
MSGMERGEFLAGS
POSUFFIX
+POTSUFFIX
POUPDATE_ALIAS
</sets>
<uses>