Announcement

#1 2022-12-06 14:26:45

oliver_piwigo
Member
2022-09-08
16

Replace german umlauts

Hello,

can I automatically replace umlauts in search queries.

For example.

My tag in the images is "Haeuser".
But user searches for "Häuser"
I want to replace: ä -> ae

Can I do something like this via the local file editor?

Thank you
Oliver

Last edited by oliver_piwigo (2022-12-06 15:27:59)

Offline

 

#2 2022-12-06 16:17:58

slim
Member
2016-03-09
27

Re: Replace german umlauts

Hello,

try this with the LocalFilesEditor.

Code:

$conf['sync_chars_regex'] = '/^[ äÄöÖüÜa-zA-Z0-9-_.,\'"^&+° #!?@$]+$/';

Slim

Offline

 

#3 2022-12-06 16:34:01

oliver_piwigo
Member
2022-09-08
16

Re: Replace german umlauts

Thank you for the answer.

But this does not yet show the desired effect.

My IPTC entry has "ae" in the word. However, the user writes the word with "ä" in the search window.

Can I say exactly "ä" = "ae"?

Kind regards
Oliver

Offline

 

#4 2022-12-06 16:40:55

TOnin
Member
1970-01-01
106

Re: Replace german umlauts

I think sync_chars_regex is to filter files and directories names.

I wonder if a good data base encoding could help solve this problem. Looks like it may be possible:
https://mariadb.com/kb/en/setting-chara … lations/#n
Can Piwigo rely on it?

Offline

 

#5 2022-12-06 17:45:22

TOnin
Member
1970-01-01
106

Re: Replace german umlauts

My database encoding is utf8_general_ci

Code:

SELECT 'Mueller' = 'Müller' ; // returns 0
SELECT 'Mueller' = 'Müller' COLLATE 'utf8mb4_german2_ci' ; // returns 1

Here, there is a (french) utf8 IPTC tag in some pictures: œuf.
When œuf is searched in Piwigo (12.3) nothing is returned. When oeuf is searched, every œuf pictures are listed. Actually, piwigo tag is oeuf.
So somehow a tag translation has been made somewhere during importation (synchronization).

In your case, if it behaves like mine, even with IPTC tag Häuser in pictures, visitors would need to search haeuser to get the pictures list.

So I join you in a call for an improvement in search page behaviour. If this is confirmed, it would be worth checking this issue is on piwigo github.

Offline

 

#6 2022-12-07 11:11:58

oliver_piwigo
Member
2022-09-08
16

Re: Replace german umlauts

Yes, there is still potential in the search.

There is the plug-in "RV Autocomplete". Here you can define variants for search words. This is going in the right direction. However, it only works for the quick search.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact