Someone once asked...
Someone answered with kindness...
I would say it is a good idea. If your intention is to connect with the people from a place you go to, learning their language is a way to create a closer connection. When you speak someone's native language, you speak closer to their heart than if you spoke in a language foreign to that person. Is also shows genuine effort, which in most places I think is appreciated.