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

Magnus Ågård  Identity Verified
Spain
Local time: 12:52
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: 12:52
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: 12:52
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: 12:52
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: 12:52
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: 12:52
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: 12:52
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: 12:52
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







SDL MultiTerm 2017
Guarantee a unified, consistent and high-quality translation with terminology software by the industry leaders.

SDL MultiTerm 2017 allows translators to create one central location to store and manage multilingual terminology, and with SDL MultiTerm Extract 2017 you can automatically create term lists from your existing documentation to save time.

More info »
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 »



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