From 6b976d825a0997a484b7d3cfcd5788e6a4b7f222 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Fri, 19 Feb 2016 07:31:51 +0000 Subject: [PATCH] Update comments about language codes * 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 | 5 +++-- languages/Language.php | 4 ++-- tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/includes/media/XMPValidate.php b/includes/media/XMPValidate.php index d69d3ec06e..fe47f4740e 100644 --- a/includes/media/XMPValidate.php +++ b/includes/media/XMPValidate.php @@ -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 diff --git a/languages/Language.php b/languages/Language.php index 89b059d47a..506877775d 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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 diff --git a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php b/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php index 574023e88c..082fe222c0 100644 --- a/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php +++ b/tests/phpunit/includes/GlobalFunctions/wfBCP47Test.php @@ -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: -- 2.20.1