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.

Customising the CMS

i18nTextCollector


Reply

4 Posts   1370 Views

Avatar
lx

11 August 2009 at 10:47pm Community Member, 83 Posts

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
banal

11 August 2009 at 11:49pm Community Member, 901 Posts

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

12 August 2009 at 12:33am Community Member, 83 Posts

Thanks banal,

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

Avatar
Martijn

15 August 2009 at 3:26pm Community Member, 271 Posts

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

This worked for me (2.3.2)...