Community « Discussion forum « Localization support board «
First tests of localizations have been positive
Tonight I have localised one large script to validate the i18n/l10n approach for YACS. poEdit is great, and I believe many translators will have fun quite soon...
Some information related to this important change for YACS:
Every language will be supported through additional .mo files external to scripts.
All of these files will be easy to change and to adapt to specific needs where required.
YACS includes its own .mo reader, because of all servers that don't have gettext readily available...
The impact on response times has been minimized by spreading strings on several files, and by caching .mo content ... in PHP files where possible.
First real applications are planned for the version 6.10, due next week.
Some information related to this important change for YACS:
First real applications are planned for the version 6.10, due next week.
NickR![]() from West Yorkshire, UK 342 posts | Cool, So I can even customise the English text now ? Nick |
| Vincent from on-a-few-hops-from-you 20 posts | Great! I see this is going on! Started out on my own, in bash, to translate this yacs, but this sounds way better. Since i took some hurdles (read: welcome in qoute hell!) i like to share the script with you anyhow: #!/bin/bash |
| Bernard from nearby-an-airport Associate, 6927 posts |
NickR: Yes, you will be able to change every string if you wish. Why not a en-NICKR locale? The implementation process will take time anyway, because of the so many scripts and strings to reshuffle. |
| Bernard from nearby-an-airport Associate, 6927 posts |
Vincent: Thank you for your positive feed-back. After a couple of hours practicing poEdit, I must admit that this is really a good choice for interactive translation. |
| Vincent from on-a-few-hops-from-you 20 posts | 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
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! |
| Bernard from nearby-an-airport Associate, 6927 posts |
Vincent: Thank you for your help on i18n and l10n... Actually the issue is not in extracting strings from YACS, but in changing the code to adapt to localization. Before localization we had: And after localization we have: Therefore the need to review and change all scripts one by one... |
| Vincent from on-a-few-hops-from-you 20 posts |
Bernard: kool - had some days off and then extra-busy days you know... Do you still need to go trough the files? In that case i could offer some help maybe? I see more lines like (in about.php, my favorite study object) : if(Surfer::is_associate()) { $local['title_en'] = 'Help'; $local['title_fr'] = 'Aide'; $local['help_en'] = 'To change information displayed, go to the '.Skin::build_link('skins/configure.php', 'configurati on panel for skins', 'shortcut'); $local['help_fr'] = 'Pour changer l\'information affichée, allez sur le '.Skin::build_link('skins/configure.php ', 'panneau de configuration des styles', 'shortcut'); $context['extra'] .= Skin::build_box(i18n::user('title'), '<p>'.i18n::user('help').'</p>', 'navigation', 'help'); } If i get you right there should be if(Surfer::is_associate()) { $context['extra'] .= Skin::build_box(i18n::s('Help'), '<p>'.i18n::user('help').'</p>', 'navigation', 'To change information displayed, go to the '.Skin::build_link('skins/configure.php', 'configurati on panel for skins', 'shortcut')'); } with the $local _en en _fr lines removed, right? i feel more tinkering comin' up ... v |
| Bernard from nearby-an-airport Associate, 6927 posts |
Vincent: about.php, as all modules at the root level of YACS, have been processed. Would you be ready to internationalize a couple of modules after the release of the 6.10? |
| Vincent from on-a-few-hops-from-you 20 posts | Yeah i think i can do that. Please use the mail address from my profile. Hope to hear from you
|
| Bernard from nearby-an-airport Associate, 6927 posts |
Vincent: thanks for your help. I will contact you soon. |

