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.

We've moved the forum!

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.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Translatable installation and files upload problem on 3.0.5


Go to End


8 Posts   1950 Views

Avatar
dannybo

Community Member, 4 Posts

15 April 2013 at 3:44am

Hallo guys!
So how to install translatable on 3.0.5?
I know similar questions have been asked on this forum as well as other places in internet dozens of times. And I checked them all. None works correctly.

eg. Method on github causes server error during the first database rebuild.

This code from ssbits.com works at first:

Translatable::set_default_locale('en_GB');
Translatable::set_allowed_locales(array(
'en_GB', //UK English
'ro_RO', //Romanian
'ru_RU' //Russian
)
);
Object::add_extension('SiteTree', 'Translatable');

Translations after implementing it worked perfect, but uploading new files became impossible and causes "SyntaxError: Unexpected token T". Actually the whole section "Files" became useless.

So what is the correct way to install Translatable and not to break anything else???

I use SilverStripe 3.0.5 on Ubuntu LAMP. Translatable 1.0.0.

Thanx in advance for any tips.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

16 April 2013 at 9:25pm

The best way to install any module is with Composer. If you're having issues, you need to be much more clear about what the problem is. "It causes an error" is not enough information to help you.

Avatar
dannybo

Community Member, 4 Posts

16 April 2013 at 11:40pm

thanx for answer UncleCheese!
Anyway I tried silverstripe 2.4.10 and found it much better. CMS is much faster, no annoying bugs etc. Meanwhile waiting for 3.1.0

Avatar
gaspra

Community Member, 8 Posts

18 April 2013 at 3:43am

Have you tried to run the backend in English? I did have some problems there too and this helped. I'm not sure if this is the same issue but it is worth a try.

Additionally I would not develop anything new on a SilverStripe < 3 despite the issues (speed, bugs). Version 3 was released while I was developing my first SilverStripe page and there was some work to do porting to the new version. Not exceptionally much but still...

Avatar
dannybo

Community Member, 4 Posts

18 April 2013 at 1:44pm

Thanx for answer gaspra!
My backend is in English, so it's something else..

Avatar
gaspra

Community Member, 8 Posts

18 April 2013 at 7:13pm

Well then then let's start over.

I have SilverStripe 3.0.5 running with Translatable 1.0 - installed without Composer (not set up yet) and it works as long as I have the backend in English. When I switch the backend to German I get the same error you're reporting when I upload/move etc.. files in the backends "Files" Section.

Let's compare the site config. Here is what I have set up:

// Set the site locale
i18n::set_locale('de_DE');

// Translation
Translatable::set_default_locale("de_DE");

$allowed_locales = array(
'de_DE' => array('German', 'Deutsch'),
'en_US' => array('English', 'Englisch'),
);
i18n::$common_locales = $allowed_locales;

Good luck :)

Avatar
dannybo

Community Member, 4 Posts

18 April 2013 at 11:04pm

Hi gaspra!
Here is my piece of code from config:

i18n::set_locale('uk_UA');
Translatable::set_default_locale("uk_UA");

Translatable::set_default_locale('uk_UA');
Translatable::set_allowed_locales(array(
'uk_UA'
'en_GB',
'ru_RU'
)
);
Object::add_extension('SiteTree', 'Translatable');

In backend Security section I switched to English interface, but the problem was still there.

Anyway I was very limited in time, so I've allready done the project in Silverstripe 2.4.10 where I didn't find any bugs at all and which is much faster. So the problem allready expired. Just hoping 3.1.0 will be more stable.
Cheers!

Avatar
gaspra

Community Member, 8 Posts

19 April 2013 at 4:47am

Try to remove the last line

Object::add_extension('SiteTree', 'Translatable');

I think I remember removing it when upgrading to v3 following the upgrade guide. I definitely don't have it in my config and it does work.

Of course there is still a lot of room for improvements in 3.1