Jason Tackaberry wrote:
> On Mon, 2008-03-24 at 10:59 +0100, Dirk Meyer wrote:
>   
>> not work. The changes to kaa.metadata are small and compatible to the
>> previous release, only small bugfixes.
>>     
>
> Maybe not.  I changed the behaviour of 'language' attribute so that it
> is a human readable string, whereas before it was a language code (which
> is now in the 'langcode' attribute).
>
> Duncan, does this affect you?
>   

Yes but positively, a DVD title audio and subtitles now give the 
language name instead of the code.

+def resolve(code):
+    """
+    Transform the given (2- or 3-letter) language code to a human readable
+    language name.  The return value is a 2-tuple containing the given
+    language code and the language name.  If the language code cannot be
+    resolved, name will be 'Unknown'.
+    """
+    if not code:
+        code = 'und'
+    code = code[:3]
+
+    for spec in codes:
+        if code in spec[:-1]:
+            return code, spec[-1]
+
+    return code, u'Undetermined'

The comment seems a bit odd as it will return Undetermined.
It may be better to return 'Unknown (%s)' % code when it is not in the 
list or just the code.

Duncan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to