A comprehensive solution written in Go to facilitate internationalization.
-
Country Metadata:
- Provide metadata for countries, including name, supported currency, dial code, timezones, and default locale.
-
Currency Module:
- Handle currency-related operations, such as retrieving currency names and symbols.
-
Phone Number Handling:
- Fetch phone number related information, including dial codes and regex patterns.
-
Subdivisions (States) Information:
- Support for accessing information about subdivisions (states) within countries, such as names and cities.
This package is compatible with modern versions of Go in module mode. If you have Go installed, you can add the package to your current development module and its dependencies by running:
go get github.com/razorpay/i18nify/packages/i18nify-go
will resolve and add the package to the current development module, along with its dependencies.
Alternatively, you can achieve the same result by importing the package in your code:
import "github.com/razorpay/i18nify/packages/i18nify-go"
Then, run go get without any parameters.
To use the latest version of this repository's main branch, execute the following command:
go get github.com/razorpay/i18nify/packages/i18nify-go@master
To initialize the Country
package in your Go application, you can use the following code snippet:
import (
i18nify_go "github.com/razorpay/i18nify/packages/i18nify-go"
)
func main() {
// Initialize the country package for a specific country (e.g., India)
countryIN := i18nify_go.NewCountry("IN")
// Now you can use countryIN to access various country-related information
// For example usage refer to example/example.go (Link provided below)
}
For example usage refer to example/example.go https://github.com/razorpay/i18nify/blob/master/packages/i18nify-go/example/example.go
Source:
India (IN): https://www.data.gov.in/catalog/all-india-pincode-directory Malaysia (MY): https://malaysiapostcode.com/ USA (US): https://www.unitedstateszipcodes.org Singapore (SG): #TBD
TBD
Feel free to contribute to this sdk by opening issues or pull requests. Your feedback and contributions are highly appreciated.