Merge pull request #886 from ruben2020/master

Fix for *.ts conflict between TypeScript and Qt Translation files
This commit is contained in:
Ted Nyman
2014-01-04 13:51:42 -08:00
3 changed files with 72 additions and 0 deletions

View File

@@ -19,6 +19,9 @@ module Linguist
if languages.all? { |l| ["Perl", "Prolog"].include?(l) }
disambiguate_pl(data, languages)
end
if languages.all? { |l| ["TypeScript", "XML"].include?(l) }
disambiguate_ts(data, languages)
end
end
end
@@ -40,6 +43,16 @@ module Linguist
matches
end
def self.disambiguate_ts(data, languages)
matches = []
if (data.include?("</translation>"))
matches << Language["XML"]
else
matches << Language["TypeScript"]
end
matches
end
def self.active?
!!ACTIVE
end