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.

Customising the CMS /

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

i18nTextCollector


Go to End


4 Posts   2000 Views

Avatar
lx

Community Member, 83 Posts

11 August 2009 at 10:47pm

Hi,

for the first time i wanted to use the i18nTextCollector. But i have some problems with it.

Rewriting Core Language Files
http://localhost/testproject/dev/tasks/i18nTextCollectorTask/?module=mysite should collect every _t that is in my mysite-folder.

But i get this error message:
[Warning] fopen(/srv/www/htdocs/testprojekt/sapphire/lang/en_US.php): failed to open stream: Permission denied

Why is it trying to write into this File? When i chmod it to 777 the process is running but the original file becomes much shorter. Most of the variables are lost.

Template-Parsing?
In my template-file \themes\testproject\templates\Includes\NewsPage.ss i am using the _t-Funktion:

<% _t('News.WEITER','weiter',PR_MEDIUM, 'weiter-Button bei News mit internem Link') %>

Is The TextCollector really runnig through templates? It did not generate a corresponding variable.

Thanks
lx

Avatar
bummzack

Community Member, 904 Posts

11 August 2009 at 11:49pm

Hi lx

I once wrote a small PHP script that basically does the same... until I noticed that such a thing already exists :-)
Anyway, you could give it a try and look if it works better for you: http://bummzack.ch/langbuilder/

Avatar
lx

Community Member, 83 Posts

12 August 2009 at 12:33am

Thanks banal,

but i would like to use the silverstripe built-in functions.
Probably i am using them not correctly.

Avatar
Martijn

Community Member, 271 Posts

15 August 2009 at 3:26pm

Have you tried to add a writable en_US.php file to your modules lang folder?

This worked for me (2.3.2)...