From 6d94401d5901212d5212e9ac4b9a4bc5c2d8fcfc Mon Sep 17 00:00:00 2001 From: aflorescu579774 Date: Mon, 9 Dec 2024 15:43:53 +0200 Subject: [PATCH] TMX 3.2.1.0 - SDLCOM-6145: Fixed a bug. Attempting to create the project will now mark the TMX files as translatable. --- TMX/Properties/AssemblyInfo.cs | 2 +- TMX/TMXSniffer.cs | 33 +++++++++++---------------------- TMX/pluginpackage.manifest.xml | 2 +- 3 files changed, 13 insertions(+), 24 deletions(-) diff --git a/TMX/Properties/AssemblyInfo.cs b/TMX/Properties/AssemblyInfo.cs index 1837fcbb76..b3d3943926 100644 --- a/TMX/Properties/AssemblyInfo.cs +++ b/TMX/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.2.0.0")] -[assembly: AssemblyFileVersion("3.2.0.0")] +[assembly: AssemblyFileVersion("3.2.1.0")] [assembly: Sdl.Core.PluginFramework.Plugin("Plugin_Name")] \ No newline at end of file diff --git a/TMX/TMXSniffer.cs b/TMX/TMXSniffer.cs index 3c80b15163..6bae52bf97 100644 --- a/TMX/TMXSniffer.cs +++ b/TMX/TMXSniffer.cs @@ -67,33 +67,22 @@ private bool IsFileSupported(string nativeFilePath) // from the file header private void GetFileLanguages(ref SniffInfo info, string nativeFilePath) { - XmlDocument doc = new XmlDocument(); + XmlDocument doc = new XmlDocument(); doc.Load(nativeFilePath); - string tmxSource = doc.SelectSingleNode("tmx/header/@srclang").InnerText; - CultureInfo sourceLanguage; - try // currently LegacySdlxLanguage initialization fails first time - { - sourceLanguage = LegacySdlxLanguage.GetCultureInfoFromIsoCode(tmxSource); - } - catch - { - sourceLanguage = LegacySdlxLanguage.GetCultureInfoFromIsoCode(tmxSource); - } + string tmxSource = doc.SelectSingleNode("tmx/header/@srclang").InnerText; info.DetectedSourceLanguage = - new Sdl.FileTypeSupport.Framework.Pair(new Language(sourceLanguage), DetectionLevel.Certain); + new Sdl.FileTypeSupport.Framework.Pair(new Language(tmxSource), DetectionLevel.Certain); - if (doc.SelectSingleNode("tmx/body/tu[1]/tuv[2]").Attributes[0] != null && - doc.SelectSingleNode("tmx/body/tu[1]/tuv[2]").Attributes[0].InnerText.Length==5) - { - string tmxTarget = doc.SelectSingleNode("tmx/body/tu[1]/tuv[2]").Attributes[0].InnerText; - var targetLanguage = LegacySdlxLanguage.GetCultureInfoFromIsoCode(tmxTarget); - - info.DetectedTargetLanguage = new Sdl.FileTypeSupport.Framework.Pair(new Language(targetLanguage), - DetectionLevel.Certain); - } - } + if (doc.SelectSingleNode("tmx/body/tu[1]/tuv[2]").Attributes[0] != null && + doc.SelectSingleNode("tmx/body/tu[1]/tuv[2]").Attributes[0].InnerText.Length == 5) + { + string tmxTarget = doc.SelectSingleNode("tmx/body/tu[1]/tuv[2]").Attributes[0].InnerText; + info.DetectedTargetLanguage = new Sdl.FileTypeSupport.Framework.Pair(new Language(tmxTarget), + DetectionLevel.Certain); + } + } } } diff --git a/TMX/pluginpackage.manifest.xml b/TMX/pluginpackage.manifest.xml index 6f0694ffd2..adf654a46c 100644 --- a/TMX/pluginpackage.manifest.xml +++ b/TMX/pluginpackage.manifest.xml @@ -1,7 +1,7 @@  File type definition for TMX - 3.2.0.0 + 3.2.1.0 Open TMX files as translatable files in Trados Studio. Trados AppStore Team