Start a new topic

Mac and Linux only: hot to show more details on tags in a terminal

 Hi,


Here is a simple way to get more details on (sdl)xliff tags. It can be useful when you feel that you should take a look at a tag in Studio to make sure that you don't insert it at the wrong place.


To use it, you press F3 (or your customized shortcut) to display the segment's tags in CT, then you put your mouse on the desired tag in the pop-up window to display the ID number.




Then, you copy the tag number (92 above) in your clipboard, and you launch your terminal command (more on this below).


Got it! It was the name of an electronic appliance, no need to check in Studio. Lucky man :-)


This grep command works on both Mac and Linux. Here it is:


grep -r -o --color --include="*.sdlxliff" 'id="number".........................' /path to your project source language folder


  • You can adapt it to the Desktop search in CT.

grep -r -o --color --include="*.sdlxliff" 'id=\"{}\".........................' /path to your project source folder ... (not tested, but it should work)


  • Or for Alfred 2 on Mac:

grep -r -o --color --include="*.sdlxliff" 'id="{query}".........................' /path to your project source folder ... (tested, works perfectly.


This will search for the specified ID number in the sdlxliff files of the specified folder.

To reduce the number of hits, you specify the package's source language folder, not the package's main folder (otherwise you will get redundant results from the target language folder).


The number of dots (....................) will give you the corresponding number of characters after the ID number ('id="number"). This is essential to see the ID's meaning... without the full line (which can be veeeeeeeery long in xliff files.)


This is a bit dirty (you will get a lot of meaningless stuff), but with my files I generally get the meaningful hits at the beginning. (I have no idea if this is always the case with xliff files, please check with your own files.)


The kind of good results I get with this grep expression includes:

  • some signs as ™ and % (that can be described as percent in the xliff file)  
  • locked text (like my electronic appliance above) that the client wants to keep unmodified in the target
  • and so on (still testing here).


Of course this grep search is only for exceptional cases, not for all the tags, to save time (and stay away from Studio when possible).


HTH


1 person likes this idea

Alain, I like this very much. Could be very useful, e.g. in segments like:



Where the degrees Celsius part isn't visible in CafeTran.


Igor, could this be made a default feature? E.g. via hovering over a tag?


Igor, I just installed the most recent file... Wow, I don't know if I'm dreaming, but the tags content display is simply amazing! Many thanks!!!

1 person likes this

Is this the harbinger of a new Update?

It's Harbinger.

 

Thanks, Alain, but in fact there are many versions of the same Harbinger (it's constantly updated behind the screens). I'll download it again on the test MacBook Pro. 

>Thanks, Alain, but in fact there are many versions of the same Harbinger


Indeed. Yesterday's Harbinger looks completely different from the original Harbinger from 1815.


By all means: don't update your Hairbindscha during an ongoing project!!!!!! 

Login to post a comment