Skip to main content Help Control Panel

YACS CMS : Open source !

Community «   Discussion forum «   Localization support board «   First tests of localizations have been positive «  

Comment: First tests of localizations have been positive

<< Previous Next >>
This is all a waste of time .. since you have the localisation done

For people who don't want/cannot upgrade, i leave you with my sed(1) tinkering.

It gives you all the files with the language code after the filename, jou have to edit in the file itself to make the translation (and replace the .php file with the php_nl file

(needless to say this is exposure on 'my night with sed' )

i translate from en -> nl, hence _en and _nl

for i in $(find . -name '*php'); do cat ${i} | sed -r '/_en.*;$/p ; s/_en(.*);$/_nl\1;/ ; /_en/{ :getline ; $!N ; /;$/!{bgetline} ; p ; s/_en(.*);/_nl\1;/ }' >${i}_nl ; done

Let's break that down:

for i in $(find . -name '*php'); \ #find all .php files

do cat ${i} | \ #cat file, pipe into

sed -r ' \ #sed using full regex

/_en.*;$/p \ #find line with _en, ending in';', print

s/_en(.*);$/_nl\1;/ \ #find line again, change _en for _nl

/_en/{ :getline \ #find line with _en still in it

$!N #add an extra line from file

/;$/!{bgetline} \ #until ';' is found, or repeat from getline

p \ #print the _en version

s/_en(.*);/_nl\1;/ \ #change _en for _nl

}' \ #close sed line


>${i}_nl \ #put into file xxx.php_nl


done # repeat till finished

but real localisation with poedit is preffered

PS Bernard, now i come to think of it, this might be a very good starting point for you to dig out the locale strings... Tell me if i can help you with that!

This comment has inspired:

by Vincent on Nov. 1 2006