Commit Graph

107 Commits

Author SHA1 Message Date
anatoly techtonik
aef2d8cffb gettext: use canonical relative paths for .pot 2016-02-09 10:45:11 +03:00
Georg Brandl
46d7e8558e Obligatory copyright update. 2016-01-14 22:54:04 +01:00
shimizukawa
dbfc72a451 refactoring: move i18n related function from osutil into i18n 2015-03-16 23:11:23 +09:00
Georg Brandl
8bc5823724 builders: pep8 fixes 2015-03-08 16:24:24 +01:00
shimizukawa
d5dca56ff8 The `gettext_enables config value has been renamed to gettext_additional_targets`. 2015-02-22 13:31:28 +09:00
Georg Brandl
a23903d8d5 Merge branch 'stable' 2015-01-03 21:41:14 +01:00
Georg Brandl
567d52f199 all: update copyright 2015-01-03 21:36:32 +01:00
Takayuki Shimizukawa
ee98decec1 Incompatibility. Now :confval:gettext_uuid is set False by default. If False, also levenshtein calculation is disabled. refs #1426 2014-10-05 21:50:44 +09:00
Takayuki Shimizukawa
9d1225a35b add :confval:gettext_enables to enable extracting 'index' to gettext catalog output / applying translation catalog to generated documentation. Closes #1344 2014-09-28 21:19:54 +09:00
Takayuki Shimizukawa
5ce8815156 remove with_statement feature for py25. 2014-09-26 02:14:05 +09:00
Georg Brandl
905cbf853d Move status_iterator to application object. 2014-09-22 14:34:57 +02:00
Takayuki Shimizukawa
eaed3ca9f1 Automatically compile `*.mo files from *.po` files. 2014-08-03 16:22:08 +09:00
Takayuki Shimizukawa
6beeeeb827 remove unnecessary list() wrappers. In some places, I replaced iterable.sort() with sorted(iterable). 2014-05-25 09:25:02 +09:00
Takayuki Shimizukawa
2d1549b35a wrap py3 iterators with list() for each places that expect a list object. refs #1350. 2014-04-30 23:25:44 +09:00
Takayuki Shimizukawa
6ae3b68859 replace ur'' prefix with r'' to support py2/py3 in one source. refs #1350 2014-04-30 23:04:21 +09:00
Takayuki Shimizukawa
ce4d342e20 use six privided iteritems(),itervalues() to support py2/py3 in one source. refs #1350. 2014-04-29 21:20:56 +09:00
Georg Brandl
85ddf03f45 merge with stable 2014-03-02 08:50:10 +01:00
Georg Brandl
501c2d13e6 Fix long lines. 2014-03-02 08:40:48 +01:00
Georg Brandl
db0f7ccc70 merge with stable 2014-03-02 08:37:54 +01:00
Takayuki Shimizukawa
194e50fd2d Fix 'make gettext' fails when the '.. todolist::' directive is present. Closes #1364
Nodes that are replicated like todo don't have a uid, however i18n also unnecessary.
If extensions need to choose i18n for the extended nodes or not, we need another approach.
2014-03-02 14:40:29 +09:00
Georg Brandl
c403737ec3 Add versionadded tags for new config values. 2014-03-01 08:25:22 +01:00
Georg Brandl
d50c5efb1a Merged in kenhys/sphinx (pull request #217)
Add feature to suppress uuid/location information for message catalogs
2014-03-01 08:21:59 +01:00
Georg Brandl
ac92719ac3 Update copyright year. 2014-03-01 08:18:23 +01:00
Georg Brandl
e030031321 Update copyright year. 2014-03-01 08:18:16 +01:00
hayashi
e8503888bc Add feature to suppress uuid/location information for message catalogs
Before: default

  #: ../../../source/news.txt:6
  # 9f62de6b9c3b477095dba5e468972e6d
  msgid "News"
  msgstr

After: suppress uuid & location information

  msgid "News"
  msgstr
2014-02-01 02:34:09 +09:00
Dmitry Shachnev
ce2185ce27 Modernize the code now that Python 2.5 is no longer supported
- Use print function instead of print statement;
- Use new exception handling;
- Use in operator instead of has_key();
- Do not use tuple arguments in functions;
- Other miscellaneous improvements.

This is based on output of `futurize --stage1`, with some
manual corrections.
2014-01-19 14:17:10 +04:00
Takayuki Shimizukawa
3db7c9a8d5 Fix ResourceWarnings with Python 3.2 or later. Closes #1269 2013-11-17 08:37:28 +00:00
Takayuki Shimizukawa
313559116d Backed out changeset cfe9e2d11003 refs #1265 2013-10-04 08:12:20 +00:00
Takayuki Shimizukawa
603a75d8d3 Now gettext translates label target name. Fix i18n: crash when using a indirect target and translating a target section name. Closes #1265 2013-10-04 05:07:09 +09:00
Georg Brandl
dd2de96498 Small consistency fix for timestamp tzoffset calculation. 2013-09-16 08:28:47 +02:00
Takayuki Shimizukawa
98c946d8a1 Fix again. Remove the effect of DST changing by the execution time difference. refs #1182 2013-06-15 12:59:49 +09:00
Takayuki Shimizukawa
c79e11a5c9 Force timezone offset to LocalTimeZone on POT-Creation-Date that was generated by gettext builder. refs #1182 2013-06-13 12:54:05 +09:00
Takayuki Shimizukawa
b7be3d2f4b add CHANGES for pot-creation-date format. Closes #1182 2013-06-04 03:30:10 +00:00
masklinn
d1d1d9a73d Add +0000 to POT-Creation-Date
%z sets an empty string when datetimes are "naive" (no timezone
specified), but some packages expect a timezone specifier on the
POT-Creation-Date header and will error out if it is missing
(e.g. babel's pofile.read_po).

Lifted the stdlib's UTC timezone recipe and set this explicitly, it's
not the correct timezone but at least it's a timezone.

The LocalTimezone recipe might be a better one.
2013-05-28 11:30:57 +00:00
Takayuki Shimizukawa
b91f70be6e Fix: 'make gettext' cause UnicodeDecodeError when templates contain utf-8 encoded string. 2013-04-13 22:44:37 +09:00
Takayuki Shimizukawa
b0b81d194d Fix: although template file did not have translation string, 'makee gettext' generate sphinx.pot 2013-04-13 21:16:22 +09:00
Georg Brandl
71360bcac6 builders: fix status_iterator backwards compatibility 2013-03-29 18:19:57 +01:00
Takayuki Shimizukawa
2c409959ac Add i18n capabilities for custom templates.
For example: The Sphinx reference documentation in doc directory provides
sphinx.pot file from ``doc/_templates/*.html`` by ``make gettext``.
2013-03-10 22:07:31 +09:00
Georg Brandl
9b4efc9ba3 Fix pyflakes issues. 2013-01-13 10:26:52 +01:00
Takayuki Shimizukawa
b17c588b0d Closes #976: Fix gettext does not extract index entries. 2013-01-05 23:38:21 +09:00
Georg Brandl
151856819c Copyright update. 2013-01-01 22:13:15 +01:00
Georg Brandl
9a4a3c9afa Satisfy "make check". 2011-10-09 23:09:57 +02:00
Robert Lehmann
468a15cbf0 Add project name to PO header. 2011-10-08 16:04:42 +02:00
Robert Lehmann
0f47e55787 Respect gettext_compact in message patching too. 2011-10-03 14:08:33 +02:00
Robert Lehmann
77329bf497 Closes #561: Add configuration option to prevent catalog bundling. 2011-10-03 13:20:53 +02:00
Georg Brandl
d7d7e0287f Fix #765: on Windows, relpath() does not always succeed. 2011-09-21 19:06:48 +02:00
Kouhei Sutou
773ba3b768 [i18n] fix reference line separator.
This commit fixes part of 5976facae92c commit:
  Refactor comment generating code for message catalogs.

The commit says "Refactor" but it changes original code behavior.
In original code, source locations are separated with " " but
in refactored code, source locations are separated with ", ".

msgmerge and po-mode that are part of the GNU gettext toolset treats
"," as part of source location. We can fix this problem by one of them:

  * Use " " instead of ", " as source locations separator
    in a "reference" line.
  * Put "reference" lines. Each "reference" line just has a source location.

This commit uses the latter because the latter has more higher readablility.

See also about "reference" line but it doesn't say about separator:
  http://www.gnu.org/s/hello/manual/gettext/PO-Files.html
2011-08-14 19:55:07 +09:00
Kouhei Sutou
f98cfbe862 [i18n] use relative path from output directory for source path.
This commit reverts part of 5976facae92c commit:
  Refactor comment generating code for message catalogs.

The commit says "Refactor" but it changes original code behavior.
In original code, start path for path.relpath() is self.outdir but
in refactored code, start path for path.relpath() is self.srcdir.

It should be self.outdir not self.srcdir to improve po-mode.el
support. po-mode.el has "po-cycle-source-reference" command. It
search source code relative from .po file directory.

See also::
  http://www.gnu.org/s/hello/manual/gettext/C-Sources-Context.html

    Program source files are usually found relative to where the PO
    file stands. As a special provision, when this fails, the file
    is also looked for, but relative to the directory immediately
    above it.
2011-08-12 14:29:19 +09:00
Robert Lehmann
b5f53e1972 Move node filtering into extract_messages. 2011-07-06 08:52:07 +02:00
Robert Lehmann
f1f7bde914 Distribute UUIDs over multiple comment lines. 2011-07-06 08:34:26 +02:00
Robert Lehmann
f477eaf26f Comment and stretch out code.
Also leverage the fact that we ignore Sphinx' built-in messages for catalogs.
2011-07-06 08:31:40 +02:00
Robert Lehmann
651a00f3cd Close #630: Revamp data structures used for message catalogs. 2011-07-06 08:25:25 +02:00
shibukawa yoshiki
16a2fd9010 skip literal_block 2010-10-28 09:34:47 +09:00
Robert Lehmann
0c9c9e8bee Refactor comment generating code for message catalogs.
Bring back UUIDs in comments too.

Overrides kou's 7b77dd3717af.
2011-07-06 07:50:02 +02:00
Kouhei Sutou
c43e9f2fef [i18n] support reference line.
From "3 The Format of PO Files" at
http://www.gnu.org/s/hello/manual/gettext/PO-Files.html ::

  Comment lines starting with #: contain references to the program's
  source code.

The reference comment is useful to jump to the source position.
GNU gettext tools support the reference comment. e.g.: po-mode.el binds
"s" key to "po-cycle-source-reference" that opens a source position in
a new buffer.
2011-05-08 17:48:38 +09:00
Kouhei Sutou
0d610fcff4 [i18n] don't generate duplicated msgid. 2011-05-08 17:32:41 +09:00
Georg Brandl
c266128c6d Rename "intl" module to "gettext", to make it easier to find. Distinguish environments with different versioning methods and always give the gettext builder its own doctree dir. 2011-01-08 17:32:32 +01:00