'No matching file type' -- although I set one up
Thread poster: Ben Jones

Ben Jones
United Kingdom
Local time: 02:42
Japanese to English
+ ...
Aug 8, 2013

A potential client has sent me some software needing localization. The files needing to be translated appear to consist of a few XHTML files (no problem there), and some strings files, unsurprisingly called XYZ.strings and similar. The internal structure of these looks as follows:

---------------------------------------------------------------------
/* Class = "NSTextFieldCell"; title = "Do something"; ObjectID = "123"; */

123.title = "Do something";


/* Class = "NSTextFieldCell"; title = "Do something else"; ObjectID = "124"; */

124.title = "Do something else";
---------------------------------------------------------------------

When I created the project in Studio 2011 (using the default template), I tried to set these up by adding a new 'Regular Expression Delimited Text' file type I called 'Strings', with File dialog wildcard expression *.strings, and then edited the 'Document structure' inside file type Strings to have Opening pattern .title=" and Closing pattern "; with Multiline set to Off.

However, when I add the files they are detected as 'Reference' and trying to set them to 'Translatable' merely results in the error 'no matching file type could be found'.

Any ideas what I am doing wrong, and how to fix it?

TIA
Ben


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 03:42
English
At a guess... Aug 8, 2013

... your opening pattern finds nothing at all so the file doesn't match. Instead of this:

.title="

Try this;

.title = "

Note the spaces either side of the equals sign. You don't really need the dot before title either but it will work anyway.

Regards

Paul


Direct link Reply with quote
 

Ben Jones
United Kingdom
Local time: 02:42
Japanese to English
+ ...
TOPIC STARTER
Multiple matches Aug 9, 2013

Thanks Paul, that works... for some files.

Some still fail, and I've noticed that they have a different structure - they're just lists of strings like:

Do Something = "Do Something";
Do Something Else = "Do Something Else";

Obviously it would be easy to set these up separately, but the problem is that they're also called XYZ.strings. Am I right to think there is no way to tell Suite that these are a different type, as it classifies them based on the filename extension? So would the only way to get around this be (somehow) to extract a list of the files that have failed, rename them to e.g. XYZ.strings2 and create a new file type?

Ben


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 03:42
English
No the easiest way would be to write... Aug 9, 2013

... a rule that captured them all. Maybe something like this?

Opening

^(?:/\* Class =|).*?= "

Closing
";.*$

Maybe that will do the job... there's a fair amount of guess work going on here because you're drip feeding me information!

Regards

Paul


Direct link Reply with quote
 

Remy Blaettler
Local time: 03:42
German to English
+ ...
Try out our regex easy Aug 9, 2013

I've created a little regex fiddle:

http://refiddle.com/grs

Unfortunately, if only recognizes one line, but you can just copy & paste all your different situations to try them out.
Much easier than restarting trados everytime.


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 03:42
English
Very neat! Aug 9, 2013

Hi Remy,

I like it. I prefer to use RegexBuddy but if you don't have this (or some other tool), or a text editor that supports regex, then it's a great way to verify what you are doing.

Thanks

Paul


Direct link Reply with quote
 

Ben Jones
United Kingdom
Local time: 02:42
Japanese to English
+ ...
TOPIC STARTER
Solved Aug 9, 2013

Sorry Paul for the drip-feed but I didn't want to swamp you (or others) and am also cautious re confidentiality.

In my case the lines including Class etc. are just comments, so the 'title' text inside them should be left untranslated. Hence I think I have three types of line to be processed (depending on the file):

1) /* Class = "NSTextFieldCell"; title = "Do something"; ObjectID = "123"; */
2) 123.title = "Do something";
3) Do Something = "Do Something";

Following your advice, I need a RegExp which matches 2) and 3) but ignores 1). In plain language, this would be an opening match where the line contains = " but doesn't start with /.

This should do it quite simply: ^[^/]* = " and indeed, it works on my files. I tried this before spotting Remy's answer, but it does check out and it looks like a great resource for similar situations in the future.

Many thanks for your help.

Ben


Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

'No matching file type' -- although I set one up

Advanced search







memoQ translator pro
Kilgray's memoQ is the world's fastest developing integrated localization & translation environment rendering you more productive and efficient.

With our advanced file filters, unlimited language and advanced file support, memoQ translator pro has been designed for translators and reviewers who work on their own, with other translators or in team-based translation projects.

More info »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search