[RESOLVED] firefox-multi package - Language pack not downloading

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
lfkl
Messages: 23
Registration: Apr 11, 2019 - 05:51

November 12, 2024 - 7:59 AM

Good morning,

Since version 130+ of the "firefox-multi" package, language packs no longer download (no problem with dictionaries).
It is my understanding that we simply need to add the language pack titles in red below in setup.py, is that correct or is there another step to take?
By default, I only have the English version (which is normal according to the documentation), and I have to go into the browser options to manually download the language of my choice. According to the basic script, I should at least have French, German, and Italian, in addition to the ones in red that I added (Arabic and Chinese).
I just performed this test with the firefox-multi 132.0.1 version directly downloaded from the Wapt store.

list_pre_installed_lang = ["fr", "en-GB", "es-ES", "de", "it", "zh-CN", "zh-TW", "ar"] # Reminder: 'en-US' will be native

Code: Select all

dist_dir = "distribution"
dist_path = makepath(programfiles, "Mozilla Firefox", dist_dir)
ext_dir = "extensions"
ext_path = makepath(dist_path, ext_dir)
policies_file = "policies.json"
policies_path = makepath(dist_path, policies_file)
list_pre_installed_lang = ["fr", "en-GB", "es-ES", "de", "it", "zh-CN", "zh-TW", "ar"  # Reminder: 'en-US' will be native
Thank you for your help, best regards,
Ramses

Wapt Enterprise 2.5.5.15697
Debian 11
W10 Education administration OS
fschelfaut
Messages: 30
Registration: Nov 7, 2024 - 12:22

November 12, 2024 - 3:01 PM

Hello,

Thank you for your feedback. I've fixed the update package, which was indeed no longer working.
I've also modified and segmented the update package code to make it more readable.

The new version will be available on the store soon. In the meantime, you can download the PREPROD build here.

Flavien,
lfkl
Messages: 23
Registration: Apr 11, 2019 - 05:51

November 13, 2024 - 2:30 AM

Hi Flavien,

Thank you for this version, which I've tested and which fixes part of the problem.
The language packs download and install correctly. They are also visible in Firefox.

However, the ones I added to setup.py still won't download or install:
list_pre_installed_lang = ["fr", "en-GB", "es-ES", "de", "it", "zh-CN", "zh-TW", "ar"] # Reminder: 'en-US' will be native.

The code seems correct to me: https://github.com/mozilla-l10n/firefox ... index.html

In the end, I added the following entries to the "policies.json" file:
},
"langpack-zh-CN@firefox.mozilla.org": {
"install_url": "file://C:\\Program Files\\Mozilla Firefox\\distribution\\extensions\\zh-CN_language_pack.xpi",
"installation_mode": "force_installed"
},
"langpack-zh-TW@firefox.mozilla.org": {
"install_url": "file://C:\\Program Files\\Mozilla Firefox\\distribution\\extensions\\zh-TW_language_pack.xpi",
"installation_mode": "force_installed"
},

And it seems to install. So, is it necessary to add its values ​​to the "policies.json" file?
However, the .XPI files don't appear in the "extensions" folder... To
be honest, I don't quite understand the general mechanism; I naively thought I just had to add its values ​​to setup.py. What am I missing?
We have many different nationalities here, and I need to be able to add languages ​​to Firefox on a regular basis.

Thank you for your help, sincerely,
Ramses
Attachments
extensions.PNG
extensions.PNG (6.71 KB) Viewed 4060 times
fschelfaut
Messages: 30
Registration: Nov 7, 2024 - 12:22

November 13, 2024 - 2:58 PM

Good morning,

I made changes to the code to fix some problems:
- some languages ​​did not have dictionaries, which led to inadequate functioning.
- I also took the opportunity to optimize certain parts of the code.

The new version of the package is available in PREPROD here.

If you want to add other languages ​​to the package, you just need to edit the files update_package.py And setup.py.
Add the desired languages ​​to the variable list_pre_installed_lang.
For example :

Code: Select all

list_pre_installed_lang = ["fr", "en-GB", "es-ES", "de", "it", "zh-CN", "zh-TW", "ar"]  # Remarque : 'en-US' est intégré par défaut
The variable was correct, but you had only added it in setup.py.

Once the changes have been made, launch the function update_package of the package, which will automatically download language packs and dictionaries for the languages ​​present in list_pre_installed_lang.

You don't need to modify the file policies.json Everything has to happen by itself!

Here is the result of my execution of theupdate_package with the languages ​​you specified:

Code: Select all

Download URL is: https://download-installer.cdn.mozilla.net/pub/firefox/releases/132.0.2/win64/en-US/Firefox%20Setup%20132.0.2.exe
Binary is present: Firefox_Setup_132.0.2.exe
Software version up-to-date (132.0.2)

### DOWNLOADING LANGUAGE PACK ###

API used for language packs is: https://services.addons.mozilla.org/api/v3/addons/language-tools/?app=firefox&type=language
Download URL for language pack in fr is: https://addons.mozilla.org/firefox/downloads/file/4385720/francais_language_pack-132.0.20241110.231641.xpi
Download URL for language pack in en-GB is: https://addons.mozilla.org/firefox/downloads/file/4385786/english_gb_language_pack-132.0.20241110.231641.xpi
Download URL for language pack in es-ES is: https://addons.mozilla.org/firefox/downloads/file/4385794/espanol_espana_language_pac-132.0.20241110.231641.xpi
Download URL for language pack in de is: https://addons.mozilla.org/firefox/downloads/file/4385723/deutsch_de_language_pack-132.0.20241110.231641.xpi
Download URL for language pack in it is: https://addons.mozilla.org/firefox/downloads/file/4385764/italiano_it_language_pack-132.0.20241110.231641.xpi
Download URL for language pack in zh-CN is: https://addons.mozilla.org/firefox/downloads/file/4385781/chinese_simplified_zh_cn_la-132.0.20241110.231641.xpi
Download URL for language pack in zh-TW is: https://addons.mozilla.org/firefox/downloads/file/4385779/traditional_chinese_zh_tw_l-132.0.20241110.231641.xpi
Download URL for language pack in ar is: https://addons.mozilla.org/firefox/downloads/file/4385747/language_pack-132.0.20241110.231641.xpi

### DOWNLOADING DICTIONNARY ###

API used for language dictionaries is: https://services.addons.mozilla.org/api/v3/addons/language-tools/?app=firefox&type=dictionary
Download URL for dictionary in fr is: https://addons.mozilla.org/firefox/downloads/latest/dictionnaire-français1/latest.xpi
Download URL for dictionary in en-GB is: https://addons.mozilla.org/firefox/downloads/latest/british-english-dictionary-2/latest.xpi
Download URL for dictionary in es-ES is: https://addons.mozilla.org/firefox/downloads/latest/diccionario-de-español-españa/latest.xpi
Download URL for dictionary in de-DE is: https://addons.mozilla.org/firefox/downloads/latest/dictionary-german/latest.xpi
Download URL for dictionary in it is: https://addons.mozilla.org/firefox/downloads/latest/dizionario-italiano/latest.xpi
No dictionary found for language: zh-CN
No dictionary found for language: zh-TW
Download URL for dictionary in ar is: https://addons.mozilla.org/firefox/downloads/latest/arabic-spell-checking-dictiona/latest.xpi
Creating policies.json file for language packs, dictionaries, extensions, and configuration
As you can see, there are no dictionaries for languages zh-CN And zh-TW.

Flavien,
lfkl
Messages: 23
Registration: Apr 11, 2019 - 05:51

November 14, 2024 - 01:13

Hello Fabien,

Thank you so much for your quick response and hard work.
Everything is working, and thanks to your explanations, I understand how to add languages ​​to this package.

Have a good day,
Ramses
Locked