Update comments about language codes
authorFomafix <fomafix@googlemail.com>
Fri, 19 Feb 2016 07:31:51 +0000 (07:31 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Fri, 19 Feb 2016 07:31:51 +0000 (07:31 +0000)
* RFC 3066 is obsoleted by RFC 4646.
* RFC 4646 is obsoleted by RFC 5646.
* All are also known as BCP 47.
* Language codes must treated as case insensitive.
* There exist conventions for the capitalization of some of the subtags.
* Write a space between BCP and 47 in comments.
* http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf is not available.
* https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMP%20SDK%20Release%20cc-2014-12/XMPSpecificationPart1.pdf
  is the new position.

Change-Id: I91e305fd5754cf4dedf8fd7460f7d3375f792c89

includes/media/XMPValidate.php
languages/Language.php
tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php

index d69d3ec..fe47f47 100644 (file)
@@ -218,8 +218,9 @@ class XMPValidate implements LoggerAwareInterface {
         *
         * This is just a naive check to make sure it somewhat looks like a lang code.
         *
-        * @see rfc 3066
-        * @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf page 30 (section 8.2.2.5)
+        * @see BCP 47
+        * @see https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/
+        *      XMP%20SDK%20Release%20cc-2014-12/XMPSpecificationPart1.pdf page 22 (section 8.2.2.4)
         *
         * @param array $info Information about current property
         * @param mixed &$val Current value to validate
index 89b059d..5068777 100644 (file)
@@ -4320,7 +4320,7 @@ class Language {
        }
 
        /**
-        * Get the RFC 3066 code for this language object
+        * Get the internal language code for this language object
         *
         * NOTE: The return value of this function is NOT HTML-safe and must be escaped with
         * htmlspecialchars() or similar
@@ -4332,7 +4332,7 @@ class Language {
        }
 
        /**
-        * Get the code in Bcp47 format which we can use
+        * Get the code in BCP 47 format which we can use
         * inside of html lang="" tags.
         *
         * NOTE: The return value of this function is NOT HTML-safe and must be escaped with
index 574023e..082fe22 100644 (file)
@@ -6,7 +6,7 @@
 class WfBCP47Test extends MediaWikiTestCase {
        /**
         * test @see wfBCP47().
-        * Please note the BCP explicitly state that language codes are case
+        * Please note the BCP 47 explicitly state that language codes are case
         * insensitive, there are some exceptions to the rule :)
         * This test is used to verify our formatting against all lower and
         * all upper cases language code.
@@ -31,7 +31,7 @@ class WfBCP47Test extends MediaWikiTestCase {
         */
        public static function provideLanguageCodes() {
                return [
-                       // Extracted from BCP47 (list not exhaustive)
+                       // Extracted from BCP 47 (list not exhaustive)
                        # 2.1.1
                        [ 'en-ca-x-ca', 'en-CA-x-ca' ],
                        [ 'sgn-be-fr', 'sgn-BE-FR' ],
@@ -50,7 +50,7 @@ class WfBCP47Test extends MediaWikiTestCase {
                                'en-Latn-GB-boont-r-extended-sequence-x-private'
                        ],
 
-                       // Examples from BCP47 Appendix A
+                       // Examples from BCP 47 Appendix A
                        # Simple language subtag:
                        [ 'DE', 'de' ],
                        [ 'fR', 'fr' ],
@@ -93,7 +93,7 @@ class WfBCP47Test extends MediaWikiTestCase {
                        [ 'de-ch-x-phonebk', 'de-CH-x-phonebk' ],
                        [ 'az-arab-x-aze-derbend', 'az-Arab-x-aze-derbend' ],
                        /**
-                        * Previous test does not reflect the BCP which states:
+                        * Previous test does not reflect the BCP 47 which states:
                         *  az-Arab-x-AZE-derbend
                         * AZE being private, it should be lower case, hence the test above
                         * should probably be: