Auto-translation rules: How do I convert DD.MM.YYYY to MM/DD/YYYY
Thread poster: Marcel Machalski
Marcel Machalski
Marcel Machalski  Identity Verified
Germany
Local time: 06:52
Member (2022)
English to German
+ ...
May 24, 2023

Hi everyone,

I would like to convert dates from DD.MM.YYYY to MM/DD/YYYY using "Auto-translation rules". Example: 26.09.2018 becomes 09/26/2018. Any ideas on how to use Regex for this purpose?

Best regards,

Marcel


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 07:52
English to Russian
Regex May 25, 2023

Find what: (\d{1,2})\.(\d{1,2})\.(\d{2}\b|\d{4})
Replace with: $2/$1/$3

This regex captures different formats like these:
6.10.2022
06.10.2022
6.1.2022
6.10.22
06.10.22

If you always have the same date format DD.MM.YYYY only, you can use the below regex:
Find what: (\d{2})\.(\d{2})\.(\d{4})
Replace with: $2/$1/$3<
... See more
Find what: (\d{1,2})\.(\d{1,2})\.(\d{2}\b|\d{4})
Replace with: $2/$1/$3

This regex captures different formats like these:
6.10.2022
06.10.2022
6.1.2022
6.10.22
06.10.22

If you always have the same date format DD.MM.YYYY only, you can use the below regex:
Find what: (\d{2})\.(\d{2})\.(\d{4})
Replace with: $2/$1/$3


*First you type the left-side regex, then click Add. Then you type the right-side regex and click Add again for both regular expressions to get stored in the AT rule.

[Edited at 2023-05-25 01:33 GMT]
Collapse


Hans Lenting
Richard Varga
Grigori Gazarian
 
Marcel Machalski
Marcel Machalski  Identity Verified
Germany
Local time: 06:52
Member (2022)
English to German
+ ...
TOPIC STARTER
Wow! May 25, 2023

Hi Stepan,

Works like a charm, thank you! Your valuable post is very appreciated. However, translation results from DeepL (right column) are still not being auto-translated after confirmation. But no worries, maybe it's just another limitation of MemoQ.

Many thanks again,

Marcel


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 07:52
English to Russian
DeepL only provides target which is out of the auto-translate scope May 25, 2023

Marcel Machalski wrote:
translation results from DeepL (right column) are still not being auto-translated after confirmation
The AT rules engine only searches the source segments and allows you to transfer the conversion output into target regardless of confirmation. If you want to autoreplace dates in target, you should use Ctrl+H (Find and replace) instead of AT rules.


 


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


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

Auto-translation rules: How do I convert DD.MM.YYYY to MM/DD/YYYY






Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

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 »