Closed Bug 564067 Opened 15 years ago Closed 15 years ago

Set up locale detection for studentreps.mozilla.com

Categories

(Websites :: studentreps.mozilla.org, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sethb, Assigned: craigcook)

Details

We'll need to set up locale detection for the student reps website. Here are two links from former projects that should be helpful: Browserchoice: http://svn.mozilla.org/projects/browserchoice/trunk/index.php http://svn.mozilla.org/projects/browserchoice/trunk/libs/l10n.php Five Years of Firefox: http://svn.mozilla.org/projects/browserchoice/trunk/libs/l10n.php
Summary: Setup locale detection for studentreps.mozilla.org → Setup locale detection for studentreps.mozilla.com
Assignee: nobody → craigcook.bugz
How's this going, Craig?
Summary: Setup locale detection for studentreps.mozilla.com → Set up locale detection for studentreps.mozilla.com
(In reply to comment #1) > How's this going, Craig? Good question. This code way over my head. I may have to see if someone in webdev can pitch in.
Another more recent example from opentochoice website, IMO this code is easier to understand and reuse but I am of course partial since I wrote it ;) Class: http://viewvc.svn.mozilla.org/vc/projects/choice/tags/production/wp-content/themes/mozilla_choice/l10n/localeDetection.php?revision=63319&view=markup Example of use on a site with 3 locales: require 'l10n/localeDetection.php'; $chooselang = new chooseLocale(); $chooselang -> locales = array('de', 'en', 'fr'); $lang = $chooselang -> getCompatibleLocale();
Nice. That looks great Pascal.
Could Pascal or Stas help Craig implement this? If not, I'll find some time for it next week.
I probably can try to help this week end (maybe this evening but not sure, depends on how my other projects are going). Craig, you are on IRC?
The repo for this project is this one right? : http://svn.mozilla.org/projects/studentreps/trunk/
(In reply to comment #7) > The repo for this project is this one right? : > http://svn.mozilla.org/projects/studentreps/trunk/ That's the one. Seth has provided a patch for the gettextification in bug 564069 but it's still pending review. So the code currently in SVN hasn't been converted yet. I can get on IRC now if you need to discuss.
sure, I am pascalc on IRC, you can find me in #europe for example
Locale detection done (along with most of what was necessary to make the site localizable) in r66984 to r66986. A few details: - Locale detection is done at the domain root and redirects to your locale if supported, to English otherwise - Locale detection is also done on 404 pages, it uses the currently used locale if it is an internal broken link or locale detection if it is an external broken link - the language switcher is automatically generated (could be improved to redirect to the same originating page, I may do that later) - Although 5 locales are declared as supported, I put files for one locale only (French), generated the .po file and translated a few strings. This is for demo/testing purposes, no problem in deleting the French po file when we have automatic compiling of po/mo files set up - There is now some basic rtl support at html level just in case - all pages are now better templated and English source files are in inc/content/ Marking fixed
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Raymond, please verify this; thanks.
You need to log in before you can comment on or make changes to this bug.