Merge pull request #1842 from pchaigno/ts

Add .ts as a XML extension for Qt translation files
This commit is contained in:
Arfon Smith
2014-12-06 17:06:09 -06:00
4 changed files with 63 additions and 0 deletions

View File

@@ -165,5 +165,13 @@ module Linguist
Language["text"]
end
end
disambiguate "TypeScript", "XML" do |data|
if data.include?("<TS ")
Language["XML"]
else
Language["TypeScript"]
end
end
end
end

View File

@@ -3066,6 +3066,7 @@ XML:
- .tmSnippet
- .tmTheme
- .tml
- .ts
- .ui
- .urdf
- .vbproj

47
samples/XML/pt_BR.ts Normal file
View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="pt_BR">
<context>
<name>MainWindow</name>
<message>
<location filename="../forms/mainwindow.ui" line="22"/>
<source>United Kingdom</source>
<translation>Reino Unido</translation>
</message>
<message>
<location filename="../forms/mainwindow.ui" line="38"/>
<source>God save the Queen</source>
<translation>Deus salve a Rainha</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="46"/>
<source>England</source>
<translation>Inglaterra</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="47"/>
<source>Wales</source>
<translation>Gales</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="48"/>
<source>Scotland</source>
<translation>Escócia</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="49"/>
<source>Northern Ireland</source>
<translation>Irlanda Norte</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="51"/>
<source>Portuguese</source>
<translation>Português</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="52"/>
<source>English</source>
<translation>Inglês</translation>
</message>
</context>
</TS>

View File

@@ -143,4 +143,11 @@ class TestHeuristcs < Test::Unit::TestCase
"LoomScript" => "LoomScript/HelloWorld.ls"
})
end
def test_ts_by_heuristics
assert_heuristics({
"TypeScript" => all_fixtures("TypeScript", "*.ts"),
"XML" => all_fixtures("XML", "*.ts")
})
end
end