Closed
Bug 657785
Opened 15 years ago
Closed 15 years ago
Move KNOWN_LANGUAGES to settings_local
Categories
(Websites Graveyard :: markup.mozilla.org, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
1.0
People
(Reporter: stas, Unassigned)
Details
(Keywords: l12y, Whiteboard: [qa-])
Attachments
(1 file)
|
3.03 KB,
patch
|
wenzel
:
review+
|
Details | Diff | Splinter Review |
For context, see bug 656458, bug 657112 and 657475.
IT (and everyone else too) would prefer to decide which list of accepted locales to use in settings_local, not settings.
Attachment #533081 -
Flags: review?(fwenzel)
Updated•15 years ago
|
Target Milestone: --- → 1.1
Updated•15 years ago
|
Target Milestone: 1.1 → 1.0
Comment 1•15 years ago
|
||
Comment on attachment 533081 [details] [diff] [review]
Patch
Looks good!
>+# Redifine settings that depend on KNOWN_LANGUAGES. Don't change them here.
>+LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in KNOWN_LANGUAGES])
>+class LazyLangs(dict):
>+ def __new__(self):
>+ from product_details import product_details
>+ return dict([(lang.lower(), product_details.languages[lang]['native'])
>+ for lang in KNOWN_LANGUAGES])
>+LANGUAGES = lazy(LazyLangs, dict)()
Not sure if you need to redefine LazyLangs here, you could probably also just put `from django.conf import settings` into __new__ and not use a closure. For this project, however, your changes are fine. A more general solution (in Playdoh) should probably be more elegant, but I understand you're working on that already.
Attachment #533081 -
Flags: review?(fwenzel) → review+
| Reporter | ||
Comment 2•15 years ago
|
||
(In reply to comment #1)
> Not sure if you need to redefine LazyLangs here, you could probably also
> just put `from django.conf import settings` into __new__ and not use a
> closure.
You're right, I went ahead and made this change to the final commit:
https://github.com/mozilla/markup/commit/bf2d108a3dd6dc0d176e04a689a72691974d47c0
> For this project, however, your changes are fine. A more general
> solution (in Playdoh) should probably be more elegant, but I understand
> you're working on that already.
Yep, I have a cleaner solution for Playdoh that I'm working on.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 3•15 years ago
|
||
Are there verification points for QA or is this [qa-]?
Updated•15 years ago
|
Whiteboard: [qa-]
| Reporter | ||
Comment 4•15 years ago
|
||
(In reply to comment #3)
> Are there verification points for QA or is this [qa-]?
Yes, [qa-] is fine.
Updated•4 years ago
|
Product: Websites → Websites Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•