librewolf/gentoo
15
36
Fork
You've already forked gentoo
7

WIP: www-client/librewolf: use LibreWolf's bundled languagepacks #74

Closed
doasu wants to merge 2 commits from doasu/www-client/firefox: use bundled languagepacks into master AGit
pull from: doasu/www-client/firefox: use bundled languagepacks
merge into: librewolf:master
librewolf:master
librewolf:upstream
Contributor
Copy link

The .xpi format is no longer supported.

PR for librewolf/issues#2961

(削除) Fixes: librewolf/issues#2961 (削除ここまで) (not yet)

The `.xpi` format is no longer supported. PR for librewolf/issues#2961 ~~Fixes: https://codeberg.org/librewolf/issues/issues/2961~~ (not yet)
doasu force-pushed doasu/www-client/firefox: use bundled languagepacks from 39033f9344 to 247cf2098e 2026年04月09日 13:09:10 +02:00 Compare
doasu changed title from (削除) www-client/librewolf: use LibreWolf's bundled languagepacks (削除ここまで) to WIP: www-client/librewolf: use LibreWolf's bundled languagepacks 2026年04月09日 13:10:44 +02:00
Author
Contributor
Copy link

Note

I likely won't have much time to test this this week, so I would appreciate any help!

> [!NOTE] > I likely won't have much time to test this this week, so I would appreciate any help!
Author
Contributor
Copy link

@any1here wrote in #73 (comment):

ac_add_options --with-l10n-base=$PWD/lw/l10n and that should be pretty much it.

As I mentioned in #73 (comment), adding this option does not fix the issue...

@any1here wrote in https://codeberg.org/librewolf/gentoo/pulls/73#issuecomment-12895401: > `ac_add_options --with-l10n-base=$PWD/lw/l10n` and that should be pretty much it. As I mentioned in https://codeberg.org/librewolf/gentoo/pulls/73#issuecomment-12898860, adding this option does not fix the issue...

@doasu wrote in #74 (comment):

@any1here wrote in #73 (comment):

ac_add_options --with-l10n-base=$PWD/lw/l10n and that should be pretty much it.

As I mentioned in #73 (comment), adding this option does not fix the issue...

Could you press Ctrl + Shift + J and see if anything gets logged maybe?

@doasu wrote in https://codeberg.org/librewolf/gentoo/pulls/74#issuecomment-12911808: > @any1here wrote in #73 (comment): > > > `ac_add_options --with-l10n-base=$PWD/lw/l10n` and that should be pretty much it. > > As I mentioned in #73 (comment), adding this option does not fix the issue... Could you press Ctrl + Shift + J and see if anything gets logged maybe?
doasu force-pushed doasu/www-client/firefox: use bundled languagepacks from 247cf2098e to 75c95a2e96 2026年04月09日 13:37:23 +02:00 Compare
doasu force-pushed doasu/www-client/firefox: use bundled languagepacks from 5c1b2021bb to 7f473ae416 2026年04月09日 13:39:14 +02:00 Compare
doasu force-pushed doasu/www-client/firefox: use bundled languagepacks from 7f473ae416 to 3a1bc63980 2026年04月09日 13:39:42 +02:00 Compare
@ -636,4 +615,0 @@
fi
done
}
Author
Contributor
Copy link

The override for src_unpack is no longer needed since the xpis have been removed.
The default implementation is to unpack all source files (literally, unpack ${A}), which works for us.

The override for `src_unpack` is no longer needed since the `xpi`s have been removed. The default implementation is to unpack all source files (literally, `unpack ${A}`), which works for us.
@ -57,4 +56,0 @@
if [[ ${PV} == *_rc* ]] ; then
MOZ_SRC_BASE_URI="https://archive.mozilla.org/pub/${MOZ_PN}/candidates/${MOZ_PV}-candidates/build${PV##*_rc}"
fi
Author
Contributor
Copy link

These were only used for fetching xpis for language packs. Dead code should be removed.

These were only used for fetching `xpi`s for language packs. Dead code should be removed.
doasu marked this conversation as resolved
@ -648,0 +628,4 @@
for languagepack in *; do
[[ -d "${languagepack}" ]] || continue # not a directory; skip
rm -rf "${languagepack}"
done
Author
Contributor
Copy link

I opted to remove all language packs which are not specified by the user's ${L10N} setting.

I opted to remove all language packs which are <u>not</u> specified by the user's `${L10N}` setting.
Author
Contributor
Copy link

@TheGreatMcPain do I understand correctly that L10N can map directly to LibreWolf's language codes?
They both seem to use IETF language tags1 2 .

@TheGreatMcPain do I understand correctly that `L10N` can map directly to LibreWolf's language codes? They both seem to use IETF language tags<sup>[1] [2]</sup>. [1]: https://www.w3.org/International/articles/language-tags/ [2]: https://wiki.gentoo.org/wiki/Localization/Guide#L10N
Author
Contributor
Copy link

@any1here wrote in #74 (comment):

Could you press Ctrl + Shift + J and see if anything gets logged maybe?

I don't see anything that would suggest missing language packs:

image

(The multi-process logger doesn't show any more info.)

@any1here wrote in https://codeberg.org/librewolf/gentoo/pulls/74#issuecomment-12911940: > Could you press Ctrl + Shift + J and see if anything gets logged maybe? I don't see anything that would suggest missing language packs: ![image](/attachments/13a15af6-8c22-45c7-85ea-1901a068ab90) *(The multi-process logger doesn't show any more info.)*
128 KiB

@doasu wrote in #74 (comment):

@any1here wrote in #74 (comment):

Could you press Ctrl + Shift + J and see if anything gets logged maybe?

I don't see anything that would suggest missing language packs:

image

(The multi-process logger doesn't show any more info.)

So you currently only have the English locale available?

@doasu wrote in https://codeberg.org/librewolf/gentoo/pulls/74#issuecomment-13009854: > @any1here wrote in #74 (comment): > > > Could you press Ctrl + Shift + J and see if anything gets logged maybe? > > I don't see anything that would suggest missing language packs: > > [![image](/attachments/13a15af6-8c22-45c7-85ea-1901a068ab90)](/librewolf/gentoo/attachments/13a15af6-8c22-45c7-85ea-1901a068ab90) > > _(The multi-process logger doesn't show any more info.)_ So you currently only have the English locale available?
Author
Contributor
Copy link

@any1here wrote in #74 (comment):

So you currently only have the English locale available?

Precisely! It's "English (US)."

@any1here wrote in https://codeberg.org/librewolf/gentoo/pulls/74#issuecomment-13024506: > So you currently only have the English locale available? Precisely! It's "English (US)."

@doasu wrote in #74 (comment):

@any1here wrote in #74 (comment):

So you currently only have the English locale available?

Precisely! It's "English (US)."

But the english locale has the correct strings?

@doasu wrote in https://codeberg.org/librewolf/gentoo/pulls/74#issuecomment-13037310: > @any1here wrote in #74 (comment): > > > So you currently only have the English locale available? > > Precisely! It's "English (US)." But the english locale has the correct strings?
Author
Contributor
Copy link

@any1here wrote in #74 (comment):

But the english locale has the correct strings?

If you mean LibreWolf strings showing correctly (branding, etc.), then aye, it does.

@any1here wrote in https://codeberg.org/librewolf/gentoo/pulls/74#issuecomment-13039065: > But the english locale has the correct strings? If you mean LibreWolf strings showing correctly (branding, etc.), then aye, it does.
Author
Contributor
Copy link

I was expecting the language packs from /lw/l10n to show up in the LibreWolf Language settings drop-down list, but they don't. 😕

image

I was expecting the language packs from `/lw/l10n` to show up in the LibreWolf Language settings drop-down list, but they don't. 😕 ![image](/attachments/df50d148-bd6d-43a4-a49b-f8f45dc49784)

@doasu wrote in #74 (comment):

@any1here wrote in #74 (comment):

But the english locale has the correct strings?

If you mean LibreWolf strings showing correctly (branding, etc.), then aye, it does.

Did you add additional languages to use to L10N?

@doasu wrote in https://codeberg.org/librewolf/gentoo/pulls/74#issuecomment-13039461: > @any1here wrote in #74 (comment): > > > But the english locale has the correct strings? > > If you mean LibreWolf strings showing correctly (branding, etc.), then aye, it does. Did you add additional languages to use to L10N?
Author
Contributor
Copy link

@any1here wrote in #74 (comment):

Did you add additional languages to use to L10N?

Yes. Here's my L10N USE:

% rg 'l10n' <(tr ' ' '\n' </var/db/pkg/www-client/librewolf-149.0.2_p1/USE)
12:l10n_en-GB
13:l10n_pl

For context, my lw/l10n directory had the following files at the time of building:

% ls -F /var/tmp/portage/www-client/librewolf-149.0.2_p1/work/librewolf-149.0.2-1/lw/l10n
en-GB/ LICENSE pl/ README.md

List of files merged/provided with package: /var/db/pkg/www-client/librewolf-149.0.2_p1/CONTENTS

@any1here wrote in https://codeberg.org/librewolf/gentoo/pulls/74#issuecomment-13041216: > Did you add additional languages to use to L10N? Yes. Here's my L10N USE: ```console % rg 'l10n' <(tr ' ' '\n' </var/db/pkg/www-client/librewolf-149.0.2_p1/USE) 12:l10n_en-GB 13:l10n_pl ``` For context, my `lw/l10n` directory had the following files at the time of building: ```console % ls -F /var/tmp/portage/www-client/librewolf-149.0.2_p1/work/librewolf-149.0.2-1/lw/l10n en-GB/ LICENSE pl/ README.md ``` List of files merged/provided with package: [/var/db/pkg/www-client/librewolf-149.0.2_p1/CONTENTS](/attachments/0b55bd39-8de0-4ff9-9c14-bf246dd378b4)

I'm a little over my head on this issue. I usually just copy what Gentoo's www-client/firefox is doing.

I have only just looked into this, but it looks like the langpacks for www-client/firefox got put into it's own ebuild as www-client/firefox-l10n. I figured we should just copy www-client/firefox-l10n and adapt it to use librewolf's sources.

Sorry I've been neglecting this overlay. Some life stuff was going on.

I'm a little over my head on this issue. I usually just copy what Gentoo's `www-client/firefox` is doing. I have only just looked into this, but it looks like the langpacks for `www-client/firefox` got put into it's own ebuild as `www-client/firefox-l10n`. I figured we should just copy `www-client/firefox-l10n` and adapt it to use librewolf's sources. Sorry I've been neglecting this overlay. Some life stuff was going on.

Looks like www-client/firefox-l10n still just downloads xpi files.

I am gonna try providing the language packs somewhere.

Looks like `www-client/firefox-l10n` still just downloads xpi files. I am gonna try providing the language packs somewhere.

I managed to setup a Gitlab CI in this repository that provides the language pack .xpi files in its package registry.

From here it shouldn't be too hard to modify www-client/firefox-l10n for librewolf.

I managed to setup a Gitlab CI in [this repository](https://gitlab.com/TheGreatMcPain/librewolf-language-packs) that provides the language pack `.xpi` files in its package registry. From here it shouldn't be too hard to modify `www-client/firefox-l10n` for librewolf.

I can manually install the language packs if I revert this commit and change extensions.langpacks.signatures.required to false.

Haven't been able to get them working via www-client/librewolf-l10n, which I've recently added, even with the changes mentioned above. Maybe I also need to revert this one too?

I can manually install the language packs if I revert [this commit](https://codeberg.org/librewolf/settings/commit/dc9e55e80f512d08525cc97b8dafc818c565e773) and change `extensions.langpacks.signatures.required` to `false`. Haven't been able to get them working via `www-client/librewolf-l10n`, which I've recently added, even with the changes mentioned above. Maybe I also need to revert [this one too?](https://codeberg.org/librewolf/source/commit/db5eedbce48ff72f0524ebad9a066e1fc730c4cc)

@TheGreatMcPain wrote in #74 (comment):

I can manually install the language packs if I revert this commit and change extensions.langpacks.signatures.required to false.

Haven't been able to get them working via www-client/librewolf-l10n, which I've recently added, even with the changes mentioned above. Maybe I also need to revert this one too?

I wouldn't recommend adding back the ability to install external language packs, since this would allow users to break their installation again.

What prevents using the already patched language packs the source tarball has? Is it because you want to not ship all the language packs?

@TheGreatMcPain wrote in https://codeberg.org/librewolf/gentoo/pulls/74#issuecomment-13300935: > I can manually install the language packs if I revert [this commit](https://codeberg.org/librewolf/settings/commit/dc9e55e80f512d08525cc97b8dafc818c565e773) and change `extensions.langpacks.signatures.required` to `false`. > > Haven't been able to get them working via `www-client/librewolf-l10n`, which I've recently added, even with the changes mentioned above. Maybe I also need to revert [this one too?](https://codeberg.org/librewolf/source/commit/db5eedbce48ff72f0524ebad9a066e1fc730c4cc) I wouldn't recommend adding back the ability to install external language packs, since this would allow users to break their installation again. What prevents using the already patched language packs the source tarball has? Is it because you want to not ship all the language packs?

My original idea was to get as close to what Gentoo's Firefox ebuild is doing, so that maintaining the LibreWolf ebuild was as easy as changing a few lines from the Firefox ebuild, but I see I went a little overboard.

I think I can get it working via ./mach package-multi-locale.

What prevents using the already patched language packs the source tarball has? Is it because you want to not ship all the language packs?

Gentoo's Firefox ebuild allows the user to select what languages they want via Gentoo's L10N useflag. The way the Firefox ebuild does it is through Firefox's language packs.

My original idea was to get as close to what Gentoo's Firefox ebuild is doing, so that maintaining the LibreWolf ebuild was as easy as changing a few lines from the Firefox ebuild, but I see I went a little overboard. I think I can get it working via `./mach package-multi-locale`. > What prevents using the already patched language packs the source tarball has? Is it because you want to not ship all the language packs? Gentoo's Firefox ebuild allows the user to select what languages they want via [Gentoo's `L10N` useflag](https://wiki.gentoo.org/wiki/Localization#Package_manager). The way the Firefox ebuild does it is through Firefox's language packs.

This is what I've come up with.

--- librewolf-149.0.2_p2-r1.ebuild	2026年04月20日 02:58:30.610680154 -0500
+++ librewolf-149.0.2_p2-r2.ebuild	2026年04月20日 03:01:14.024852970 -0500
@@ -219,6 +219,44 @@
 	einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2
 }
 
+MOZ_LANGS=(
+	ace ach af ak an ar as ast az be bg bn bn-BD bn-IN bo bqi br brx bs ca cak ca-valencia
+	ckb crh cs csb cy da de dsb el en-CA en-GB en-ZA eo es es-AR es-CL es-ES es-MX et eu fa
+	ff fi fr frp fur fy-NL ga ga-IE gd gl gn gu-IN gv he hi-IN hr hsb hto hu hy-AM hye ia id
+	ilo is it ixl ja ja-JP-mac ka kab kk km kmr kn ko kok ks ku kw lb lg lij lo lt ltg lv mai
+	meh mix mk ml mn mr ms my nb-NO ne-NP nl nn-NO nr nso ny oc or pai pa-IN pbb pl ppl pt-BR
+	pt-PT quy qvi rm ro ru rw sah sat sc scn sco si sk skr sl son sq sr ss st sv-SE sw szl ta
+	ta-LK te tg th tl tn tr trs ts tsz uk ur uz ve vi wo xcl xh zam zh-CN zh-TW zu
+)
+MOZ_LANG_MAP=()
+
+mozilla_set_globals() {
+	# https://bugs.gentoo.org/587334
+	local MOZ_TOO_REGIONALIZED_FOR_L10N=(
+		fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO ne-NP nn-NO pa-IN sv-SE
+	)
+
+	local lang xflag
+	for lang in "${MOZ_LANGS[@]}" ; do
+		# en and en_US are handled internally
+		if [[ ${lang} == en ]] || [[ ${lang} == en-US ]] ; then
+			continue
+		fi
+
+		# strip region subtag if $lang is in the list
+		if has ${lang} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then
+			xflag=${lang%%-*}
+		else
+			xflag=${lang}
+		fi
+
+		MOZ_LANG_MAP+=("l10n_${xflag/[_@]/-} ${lang}")
+
+		IUSE+=" l10n_${xflag/[_@]/-}"
+	done
+}
+mozilla_set_globals
+
 moz_clear_vendor_checksums() {
 	debug-print-function ${FUNCNAME} "$@"
 
@@ -1168,7 +1206,21 @@
 		"${BUILD_DIR}"/dist/bin/${PN} \
 		"${BUILD_DIR}"/dist/bin/plugin-container
 
-	DESTDIR="${D}" ./mach install || die
+	#DESTDIR="${D}" ./mach install || die
+	# ./mach install doesn't install the locale information for some reason.
+	# Use packge-multi-locale instead
+	local mymozlangs=()
+	for lang_tuple in "${MOZ_LANG_MAP[@]}"; do
+		IFS=' ' read -r l10n lang <<< "${lang_tuple}"
+
+		if use "${l10n}"; then
+			mymozlangs+=("${lang}")
+		fi
+	done
+	./mach package-multi-locale --locale "${mymozlangs[@]}" || die
+
+	dodir "${MOZILLA_FIVE_HOME}" || die
+	cp -r "${BUILD_DIR}"/dist/librewolf/* "${ED}"/"${MOZILLA_FIVE_HOME}" || die
 
 	## LibreWolf
 	# For some reason 'local-settings.js' doesn't get properly packaged.

It seems to be working on my end, but I've attached the new ebuild so that you can test it yourself before I go ahead and commit it.

This is what I've come up with. ``` --- librewolf-149.0.2_p2-r1.ebuild 2026年04月20日 02:58:30.610680154 -0500 +++ librewolf-149.0.2_p2-r2.ebuild 2026年04月20日 03:01:14.024852970 -0500 @@ -219,6 +219,44 @@ einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2 } +MOZ_LANGS=( + ace ach af ak an ar as ast az be bg bn bn-BD bn-IN bo bqi br brx bs ca cak ca-valencia + ckb crh cs csb cy da de dsb el en-CA en-GB en-ZA eo es es-AR es-CL es-ES es-MX et eu fa + ff fi fr frp fur fy-NL ga ga-IE gd gl gn gu-IN gv he hi-IN hr hsb hto hu hy-AM hye ia id + ilo is it ixl ja ja-JP-mac ka kab kk km kmr kn ko kok ks ku kw lb lg lij lo lt ltg lv mai + meh mix mk ml mn mr ms my nb-NO ne-NP nl nn-NO nr nso ny oc or pai pa-IN pbb pl ppl pt-BR + pt-PT quy qvi rm ro ru rw sah sat sc scn sco si sk skr sl son sq sr ss st sv-SE sw szl ta + ta-LK te tg th tl tn tr trs ts tsz uk ur uz ve vi wo xcl xh zam zh-CN zh-TW zu +) +MOZ_LANG_MAP=() + +mozilla_set_globals() { + # https://bugs.gentoo.org/587334 + local MOZ_TOO_REGIONALIZED_FOR_L10N=( + fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO ne-NP nn-NO pa-IN sv-SE + ) + + local lang xflag + for lang in "${MOZ_LANGS[@]}" ; do + # en and en_US are handled internally + if [[ ${lang} == en ]] || [[ ${lang} == en-US ]] ; then + continue + fi + + # strip region subtag if $lang is in the list + if has ${lang} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then + xflag=${lang%%-*} + else + xflag=${lang} + fi + + MOZ_LANG_MAP+=("l10n_${xflag/[_@]/-} ${lang}") + + IUSE+=" l10n_${xflag/[_@]/-}" + done +} +mozilla_set_globals + moz_clear_vendor_checksums() { debug-print-function ${FUNCNAME} "$@" @@ -1168,7 +1206,21 @@ "${BUILD_DIR}"/dist/bin/${PN} \ "${BUILD_DIR}"/dist/bin/plugin-container - DESTDIR="${D}" ./mach install || die + #DESTDIR="${D}" ./mach install || die + # ./mach install doesn't install the locale information for some reason. + # Use packge-multi-locale instead + local mymozlangs=() + for lang_tuple in "${MOZ_LANG_MAP[@]}"; do + IFS=' ' read -r l10n lang <<< "${lang_tuple}" + + if use "${l10n}"; then + mymozlangs+=("${lang}") + fi + done + ./mach package-multi-locale --locale "${mymozlangs[@]}" || die + + dodir "${MOZILLA_FIVE_HOME}" || die + cp -r "${BUILD_DIR}"/dist/librewolf/* "${ED}"/"${MOZILLA_FIVE_HOME}" || die ## LibreWolf # For some reason 'local-settings.js' doesn't get properly packaged. ``` It seems to be working on my end, but I've attached the new ebuild so that you can test it yourself before I go ahead and commit it.
Author
Contributor
Copy link

I'll try it out and let you know if it works on my machine :>

I'll try it out and let you know if it works on my machine :>
Author
Contributor
Copy link

@TheGreatMcPain: It works!
image

@TheGreatMcPain: It works! ![image](/attachments/3f78f5f1-da44-402b-b0a7-538d4ce2e9ce)
Author
Contributor
Copy link

Superseded-by: e0706977f4

Superseded-by: e0706977f41b60b8a55204483ed08520efe71b26
doasu closed this pull request 2026年04月21日 13:31:16 +02:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
librewolf/gentoo!74
Reference in a new issue
librewolf/gentoo
No description provided.
Delete branch "doasu/www-client/firefox: use bundled languagepacks"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?