Studio 2009 - Auto Substitution
Thread poster: hhl

hhl
Local time: 23:55
English to German
Aug 7, 2010

How to automatically transform "$xxx.yy" to "xxx,yy°USD"?

Is there a way to have currency values like the above automatically inserted into target text the way as indicated above?

Or would this require to extend the Studio "Measurements" functionality to include an option for defining customized "measurements"?


 

Jerzy Czopik  Identity Verified
Germany
Local time: 23:55
Member (2003)
Polish to German
+ ...
Search and replace in filtered view Aug 7, 2010

...would be my answer to this. So for just number segments like $ xxx.xx it would be quite easy I think - use ^\$ to show all segments beginning with the $ sign, then use search & replace operator to do the trick - or at least I hope it is possible similar to Word. Never tried that however. An automated replacement for that does not exist AFAIK.

Regards
Jerzy


 

hhl
Local time: 23:55
English to German
TOPIC STARTER
Complicated replacement Aug 7, 2010

If there's a $ (or whatever symbol) in front of the number (no space between $ and the value!), Studio does no longer identify the number as a number. Therefore you need to manually edit each number, because you have to replace "." with "," and "," with "." when translating EN>DE. May be there is some complex regular expression to achieve this, but I don't know.
Also, the replacement includes to move the currency symbol from the front to the back of the expression (including a non-breakable space or an individual thin space). At least the latter can be achieved by regular expressions...


 

Jerzy Czopik  Identity Verified
Germany
Local time: 23:55
Member (2003)
Polish to German
+ ...
I agrree - complicated Aug 7, 2010

If the source would be Word or if you would be able to open source in Word, I would do this operation in Word, where the use of regex is much simplier than in Studio.

 

István Hirsch  Identity Verified
Local time: 23:55
English to Hungarian
Aug 8, 2010



[Módosítva: 2010-08-08 11:55 GMT]


 

István Hirsch  Identity Verified
Local time: 23:55
English to Hungarian
The hard way Aug 8, 2010

Of course, before trying this, make a copy of the file to be changed.
In the Edit/Find and Replace window check Use and select Regular expressions from the drop-down menu. „Less than” should be replaced everywhere with its symbol, which I could not insert in the text.

1. Find: (?less than=\$[1-9][0-9]{2}\.[0-9]{2})\s Replace with: _USD_
2. Find: (?less than=\$[1-9][0-9]{2}\.[0-9]{2})\. Replace with: _USD.
3. Find: (?less than=\$[1-9][0-9]{2}\.[0-9]{2}), Replace with: _USD,
4. Find (?less than=\$[1-9][0-9]{2}). Replace with: ,
5. Find \$(?=[1-9][0-9]{2},) Replace with: (leave blank)

1. Inserts USD if the number is followed by a whitespace.
2. ~ ... followed by a full stop.
3. ~ …followed by a comma.
4. Replaces decimal (.) with decimal (,).
5. Deletes $ if it is the first character of a number.

2. and/or 3. can be omitted (if they do not occur in the text), but this order of the replacements should be kept.
Hope this works in the target text.


 

Jerzy Czopik  Identity Verified
Germany
Local time: 23:55
Member (2003)
Polish to German
+ ...
Side note: use Entities if you need symbols like less than in this forum Aug 8, 2010

To insert <, use & lt ; (without blanks, obviously), or & gt ; for >

 

István Hirsch  Identity Verified
Local time: 23:55
English to Hungarian
Thanks... Aug 8, 2010

...for the info. I haven't known that.

 


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


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

Studio 2009 - Auto Substitution

Advanced search







BaccS – Business Accounting Software
Modern desktop project management for freelance translators

BaccS makes it easy for translators to manage their projects, schedule tasks, create invoices, and view highly customizable reports. User-friendly, ProZ.com integration, community-driven development – a few reasons BaccS is trusted by translators!

More info »
TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »



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