2pisoftware / cmfive

DEPRECATED! Please see https://github.com/2pisoftware/cmfive-core for new version
http://cmfive.com
4 stars 4 forks source link

translations proposal #193

Closed syntithenai closed 8 years ago

syntithenai commented 8 years ago

Proposed implementation of translations.

See translations branch. Note that report/connections/index has been hacked/broken as sample.

FIRST

Config::set('translations', array('report' => array( 'permodule' => 'per module', 'index' => array( 'peraction' => 'per action' ), 'connections' => array( 'persub' => 'per sub module', 'index' => array( 'persubaction' => 'per sub action' ) )

)));

THEN in report/connections/index action.

echo "PM:". t($w,'permodule');
echo "PS:". t($w,'persub');
echo "PA:".t($w,'peraction');
echo "PSA:".t($w,'persubaction');

// echo $w->Translation->translate('name'); echo "asdfasdf"; die()

careck commented 8 years ago

Steve, please look at the existing ticket for Internationalisation #17 which explains my current thinking on this subject.

I don't really like the keyword style approach for translation because it is quite tedious to maintain (I've been there before!) and rather prefer a natural approach where messages are first written in plain english and these strings serve as keys for lookup to other translations (as used with gettext and wordpress).

Please use the #17 ticket for further discussion of this topic.