sys.stderr.write('skipping likelySubtag "%s" -> "%s" (%s)\n' % (tmp[u"from"], tmp[u"to"], str(e))) continue # substitute according to http://www.unicode.org/reports/tr35/#Likely_Subtags if to_country == "AnyCountry" and from_country != to_country: to_country = from_country if to_script == "AnyScript" and from_script != to_script: to_script = from_script print " <likelySubtag>" print " <from>" print " <language>" + from_language + "</language>" print " <script>" + from_script + "</script>" print " <country>" + from_country + "</country>" print " </from>" print " <to>" print " <language>" + to_language + "</language>" print " <script>" + to_script + "</script>" print " <country>" + to_country + "</country>" print " </to>" print " </likelySubtag>" print " </likelySubtags>" print " <localeList>" Locale.C().toXml() for key in locale_keys: locale_database[key].toXml() print " </localeList>" print "</localeDatabase>"
continue # substitute according to http://www.unicode.org/reports/tr35/#Likely_Subtags if to_country == "AnyCountry" and from_country != to_country: to_country = from_country if to_script == "AnyScript" and from_script != to_script: to_script = from_script print " <likelySubtag>" print " <from>" print " <language>" + from_language + "</language>" print " <script>" + from_script + "</script>" print " <country>" + from_country + "</country>" print " </from>" print " <to>" print " <language>" + to_language + "</language>" print " <script>" + to_script + "</script>" print " <country>" + to_country + "</country>" print " </to>" print " </likelySubtag>" print " </likelySubtags>" if skips: wrappedwarn('skipping likelySubtags (for unknown language codes): ', skips) print " <localeList>" Locale.C(calendars).toXml(calendars) for key in locale_keys: locale_database[key].toXml(calendars) print " </localeList>" print "</localeDatabase>"