﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18960	Please add a filter for getting the language family from a given language code to the i18n tag library	carsten.klein@…	nobody	"For my current project, I need an i18n filter that returns just the language family, or whatever it is called, from say 'en-us'. The family then would be 'en'. While I could add this as part of my project, I think that the feature would also be helpful to other users, hence my request.

A sample filter implementation would be:

{{{
@register.filter
def language_family(lang_code):
    return lang_code.split('-')[0]
}}}

Please note that although I am aware of your process, the above code snippet is so small, that I will not include a patch for the template tags library i18n.py here.

TIA!
"	New feature	closed	Translations	1.4	Normal	wontfix			Unreviewed	0	0	0	0	0	0
