Closed
Bug 1101263
Opened 11 years ago
Closed 11 years ago
Shelves created in non en-US locales are missing their names at /operators/shelves
Categories
(Marketplace Graveyard :: Curation Tools, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: krupa.mozbugs, Unassigned)
References
()
Details
Attachments
(1 file)
|
266.93 KB,
image/png
|
Details |
steps to reproduce:
1. Make a shelf for locale "es" only like https://marketplace.allizom.org/operators/shelves/edit/coleccin-de-aplicaciones
2. Load https://marketplace.allizom.org/operators/shelves
3. Check the shelf name in the list
expected behavior:
Collection name is always shown in the list irrespective of what locale the shelf was created in
actual behavior:
For someone who is visiting https://marketplace.allizom.org/operators/shelves in en-us, shelves set for es won't have any name. See screenshot.
Updated•11 years ago
|
Priority: -- → P2
Comment 1•11 years ago
|
||
It's probably because the operator shelf model has no default locale. Here is what I think is happening:
- Curator saves a shelf with only a name in "es" locale
- Server-side, this adds a translation for the name for that shelf, but only in "es"
- User visits in english, on the server-side we look for name in "en-US" because it's the current language. We also fall back to settings.LANGUAGE_CODE, since the model doesn't define a better fallback, but it's also "en-US".
Solutions:
1) Define a default_locale field for operator shelves, and make sure there is always a translation in the language corresponding to that field.
OR
2) Always make sure a en-US translation is provided for every field (since it's the fallback when we don't define one)
For reference: http://zamboni.readthedocs.org/en/latest/topics/translations.html#how-it-works-behind-the-scenes
Comment 2•11 years ago
|
||
So, this was very complicated.
1) Transonic was sending empty string translations for all fields, for all locales. There is an inherent difference between an empty string translation and a null/missing value.
This was fixed here: https://github.com/mozilla/transonic/commit/51cd3e21eff8b6fb814f9dcac56cc8dbd71d7c63
The fix was ported to the operator dashboard here: https://github.com/mozilla/marketplace-operator-dashboard/commit/6e4dd45131e9119d7e02c09c55b661d939eb74a8
2) The operator dashboard was sending lang=xx in all requests, so the l10n shortcut was being applied: http://firefox-marketplace-api.readthedocs.org/en/latest/topics/overview.html#translations
That was fixed here: https://github.com/mozilla/marketplace-operator-dashboard/commit/981c09b2ad9e8db89f7167ebcb506e3606833c95
3) I considered writing a management command to clean up the existing bad data, but our translation code is magical and hairy, and removal would be dangerous. I am going to leave the bad data where it is.
When validating this, please create a new shelf.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 3•11 years ago
|
||
This is happening in the old /curate tools too for the KDDI op shelf.
See https://www.dropbox.com/s/0mmwyu0o45pta2c/Screenshot%202014-12-30%2010.50.22.png?dl=0
You need to log in
before you can comment on or make changes to this bug.
Description
•