Posts

INI creation for XML file

Recently, I have handled a translation job for my VIP client. We have worked in word file and FM file for translation and DTP for many years. This time, our client changed the whole flow and used XML file to make the translation and DTP in FM. There is no .ini file provided, no suitable ini files selectable once you open these xml files. So we must create pertinent .ini file for this set of xml files before translation. Below are the steps:

1         Go to: Tools –>Tag Settings

2         select New…

3         The Tag Settings Wizard launches.

4         The first page describes the process. Select Next >

5         Step 1: Settings Name & Type. Give the Settings name. This is the name that will appear in the Tag Settings Manager.

  1. Select the Setting type desired, they are:
  • New settings for XML
  • New Settings for SGML/HTML
  • Base on predefined HTML 4.0 settings
  • Base on predefined XSL settings
  1. Enter the “setting name”, and for setting type, here we choose “New Settings for XML”.  Select Next >
  2. Step 2: Import Tag Definitions. Tag definitions can be imported from a variety of sources, here we click “Import…”and load all source xml files.
  3. Select OK and then Next >>>
  4. You’re done with the Wizard.  Select Finish to save. Save the file to somewhere you (and everyone else) can reference for future use.

 

After the translation was finished, we found there was a kind of particular tag needs to be translated.
See example : <indexterm ixentry=”Maintenance”/>

as the xml will be imported into FM and do the layout, all indexterm should be translated. that is, we should translate “Maintenance”, but it is internal tag which cannot be touched. How do we make such tags translatable?

1 go to: Tools à Tag Settings, choose the ini file you used and click “Properties”.

2 Select “Element” and found the element “indexterm”

The tag type is internal now.

3 Double click the line, dialog “element properties” popped up and check “External” in “Type”

4         and then go to “Attributes”, check “ixentry”.

5 Select OK and finish the setting.

For example, such tag shows like:

After the setting, we made all such tags as external and translatable.

Below are some tips from “tips of the day” of TagEditor. You can test the usage piece by piece and must get more familiar with this tool.

1 You can create customized tag settings files for any XML (or SGML) DTD, schema or XML files you have. To do so, choose “Tag setting” from the “Tool” menu.

2 You can switch the user interface language at any time. Simply select the “User Interface Language” command from the “View” menu, and choose your preferred language for menus and dialog boxes.

3 If SDL Trados Translaator’s Workbench is not running when you start TagEditor, you can easily start it anytime later by clicking the “Connect to Workbench” icon on the Standard toolbar.

4 You can get Help on almost any TagEditor command. Just press [Shift]+[F1] or select the “What’s This” command from the Help menu and click on the tool bar button or menu item that interests you.

5 Whenever you start TagEditor, you can automatically launch Translaator’s Workbench along with it. To do so, check “Start Translaator’s Workbench automatically” on the “Tools | Options | General” tabs.

6 You can click the right mouse button anywhere in a document. This will bring up a context menu with the most common editing commands.

7 The descriptive name of the tag settings file for the current document is always displayed in the status bar for your convenience.

8 TagEditor features what is referred to as “Tag tips”: to display the full contents of any tag, move your mouse pointer over it and wait for a short moment. TagEditor will now display a tag tip with the full contents of the tag.

9 You can undo the most recent editing commands. To do so, use the “Undo” command from the “Edit” menu.

10 You can redo previously undone commands. To do so, use the “redo” command from the “Edit” menu.

11 You can quickly switch through all available view modes using the shortcuts [Ctrl]+[Tab] and [Ctrl]+[Shift]+[Tab].

12 If you notice display problems in and HTML document, close it, go to “Tools – Tag Settings – Predefined HTML Settings – Edit – Elements – Advanced” and change the options in the “Display options” group box.

13 You can define your own entities that don’t belong to any of the standard entity set lists. To do so, in step 4 of the Tag Setting Wizard, choose “User Defined” from the “Sets” list and add your own entities as desired.

14 If the document you open contains “garbled” characters, try altering the document’s encoding (code page) scheme. You achieve this using the “Encoding” command from the “View” menu.

15 TagEditor comes with build-in tag setting for HTML 4.0 that are contained in the file HTML.4.INI. if you by accident delete this settings file you can always recreate it later. To do so, choose Tag Setting from the Tools menu, click “new”, and choose the corresponding option in the dialog box that follows.

16 You can customize the way tags looks. To do so, choose “Tools | Options | Colours”.

17 TagEditor is a fully featured MDI (Multiple Document Interface) application. This means that you can work on several documents at the same time. To switch between open documents, use the keyboard shortcut [Ctrl]+[F6] or [Ctrl]+[Shift]+[F6].

18 You can drag & drop files from Windows Explorer to the TagEditor window or even on the TagEditor icon on the desktop.

19 You can check the spelling of your translated text at each segment. To do so, choose “Check spelling when closing segment” on the “Tools | Options | Spelling” tab.

20 When defining tag setting for XML, be sure to uncheck all but the “XML Default” entity set in step 5 of the Tag Setting Wizard.

21 TagEditor can make sure that the target text contains the same tag as the source. To do so, choose “Tools | Options | Verification” and set your desired verification level.

22 You can reduce all tags to small placeholders when you are not in translation mode. To do so, choose “View | Tag Text | None”.

23 To fine-tune setting for advanced XML and HTML features such as scripting, use the “Advanced Settings” dialog box that is available from the “Elements” tab of the Tag Setting Properties dialog box.

24 To speed up the process of defining elements for tag settings, you can categorise unknown elements as external, internal or placeholder. To do so, use “Tools | Tag Settings | Edit | Elements | Advanced”.

25 TagEditor comes with a powerful tag verification engine, a major quality assurance feature. Use it to compare all tags in the target against the source. Click the Verify button or press [F8] to start.

26 After verifying the tags in the documents, use the message toolbar to navigate from one message to another and to go to its corresponding location in the document.

27 To move from one verification message to the next/previous one, press [F4]/[Shift]+[F4].

28 To fine-tune age verification settings for the current document type, go to “Tool – Plug-in – SDL Trados Generic Tag Verifier – Properties”.

29 TagEditor has a versatile plug-in interface that can be used to extend its functionality. To view the current plug-ins, click the Pug-in button on the standard toolbar. Check marks indicate active plug-ins.

30 To quickly insert frequently used formatting tags such as those used for bold or common special characters such as the copyright symbol, use the tag toolbars.

31 You can customize tag toolbar settings for the current document type. Choose “Tools – Customize Tag Toolbar”.

32 There are standard keyboard shortcuts for all tag and character buttons. For instance, press [Ctrl]+[I] to make text italic, and [Ctrl]+[Alt]+[T] to insert a trademark symbol.

33 To store and quickly insert text that you use frequently, you can use “Tools – AutoText”.

34 If you have MultiTerm 7 installed, you can use the MultiTerm toolbar to search for terms and and new terms to your MultiTerm termbase while you work.

35 To change the case of any selected text, use “Edit – Change Case”.

36 To count the text and tags in the current selections, use “Tools – Count Characters”.

37 SDL Trados TagEditor allows you to work with comments for all kinds of reviewing purposes. You can view, add and edit comments using the “Comments” command from the “Edit” menu.

38 You can work on SDL’s translation document format (ITD) in TagEditor. To achieve this, choose the ITD file type from the Open dialog box.

Solution to “Error while writing breaks” while cleaning TTX to doc files

Hey guys, just want to share with you a possible solution to a problem I recently encountered while I was cleaning this TTX bilingual file to word file. As usual after I got everything done for TEP of this translation (it was a big one with approx. 25000+ new words) I tried to clean directly this TTX file to the Microsoft Word file but it showed this “Error while writing breaks”. I tried to fix if there was any tag missing but it was really a huge file that I just couldn’t. Then I searched in web and found there were also threads discussing this question on this translation & localization forum, this proz.com.

I studied for a while and by compiling their answers from quite a few threads, I managed to find a solution that DID work to this problem: First the reason why this reminder appears is because the word document contains section breaks that are not proceeded by a paragraph end mark (inside TTX tags these “section breaks” are all over the place). Section breaks without paragraph end marks are not supported by TTX.

Solution can be divided into 4 steps:

1. Open the Microsoft Word document and press “Ctrl + H” to invoke the Replace dialog box.
2. Type in ^b (section break) in the Find what box and type in ^p^& in the Replace with box.
3. Click Replace all, this means that MS Word has replaced all section breaks in the file with a paragraph end mark followed by a section break.
4. Save the doc file and regenerate the TTX (using the project TM) and it worked: files successfully cleaned.

Notes taken from internet (for reference)

It is recommended that you always test the TRADOStag (TTX) workflow using a copy of the Microsoft Word document you want to translate. This way you can detect and fix any potential issues before translation starts.

To test the workflow in TagEditor:

1. Update all the fields in a document by selecting [Ctrl+A] in Microsoft Word to select the entire document, then press the F9 key to update all the fields. Save the document and exit Microsoft Word.
2. Open the document in TagEditor.
3. Save the document as a bilingual file and translate one of the segments.
4. Save the bilingual file as a target file and open the target file in Microsoft Word.

Hope this helps!! ^^

[技术文档]-如何用trados翻译JSON文件-2

   常规处理json数据都是在网页上处理的,直接在网页上利用javascript的eval()进行读取。所以实际上我也可以这么来做,但考虑方便处理,尝试寻找一下有没软件能够处理这方面的数据。就是它,Altova XMLSpy,XMLSPY是一个专业的XML处理软件,能用于配置各种xml配置环境的设计调试。支持包括,XML,XML Schema,XSL/XSLT.SOAP,WSDL和互联网技术。软件很强大,但我们这次只使用其中一个小功能,“转换”。

Altova XMLSpy最新版是2012,我安装的是2011。界面如下

 

下面是一个json例子3.json

Sample:

{

         “firstName”: “John”,

         “lastName”: “Smith”,

         “male”: “true”,

         “age”: “25”,

         “address”: {

                   “streetAddress”: “21 2nd Street”,

                   “city”: “New York”,

                   “state”: “NY”,

                   “postalCode”: “10021”

         },

         “phoneNumber”: [

                   {

                            “type”: “home”,

                            “number”: “212 555-1234”

                   }, {

                            “type”: “fax”,

                            “number”: “646 555-4567”

                   }

         ]

}

用软件打开json文件。点击转换-> 互相转换xml和json,软件会自动生成一个新的XML,这是会提示xml不够规范,的确,得学会相应的信息才能修复。

生成的xml如下

<json>

         <firstName>John</firstName>

         <lastName>Smith</lastName>

         <male>true</male>

         <age>25</age>

         <address>

                   <streetAddress>21 2nd Street</streetAddress>

                   <city>New York</city>

                   <state>NY</state>

                   <postalCode>10021</postalCode>

         </address>

         <phoneNumber>

                   <type>home</type>

                   <number>212 555-1234</number>

         </phoneNumber>

         <phoneNumber>

                   <type>fax</type>

                   <number>646 555-4567</number>

         </phoneNumber>

</json>

  生成的xml会自动生成一个<json></json>的父节点。

好了,这份xml就可以提供给tageditor翻译了。

打开tageditor,打开这份xml,会出现这个界面,因为认不出节点,得给其编辑重新设置,在标签管理设置里面,新建一个标签管理,新建->下一步->设置一个名字->xml新设置->导入(导入刚才的xml),导入之后会检查出xml所存在的标签,然后选定需要锁定的标签,建议全部选定,然后下一步,设置好字体之类,再保存这份ini之后就可以开始翻译了,就是普通的翻译xml的流程。

翻译好之后,clean up后出来的xml文件就得转换回原来的json格式。

   这里提供一个现成的网站提供在线转换xml到json还原。

http://extjs.org.cn/xml2json/xml2json_online.php

   将xml文件贴上去,按转换,下面就出来相应的json格式了,在XMLSPY中新建一个json文件,贴上刚才的json数据,删除多余的头部的json标签。在XMLSPY中,可以对其进行必要的编辑和校验。如图所示,的“美编”标签,可以美化格式。

   完整的流程就这样可以了。上面的流程是针对最便捷的方法来解决这个问题。参考json官方网站,可以发现,官方网站有很多json对于各种语言的支持,C,C#,JAVA,甚至ActionScript3都给予支持。有兴趣的可以开发相应的程序。

[技术文档]-如何用trados翻译JSON文件-1

Trados功能强大,各位大概都知道。但文档格式多种多样,就不是每一样trados都能顾及得到。特别涉及到一些比较特殊的格式的文件。例如,json。下面我来介绍怎么去解决这个问题。

解决之前要首先了解什么是json格式的文件,json是javascript object notation的简写,可以说,JSON是原生于javascript的子集。同时也独立于语言,是一种轻量级的数据交换格式。说到这里,大家是不是觉得这格式和曾经学过的某种格式很类似呢,的确,就是它xml。但JSON比XML更小,更快,更容易解析。当然了,这里说的xml是特指xml document,就是xml数据文档。

问题分析,trados是支持xml翻译的,用tageditor,能有效处理xml的翻译,另外用sdlx也是可以的,对相应的字段进行锁定。知道了这个就好办,下一步要解决的是,json和xml之间的转换。

摘录某文章的描述就是 json与xml的不同之处:1.没有结束标签,2.更短,3.读写速度更快,4.能够使用内建的javascript eval()方法进行解析,5.使用数组,6.不使用保留字

JSON具有以下这些形式:

对象是一个无序的“‘名称/值’对”集合。一个对象以“{”(左括号)开始,“}”(右括号)结束。每个“名称”后跟一个“:”(冒号);“‘名称/值’ 对”之间使用“,”(逗号)分隔。

官方也有这样的介绍

“名称/值”对的集合(A collection of name/value pairs)。不同的语言中,它被理解为对象(object,纪录(record),结构(struct),字典(dictionary),哈希表(hash table),有键列表(keyed list),或者关联数组 (associative array)。

值的有序列表(An ordered list of values)。在大部分语言中,它被理解为数组(array)。

比较两者的数据结构

JSON:

{

“employees”: [

{ “firstName”:”Bill” , “lastName”:”Gates” },

{ “firstName”:”George” , “lastName”:”Bush” },

{ “firstName”:”Thomas” , “lastName”:”Carter” }

]

}

从上面可见,结构简单,但很清晰,内含结构并列的数组。

XML:

<note>

<to>George</to>

<from>John</from>

<heading>Reminder</heading>

<body>Don’t forget the meeting!</body>

</note>

上面的是xml的文档,大伙应该都见过不少,第一行编码,之后的按节点编排

常规情况下考虑,XML转JSON,考虑到JSON的数据表现可以对象,也可能是数组,所以这时得惦记这事。再有对于XML里面的CDATA标签的内容,得特别关注,因为json注释不一样。查遍网络,很难发现一款十分专用的软件来转换。

关于使用 Trados 的一点建议

以下是我在作业中遇到的一些问题,想跟大家分享一下。

1. 因为 tageditor 与中文输入法兼容不好,在翻译过程中,汉字输入状态恢复为英文输入状态。因此,输入标点时要尤为小心,确保目前尚入于中文输入状态,小心不要在中文译文中输入半角符号。

2. 如果 PM 没有给 TM ,建议在新建 TM 时设定 TM 的字体(公司 style guide 规定汉字默认字体为宋体),否则 TM 默认字体为 Arial Unicode MS,。而且在译文中,请尽量统一字体。至于如何统一,请参阅 Motta 的日志《Trados中Tageditor中字体显示不出的解决办法》。其中说明了 tageditor 中在标点后输入汉字时字体改变的解决方法。

3. 某些情况下,在 tageditor 中打开语段输入汉字时,tageditor 会自动关闭。有同事建议先输入英文,然后在英文后面再输入汉字,如此也许能解决问题。如果觉得麻烦,可能直接利用 TM 的 copy source on no match。最后把不必要的英文删除。

4. TM 在使用的过程中,有可能出现这样一种状况:100% 匹配语段,获取译文时,字体会自动变成粗体。有时也可能不符合语段原文的格式。因为是完全匹配,所以这些问题很容易就被忽视。但实际上小问题可能在最后的排版过程中带来大麻烦。

Trados中Tageditor中字体显示不出的解决办法

Trados中tageditor的用处大家都清楚,但其使用过程中经常出现字体问题。涉及问题的原因,与系统win7 or XP?字体安装状态,软件版本等等都或多或少有着联系。

共用TM导致的问题,会引起字体或格式的错误。

问题一:Tageditor文件(后简称TTX),ttx文件某些字体显示成方格,显示不出来,但有部分字体又可以显示出来,问题出现的原因是系统缺了这个字体,一般来说版本2007的默认字体是”Arial Unicode MS”,一种样子和“宋体”很像的字体,当第一个编辑者用WIN7+trados2007,而后的编辑者使用WIN XP+ Trados2007的时候,某种情况下就会出现字体不显示的情况。

解决办法是,用UltraEditor或Editplus之类的文本编辑软件打开之后,将显示不出的字体调节为你电脑能显示的字体,例如宋体。

第二个方法是给你的系统加载所缺失的自己,网上可以下载这种字体,然后安装替换掉原来的,切记,”Arial Unicode MS”不用随便删掉,不然以后问题多多,再有,编辑替换TTX的时候,切记不要改变其内部结构。

问题二:在编辑TU时候,一个句子编辑完之后,标点之后,字体会自动变化,不再是原来的字体,同样,也是”Arial Unicode MS”字体的问题,可以说是trados 2007的一个小bug,标点默认字体是其默认字体,而之后输入的内容继承了这种字体,解决办法。笨办法,输入句子的时候不写标点,而之后再一个一个拷贝进去,显然,效率很低。最好的办法是替换系统中的这个字体,和问题一,一样的的解决办法

上述所提未必是最好的解决办法,只是自己实践中的小结

Tag Operation in TagEditor

Tag Operation in TagEditor

TagEditor is an useful computer assisted translation tool provided by SDL Trados. And it is very powerful in translating .xls, .ttx, .html, .sgml and other formats. However, carefulness is a must when translation with TagEditor.

And there are some thoughts I would like to share with you. Some thoughts were taught by my workmates and some are my experience in using TagEditor.

When working on the translations, the tag should be remain as it is. Any operations, such as add a tag, delete a tag, or put the tags in a wrong order, must be done with great attention. Generally, we are required not to make any alternation to the tags. But in some situations, things are quite different.

1) some tags are to be translated. For example, “Test&amp;Target”. If you just translate “Test” and “Target” to target language, and leave “&amp;” as it is, finally in target language a symbol “&” remains between the translations of “Test” and “Target” . A little strange, isn’t it? In such case, the tag equals to “and” and should be translated.

2) Tags order are to be changed. Due to the different structures of source language and target language, some alternations have to be made to the word order, so does the tags adhered to the words or phrases.

3) Some tags could be deleted. This kind of tags are rare and I do not suggest to delete them even if they do not work any more. Take the tags for superscript for example, “1<cf superscript=”on”>st</cf> of June”, the superscript for date expressions is no longer used in target language. So the tags “<cf superscript=”on”>” and “</cf>” can be deleted. If you want to leave the tags in target language, please make sure that no word remain between the two tags.

Hope this can help you in some way.