#1396: Implementation of i18n is awkward and time-wasting
--------------------------+-------------------------------------------------
  Reporter:  colnector    |       Owner:  jwage                
      Type:  enhancement  |      Status:  new                  
  Priority:  major        |   Milestone:  New                  
 Component:  I18n         |     Version:  1.0                  
Resolution:               |    Keywords:                       
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  0            |  
--------------------------+-------------------------------------------------
Old description:

> Hydration of i18n supported-classes is uncomfortable and takes too much
> time IMO.
>
> Here's a sample translated object retrieved (as array):
>

> {{{
>         [1] => Array
>             (
>                 [id] => 2
>                 [Translation] => Array
>                     (
>                         [0] => Array
>                             (
>                                 [id] => 2
>                                 [lang] => 0
>                                 [name] => Edit your personal page
>                             )
>
>                         [110] => Array
>                             (
>                                 [id] => 2
>                                 [lang] => 110
>                                 [name] => Edita tu página personal
>                             )
>
>                     )
>
>             )
> }}}
>
> You can see that 'id' appears 3 times here.
> IMHO, an efficient i18n implementation would result in:
>
> {{{        [1] => Array
>             (
>                 [id] => 2
>                 [name] => Edita tu página personal
>             )
> }}}
>
> if the translated language is found or:
>
> {{{
>         [1] => Array
>             (
>                 [id] => 2
>                 [name] => Edit your personal page
>             )
> }}}
>
> If it's not found. Language fallback could be defined (say fall from any
> language to the default language or more complicated such as Portuguese
> ->Spanish ->English ).
>
> Proper handling of i18n by Doctrine would result in added robustness. I'm
> currently forced to use a work-around I've made, checking the Translation
> part of each object. Needless to say, there's surely a waste of memory
> and cpu for the unneeded hydration.

New description:

 Hydration of i18n supported-classes is uncomfortable and takes too much
 time IMO.

 Here's a sample translated object retrieved (as array):


 {{{
         [1] => Array
             (
                 [id] => 2
                 [Translation] => Array
                     (
                         [0] => Array
                             (
                                 [id] => 2
                                 [lang] => 0
                                 [name] => Edit your personal page
                             )

                         [110] => Array
                             (
                                 [id] => 2
                                 [lang] => 110
                                 [name] => Edita tu página personal
                             )

                     )

             )
 }}}

 You can see that 'id' appears 3 times here.
 IMHO, an efficient i18n implementation would result in:

 {{{
       [1] => Array
             (
                 [id] => 2
                 [name] => Edita tu página personal
             )
 }}}

 if the translated language is found or:

 {{{
         [1] => Array
             (
                 [id] => 2
                 [name] => Edit your personal page
             )
 }}}

 If it's not found. Language fallback could be defined (say fall from any
 language to the default language or more complicated such as Portuguese
 ->Spanish ->English ).

 Proper handling of i18n by Doctrine would result in added robustness. I'm
 currently forced to use a work-around I've made, checking the Translation
 part of each object. Needless to say, there's surely a waste of memory and
 cpu for the unneeded hydration.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1396#comment:1>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to