THANK you very much!
i'll give this a try and let you know...!
anyway, thank you very much :)
Eduardo
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
THANK you very much!
i'll give this a try and let you know...!
anyway, thank you very much :)
Eduardo
Howard,
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.
Howard:
Confirmed. Your fix works! thank you very much! :)
Kalileo:
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!
:)
Thanks
Regards
Eduardo
Eduardo,
to go with Howard's example, instead of
<% if LangIsMaori %>
<h2>NgÄ mahi whai muri mai</h2>
<% else %>
<h2>Upcoming Events</h2>
<% 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
Eduardo,
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.
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
Version: 2.3.2
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 !
@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!
Kalileo,
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! :)
Regards
Eduardo