# Copyright 1999-2022 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 URELEASE="jammy" inherit ubuntu-versionator UURL="http://archive.ubuntu.com/ubuntu/pool/main/l" DESCRIPTION="Language translations pack for Unity desktop" HOMEPAGE="https://translations.launchpad.net/ubuntu" SRC_URI="" LICENSE="GPL-3" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" RESTRICT="mirror" DEPEND="sys-devel/gettext !!/dev/null done rm -r "${S}"/po for pofile in $( \ find "${S}" -type f -name "*.po" \ ! -name "${gcc_po}" \ ! -name "${ls_po}" \ ! -name "${ylp_po}" \ ); do if [[ ${pofile##*/} == ${ucc_po} ]]; then _progress_indicator # Add translations for sharing panel and online-accounts desktop launcher sed -i -e "/\"Sharing\"/,+1 d" "${pofile}" # remove old identical msgid gcc_src=${pofile/${ucc_po}/${gcc_po}} for msgid in "${sh_msgids[@]}" "${oa_msgids[@]}"; do if ! grep -q "^\(msgid\|msgctxt\)\s\"${msgid}\"$" "${pofile}"; then msgid="$(awk "/^(msgid\s|msgctxt\s|)\"${msgid}\"\$/ { p = 1 } p { print } /^\$/ { p = 0 }" "${gcc_src}" 2>/dev/null)" case ${msgid:0:1} in m) echo "${msgid}" >> "${pofile}" ;; \") echo "msgid \"\"${newline}${msgid}" >> "${pofile}" ;; esac fi done _progress_indicator # Add translations for langselector panel ls_src=${pofile/${ucc_po}/${ls_po}} ls_src=${ls_src/gnome-} for msgid in "${ls_msgids[@]}"; do if ! grep -q "^\(msgid\|msgctxt\)\s\"${msgid}\"$" "${pofile}"; then echo "$(awk "/^(msgid|msgctxt)\s\"${msgid}\"\$/ { p = 1 } p { print } /^\$/ { p = 0 }" "${gcc_src}" "${ls_src}" 2>/dev/null)" \ >> "${pofile}" fi done rm "${gcc_src}" "${ls_src}" 2>/dev/null fi # Add translations for Unity help desktop launcher if [[ ${pofile##*/} == ${is_po} ]]; then _progress_indicator ylp_src=${pofile/${is_po}/${ylp_po}} for msgid in "${is_msgids[@]}"; do sed -i -e "s/GNOME/Unity/g" "${ylp_src}" if ! grep -q "^\(msgid\|msgctxt\)\s\"${msgid}\"$" "${pofile}"; then echo "$(awk "/^(msgid|msgctxt)\s\"${msgid}\"\$/ { p = 1 } p { print } /^\$/ { p = 0 }" "${ylp_src}" 2>/dev/null)" \ >> "${pofile}" fi done rm "${ylp_src}" 2>/dev/null fi msgfmt -o "${pofile%.po}.mo" "${pofile}" rm "${pofile}" done insinto /usr/share/locale doins -r "${S}"/language-pack-*-base/data/* printf "\b\b%s\n" "... done!" }