Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In vietnam #39

Closed
nhutruby opened this issue May 6, 2012 · 27 comments
Closed

In vietnam #39

nhutruby opened this issue May 6, 2012 · 27 comments

Comments

@nhutruby
Copy link

nhutruby commented May 6, 2012

can not run in vietnam

@nhutruby nhutruby closed this as completed May 6, 2012
@floere
Copy link
Owner

floere commented May 6, 2012

Hi there! Thanks for the issue.

Phony does not yet contain rules for vietnamese telephone numbers (see lib/countries.rb). If you can provide some via pull request or via documentation, that would be most welcome.
Are these rules correct? https://en.wikipedia.org/wiki/Telephone_numbers_in_Vietnam

@nhutruby
Copy link
Author

nhutruby commented May 6, 2012

Yes, the rules are correct
Thanks

@floere
Copy link
Owner

floere commented May 6, 2012

@willingchangthernguyen Would you be willing to implement the rules and send a pull request? (I almost have no time for this right now)

@nhutruby
Copy link
Author

nhutruby commented May 6, 2012

How can I do ?

@floere
Copy link
Owner

floere commented May 6, 2012

You can fork the project, then pull the code to your computer, and edit the code. The tests can be run by entering rake. (If all this is gibberish to you, never mind – I will look at it next week :) )

@floere floere reopened this May 13, 2012
@floere floere closed this as completed in 97ac497 May 13, 2012
@floere
Copy link
Owner

floere commented May 13, 2012

@willingchangthernguyen I've included Vietnam in Phony. Enjoy and please tell me if there are any problems.

@nhutruby
Copy link
Author

Thanks, I will check it

Willing

@nhutruby
Copy link
Author

Hi Floere

When I add country_code 84 9y x x x x x x x -> 0 9y x x x x x x x ->ok
But when setting 0 9y x x x x x x x -> delete 0 -> 9y x x x x x x x -> not ok

Thanks
Willing

@floere
Copy link
Owner

floere commented May 16, 2012

Hi Willing,

As outlined in the README, "This gem can normalize, format and split E164 numbers." – so this only works with E164 numbers with a country code.

How do you expect the gem to know what to do if there is no country code?

Cheers,
Florian

@nhutruby
Copy link
Author

Hi Floere
In USA
415 922 4711 -> 05922 4711 not include 0
1415 922 4711 -> 0415 922 4711 ??

Thanks
Willing

@nhutruby
Copy link
Author

Hi Floere
Ok ,we need a country code

but about US:
1415 922 4711 -> 0415 922 4711 ?? ,they don't need 0

Thanks
Willing

@floere
Copy link
Owner

floere commented May 16, 2012

Hi Willing,

I'm not sure what you mean. What are you doing in the step "->", i.e. what does the arrow mean?
What do you expect to happen? Can you give me an annotated example where phony does the wrong thing, please?

Cheers,
Florian

@nhutruby
Copy link
Author

HI Florian
I give an example in US
1415 922 4711 , the phony generates 0415 922 4711 ?? , don't need 0 letter ,should 415 922 4711

Thanks
Willing

@floere
Copy link
Owner

floere commented May 16, 2012

What did you do to get these numbers?

I did this with your example:

require 'phony'

p Phony.formatted(Phony.normalize("1415 922 4711")) # => "+1 415 922 4711"

# Or just:
#
p Phony.formatted("14159224711") # => "+1 415 922 4711"

I get +1 415 922 4711. So what exactly are you doing?

@nhutruby
Copy link
Author

HI Florian
for US
Phony.formatted('14159224711', :format => :national).should == '4159224711'
in vietnam is ok Phony.formatted('84903670454', :format => :national) should == 0903670454
Thanks
Willing

@floere
Copy link
Owner

floere commented May 16, 2012

Hi Willing,

I think I get it now. If one uses national formatting, it should not add a zero for US numbers, but for Vietnamese numbers it's ok. Am I right?

Cheers,
Florian

@nhutruby
Copy link
Author

Hi Florian
You are right

Thanks
Willing

@nhutruby
Copy link
Author

Hi Florian

Please change it asap ,I am using your gem

Thanks
Willing

@floere
Copy link
Owner

floere commented May 17, 2012

Hi Willing

This is not how open source software works. If you want "asap", you have to pay: My going rate is 200$ an hour. If you can wait a bit, it is free. "a bit" is dependent on the quality of interaction, and the helpfulness of the other party.

Cheers,
Florian

@nhutruby
Copy link
Author

Hi Florian
:D
I will wait
Thanks
Willing

@floere floere reopened this May 17, 2012
@floere
Copy link
Owner

floere commented May 17, 2012

Hi Willing

Thanks for the wait and your understanding. The fix is released in version 1.7.0.

It is demonstrated here:
https://github.com/floere/phony/blob/master/spec/lib/phony_spec.rb#L175-177

If you notice another error, don't hesitate to open another issue, describing – best in code – what the problem was.

Please also remember that I am providing my work and invested free time out of the goodness of my heart, and ask for nothing else but the occasional thank you note, which are surprisingly rare.

All the best and enjoy,
Florian

@floere floere closed this as completed May 17, 2012
@nhutruby
Copy link
Author

Hi Florian

14159224711 ->still 04159224711
please delete 0
Thanks
Willing

@floere
Copy link
Owner

floere commented May 17, 2012

Have you updated the gem to the latest version > 1.7.0?

This is what I get:

$ gem install phony
Successfully installed phony-1.7.1
1 gem installed
Installing ri documentation for phony-1.7.1...
Installing RDoc documentation for phony-1.7.1...
$ ruby -e 'require "phony"; p Phony.formatted("14159224711", :format => :national)'
"415 922 4711"

(Note the last line – no zero)

@nhutruby
Copy link
Author

Hi Florian
Successful
Thanks
Willing

@floere
Copy link
Owner

floere commented May 17, 2012

Good to hear!

@nhutruby
Copy link
Author

Hi Florian
I saw countries gem ,it's data have some great thing ,please check it to improve phony
Thanks
Willing

@floere
Copy link
Owner

floere commented Jun 4, 2012

Hi Willing,

The great thing about gems and Ruby is that gems are focussed pieces of code. Phony deals with phone numbers and countries deals with countries.
Using Ruby, you can combine them to be a great combo!

I could pull in countries into phony. But then, not everybody needs country stuff in their phone numbers. So I'd rather leave it up to the users of Phony whether to pull in countries or not.

Thanks for your feedback!
Florian

glebm pushed a commit to glebm/phony that referenced this issue Jul 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants