#1396: Implementation of i18n is awkward and time-wasting
--------------------------+-------------------------------------------------
Reporter: colnector | Owner: jwage
Type: enhancement | Status: closed
Priority: major | Milestone:
Component: I18n | Version: 1.0
Resolution: wontfix | Keywords:
Has_test: 0 | Mystatus: Pending Core Response
Has_patch: 0 |
--------------------------+-------------------------------------------------
Comment (by colnector):
Thank you very much for your response and the apology.
I am not proficient in Doctrine's code but I am able to give my example an
SQL statement which I have now tested under MySQL.
In this example `phrase` and `phrase_translation` are the tables.
`lang` notes the language and we prefer the language 45 over 0 (which is
the default).
{{{
SELECT * FROM (SELECT * FROM `phrase`) p
JOIN
(SELECT id,name,lang FROM `phrase_translation` t_p1 WHERE lang = (SELECT
MAX(lang) FROM `phrase_translation` t_p2 WHERE (t_p2.lang = 45 OR
t_p2.lang = 0) AND `id`=`t_p1`.`id`)) t_p
ON p.id = t_p.id
}}}
This query should naturally be further optimized and can be enhanced for
cultures used as string.
The result set given here has only one row per phrase object (with either
lang 45 or 0) so the representation I have shown at the top of my ticket
can be achieved in the hydration process (which will be much faster).
Also, less data moves between the DBMS and the ORM.
Doctrine is a wonderful tool but its i18n support is far too basic for a
website which needs true i18n support. As my website has vast i18n needs,
I am forced to write workarounds.
Please consider re-opening this ticket (and perhaps move it to a future
version), so these important issues would not be ignored. I'm sure a lot
of dev time went into i18n in Doctrine and I believe not as much time
would be needed to make the i18n both easy to use and well-optimized.
Thanks :)
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1396#comment:7>
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
-~----------~----~----~----~------~----~------~--~---