[logaling-commit] logaling/logaling-command [master] fix to get text by <seg>text</seg>

Back to archive index

null+****@clear***** null+****@clear*****
Thu Apr 26 16:41:43 JST 2012


SUZUKI Miho	2012-04-26 16:41:43 +0900 (Thu, 26 Apr 2012)

  New Revision: 14d9a67613345194619a2e3eee955cfc50078ec5

  Merged dc203a9: Merge pull request #58 from logaling/import-tmx

  Log:
    fix to get text by <seg>text</seg>

  Modified files:
    lib/logaling/external_glossaries/tmx.rb

  Modified: lib/logaling/external_glossaries/tmx.rb (+9 -5)
===================================================================
--- lib/logaling/external_glossaries/tmx.rb    2012-04-26 16:05:43 +0900 (1440ab9)
+++ lib/logaling/external_glossaries/tmx.rb    2012-04-26 16:41:43 +0900 (99f302e)
@@ -29,13 +29,17 @@ module Logaling
       tu_nodes.each do |tu|
         original = ""
         translation = ""
-        tu.children.each do |child|
-          if child.name == "tuv"
-            lang = child["lang"].downcase.sub(/\-.*/, "")
+        tu.children.each do |tuv|
+          if tuv.name == "tuv"
+            lang = tuv["lang"].downcase.sub(/\-.*/, "")
             if lang == glossary_info[:source_language]
-              original = child.text.strip
+              tuv.children.each do |child|
+                original = child.text.strip if child.name == "seg"
+              end
             elsif lang == glossary_info[:target_language]
-              translation = child.text.strip
+              tuv.children.each do |child|
+                translation = child.text.strip if child.name == "seg"
+              end
             end
           end
         end




More information about the logaling-commit mailing list
Back to archive index