MemoQ 2014 R2 auto-translation rules
Thread poster: Châu Nguyễn

Châu Nguyễn  Identity Verified
Vietnam
Local time: 02:42
Member (2012)
English to Vietnamese
+ ...
Aug 3, 2015

Hi, i'm kinda new to MemoQ auto-translation rules.

Could any one help me to write an expression to convert a date string from format 'dd/mm/yyyy' to 'mmmm dd, yyyy'? e.g: 01/01/2014 => January 01, 2014.

I tried the following:
- Since the month would be a number, I created a translation pairs custom list #month# with source is number from 01-12 and target is January-December.

- In the Auto-translation rules I created the following auto-translation rules: '(\d)/(#month#)/(\d)' and Replace order rules: '$2 $1, $3'.

- The result: 01/01/2014 => 01nuary 01, 2014 | 01/02/2014 => 02bruary 01, 2014.

I wonder why is there always two digit that replace the first 2 characters of the $2. If I put extra spaces in front it would show 01 January 01, 2014 | 02 February 01, 2014.

I appreciate all your help.
Thanks.


 

Manuel Arcedillo
Spain
Local time: 21:42
English to Spanish
RegEx needs fixing Aug 3, 2015

Hi,

Try \d+ instead of \d in both instances.

Edit: I now see that these rules behave one way in the preview and another way in the editor. Where are you experiencing this?

[Edited at 2015-08-03 14:58 GMT]


 

Châu Nguyễn  Identity Verified
Vietnam
Local time: 02:42
Member (2012)
English to Vietnamese
+ ...
TOPIC STARTER
I did not check in the editor Aug 4, 2015

I only preview my regex. Since it did not turn out as I expected, I did not use it in editor mode. Now that you mentioned it, I will try and see what happened.

I found the solution
To convert from dd/mm/yyyy to mmm dd, yyyy the auto-translation rule should be (\d\d)/(#month#)/(\d\d\d\d) and the replace order rule should be $2 $1, $3.

[Edited at 2015-08-04 02:54 GMT]

More notes:
- There is a different between 1 and 01. So in the above example if you want to translate 1 or 01 into January, You have to create 2 different list items in the Translation pairs. i.e. 1 - January and 01 - January. The same for other months.

- Different translation rules must be set to cover all possible of the date and time format as in my above example.
+ 05/01/1989 : (\d\d)/(#month#)/(\d\d\d\d)
+ 5/1/1989: (\d)/(#month#)/(\d\d\d\d)
+ 5/1/89: (\d)/(#month#)/(\d\d)

[Edited at 2015-08-04 03:29 GMT]


 

Manuel Arcedillo
Spain
Local time: 21:42
English to Spanish
If you need something simpler Aug 4, 2015

I'm glad you found a solution. If you want to use just one rule for all cases you mention and similar ones, this should work: (\d+)/(#month#)/(\d+)

 

Châu Nguyễn  Identity Verified
Vietnam
Local time: 02:42
Member (2012)
English to Vietnamese
+ ...
TOPIC STARTER
Thank you Aug 4, 2015

Manuel Arcedillo wrote:

I'm glad you found a solution. If you want to use just one rule for all cases you mention and similar ones, this should work: (\d+)/(#month#)/(\d+)


Thank you,

I didn't understand your suggestion at first. I've just read through the documentation and kinda understand it now.icon_biggrin.gif


 


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


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

MemoQ 2014 R2 auto-translation rules

Advanced search






WordFinder Unlimited
For clarity and excellence

WordFinder is the leading dictionary service that gives you the words you want anywhere, anytime. Access 260+ dictionaries from the world's leading dictionary publishers in virtually any device. Find the right word anywhere, anytime - online or offline.

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