Commit Graph

19 Commits

Author SHA1 Message Date
Augie Fackler
14695b388a i18n: use getattr instead of hasattr
Using getattr instead of util.safehasattr here to avoid adding another
dependency for i18n.
2011-07-25 20:46:30 -05:00
Brodie Rao
5f24d65643 HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
This makes it possible to gain the benefits of HGPLAIN for scripting
while preserving different behaviors like internationalization.
2011-01-05 00:18:36 +11:00
Martin Geisler
2493321650 i18n: fix translation of empty paragraphs 2010-06-19 19:16:11 +02:00
Wagner Bruna
3eefab1b9b i18n: translate each paragraph separately
Makes translation work easier by reducing message sizes and avoiding
invalidating whole messages on small changes or additions to the
original text.
2010-04-06 22:30:50 -03:00
Brodie Rao
48b845981a ui: add HGPLAIN environment variable for easier scripting
If HGPLAIN is set, the following settings are ignored when read from
hgrc files:

- ui.debug
- ui.fallbackencoding
- ui.quiet
- ui.traceback
- ui.verbose
- defaults.*

Localization is also disabled.

Equivalent options set via command line are honored.
2010-02-07 14:56:18 +01:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Martin Geisler
3550fb27d7 i18n: remove unnecessary os.path.normpath call 2009-10-03 18:58:25 +02:00
Martin Geisler
147cf1b01f i18n: move unrelated line out of try-except block 2009-08-06 00:34:28 +02:00
Martin Geisler
a2c9777e20 i18n: updated outdated comment 2009-08-06 00:26:34 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Martin Geisler
8e4bc1e9ad put license and copyright info into comment blocks 2009-04-26 01:13:08 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
642f4d7151 move encoding bits from util to encoding
In addition to cleaning up util, this gets rid of some circular dependencies.
2009-04-03 14:51:48 -05:00
Martin Geisler
7f3f8dbbe2 i18n: encode output in user's local encoding
This makes the translated output obey the HGENCODING environment
variable or the preferred encoding as set by the LANG or LC_ALL
environment variables.

Python 2.4 has a lgettext method which is similar, except that it
doesn't know about HGENCODING or the settings in .hgrc.
2009-01-15 00:14:36 +01:00
Martin Geisler
b8064b97f3 i18n: lookup .mo files in private locale/ directory
This default is to look for /usr/share/locale/xx/LC_MESSAGES/hg.mo for
language xx, but this code will instead do the lookup from locale/ or
mercurial/locale/ relative to the root of the Mercurial source tree.
2009-01-15 00:12:35 +01:00
Matt Mackall
d1c48b4dad Enable gettext translations
The new demandimport eliminates most of the gettext performance hit of
importing gettext, which was doubling the run time for 'hg'.

Now, with 'hg tip':

dummy: .09530s no translations: .09638s translations: .09755s
2006-12-14 17:32:00 -06:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07:00
Benoit Boissinot
912c1aa6a3 use a dummy function for gettext
import gettext is really slow, until we figure out a solution
we use identity for gettext
2005-10-18 18:38:04 -07:00
Benoit Boissinot
e38e94088a i18n first part: make '_' available for files who need it 2005-10-18 18:37:48 -07:00