limit the number of languages activated by default #1053

Closed
opened 2026-10-05 00:29:47 +02:00 by adam · 1 comment
Owner

Currently (version 2.10) Piwigo activates all languages it finds in the language folder. With many years of adding new languages, the result is now a list of 70 languages. It's far too many and not very relevant.

In addition to the language chosen for installation, I would like Piwigo to only activate the top 10 languages used by its community. To find them, I have extracted the number of unique IP addresses on each language that perform an HTTP request like this one:

20200801_access.log:piwigo.org:- IP.ADD.RES.S - - [01/Aug/2020:00:00:09 +0200] 200 "POST /ext/api/get_revision_list.php?format=php&last_revision_only=true&version=80&lang=en&get_nb_downloads=true HTTP/1.0" 317552 "-" "Piwigo" "-/-"

Here the language is en for English

# grep 'api' 202008*_access.log |grep lang | perl -ne 'm/51.38.(\d+)\.(\d+):([^\s]+) .*lang=(\w+)/; print "$1 $2\n";' | sort | uniq| awk '{print $2}' | sort | uniq -c | sort -rn | head -10
   2688 en
   1490 de
    944 fr
    452 zh
    216 pl
    213 es
    206 nl
    150 it
    118 ru
    118 cs

English (which one, we have 3), Deutsch, French, Chinese (we have 3), Polish, Spanish, Dutch, Italian, Russian and Czech.

Currently (version 2.10) Piwigo activates all languages it finds in the language folder. With many years of adding new languages, the result is now a list of 70 languages. It's far too many and not very relevant. In addition to the language chosen for installation, I would like Piwigo to only activate the top 10 languages used by its community. To find them, I have extracted the number of unique IP addresses on each language that perform an HTTP request like this one: ``` 20200801_access.log:piwigo.org:- IP.ADD.RES.S - - [01/Aug/2020:00:00:09 +0200] 200 "POST /ext/api/get_revision_list.php?format=php&last_revision_only=true&version=80&lang=en&get_nb_downloads=true HTTP/1.0" 317552 "-" "Piwigo" "-/-" ``` Here the language is `en` for English ``` # grep 'api' 202008*_access.log |grep lang | perl -ne 'm/51.38.(\d+)\.(\d+):([^\s]+) .*lang=(\w+)/; print "$1 $2\n";' | sort | uniq| awk '{print $2}' | sort | uniq -c | sort -rn | head -10 2688 en 1490 de 944 fr 452 zh 216 pl 213 es 206 nl 150 it 118 ru 118 cs ``` English (which one, we have 3), Deutsch, French, Chinese (we have 3), Polish, Spanish, Dutch, Italian, Russian and Czech. <!-- github-sync-id:684161553 -->
adam closed this issue 2026-10-05 00:29:47 +02:00
Author
Owner

After discussion with @ddtddt there is no obvious reason to activate 10 languages. Let's activate only the installation language.

What's more important is to detect browser language to automatically load the installation form with this language, which should already be the case.

After discussion with @ddtddt there is no obvious reason to activate 10 languages. Let's activate only the installation language. What's more important is to detect browser language to automatically load the installation form with this language, which should already be the case. <!-- github-comment-id:686320031 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1053