Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

i18n and fallback language


Reply


4 Posts   1572 Views

Avatar
carlgmathisen

Community Member, 4 Posts

2 March 2009 at 11:39pm

Edited: 02/03/2009 11:41pm

Hi guys,

I've set up Internationalization on my SilverStripe installation with:

i18n::enable();
i18n::set_default_lang('en');

... and it works like a charm. My question is, is it possible to have a fallback language?

1. Let's say my main menu looks something like this in English:

|- Home
|- About Us
|- Contact

2. I translate the Contact page to the norwegian title "Kontakt"

My main menu, when setting locale to Norwegian on the site, will currently look like this:

|- Kontakt

As a result, the english articles are hidden, as the site (naturally) only shows the translated pages to the current locale.

Is it possible to specify a fallback language, that my menu may look like this?

|- Home
|- About Us
|- Kontakt

Thanks guys

Carl

Avatar
Ingo

Forum Moderator, 801 Posts

3 March 2009 at 3:51pm

You're using our daily builds/trunk, right?

Hm, currently not possible, but would make sense. We have a similiar module (subsites) which can link pages between different "subsites", which is essentially the same as different translations of the same page. Technically, it will be challenging to get these fallbacks working without having them explicitly created.

So, couple of options worth investigating:
- globally enable fallbacks automatically through a code-preference (selecting both translated and untranslated pages)
- explicitly creating placeholder pages as a "VirtualPage" (showing untranslated content, no redirect). we could have a checkbox on "create translation" button to optionally create this placeholder instead of a full-fleged editable translation
- batch-creating placeholder pages for the whole site or a specific sub-tree through some user action

Sorry if this goes too much into depth, I'm basically kicking off discussion about the implementation. Our first goal will be to get Translatable in a stable and tested state, so don't expect any work on placeholder pages in the next month or two - unless we get help/contributions of course.

Avatar
carlgmathisen

Community Member, 4 Posts

6 March 2009 at 2:42am

Hi Ingo,

Thank you for your elaborate answer. Very interesting. In my case, I've solved it in the short run by convincing the client to translate every page :)

The creation of virtual placeholder pages is a good idea - this will solve the issue for those in a more precarious need for this functionality.

Your first option definately seems like the easiest solution for the developer, using SilverStripe. If it's the easiest solution to implement for the SilverStripe framework developer... well that's another discussion :)

I will also have a look to see what can be done.

Carl

Avatar
lise

Community Member, 47 Posts

5 November 2011 at 1:53pm

Hello,

I am wondering what is the status of this problem/discussion as I have exactly the same issue. My client is looking at SilverSTripe
to create a large website in multiple languages (using Content localization and the Translatable class). But all the pages
will not be translated in all the languages. However they would like visitors to always have access to all the pages : each page
would be served either in the "locale" language if it has been translated on in the "default" language if it has not.

Is it possible? How can this be implemented?

Thanks