Foreign language metadata markup

Hi all;

I’m working on ensuring that our custom Omeka theme is in compliance with accessibility guidelines, and I’ve run into a snag. One of the things that’s required is that markup signal to assistive technologies the language of the content. I already have the appropriate tagging in place to designate all pages overall as US-english. However, some of our records contains spanish-language metadata. Often, those records will have two title, description, and subject fields, one in spanish and one in english. I need to signal to assistive technologies that some of the page content is in spanish, not english, as is the rest of the page. This would be simple if the content was not auto generated from the database, I’d just wrap it in a tag and set the “lang” attribute to the appropriate value. But that won’t work here because the content is auto-populated into the page template.

My inital solution was to try wrapping tags around the metadata itself in our CSV spreadsheets, and than marking it as HTML in the CSV import, but to my surprise, I discovered that the CSV import plugin seems to strip off any “lang” attributes of any tag loaded.

Is there a better solution? Is there a solution at all? How do I mark up foreign-language content on Omeka pages for assistive technologies?

Huh. That is odd. I had originally thought that the security settings for stripping HTML tags and attributes was the culprit, but when I disabled all those, I saw the same results you do with the lang attribute being stripped out. But, just manually editing the metadata to use HTML with the lang attribute worked just fine.

So, worst case is that your approach works, just not with the CSVImport plugin.

I suspect that the plugin is somewhere applying overly-cautious checks similar to the core security settings and/or not properly using those settings, so I’m filing this as a bug in the plugin.

Aaand that’s confirmed. Commenting out the line that invokes Omeka’s HTML cleaner lets lang attributes get imported.

The file in CSVImporter is /models/CsvImport/ColumnMap/Element.php Change line 44 just by commenting it out:

// $filter = new Omeka_Filter_HtmlPurifier();

Actually you have to do a bit more than that-If you just comment out line 44, line 45 will throw an error because the variable it references is undefined. What I’ve done is comment out both lines and insert:

$text = $row[$this->_columnName];

Below, this makes the first if branch identical to the second, but I didn’t want to dismantle the whole if/then structure. That seems to work fine.

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.