Auto-sustitution of numbers in Swedish
Thread poster: Magnus Ågård

Magnus Ågård  Identity Verified
Spain
Local time: 14:47
Member (2009)
English to Swedish
+ ...
Jun 25, 2012

I use Trados Studio 2011 and I can´t get it to handle the Swedish number format correctly.

A number written "3179.43" in the English original should be localised as "3 179,43" with a comma instead of a decimal point and a (non-breaking) space between thousands. When translated it changes the point to comma but the space is not inserted.

I have alsp checked the Windows Control Panel to see that it is in Swedish with the correct format. What is to do with this?

(These are not the only auto-translation errors I get as Trados also eats up the tabs, spaces and some tags in formatted text)


Direct link Reply with quote
 

István Hirsch  Identity Verified
Local time: 14:47
English to Hungarian
If there is no other solution Jun 25, 2012

You could work with a text editor either on the target file or the sdlxliff file, but here is a less risky alternative with Studio.

Check the „Use” checkbox and select "Regular Expressions” in Editor View to „Find and Replace”.

Find:

1(?=[0-9]{3},[0-9]{2})

Replace with:
1_

Note the space following number „1” in the Replace box.

Unfortunately, you will have to repeat this with all the nine numbers – replace number "1" (first position) with them in both the Find and the Replace box.

If you want to insert non-breaking space, put a non-breaking space (instead of the normal) after number „1” in the Replace box: you can copy/paste this by selecting a normal space on the target side, clicking on the non-breaking space symbol in the toolbar, then copy/pasting that space after „1”.


Direct link Reply with quote
 

Magnus Ågård  Identity Verified
Spain
Local time: 14:47
Member (2009)
English to Swedish
+ ...
TOPIC STARTER
Thanks! You are the real expert of regular expressions! Jun 26, 2012

It works quite well, it will include numbers with three decimal also so you can´t really replace all occurrences, but it will help me a lot.

(I did try other combinations, but as Trados can´t handle regular expressions in the replace function (what a flaw!), I gave up.)

I take it from the mere existence of your answer that there is no way of teaching Trados to do this correctly and automatically. The same then goes for it's eating tabs, tags and spaces...:-(


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 14:47
English
The problem... Jun 26, 2012

... is created because the English is not written with a thousands seperator (according to the rules Studio uses) as set down here:

http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx

So for example, if I have two numbers as follows you can see the first is localized bsed on there being no thousands break at all, and the second as you see fit.


The problem for Studio is that it has no idea of knowing whether you want to follow suit and have no thousand seperator in the target, or not.

On the ability to replace via regex as well as search... I completely agree. This is on the cards for a later release.

Regards

Paul


Direct link Reply with quote
 

István Hirsch  Identity Verified
Local time: 14:47
English to Hungarian
To further develop... Jun 26, 2012

... please give me a number where it does not provide the required result.

Direct link Reply with quote
 

Magnus Ågård  Identity Verified
Spain
Local time: 14:47
Member (2009)
English to Swedish
+ ...
TOPIC STARTER
I'm not sure how ... Jun 26, 2012

... the regular should be written but it should detetct any of these cases:

1000
1000/3000
1234,45
1234,4567 (but no spaces in the decimals)
1234567 (two spaces needed)
and so on..

perhaps just writing:

1(?=[0-9]{3})

will do for most of my particular cases this time anyway ...

Great help all the same!


Direct link Reply with quote
 

István Hirsch  Identity Verified
Local time: 14:47
English to Hungarian
There are too many different cases... Jun 26, 2012

... to treat them all with a single regex within Studio.

Your formula is good for 4-digit numbers without decimal parts if you collect those numbers by filtering - otherwise the conversion would take place in every number (in every position) where number "1" is followed by 3 digits, for example.


Direct link Reply with quote
 

Magnus Ågård  Identity Verified
Spain
Local time: 14:47
Member (2009)
English to Swedish
+ ...
TOPIC STARTER
Not really ... Jun 26, 2012

... it will detect just any three digits in a row independently whether they are followed by any number of decimals or not. It will of course also detect the year (e.g. 2012), 1,1234 and any other stuff but will work ok for now. Many thanks for your helpful attitude!

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 »

Auto-sustitution of numbers in Swedish

Advanced search







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 »
Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »



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