This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » symfony 1.3 and 1.4 » ¿The best way to add new locale properties with i18n? (sfCultureInfo)
¿The best way to add new locale properties with i18n? (sfCultureInfo) [message #103374] Sun, 01 August 2010 13:10
jalismak  is currently offline jalismak
Messages: 8
Registered: March 2009
Junior Member
Hi!

I'm developing a car website with symfony featuring i18n an i10n.

I want to ad some values to my model that depends on the language and country of the user.

For example:

Power ( KW, HP, CV ....)
Engine size (Litres, C.C.)
Milleage ( kilometres, miles)

In my model:

AdCar:
  columns:
    ..
    power:                    { type: integer, notnull: false}
    power_unit:               { type: integer(2), notnull: true } # CV, KW, HP...


I don't know if the best way to define this in the model is adding the "power_unit" field or make a adCar_Translation table and add there the power localized

I have been investigating also the sfCultureInfo and all de ICU stuff with the .dat files. I don't know if the best way to accomplish this is including those data extending the sfCultureInfo and creating custom dat files that extends the funcionality os sfCultureInfo. It seems very complex :-S

The other option is to make my own cultureManager and save those data in yml files for example and calling the manager when i need it:

YAML file example:
en_EN:
  power_unit:  HP
  milleage:    ML

es_ES:
  power_unite: CV
  milleage:    KM
  


what do you think?
Previous Topic:Best procedure for including files based on configuration settings
Next Topic:"fake" properties on models
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software