Translating the website

Hi everyone,

just wanted to ask how can I change the text to be localized to the language I need.
I’m creating a website in italian and, at the moment, I have a mixture of english and italian words showing up, as I changed the ones that are customizable, but couldn’t access the rest.
For example, how can I translate the text in “Browse all N items”, “Read more about us”, or “View a random item”?
If you could point me to where these strings are stored, then I could change them manually, but I wouldn’t know where to look unfortunately.

I tried to use the Translations plugin, but seems to be working on for the “Search” word.

Thank you very much for all your work and support, I hope you can help.

Guglielmo

Here are a few related forum posts that might help you get started.

Thank you for your help

Can I ask a quick question, @ebell. So I’m 99% there on my translation odyssey with Curatescape. I’ve been looking at the theme php, and I just wanted to confirm that if I enter a string into my .mo file that’s (for example) ‘Stories’ = ‘Storiau’ and ‘Featured %s’ = ‘%s dan sylw’, that will work right?

I know it treats dynamic content as a different string, but with the way things are phrased in Curatescape and what the Omeka translation guide says, it seems to be correct?

I know there are other possible changes I might need to make to the php, but I’m about to pull together a version of the latest release of the theme and reconcile all of my ‘favourite’ customisations into one new version locally as a project, so I wanted to know how far I needed to go.

I am probably the wrong person to ask since I have no real experience with translation beyond trying to follow best practices for text in the code base, but here’s how I think it works:

I believe the only strings that can be translated are the static ones. So in a string that looks look like __("This is %s", "translatable"), you can only provide translations for “This is” – the term “translatable” is a dynamic string and it won’t be translated even if you have __("translatable") elsewhere. You might be able to do something like __("This is %s", __("translatable")) but at that point you should just change the string to __("This is translatable").

Does that make sense? I think that’s right, but again I am not an expert in this area. The best way to learn is probably just to do it and see what happens.

I’ll give it a try and see what happens, as you say. It actually does seem to mostly work! The main trick is translating them meaningfully, but I think I’m nearly there!

Hi @ebell. I have one question. Where would I find the string for the word MENU in the menu button? I found it in the code but I can’t seem to identify the string in my .mo file. I’m making good progress.

I’ve just pushed a new commit to the codebase. Here are the required changes:

You can implement these changes manually in your own theme or you can download the master branch. Otherwise, it will be in the next release.

Minor adjustment. I decided to use a data-title attribute instead of title on that <i> element since the outer link already has a title. Functionally, there is no difference. It’s semantic.

Thanks @ebell, that’s great! I was planning to ‘celebrate’ finishing my translation work by updating the theme and relevant plugins, so I can add this in at that time.

Do you also happen to know the string for page ranges? E.g. ‘1 of 4’ in a list of results? I know it’s being pulled in from Omeka by the theme, but not sure where to look.

That’s probably from common/pagination-control.php, line 46

echo __('%s of %s', $pageInput, $this->last);

It’s part of the pagination at the bottom of items/browse.

Hi @ebell. I’ve just seen what might be another untranslatable string in the menu: the ‘View A Random Story’ button. Is that like ‘menu’, or am I using the wrong string?

Looks like the issue is limited to the button’s text in the side menu. Just pushed a new release that includes the fix for this one and some others…

Thanks @ebell. I’ve updated the script and my new version of the theme + multilanguage plugin + switcher is working nicely. I think I’m at the stage now where all we need is the simple pages copy, and then we’ll be good to go.