Manfred62 Posted September 13, 2013 Share Posted September 13, 2013 I'm making some tests with translation in the admin. Tried to concatenate this strings, but it doesn't work? Example: $form->description = __("Translate ", __FILE__) . basename($file, '.module') . __(" to ", __FILE__) . $this->language->title; Only get the first phrase as translatable field. Can anyone explain this? Link to comment Share on other sites More sharing options...
Wanze Posted September 13, 2013 Share Posted September 13, 2013 There may only be one translation function call per line See here: http://processwire.com/api/multi-language-support/code-i18n/ 1 Link to comment Share on other sites More sharing options...
Manfred62 Posted September 13, 2013 Author Share Posted September 13, 2013 thanks Had to read more in the documentation... Link to comment Share on other sites More sharing options...
Manfred62 Posted September 14, 2013 Author Share Posted September 14, 2013 hmm, just another question. What recommended here? Both are doing it. "\n\t\t<label for='selected_image_description'>{$this->_('Description')}</label>" . or this "\n\t\t<label for='selected_image_description'>" . $this->_('Description') . "</label>" . Link to comment Share on other sites More sharing options...
adrian Posted September 14, 2013 Share Posted September 14, 2013 It really is personal preference, but I think Ryan would most likely go with the first: Here are a couple of relevant threads/posts: http://processwire.com/talk/topic/4439-when-do-we-need-curly-brackets/ http://processwire.com/talk/topic/3835-sorting-pages-by-multiple-values/?p=37797 Link to comment Share on other sites More sharing options...
Manfred62 Posted September 14, 2013 Author Share Posted September 14, 2013 ok, shorter is better.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now