public static unowned Language? from_string (string? language)

Take a RFC-3066 format language tag as a string and convert it to a Language pointer that can be efficiently copied (copy the pointer) and compared with other language tags (compare the pointer.


This function first canonicalizes the string by converting it to lowercase, mapping '_' to '-', and stripping all characters other than letters and '-'.

Use get_default if you want to get the Language for the current locale of the process.



a string representing a language tag, or null


an opaque pointer to a Language structure, or null if language was null. The returned pointer will be valid forever after, and should not be freed.