22972 Posts in 11596 Topics by 2824 members
|Go to End||Next >|
23 June 2009 at 12:15pm
THANK you very much!
i'll give this a try and let you know...!
anyway, thank you very much
23 June 2009 at 2:44pm
just to be sure that you know this:
i18n (which was not broken, only translatable was) would do the same more elegantly, as long as you just need to display translated text.
23 June 2009 at 2:52pm
Confirmed. Your fix works! thank you very much!
I don't know if you are refering to the new version of SS. I've asked for a more friendly tutorial to implement the new version of multi language support, but i did not find any "no programmer friendly" tutorial.
If you have some post that explains this, i will be very happy!
23 June 2009 at 3:17pm Last edited: 23 June 2009 3:19pm
to go with Howard's example, instead of
<% if LangIsMaori %>
<h2>NgÄ mahi whai muri mai</h2>
<% else %>
<% end_if %>
when using i18n you simply need
<h2><% _t('Events.Upcoming_Events',"Upcoming Events") %></h2>
and the translations are in files in /mysite/lang/ such as for English in en_US.php
$lang['en_US']['Events']['Upcoming_Events'] = 'Upcoming Events';
or for Maori in mr_MR.php (I assume, check the correct code)
$lang['mr_MR']['Events']['Upcoming_Events'] = 'NgÄ mahi whai muri mai';
You can see that the code in the templates is much more simple and universal than starting to check languages there with if-elseif-else constructions, and scalable, you can add as many translations as you want without changing the template.
If you need to add language specific stuff other than text the if-else might be the way you need to go though.
As said, while translatable needs i18n the fact that translatable was broken does not mean that i18n was broken. I mix the Multilingual Content - alternative to 'translatable' in SS 2.3.1 with i18n, works fine. See also my posts on the previous page about i18n and a bug in i18n in SS 2.3.1
23 June 2009 at 3:23pm
i18n is of course also available and heavily used in 2.3.2. many of the more recent templates now already use it, instead of hardcoding the English text, so often you only need to add your translations in /mysite/lang.
8 July 2009 at 10:23pm
I have exactly the same problem than Cem. Wilhe I followed exactly the two first steps of the "recipes:multilingual_content", I have the following error message when I try to visit mysite.com/en/page/:
Fatal error: Class 'MultiLingual' not found in [...]/sapphire/core/control/Director.php on line 274
Since I added the Multilingual class in mysite/code/Page.php, mysite.com/page/ works fine
Does anyone has an idea to help me? I suppose we should show the system that the Multilingual class is present in mysite/Multilingual.php but I have no idea how to do it...
Thanks in advance !
10 July 2009 at 11:37pm Last edited: 11 July 2009 12:56pm
@sebaf, the "Alternative Multilingual" recipe is for SS 2.3.1 only.
In SS 2.3.1 the "translatable" module was broken, so we needed it this alternative. However in 2.3.2 the translatable module is back and better than ever before, so if you use SS 2.3.2 you neither need the alternative nor was it ever meant to be used with it.
In short: With SS 2.3.2 use the translatable module!
11 July 2009 at 5:47am
Thanks for your answer, actually i'm having a problem with a form wich i need to translate.
I don't want to appear like an asshole here, but i think the documentation for the multi language sites it's far to be clear.
Anyway, thank you very much for your help!
|Go to Top||Next >|