Log message #4051553

# At Username Text
# Jul 13th 2017, 08:25 saeideng :+1:
# Jul 13th 2017, 08:25 savant and then if I want to update, I just look at the diff on github and apply those changes
# Jul 13th 2017, 08:24 savant and set it to whatever I got the app version at
# Jul 13th 2017, 08:24 savant `extra.cakephp.app_version`
# Jul 13th 2017, 08:24 savant something like
# Jul 13th 2017, 08:24 savant I typically just add a value in my application
# Jul 13th 2017, 08:24 saeideng but i worry about other files
# Jul 13th 2017, 08:23 saeideng I know I should update bootstrap/middleware/index.php
# Jul 13th 2017, 08:23 saeideng but
# Jul 13th 2017, 08:23 saeideng nut I want update that
# Jul 13th 2017, 08:22 savant we dont set a version in composer.json
# Jul 13th 2017, 08:22 saeideng i want compare by latest version
# Jul 13th 2017, 08:22 saeideng how I can to detect cakephp/app version on my exist programs?
# Jul 13th 2017, 08:21 saeideng hi
# Jul 13th 2017, 08:16 marcusgoede i do that because i need a place where the bake shell can find the value with the translate function __(‘value’) and put it into the pot file. is there a better way with just one file to maintain?
# Jul 13th 2017, 08:10 hmic savants one is faster, this is more readable and flxible, i usually prefer using sprintf for string formatting
# Jul 13th 2017, 08:10 jarard01 hmic thanks - yes I just tried that and I'm going to use that approach
# Jul 13th 2017, 08:09 hmic jarard01, you could use printf number formatting too like sprintf('%010d', $int);
# Jul 13th 2017, 08:08 jarard01 thanks savant that worked
# Jul 13th 2017, 08:08 hmic marcusgoede: why translate on loading the file? - you will not need all of them in every case for sure. so thats quite a bit of wasted resources. just translate them when you output them - this is how it's usually done and best practise anyways!
# Jul 13th 2017, 08:08 jarard01 hi neon1025 o/
# Jul 13th 2017, 08:06 neon1024 Morning everyone
# Jul 13th 2017, 07:58 savant http://php.net/manual/en/function.str-pad.php
# Jul 13th 2017, 07:58 jarard01 so 1 would be come 00000001
# Jul 13th 2017, 07:58 jarard01 is there a cake way to add or pad a a number with leading 0's
# Jul 13th 2017, 07:29 marcusgoede ok thanks
# Jul 13th 2017, 07:29 savant sure
# Jul 13th 2017, 07:29 marcusgoede it works in AppController::beforeFilter(), is that good practice?
# Jul 13th 2017, 07:29 savant you can load it in your AppView
# Jul 13th 2017, 07:29 savant if its only for templates
# Jul 13th 2017, 07:29 savant i would load it after you’ve set the language.
# Jul 13th 2017, 07:28 marcusgoede for example options for select inputs like [‘active’ => __(‘active’)]
# Jul 13th 2017, 07:27 savant what is in that file?
# Jul 13th 2017, 07:26 marcusgoede where is a good place to load configuration file with Configure::load() which contain translated values with __()? When I load the config in bootstrap.php the values will be translated to the apps default language, not the current one
# Jul 13th 2017, 07:00 spriz Okay :slightly_smiling_face: Nice to hear I'm not the only one @savant :tada:
# Jul 13th 2017, 06:19 savant but I wouldnt write the second way normally at the application later
# Jul 13th 2017, 06:18 savant or plugins/behaviors that need to be generic
# Jul 13th 2017, 06:18 savant unless im doing some weird stuff with relations
# Jul 13th 2017, 06:18 savant i use the former
# Jul 13th 2017, 06:17 spriz Personally I've used the "old" (first) in own project code and the second only in behaviors, plugins etc.
# Jul 13th 2017, 06:16 spriz Question regarding syntax for the 3.x orm - which one do you prefer and why? https://gist.github.com/Spriz/645b9e96c1430f141f3d49e225e4ede6