contain match and date tokens in another language

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hi,

I'm trying to have Hazel recognize dates in another language than the default system locale. My system is set to French, but i want to act on documents written in English, German etc.

when creating a rule with "Contents contain match" and "Custom date", then "Edit token…" i can choose the full name or abbreviation of the month name, but only in the default system language. This does not match month names in other languages.

Is there a way to achieve this ?

Thanks for your answer and great work.

-Guillaume
guillaume kuster
 
Posts: 7
Joined: Thu May 17, 2012 1:37 am

In your language settings in System Preferences, add the other languages to the list. Hazel should then match dates in the languages listed there.
Mr_Noodle
Site Admin
 
Posts: 11875
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

It is not working on El Capitan on my side but used to work on Yosemite.

Or do I miss something but in my system language prefs are english and on the second place german but I am not able to get a german month name
sebastianf
 
Posts: 4
Joined: Fri Oct 16, 2015 3:37 pm

Is it failing on all German month names or just a particular one? Are you trying to match the full name or an abbreviated version?
Mr_Noodle
Site Admin
 
Posts: 11875
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I only see the english month names.
no Gemran, although I have english (first) and german (second) in the preferred languages settings

I want to set the full month name as a tag
sebastianf
 
Posts: 4
Joined: Fri Oct 16, 2015 3:37 pm

Are you trying to match against a German month or format a date to use a German month? If the latter, it will only output months using the first language in the list.
Mr_Noodle
Site Admin
 
Posts: 11875
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I created a "Dynamic Tag" >"date created">month as a word

But I found the solution.
Not "Preferred Languages" needs to be set to German, but the Format Language in Language & Region > Advanced > General in the OS X Settings
sebastianf
 
Posts: 4
Joined: Fri Oct 16, 2015 3:37 pm

Hazel can't seem to match a date in Spanish correctly

The date pattern is Dic/17/2021 but it's interpreted as 17/02/2021. I presume the Feb assumption is because it can't match the month and I am running the script in February.

I have setup Spanish as the second language in my Mac.
awaldraff
 
Posts: 33
Joined: Fri Sep 23, 2016 3:47 pm

Are you using automatic date detection? If so, it might not recognize the format when you have a month followed by a slash, which does look weird to me. I suggest specifying a pattern manually.
Mr_Noodle
Site Admin
 
Posts: 11875
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Are you using automatic date detection? If so, it might not recognize the format when you have a month followed by a slash, which does look weird to me. I suggest specifying a pattern manually.


I am specifying the pattern manually. But it does replace the unrecognized month (written in Spanish) with the current month
awaldraff
 
Posts: 33
Joined: Fri Sep 23, 2016 3:47 pm

Can you export your rule and send that in to support along with an example file demonstrating this?
Mr_Noodle
Site Admin
 
Posts: 11875
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Since 5.1.1 automatic date detection is not working for me either.
A lot of my documents are in German and my system language is English.

This has been happening since about 6 months. Simple and clear dates like 31.12.2021 are simply not matching. But if I search for that format it is matched. Also dates like 31. Dezember 2021.


Really painful since this is the single most useful feature of Hazel and without it it's not possible to manually configure this for all the possible rules. It used to read all date formats in all languages, text and written dates.

Please fix it.
domhnallw
 
Posts: 1
Joined: Tue Mar 22, 2022 11:37 am

Can you email in specific examples? Also, note that this functionality is actually Apple's data detectors (which is used in places like Mail). I don't really have control over the algorithm for that so my options are limited short of re-implementing the whole thing myself.
Mr_Noodle
Site Admin
 
Posts: 11875
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support