Closed Bug 657785 Opened 15 years ago Closed 15 years ago

Move KNOWN_LANGUAGES to settings_local

Categories

(Websites Graveyard :: markup.mozilla.org, defect)

Firefox 4
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stas, Unassigned)

Details

(Keywords: l12y, Whiteboard: [qa-])

Attachments

(1 file)

Attached patch PatchSplinter 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)
Target Milestone: --- → 1.1
Target Milestone: 1.1 → 1.0
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+
(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
Are there verification points for QA or is this [qa-]?
Whiteboard: [qa-]
(In reply to comment #3) > Are there verification points for QA or is this [qa-]? Yes, [qa-] is fine.
Thanks Stas :) QA verified as [qa-]
Status: RESOLVED → VERIFIED
Product: Websites → Websites Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: