Page 1 of 1

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

Published: November 12, 2024 - 7:59 AM
by lfkl
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

Re: firefox-multi package - Language pack not downloading

Published: November 12, 2024 - 3:01 PM
by fschelfaut
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,

Re: firefox-multi package - Language pack not downloading

Published: November 13, 2024 - 2:30 AM
by lfkl
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

Re: firefox-multi package - Language pack not downloading

Published: November 13, 2024 - 2:58 PM
by fschelfaut
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,

[SOLVED] Re: firefox-multi package - Language pack not downloading

Published: November 14, 2024 - 01:13
by lfkl
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