diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Tool/GettextCommon.py | 25 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gettext.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gettext.xml | 7 | ||||
-rw-r--r-- | src/engine/SCons/Tool/msgfmt.py | 6 |
4 files changed, 20 insertions, 22 deletions
diff --git a/src/engine/SCons/Tool/GettextCommon.py b/src/engine/SCons/Tool/GettextCommon.py index d786015..66ab57c 100644 --- a/src/engine/SCons/Tool/GettextCommon.py +++ b/src/engine/SCons/Tool/GettextCommon.py @@ -54,8 +54,8 @@ class _POTargetFactory(object): """ A factory of `PO` target files. Factory defaults differ from these of `SCons.Node.FS.FS`. We set `precious` - (this is required by builders and actions in `SConsToolGettext`) and - `noclean` flags by default for all produced nodes. + (this is required by builders and actions gettext) and `noclean` flags by + default for all produced nodes. """ def __init__( self, env, nodefault = True, alias = None, precious = True , noclean = True ): @@ -239,17 +239,16 @@ class RPaths(object): It seems like `SCons.Node.FS.Base.get_path()` returns absolute paths for nodes that are outside of current working directory (`env.fs.getcwd()`). - In `SConsToolGettext` way we often have `SConscript`, `POT` and `PO` files - within `po/` directory and source files (e.g. `*.c`) outside of it. When - generating `POT` template file, references to source files are written to - `POT` template, so a translator may later quickly jump to appropriate source - file and line from its `PO` editor (e.g. `poedit`). Relative paths in - `PO` file are usually interpreted by `PO` editor as paths relative to the - place, where `PO` file lives. The absolute paths would make resultant `POT` - file nonportable, as the references would be correct only on the machine, - where `POT` file was recently re-created. For such reason, we need a - function, which always returns relative paths. This is the purpose of - `RPaths` callable object. + Here, we often have `SConscript`, `POT` and `PO` files within `po/` + directory and source files (e.g. `*.c`) outside of it. When generating `POT` + template file, references to source files are written to `POT` template, so + a translator may later quickly jump to appropriate source file and line from + its `PO` editor (e.g. `poedit`). Relative paths in `PO` file are usually + interpreted by `PO` editor as paths relative to the place, where `PO` file + lives. The absolute paths would make resultant `POT` file nonportable, as + the references would be correct only on the machine, where `POT` file was + recently re-created. For such reason, we need a function, which always + returns relative paths. This is the purpose of `RPaths` callable object. The `__call__` method returns paths relative to current woking directory, but we assume, that *xgettext(1)* is run from the directory, where target file is diff --git a/src/engine/SCons/Tool/gettext.py b/src/engine/SCons/Tool/gettext.py index 1055087..8dfdecf 100644 --- a/src/engine/SCons/Tool/gettext.py +++ b/src/engine/SCons/Tool/gettext.py @@ -28,7 +28,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" ############################################################################# def generate(env,**kw): import SCons.Tool - from SConsToolGettext.GettextCommon \ + from SCons.Tool.GettextCommon \ import _translate, _install_mo_files, tool_list for t in tool_list(env['PLATFORM'], env): env.Tool(t) @@ -39,7 +39,7 @@ def generate(env,**kw): ############################################################################# def exists(env): - from SConsToolGettext.GettextCommon \ + from SCons.Tool.GettextCommon \ import _xgettext_exists, _msginit_exists, \ _msgmerge_exists, _msgfmt_exists return _xgettext_exists(env) and _msginit_exists(env) \ diff --git a/src/engine/SCons/Tool/gettext.xml b/src/engine/SCons/Tool/gettext.xml index db76cc9..2c6f1ae 100644 --- a/src/engine/SCons/Tool/gettext.xml +++ b/src/engine/SCons/Tool/gettext.xml @@ -36,9 +36,8 @@ perform particular activities related to software internationalization. You may be however interested in <emphasis>top-level</emphasis> builders &b-Translate; and &b-InstallMOFiles; described few paragraphs later. -To use &t-gettext; tools, copy <filename>SConsToolGettext</filename> -folder to your <filename>site_scons/</filename> and simply add -<literal>'gettext'</literal> tool to your environment: +To use &t-gettext; tools add <literal>'gettext'</literal> tool to your +environment: <example> env = Environment( tools = ['default', 'gettext'] ) </example> @@ -207,7 +206,7 @@ not defined), the builders use <filename>messages.pot</filename> as default <cvar name="POAUTOINIT"> <summary> The &cv-POAUTOINIT; variable, if set to <literal>True</literal> (on non-zero -numeric value), let the SConsToolGettext to automatically initialize +numeric value), let the &t-link-msginit; tool to automatically initialize <emphasis>missing</emphasis> <literal>PO</literal> files with <command>msginit(1)</command>. This applies to both, &b-link-POInit; and &b-link-POUpdate; builders (and others that use any of diff --git a/src/engine/SCons/Tool/msgfmt.py b/src/engine/SCons/Tool/msgfmt.py index ce8cff8..f5cdb8f 100644 --- a/src/engine/SCons/Tool/msgfmt.py +++ b/src/engine/SCons/Tool/msgfmt.py @@ -29,9 +29,9 @@ class _MOFileBuilder(BuilderBase): """ The builder class for `MO` files. The reason for this builder to exists and its purpose is quite simillar - as for `SConsToolGettext._POFileBuilder`. This time, we extend list of - sources, not targets, and call `BuilderBase._execute()` only once (as we - assume single-target here). + as for `_POFileBuilder`. This time, we extend list of sources, not targets, + and call `BuilderBase._execute()` only once (as we assume single-target + here). """ def _execute(self, env, target, source, *args, **kw): |