Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add translation capability #81

Merged
merged 55 commits into from Dec 16, 2011
Merged

Add translation capability #81

merged 55 commits into from Dec 16, 2011

Conversation

@dbu
Copy link
Member

@dbu dbu commented Dec 13, 2011

this adds translation annotations and functionality to the phpcr-odm. doc is included in the README.

as discussed on the mailing list:
https://groups.google.com/group/symfony-cmf-devs/browse_thread/thread/87349a31eb9f7eb2

this wil replace the MultilangContentBundle of symfony-cmf (https://github.com/symfony-cmf/symfony-cmf/wiki/MultilangContentBundle) => Note to self: clean up that wiki page once this is merged.

Daniel Barsotti and others added 30 commits Nov 18, 2011
This reverts commit 8eb12dc.

We don't need locale sensitive changesets in the UnitOfWork for now.
*/
public function getPreferredLocalesOrder($document, ClassMetadata $metadata, $forLocale = null)
{
if (is_null($forLocale)) {
Copy link
Member

@lsmith77 lsmith77 Dec 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you know me ... i always think its best to separate the error handling checks from the rest of the method logic.

Loading

Copy link
Member Author

@dbu dbu Dec 15, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while i generally agree, in this case i do not really see how to do it here.
this is not more readable:

    if (! is_null($forLocale) && ! array_key_exists($forLocale, $this->localePreference)) {
        throw new \InvalidArgumentException("There is no language fallback for language '$forLocale'");
    }

    if (is_null($forLocale)) {
        $preferred = $this->localePreference[$this->defaultLocale];
    } else {
        $preferred = $this->localePreference[$forLocale];
    }

i commited a reversed order: exception at the end.

Loading

@lsmith77
Copy link
Member

@lsmith77 lsmith77 commented Dec 14, 2011

@dbu: i added a bunch of comments .. also it looks like you may have to sync your branch with master.

Loading

@dbu
Copy link
Member Author

@dbu dbu commented Dec 14, 2011

thanks @lsmith77 - one day we will have the code style coded right into our brains ;-)
i will clean those up tomorrow.

does anybody have worries about functionality or the interfaces? if code style cleanups are the only problem, this will be merged tomorrow :-)

Loading

dbu added a commit that referenced this issue Dec 16, 2011
@dbu dbu merged commit 1c24c2f into doctrine:master Dec 16, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants