A Windows Region Setting (Locale) Specific Problem!
Thread poster: ATB Translation
ATB Translation
ATB Translation
Türkiye
English to Turkish
+ ...
Apr 14, 2017

Dear all,
The problem with Turkish regional settings, is it has no specific setting for how percentage sign is rendered. Henceforth it is rendered in the American way, meaning after the number (like 100.0%). But we use it in the reverse manner (like % 100,0).
Since most CAT tools use the system's regional settings, it is rendered incorrectly in the resultant target text. We need to correct it manually. In case of a few percentages, this is not a problem. But when text contains thousa
... See more
Dear all,
The problem with Turkish regional settings, is it has no specific setting for how percentage sign is rendered. Henceforth it is rendered in the American way, meaning after the number (like 100.0%). But we use it in the reverse manner (like % 100,0).
Since most CAT tools use the system's regional settings, it is rendered incorrectly in the resultant target text. We need to correct it manually. In case of a few percentages, this is not a problem. But when text contains thousands of them, it is very time consuming.

My question is: Is there a way to customize windows regional settings to include custom format for percentages?
I am every willing to go to programming solutions.

Best Wishes,
ATB
Collapse


 
Elif Baykara Narbay
Elif Baykara Narbay  Identity Verified
Türkiye
Local time: 22:15
German to Turkish
+ ...
regex Apr 15, 2017

The solution is regex (regular expressions). You can find various online guides and training websites.

https://regexone.com/
http://regexr.com/

A note for anyone willing to provide a regex for this specific case: there is no space after the % sign. The correct form is: %1.234,56.

[Edited at 2017-04-
... See more
The solution is regex (regular expressions). You can find various online guides and training websites.

https://regexone.com/
http://regexr.com/

A note for anyone willing to provide a regex for this specific case: there is no space after the % sign. The correct form is: %1.234,56.

[Edited at 2017-04-15 09:15 GMT]

[Edited at 2017-04-15 09:16 GMT]
Collapse


 
ATB Translation
ATB Translation
Türkiye
English to Turkish
+ ...
TOPIC STARTER
Thank you!... Apr 15, 2017

Thank you for your reply!
I am *a bit* familiar with regular expressions but I think I miss the point as to how this will change the regional settings.

Are you suggesting we need to use regular expressions on find-and-replace to find and correct them.

We sometimes use that approach too.

However, if there is leading sign (+ or -, does not matter, e.g. +0.4%) that renders find and replace useless. (Or we are not very savvy with regular expressions.)
... See more
Thank you for your reply!
I am *a bit* familiar with regular expressions but I think I miss the point as to how this will change the regional settings.

Are you suggesting we need to use regular expressions on find-and-replace to find and correct them.

We sometimes use that approach too.

However, if there is leading sign (+ or -, does not matter, e.g. +0.4%) that renders find and replace useless. (Or we are not very savvy with regular expressions.)

BTW, the links you gave are quite useful.
I am examining them and hoping to find a "find-and-replace" solution to my formatting problem using regular expressions.

Thank you again.

[Edited at 2017-04-15 13:05 GMT]
Collapse


 
Rolf Keller
Rolf Keller
Germany
Local time: 20:15
English to German
Regex will do it Apr 15, 2017

ATB Translation wrote:

However, if there is leading sign (+ or -, does not matter, e.g. +0.4%) that renders find and replace useless.


Using parenthesized subexpressions you can re-arrange them at will.

Search for (+|-)?(0-9|.)1+(%)

So you have:
(+|-]? means $1 = + or – or nothing

(0-9|.)1+ means $2 = any combination of digits and dots

(%) means $3 = %

Replace by $1$3$2

Of course it depends on the Regex dialect you are using. And of course my solution includes a tiny bug somewhere (I didn't test it), but the principle should be clear.


 
ATB Translation
ATB Translation
Türkiye
English to Turkish
+ ...
TOPIC STARTER
Thank You Rolf That kinda worked!... Apr 15, 2017

Rolf Keller wrote:

Search for (+|-)?(0-9|.)1+(%)

So you have:
(+|-]? means $1 = + or – or nothing

(0-9|.)1+ means $2 = any combination of digits and dots

(%) means $3 = %

Replace by $1$3$2

Thank you for your input:
I slightly changed what you inspired.
Here is my search text:
([+|-])?([0-9]\.[0-9])(%)
And my replace text is same as you suggested.

That's a great input. Thank you. I shall buy you a beer, if we ever meet!...

Best Regards


 
Rolf Keller
Rolf Keller
Germany
Local time: 20:15
English to German
It works, but ... Apr 16, 2017

ATB Translation wrote:

Here is my search text:
([+|-])?([0-9]\.[0-9])(%)


([0-9]\.[0-9]) matches 2.5 but does it match 2 or 25.5?


 
ATB Translation
ATB Translation
Türkiye
English to Turkish
+ ...
TOPIC STARTER
Maybe I need to modify a little more Apr 16, 2017

Rolf Keller wrote:

ATB Translation wrote:

Here is my search text:
([+|-])?([0-9]\.[0-9])(%)


([0-9]\.[0-9]) matches 2.5 but does it match 2 or 25.5?


Hi,
Since percentages in our files are small numbers, it worked for us but apparently I need to modify it further.

Thank you for your input.
Best Reards


 
Elif Baykara Narbay
Elif Baykara Narbay  Identity Verified
Türkiye
Local time: 22:15
German to Turkish
+ ...
I will definitely use them myself :) Apr 16, 2017

I am glad that this topic is started. Most of the time I need to convert the percentages and numbers as well but until now it was easier for me to do it manually

I should definitely study regex, too.


 
ATB Translation
ATB Translation
Türkiye
English to Turkish
+ ...
TOPIC STARTER
A slight modification to solve double digit percentages!... Apr 17, 2017

Rolf Keller wrote:

([0-9]\.[0-9]) matches 2.5 but does it match 2 or 25.5?



Hi there,
Here is how I solved your version of the problem:
([+|-])?([0-9]*\.[0-9])(%)

A small asteriks before the "\." did the trick!...
If I add another asteriks after the second [0-9], then I shall even find and replace double decimal point percentages.

Best wishes!...


 


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


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

A Windows Region Setting (Locale) Specific Problem!






Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »