User "Krinkle" posted a comment on MediaWiki.r102205.
Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/102205#c25621
Commit summary:
[TsIntuition] Minor fixes in acceptableLanguages()
* Adding an example of the static utility function to demo/demo6
* Moving the function out of the TsIntuition class into TsIntuitionUtil where
the other static utility functions are, renaming to getAcceptableLanguages
* Improving documentation/variable naming a little bit
* Whitespace / curly braces fixes
* Although I'm not 100% sure about this, I've added a FIXME about the q-val
defaulting to 1. It needs a look-ahead technique to be more solid, right now
low-level accept-languages are getting too high. Example:
-- code
getAcceptableLanguages: ( 'nl-be,nl;q=0.7,en-us,en;q=0.3' ):
array(4) {
["nl-be"]=>
string(1) "1" // should be 0.7
["en-us"]=>
string(1) "1" // should be 0.3
["nl"]=>
string(3) "0.7"
["en"]=>
string(3) "0.3"
}
-- /code
See demo6 for more this in action
* Follows-up r100234
Comment:
Like I said in the commit message: "'' Although I'm not 100% sure about this,
I've added a FIXME about the q-val defaulting to 1.''".
When I add languages in Firefox preferences, the default for me was "nl, en-us,
en". Which ended up like "nl;q=0.7,en-us,en;q=0.3" in the HTTP header. There
for it appears that Firefox is not adding q-values for all languages codes,
which to me clearly suggests that it assumes that whatever is processing that
header is using either look-ahead or look-behind, NOT directly default to
something.
So that <code>"nl-be,nl;q=0.7, en-us,en;q=0.3"</code> would be equivalent to
<code>"nl-be;q=0.7nl;q=0.7, en-us;q=0.3en;q=0.3"</code>
If the specification says otherwise, I have no problem keeping it like it is.
If the specification agrees however than the below comments are correct:
<pre>
getAcceptableLanguages: ( 'nl-be,nl;q=0.7,en-us,en;q=0.3' ):
array(4) {
["nl-be"]=>
string(1) "1" // should be 0.7
["en-us"]=>
string(1) "1" // should be 0.3
["nl"]=>
string(3) "0.7"
["en"]=>
string(3) "0.3"
}
</pre>
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview