for git v1.5.2 (and below): chdir to the directory of the target file before executin...
[translate_toolkit.git] / lang / test_vi.py
bloba9493fad98d2290fa96f49fcf49c6a9ab8216df4
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 from translate.lang import factory
6 def test_punctranslate():
7 """Tests that we can translate punctuation."""
8 language = factory.getlanguage('vi')
9 assert language.punctranslate(u"abc efg") == u"abc efg"
10 assert language.punctranslate(u"abc efg.") == u"abc efg."
11 assert language.punctranslate(u"abc efg!") == u"abc efg !"
12 assert language.punctranslate(u"abc efg? hij!") == u"abc efg? hij !"
13 assert language.punctranslate(u"Delete file: %s?") == u"Delete file : %s?"
14 assert language.punctranslate(u'The user "root"') == u"The user « root »"
15 # More exhaustive testing of the quoting is in test_fr.py
16 assert language.punctranslate(u'Lưu "Tập tin"') == u"Lưu « Tập tin »"
17 assert language.punctranslate(u"Lưu 'Tập tin'") == u"Lưu « Tập tin »"
18 assert language.punctranslate(u"Lưu `Tập tin'") == u"Lưu « Tập tin »"
20 def test_sentences():
21 """Tests basic functionality of sentence segmentation."""
22 language = factory.getlanguage('vi')
23 sentences = language.sentences(u"Normal case. Nothing interesting.")
24 assert sentences == [u"Normal case.", u"Nothing interesting."]
25 sentences = language.sentences(u"Is that the case ? Sounds interesting !")
26 assert sentences == [u"Is that the case ?", u"Sounds interesting !"]