Re: [php-139] MongoDB and internationalization?

From: Janis Rough
Sent on: Thursday, August 11, 2011 9:02 AM
thanks for the great info.
Janis L. Rough



--- On Thu, 8/11/11, Poppin Fressh <[address removed]> wrote:

> From: Poppin Fressh <[address removed]>
> Subject: Re: [php-139] MongoDB and internationalization?
> To: [address removed]
> Date: Thursday, August 11, 2011, 8:08 AM
> I don't think any respositories have
> "isues" with i8n; nor do they
> have "solutions" per se.
> Doctrine, for example, is a PHP ORM that has i8N hooks -
> but these
> hooks are in the PHP ActiveRecord code, not the repo. I
> know that they
> work in mySQL - I would guess that they adapt to the
> Doctrine Mongo
> adapters as well,though I haven't done the research.
> One thing I would look at is that you can use compound keys
> as
> identities in Mongo; that is you can have the master
> records in one
> language in one ("articles") collection
> 
> {_id: ObjectId("aaabbb-hash"), title: "Why Western Europe
> is Better
> than Eastern Europe", text: "Who hasn't asked themselves,
> from time to
> time, why England is so much ...."}
> and then have a translation collection "articles_i8n" with
> a language/ID key
> 
> {_id:{  key: ObjectId ("aaabbb-hash"), i18n:
> "RU"}, title:
> "ПочемуЗападной Европе лучше,
> чем Восточная Европа", text:"Кто из
> нас
> не спросил себя, время от
> времени, почемуАнглия так
> много ...." }
> 
> While this fancy use of a compound key is not the only way
> to solve
> the problem - an i18n field and a second compound index
> created
> manually also works - its a slightly more efficient use of
> indices.
> 
> As for the data types - at this point in the discussion,
> for your
> purposes, remember that Mongo is a JSON store - everything
> you know
> about JSON types - by which I mean JavaScript types -
> applies to
> Mongo. There are some very borderline exceptions to this
> rule but for
> the most part it applies nicely. This means that you
> exchange the 12
> words for integer of MySql for a fairly spartan set of data
> types -
> number, string, date and a few specialty constructs like
> document
> reference and lat/long map point.
> 
> Also keep in mind that there are no schema in Mongo - it
> takes what
> you give it and does not type validate your content, which
> puts that
> responsibility back on you, the developer. The best system
> for
> creating client side schema in PHP that I know of to date
> is Doctrine,
> though I would encourage you to look into Node/Mongoose if
> you are
> interested in the Node system.
> 
> Also, though they don't like to push this, Mongo does have
> a REST
> interface to it as well.
> 
> On Wed, Aug 10, 2011 at 11:13 AM, Janis Rough <[address removed]>
> wrote:
> >
> > I have a question about last nights MongoDB
> presentation.
> > I didn't think to ask but would MongoDB recepticle of
> data have an issue with localization or
> internationalization?
> > How is PHP 6 progressing?  Are the data types
> different in MongoDB that MySQL?
> > thanks
> > --
> > Janis L. Rough
> >
> >
> >
> >
> > --
> > Please Note: If you hit "REPLY", your message will be
> sent to everyone on this mailing list ([address removed])
> > This message was sent by Janis Rough ([address removed])
> from The SF PHP Meetup Group.
> > To learn more about Janis Rough, visit his/her member
> profile
> > To unsubscribe or to update your mailing list
> settings, click here
> >
> > Meetup, PO Box 4668 #37895 New York, New York
> 10163-4668 | [address removed]
> 
> 
> 
> --
> Please Note: If you hit "REPLY", your message will be sent
> to everyone on this mailing list ([address removed])
> http://www.sfphp....
> This message was sent by Poppin Fressh ([address removed])
> from The SF PHP Meetup Group.
> To learn more about Poppin Fressh, visit his/her member
> profile: http://www.sfphp....
> To unsubscribe or to update your mailing list settings,
> click here: http://www.sfphp....
> Meetup, PO Box 4668 #37895 New York, New York 10163-4668 |
> [address removed]
> 
>

IGN

Food, beverages, organizer time and give-aways.

Engineyard/Orchestra.io

Drinks at the 21st Amendment for the SFPHP Meeting-After-the-Meeting

O'Reilly User Group Program

The O'Reilly User Group Program provides the great books we get monthly.

People in this
Meetup are also in:

Log in

Not registered with us yet?

Sign up

Meetup members, Log in

or
By clicking the "Sign up using Facebook" or "Sign up" buttons above, you agree to Meetup's Terms of Service