# |
Jul 7th 2017, 14:37 |
jdominguezpaz |
yeah... I have 'frecuenciasemanal'=>'frecuenciassemanales' in irregular but i Get FrecuenciaSemanal->Frecuenciassemanales without the second word capitalized when pluralize |
# |
Jul 7th 2017, 14:36 |
hmic |
you should likely use english names inside your app source anyways! |
# |
Jul 7th 2017, 14:36 |
hmic |
the inflector is only good at english at all |
# |
Jul 7th 2017, 14:36 |
jdominguezpaz |
(of course i'm spanis so... my apologies for any kick to the english language in my writing) :) |
# |
Jul 7th 2017, 14:36 |
hmic |
it's irregular in this case :p |
# |
Jul 7th 2017, 14:35 |
slackebot |
FrecuenciasSemanales) we need to inflect both words almost always. Is there a way to get this? |
# |
Jul 7th 2017, 14:35 |
jdominguezpaz |
Hello, I'm struggling trying to get inflector inflects in spanish. :slightly_smiling_face: It's no problem to me to declare all "irregular" spanish nouns in bootstrap.php in a one by one basis (there are not too many) but I have problems inflecting two words and I think is because plural adjectives. For example: Normal pluralize (BigApple => BigApples) only inflects the noun which is the second word. In Spanish (FrecuenciaSemanal => |
# |
Jul 7th 2017, 14:30 |
inoas |
it should be @ hmic |
# |
Jul 7th 2017, 14:30 |
hmic |
mic_, yeah, just extend the htmlhelper in your app to add the type |
# |
Jul 7th 2017, 14:30 |
mic_ |
hmic: I have just found out, that Form finds out of course types and so on - but no locale formatting applied. |
# |
Jul 7th 2017, 14:29 |
hmic |
nice inoas! should be the default on debug=true |
# |
Jul 7th 2017, 14:29 |
mic_ |
hmic: I am trying to figure out a way to do it, because that would be it - extend and override a bit in the standard. |
# |
Jul 7th 2017, 14:27 |
hmic |
not that hard actually |
# |
Jul 7th 2017, 14:27 |
hmic |
so you would need to add the input type to the formhelper and have it locale format your numbers |
# |
Jul 7th 2017, 14:26 |
mic_ |
hmic: well, but that's not something I would like to have everywhere. just in Form. |
# |
Jul 7th 2017, 14:26 |
hmic |
you could implement them of course and make the database types use them, sure |
# |
Jul 7th 2017, 14:25 |
hmic |
in php numbers (int and float) are no objects |
# |
Jul 7th 2017, 14:25 |
inoas |
you could extend that to Cake\ORM\Entity |
# |
Jul 7th 2017, 14:25 |
mic_ |
hmic: but so far no solution similar to Date/FrozenDate with their ::setToStringFormat() |
# |
Jul 7th 2017, 14:24 |
mic_ |
hmic: Type::build('decimal')->useLocaleParser() fixes "input formatting" |
# |
Jul 7th 2017, 14:24 |
inoas |
this is what I do @ devito https://gist.github.com/inoas/60c9c7372d5fb7ce6f70b5691796ceba |
# |
Jul 7th 2017, 14:24 |
hmic |
answer: it's not. so no way to format "automagically"... you could, however, make the database type "decimal" locale aware (probably want float/double) too! |
# |
Jul 7th 2017, 14:23 |
mic_ |
hmic: I added explicitly 'type' => 'decimal' to Form->input(), but no change in formatting |
# |
Jul 7th 2017, 14:22 |
inoas |
auto-entities are imho "okay" but can also be a problem |
# |
Jul 7th 2017, 14:22 |
inoas |
devito auto models are IMHO an evil thing |
# |
Jul 7th 2017, 14:21 |
mic_ |
hmic: 2 sec |
# |
Jul 7th 2017, 14:21 |
mic_ |
aha |
# |
Jul 7th 2017, 14:20 |
hmic |
a formhelper input type, widget too |
# |
Jul 7th 2017, 14:19 |
mic_ |
hmic: you mean "type", as in the Form template/HTML input - or type as Database? |
# |
Jul 7th 2017, 14:18 |
hmic |
mic_, is there a field type that formhelper knows about, that holds decimal data? |
# |
Jul 7th 2017, 14:17 |
mic_ |
should resort to Javascript to make the final formatting, or is there an option that would automatically tell the FormHelper to fix my decimals with proper, locale aware formatting? |
# |
Jul 7th 2017, 14:16 |
mic_ |
I am trying to find a solution to localized decimals + form helper. The built-in piping allows to use locale parser for decimals in a given locale, but FormHelper always throws in the value "as in the DB". |
# |
Jul 7th 2017, 14:15 |
devito |
yesterday my name spacing got me all messed up. I baked a model and forgot to prefix it with the plugin name. then when i tried to create and save, the modified and created dates weren't updating. Took me a while to realize my models were in the wrong place |
# |
Jul 7th 2017, 14:13 |
devito |
me 2 |
# |
Jul 7th 2017, 14:12 |
admad |
@devito I think you need a break :slightly_smiling_face: |
# |
Jul 7th 2017, 14:06 |
devito |
thanks |
# |
Jul 7th 2017, 14:06 |
devito |
@neon1024 yea i read to fast. didnt see the options were bulleted under each relationship type. |
# |
Jul 7th 2017, 14:05 |
inoas |
but there is also CRUD + Crud View which might help you for semi-automated apps |
# |
Jul 7th 2017, 14:04 |
inoas |
and then loop and use FormHelper::inputs() |
# |
Jul 7th 2017, 14:04 |
inoas |
akkaweb that sounds not so wise... however what you can look at is $_hidden ... in a similar way you could design visibility maps for entities |
# |
Jul 7th 2017, 14:04 |
neon1024 |
https://book.cakephp.org/3.0/en/orm/associations.html this page you mean? |