3 Google's JavaScript library for parsing, formatting, and validating
4 international phone numbers.
9 1. Checkout closure-library next to libphonenumber:
12 svn checkout http://libphonenumber.googlecode.com/svn/trunk/ ~/src/libphonenumber
13 svn checkout http://closure-library.googlecode.com/svn/trunk/ ~/src/closure-library
15 (Or change the path of the <script src=""> in the html pages to point to
16 wherever base.js is located.)
18 2. Run the unit tests to make sure everything is working. Open the following
19 pages with your web browser:
20 javascript/i18n/phonenumbers/phonenumberutil_test.html
21 javascript/i18n/phonenumbers/asyoutypeformatter_test.html
23 3. Run the demo: javascript/i18n/phonenumbers/demo.html
28 The JavaScript library is ported from the Java implementation (revision 374).
29 When the Java project gets updated follow these steps to update the JavaScript
32 1. If the protocol buffers (phonemetadata.proto and phonenumber.proto)
34 a. Manually update the .pb.js files with the changes of the .proto files.
35 b. Manually update the toJsArray() Java methods in
36 tools/java/java-build/src/com/google/i18n/phonenumbers/BuildMetadataJsonFromXml.java
37 c. Build tools/java/java-build/target/java-build-1.0-SNAPSHOT-jar-with-dependencies.jar
39 mvn -f tools/java/java-build/pom.xml package
41 2. If the phone number metadata in the XML format has changed
42 (resources/PhoneNumberMetaData.xml)
43 run the following commands to regenerate metadata.js and
44 metadatafortesting.js:
46 ant -f java/build.xml build-js-metadata
48 3. Manually port any changes of the Java code to the JavaScript code:
49 PhoneNumberUtil.java => phonenumberutil.js
50 AsYouTypeFormatter.java => asyoutypeformatter.js
51 PhoneNumberUtilTest.java => phonenumberutil_test.js
52 AsYouTypeFormatterTest.java => asyoutypeformatter_test.js
57 Port functionality to extract phone-numbers from text (findNumbers).
58 Port offline phone number geocoder.
59 Enable PhoneNumberUtil to handle all digits, rather than a subset
60 (JavaScript has no equivalent to the Java Character.digit).