multilingual metadata in Omeka - an approach

Hello Everybody,

for one of our projects we need the possibility to enter and display metadata in three different languages (Italian, German and English).

After reading a little bit here, here and here about the limited possibilities of creating multilingual metadata for one item in Omeka, we decided to take a rather quick, but hopefully not dirty approach which I want to present and discuss here:

Metadata Entry

Omeka's out-of-the-box functionality to duplicate metadata fields allows us to enter the different translation of the metadata values in a separate field.

In order to be able to automatically recognize the language of each value, we imposed the following rule: Every metadata entry has to have a standardized prefix in the form of an ISO 639-3 language code which is followed by a colon. This would get you something like this:

<dc:subject>deu: Bauchnabel</dc:subject>
<dc:subject>ita: Ombelico</dc:subject>
<dc:subject>eng: Belly Button</dc:subject>

In order to ensure that the prefix will always be entered we set up a form validation routine for the metadata entry and edit forms in the Omeka backend using the jQuery Validation plugin. This plugin is extremely powerful and since Omeka already uses jQuery it's also relatively easy to implement.

Here is the Javascript code we used:

jQuery(document).ready(function(){    

  // add class-name "language-prefix-ISO_639_3" to both elements when DOM is loaded
  jQuery("textarea, select").addClass("language-prefix-ISO_639_3");

  // add class-name "language-prefix-ISO_639_3" to both elements after a new element has been added dynamically clicking the "Add-Input" button
  jQuery('.add-element').ajaxComplete(function() {
    jQuery("textarea, select").addClass("language-prefix-ISO_639_3");
  });

  // validation method that checks if metadata entry begins with an ISO_639_3 code followed by a colon
  jQuery.validator.addMethod(
    "language-prefix-ISO_639_2",
    function(value, element) {
      if(value.trim().length != 0) {
        var expression = /^(deu|DEU|ita|ITA|eng|ENG):/;
        return expression.test(value);
      }
      else {
        return true;
      }
    },
    "Please start your metadata entry with one of the following values. IT: (if entry is in italian), EN: (if entry is in English), DE: (if entry is in german)"
  );

  // Execute Form Validation
  jQuery("#item-form").validate({
    errorClass: "invalid-metadata",
  });

});

We decided to encapsulate this chunk of code in a separate javascript file and added it via <?php echo js('filename'); ?> at the end of the following template files of Omeka's default backend theme:

  • items/add.php
  • items/edit.php

Now a user who is adding or editing an item in Omeka won't be able to do so, unless he or she precedes the metadata values with an ISO 639-3 code which is followed by a colon. If he or she tries to send the form without doing so, an error message pops up beside the metadata field and the form won't be send to the server.

Please note: this form validation routine only works for non-HTML metadata values.

Metadata display in frontend

We have not yet implementet this feature, however our idea is this:

Since we ensured/enforced a consistent metadata entry in the form of [ISO 639-3 code]:[metatada value] we can use the ISO 639-3 code as a hook for displaying only those metadata values that correspond to the current interface language. To do that we will most likely implement a custom function that incorporates the following logic:

if (interfaceLanguage == DEU ) {
  Display only metadata values that are preceded by the string "DEU:"
}
else if (interfaceLanguage == ITA) {
  Display only metadata values that are preceded by the string "ITA:"
}
...
else {}

The feature of changing the interface language should be implemented in the new Omeka 2.0 version, as stated here.

Best regards, Matthias Einbrodt

Hello,

I'm very interested in this approach. Has anyone already been able to successfully implement it? If so I'd really like to have a bit more detailed description on how to do it, especially for the metadata display in frontend.

Thanks,
François.

Hi François,

we implemented it for our Omeka test environment. However, we didn't go live yet.

Give me a week to see how we did it because I really don't remember the details.

Regards, Matthias

Hi Matthias,

if you ever get time to explain me how you did this, I'm still very interested!

Kind regards,
François.

Hi Matthias,
sorry to insist, this is just a gentle reminder. Did you find how you did this?
Thanks,
François.