A Windows Region Setting (Locale) Specific Problem!
Thread poster: ATB Translation

ATB Translation
Turkey
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 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


 

Elif Baykara Narbay  Identity Verified
Turkey
Local time: 09:20
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-15 09:15 GMT]

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


 

ATB Translation
Turkey
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.)

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]


 

Rolf Keller
Germany
Local time: 08:20
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
Turkey
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
Germany
Local time: 08:20
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
Turkey
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.icon_smile.gif
Best Reards


 

Elif Baykara Narbay  Identity Verified
Turkey
Local time: 09:20
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 icon_smile.gif

I should definitely study regex, too.


 

ATB Translation
Turkey
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!...icon_smile.gif
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!

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 »
PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

More info »



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