Closed Bug 906058 Opened 11 years ago Closed 11 years ago

Make snippet locale matching check all locales, not just the first one

Categories

(Snippets :: Service, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: osmose, Unassigned)

Details

Currently, when Snippets is trying to match a snippet to a client's locale, it finds the first locale that is a prefix of the client's locale and filters by that. For example, if a user came in with es-MX and the first locale found was `es`, they'd only receive snippets that are set to go out to the `es` locale. If a snippet was specifically targeted to es-MX, they wouldn't see it.

This should change so that both `es` and `es-MX` are used when matching snippets to a user with a locale like es-MX.
Question - so if I ran a snippet in Spain with two locales 'es' and 'es-ES', are you saying that the users would only see the 'es'?
(In reply to jcollings from comment #1)
> Question - so if I ran a snippet in Spain with two locales 'es' and 'es-ES',
> are you saying that the users would only see the 'es'?

A single snippet with the two locales es-ES and es would be seen by all users with the es-ES locale. It would also be seen by some users in other es- locales, like es-MX. Where the bug comes in is that some users in es-MX may not see it because we match them as es-MX instead of just es, and the snippet doesn't have the es-MX locale.

For now the best bet is to include all es- locales when you want to target every Spanish-speaking locale. Same with other locales: when you want an English snippet to go to every English locale, you add all of the en- locales to the list.

This bug really only affects a corner case that we don't normally run into.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Verified that requests for snippets in es-MX are now returning snippets in es and in es-MX.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.