tests/test-i18n.t
author Adrian Buehlmann <adrian@cadifra.com>
Wed, 18 May 2011 09:12:27 +0200
changeset 14413 5ef18e28df19
parent 13967 f85c9b0fdb32
child 14660 d29d31e0fdc3
permissions -rw-r--r--
pure: provide more correct implementation of posixfile for Windows requires ctypes Why is posixfile a class? Because the implementation needs to use the Python library call os.fdopen [1], which sets the 'name' attribute on the Python file object it creates to the mostly meaningless string '<fdopen>', since file descriptors don't have a name. But users of posixfile depend on the name attribute [2] being set to a proper value, like Python's built-in 'open' function sets it on file objects. Python file's name attribute is read-only, so we can't just assign to it after the file object has alrady been created. To solve this problem, we save the name of the file on a wrapper object, and delegate the file function calls to the wrapped (private) file object using __getattr__. [1] http://docs.python.org/library/os.html#os.fdopen [2] http://docs.python.org/library/stdtypes.html#file.name
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13442
bb107a31820e test-i18n: make test conditional on msgfmt availability
Martin Geisler <mg@lazybytes.net>
parents: 13414
diff changeset
     1
Translations are optional:
bb107a31820e test-i18n: make test conditional on msgfmt availability
Martin Geisler <mg@lazybytes.net>
parents: 13414
diff changeset
     2
bb107a31820e test-i18n: make test conditional on msgfmt availability
Martin Geisler <mg@lazybytes.net>
parents: 13414
diff changeset
     3
  $ "$TESTDIR/hghave" gettext || exit 80
bb107a31820e test-i18n: make test conditional on msgfmt availability
Martin Geisler <mg@lazybytes.net>
parents: 13414
diff changeset
     4
13414
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     5
Test that translations are compiled and installed correctly.
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     6
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     7
Default encoding in tests is "ascii" and the translation is encoded
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     8
using the "replace" error handler:
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     9
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    10
  $ LANGUAGE=pt_BR hg tip
13967
f85c9b0fdb32 dispatch: improve repository not found message
Matt Mackall <mpm@selenic.com>
parents: 13442
diff changeset
    11
  abortado: no repository found in '$TESTTMP' (.hg not found)!
13414
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    12
  [255]
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    13
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    14
Using a more accomodating encoding:
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    15
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    16
  $ HGENCODING=UTF-8 LANGUAGE=pt_BR hg tip
13967
f85c9b0fdb32 dispatch: improve repository not found message
Matt Mackall <mpm@selenic.com>
parents: 13442
diff changeset
    17
  abortado: no repository found in '$TESTTMP' (.hg not found)!
13414
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    18
  [255]
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    19
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    20
Different encoding:
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    21
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    22
  $ HGENCODING=Latin-1 LANGUAGE=pt_BR hg tip
13967
f85c9b0fdb32 dispatch: improve repository not found message
Matt Mackall <mpm@selenic.com>
parents: 13442
diff changeset
    23
  abortado: no repository found in '$TESTTMP' (.hg not found)!
13414
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    24
  [255]