Socket
Socket
Sign inDemoInstall

github.com/davidgs/datesi18n

Package Overview
Dependencies
6
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/davidgs/datesi18n

Package datesi18n provides internationalization for programs needing language support for weekdays and months. The package is intended to be used with the dates package. The following code is an example of using the datesi18n package: The output of the program is:


Version published

Readme

Source

DatesI18n

A library to do quick translations of Day and Month names, including 'short' names, where provided.

Usage

package main

import (
  "fmt"

  datesI18N "github.com/davidgs/datesI18N"
)

func main() {
  fr := datesI18N.NewDatesI18N("fr") // french
  wed := fr.Weekdays.Wednesday
  fmt.Println("French Wednesday: ", wed)
}

Output:

French Wednesday: Mercredi

If you are using the Go time Package, you can use this package to give you translated Days and months.

Language Support

Note: Not all languages have all parts translated! Soo the lang/ directory for languages supported. See the individual .json file for which parts of the Days/Months are provided.

If you would like to provide additional translations or additions to a given translation, please submit a PR!

See Supported Languages for a current list of fully- or partially-supported languages

FAQs

Last updated on 30 Sep 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc