21301 Posts in 5736 Topics by 2603 members
General Questions
SilverStripe Forums » General Questions » Change default language without showing admin translation tab
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1714 Views |
-
Change default language without showing admin translation tab

16 July 2009 at 5:14am
First of all: Hi and thanks for this - at first glance - excellent framework and cms.
I read the posts about the translations pro's and con's and managed to change the default language to nl_NL with:
Translatable::enable();
Translatable::set_default_locale('nl_NL');Is it posible to change the default language, but disable the translation tab in the admin section?
-
Re: Change default language without showing admin translation tab

17 July 2009 at 6:50am Last edited: 17 July 2009 7:10am
Ok, I managed to hide the translation tab by adding a rule in the function getCMSFields on mysite\code\Page.php
$fields->removeFieldFromTab("Root", "Translations");
Will hide the translationtab on all admin editpages.
I did this because I wanted to change the default language to Dutch, without showeing translation options.
Remove more tabs:
$fields->removeFieldsFromTab("Root", array('Content','Behaviour','To-do','Access','Reports','Translations'));Maybe it is of use for someone.
EDIT:
This works for all tabs as expected except the Todo tab had to be called To-do instead of Todo like the tab is called.
Is this correct behaviour?
-
Re: Change default language without showing admin translation tab

18 July 2009 at 2:37am
Hi Martijn,
Translatable is meant to be used on multi-lingual sites. If you're not planning on building one and you just want to have your site properly set to Dutch, you don't have to enable Translatable, it should be enough to just set in your sapphire/_config.php:i18n::set_locale('nl_NL');
This is supposing you're using 2.3.2. Or are you for some reason aiming on doing a multi-lingual site without translations? -
Re: Change default language without showing admin translation tab

18 July 2009 at 5:23am Last edited: 18 July 2009 5:24am
No I don't... yet.
But because I could not get the dutch language files of ecommerce to work I added the rule i think...
But your right. It works without the Translatable enable...
should't this be don in mysite/_config.php?
-
Re: Change default language without showing admin translation tab

20 July 2009 at 3:59am
>> should't this be don in mysite/_config.php?
It's just that Silverstripe places its example in the sapphire/_config.php so I just thought to point you to it
But sure, you're right, I guess all things particular to your site should be in mysite/, so they won't get lost on upgrades...
| 1714 Views | ||
|
Page:
1
|
Go to Top |

