Josua
unread,Mar 15, 2012, 8:03:59 AM3/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to silverst...@googlegroups.com
Hi!
You should put a mechanism whereby we can specify that a page is multilingual by
itself, as with the automatic following pages :
'/Security/login',
'/Security/lostpassword',
'/Security/passwordsent',
'/ForumMemberProfile/register',
'/ForumMemberProfile/RegistrationForm',
'/foro/sendacontrols/starttopic'
You
should also propagate the locale between them, ie if I call /Security/login
from a page with a es_ES locale (ie /inicio (spanish home page)),
/Security/login should be called like
this:
/Security/login?locale=es_ES to display the texts in Spanish.
Similarly, if, from the page /Security/login?locale=es_ES is called the page /Security/Lostpassword
should automatically use the call with the locale built in the link /Security/lostpassword?locale=es_ES
When we consult these pages if they have other translations should always tell YES.
public function init() {
parent::init();
self::save_current_member();
if($this->dataRecord->hasExtension('Translatable')) {
if (!TranslatableExtension::is_page_multilanguage()) {
TranslatableExtension::set_global_locale($this->dataRecord->Locale);
}
}
// Note: you should use SS template require tags inside your templates
// instead of putting Requirements calls here. However these are
// included so that our older themes still work
Requirements::themedCSS('layout');
Requirements::themedCSS('typography');
Requirements::themedCSS('form');
}
Also, in the template, the placeholder Translations should give the options
available for these sites based on set_allowed_locales, otherwise we have to do strange tricks for these pages.
Translatable::set_allowed_locales(array(
'en_US', // US English
'es_ES' // Español
));
<% if Translations %>
<% control Translations %>
<li><a href="$Link" hreflang="$Locale.RFC1766" title="$Title - $Locale.NiceShort">
<img src="$ThemeDir/images/flags/lang-<% sprintf(_t('IMAGE','%2.2s'),$Locale.RFC1766) %>.gif"></a>
</li>
<% end_control %>
<li><a href="$Link" hreflang="$Locale.RFC1766" title="$Title - $Locale.NiceShort">
<img src="$ThemeDir/images/flags/lang-<% sprintf(_t('IMAGE','%2.2s'),$Locale.RFC1766) %>.gif"></a>
<span>$Locale.NiceShort</span>
</li>
<% else %>
<% if TranslationsLogin %>
<% control TranslationsLogin %>
<li><a href="$link" title="$Title - $name">
<img src="$ThemeDir/images/flags/lang-<% sprintf(_t('IMAGE','%2.2s'),$localeRFC1766) %>.gif"></a>
</li>
<% end_control %>
<% end_if %>
<li><a href="$PageLink" hreflang="$Locale.RFC1766" title="$Title - $Locale.NiceShort">
<img src="$ThemeDir/images/flags/lang-<% sprintf(_t('IMAGE','%2.2s'),$Locale.RFC1766) %>.gif"></a>
<span>$Locale.NiceShort</span>
</li>
<% end_if %>
Please, if I have not explained well, consult me.
Sorry for my poor English.
Regards,
Jose