Gentoo Development Guide

L10N.ECLASS

Section: portage (5)
Updated: Nov 2014
Index Return to Main Contents
 

NAME

l10n.eclass - convenience functions to handle localizations  

DESCRIPTION

The l10n (localization) eclass offers a number of functions to more conveniently handle localizations (translations) offered by packages. These are meant to prevent code duplication for such boring tasks as determining the cross-section between the user's set LINGUAS and what is offered by the package; and generating the right list of linguas_* USE flags.  

FUNCTIONS

l10n_for_each_locale_do <function>
Convenience function for processing localizations. The parameter should be a function (defined in the consuming eclass or ebuild) which takes an individual localization as (last) parameter.

Example: l10n_for_each_locale_do install_locale

l10n_for_each_disabled_locale_do <function>
Complementary to l10n_for_each_locale_do, this function will process locales that are disabled. This could be used for example to remove locales from a Makefile, to prevent them from being built needlessly.
l10n_find_plocales_changes <translations dir> <filename pre pattern> <filename post pattern>
Ebuild maintenance helper function to find changes in package offered locales when doing a version bump. This could be added for example to src_prepare

Example: l10n_find_plocales_changes "${S}/src/translations" "${PN}_" '.ts'

l10n_get_locales [disabled]
Determine which LINGUAS USE flags the user has enabled that are offered by the package, as listed in PLOCALES, and return them. In case no locales are selected, fall back on PLOCALE_BACKUP. When the disabled argument is given, return the disabled useflags instead of the enabled ones.
 

ECLASS VARIABLES

PLOCALES
Variable listing the locales for which localizations are offered by the package. Check profiles/desc/linguas.desc to see if the locales are listed there. Add any missing ones there.

Example: PLOCALES="cy de el_GR en_US pt_BR vi zh_CN"

PLOCALE_BACKUP
In some cases the package fails when none of the offered PLOCALES are selected by the user. In that case this variable should be set to a default locale (usually 'en' or 'en_US') as backup.

Example: PLOCALE_BACKUP="en_US"

 

MAINTAINERS

Ben de Groot <yngwin@gentoo.org>
 

REPORTING BUGS

Please report bugs via http://bugs.gentoo.org/  

FILES

/usr/portage/eclass/l10n.eclass  

SEE ALSO

ebuild(5)
http://sources.gentoo.org/eclass/l10n.eclass?view=log


 

Index

NAME
DESCRIPTION
FUNCTIONS
ECLASS VARIABLES
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:25:07 GMT, November 01, 2014