+
+ auto lang = node->optional_node_child("Language");
+ if (lang) {
+ try {
+ _language = dcp::LanguageTag(lang->content());
+ auto add = lang->optional_bool_attribute("Additional");
+ _language_is_additional = add && *add;
+ } catch (dcp::LanguageTagError&) {
+ /* The language tag can be empty or invalid if it was loaded from a
+ * 2.14.x metadata file; we'll just ignore it in that case.
+ */
+ if (version <= 37) {
+ if (!lang->content().empty()) {
+ notes.push_back (String::compose(
+ _("A subtitle or closed caption file in this project is marked with the language '%1', "
+ "which DCP-o-matic does not recognise. The file's language has been cleared."), lang->content()));
+ }
+ } else {
+ throw;
+ }
+ }
+ }