Page 1 of 1

Matching months as words in foreign languages

PostPosted: Sun Jun 19, 2016 2:29 pm
by hepabolu
Because it took me some time digging through this forum, I thought I'd share the knowledge here. This applies to Hazel 4.0.2, but probably also to version 3.x.
Just to be complete: this is tested on El Capitan, 10.11.5.

I prefer to have my operating system in English, while my native language is Dutch. So I process a lot of Dutch documents with Dutch dates.

Problem 1: you want to match a date in a file where the month is written in words AND is in a different language than English. E.g.

EN: 12 March 2016
NL: 12 maart 2016

You can still match the date with a Custom Date variable where you choose the month name written in full in English (December). So in this case you would match with [day: 2 positions] [month: December] [year: 4 digits]

To allow Hazel to match the Dutch version, you need to add Dutch as a preferred language in System Preferences > Language & Region > Preferred Languages.

You can then use the date variable in e.g. the name of the file in any pattern you'd like.

Problem 2: you matched a date in a file and want to use it with the month in letters in a different language than English. E.g. you want to match 2016-03-05 and use it as 2016-maa-05 (in Dutch).

To allow Hazel to use the Dutch version of the month names, you need to set Dutch as the format language in System Preferences > Language & Region > Advanced > General > Format language.

Re: Matching months as words in foreign languages

PostPosted: Wed Jan 22, 2020 3:22 pm
by Dave61
Many thanks, just had to solve exactly this problem. Your post saved me a lot of time and grief.