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)
Websites
studentreps.mozilla.org
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
| Reporter | ||
Updated•15 years ago
|
Summary: Setup locale detection for studentreps.mozilla.org → Setup locale detection for studentreps.mozilla.com
| Reporter | ||
Updated•15 years ago
|
Assignee: nobody → craigcook.bugz
Comment 1•15 years ago
|
||
How's this going, Craig?
Summary: Setup locale detection for studentreps.mozilla.com → Set up locale detection for studentreps.mozilla.com
| Assignee | ||
Comment 2•15 years ago
|
||
(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.
Comment 3•15 years ago
|
||
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();
| Reporter | ||
Comment 4•15 years ago
|
||
Nice. That looks great Pascal.
Comment 5•15 years ago
|
||
Could Pascal or Stas help Craig implement this? If not, I'll find some time for it next week.
Comment 6•15 years ago
|
||
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?
Comment 7•15 years ago
|
||
The repo for this project is this one right? :
http://svn.mozilla.org/projects/studentreps/trunk/
| Assignee | ||
Comment 8•15 years ago
|
||
(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.
Comment 9•15 years ago
|
||
sure, I am pascalc on IRC, you can find me in #europe for example
Comment 10•15 years ago
|
||
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.
Description
•