Bilingual content in Stories and Simple Pages

Hi There,

Our Curatescape themed Omeka project is looking the way we want and getting ready for a soft launch in June.

One project-specific item that we are trying to incorporate is the use of both English and Welsh in the project. This raises two questions:

  1. For certain stories, we are interested in allowing bilingual subtitles, ledes and stories. I was wondering what the most efficient way of achieving this would be. I’d rather split up the attributes if possible and offer subtitle (Welsh), lede (Welsh) and story (Welsh), but suspect that this would ruin the formatting. I’m asking for best practice tips, I suppose.

  2. Do you have any tips in the simple pages plugin for displaying two versions of certain text (not everything, since the default language is English) in html that will work well in the theme?

Any thoughts and suggestions would be gratefully received. I know this is partially an Omeka question, but it has bearing on the way the the theme displays the metadata and simple page html so I wanted to start here.

Hi @james-smith,

There really is no established way to display bilingual content in Omeka without making some significant code changes in the theme.

One method for dealing with item metadata might be to duplicate each field that needs translation (just using the “add input” button would be my recommendation, but you can also create new custom fields) and have the first instance use English and the second use the Welsh equivalent. Show the English version by default (if that is the primary audience). Then you could add some JavaScript to the page, allowing the user to set an alternate language. When a user requests Welsh, you can use JavaScript to fetch that content using the Omeka REST API without reloading the page, replacing the English equivalent on the page. You could also use navigator.language to detect if the user has Welsh set as their default language.

For the Simple Pages plugin, you could enter both English and Welsh in their own HTML divs and have one hidden by default, using the same language selection method, and hiding/un-hiding each language as needed.

This level of customization may or may not be practical for you, but this is probably (more or less) how I would do it.

Sorry I don’t have a simpler solution. :slightly_frowning_face:

Thanks again! I think that we’ll find a good balance. Like I said it isn’t something that there is a single way of delivering, so I might come back and ask some more questions as we go. We have what we want: this is more of a bonus.

Further to my last question, is Curatescape compatible with the locale switcher plugin?

Yes, it is compatible with the Locale Switcher plugin.

According to the Locale Switcher plugin documentation, you would need to manually add the following somewhere in the theme:

<?php echo $this->localeSwitcher(); ?>

Then you would need to create translation files (.po/.mo) for the theme and each plugin.

Note that this will only provide translation of static labels… not the actual content.

So in the screenshot below, you can see I added the required code to the top of the theme’s main content container (not an ideal location) and switched over to the Welsh translation. That translated some common labels, such as Logout, Search, Tags. You’ll need to add your own translations for all the rest of the unique labels used in the theme, such as Stories, Tours, Menu, etc. And, again, this won’t solve your core issue, which is to translate the content. So this plugin might be part of the solution, but you would still need to make some additional changes to the theme and to your data structure to really achieve a bilingual site.

Thanks! I’m not 100% sure if this is necessary or desirable, but I wanted to have the option open to us.

Hi @ebell. We’ve just been talking about the javascript field switching idea, and are thinking of seeking help in the computer science/DH community of our university to do it. I was wondering if there was any appetite at your end to offer a solution for swapping out languages in Curatescape stories, or if it is something we should pursue ourselves and feed back on.

We have a pretty full schedule at the moment, so we can’t really commit to anything new right now. But keep us in the loop and let me know if you have any questions as you go.

Thanks! I’ll take a look into it. We’d like to contribute something other can use, so I’ll keep in touch once we have an idea of our capabilities in house.

Hi Erin,

My customisations are going well. Further to this thread, where do you think that the best place to put the switcher php in would be? We have a nice big customised .po/.mo file going now.

All the best,
James

Hi @james-smith, one simple solution would be to add a new HTML container in the header.php file, right before the opening <header> tag. Something like…

<!-- (using inline styles here for convenience) -->
<div id="locale-switcher-top" style="background: #000; color: #fff;padding: .5em 1em;text-align: center;">
    <?php echo $this->localeSwitcher(); ?>
</div>

This would display more or less like the admin bar that displays for users who are logged in to the site.

That sounds like a good spot! Many thanks.