Browse Source

Update nationalPrefixOptionalWhenFormatting documentation.

pull/986/head
Keghani Kouzoujian 10 years ago
parent
commit
a342989093
3 changed files with 9 additions and 6 deletions
  1. +4
    -0
      java/release_notes.txt
  2. +1
    -1
      resources/phonemetadata.proto
  3. +4
    -5
      tools/java/common/src/com/google/i18n/phonenumbers/BuildMetadataFromXml.java

+ 4
- 0
java/release_notes.txt View File

@ -1,3 +1,7 @@
Pending changes:
Code changes:
- Update nationalPrefixOptionalWhenFormatting documentation.
Feb 25, 2016: libphonenumber-7.2.6 Feb 25, 2016: libphonenumber-7.2.6
Metadata changes: Metadata changes:
- Updated phone metadata for region code(s): DJ, MA, NA, US - Updated phone metadata for region code(s): DJ, MA, NA, US


+ 1
- 1
resources/phonemetadata.proto View File

@ -82,7 +82,7 @@ message NumberFormat {
// commonly seen this number written by people without the leading 0, for // commonly seen this number written by people without the leading 0, for
// example as (20) XXXX XXXX, this field would be set to true. This will be // example as (20) XXXX XXXX, this field would be set to true. This will be
// inherited from the value set for the territory in the XML file, unless a // inherited from the value set for the territory in the XML file, unless a
// national_prefix_formatting_rule is defined specifically for this
// national_prefix_optional_when_formatting is defined specifically for this
// NumberFormat. // NumberFormat.
optional bool national_prefix_optional_when_formatting = 6; optional bool national_prefix_optional_when_formatting = 6;


+ 4
- 5
tools/java/common/src/com/google/i18n/phonenumbers/BuildMetadataFromXml.java View File

@ -294,10 +294,10 @@ public class BuildMetadataFromXml {
} }
/** /**
* Extracts the available formats from the provided DOM element. If it does not contain any
* nationalPrefixFormattingRule, the one passed-in is retained. The nationalPrefix,
* nationalPrefixFormattingRule and nationalPrefixOptionalWhenFormatting values are provided from
* the parent (territory) element.
* Extracts the available formats from the provided DOM element. If it does not contain any
* nationalPrefixFormattingRule, the one passed-in is retained; similarly for
* nationalPrefixOptionalWhenFormatting. The nationalPrefix, nationalPrefixFormattingRule and
* nationalPrefixOptionalWhenFormatting values are provided from the parent (territory) element.
*/ */
// @VisibleForTesting // @VisibleForTesting
static void loadAvailableFormats(PhoneMetadata metadata, static void loadAvailableFormats(PhoneMetadata metadata,
@ -324,7 +324,6 @@ public class BuildMetadataFromXml {
} else { } else {
format.nationalPrefixFormattingRule = nationalPrefixFormattingRule; format.nationalPrefixFormattingRule = nationalPrefixFormattingRule;
} }
if (numberFormatElement.hasAttribute(NATIONAL_PREFIX_OPTIONAL_WHEN_FORMATTING)) { if (numberFormatElement.hasAttribute(NATIONAL_PREFIX_OPTIONAL_WHEN_FORMATTING)) {
format.nationalPrefixOptionalWhenFormatting = format.nationalPrefixOptionalWhenFormatting =
Boolean.valueOf(numberFormatElement.getAttribute( Boolean.valueOf(numberFormatElement.getAttribute(


Loading…
Cancel
Save