CDSoft / pp

PP - Generic preprocessor (with pandoc in mind) - macros, literate programming, diagrams, scripts...
http://cdelord.fr/pp
GNU General Public License v3.0
253 stars 21 forks source link

i18n: IT Localization #19

Closed tajmone closed 7 years ago

tajmone commented 7 years ago

Is it possible to add support for Italian locale to pp?

Here's my adaptation of the locale date format settings for Italian, based on the French from Preprocessor.hs:

-- italian locale date format
myLocale "it" = TimeLocale {
                    wDays = [("domenica","dom")
                            ,("lunedì","lun")
                            ,("martedì","mar")
                            ,("mercoledì","mer")
                            ,("giovedì","gio")
                            ,("venerdì","ven")
                            ,("sabato","sab")],
                    months = [("gennaio","gen")
                             ,("febbraio","feb")
                             ,("marzo","mar")
                             ,("aprile","apr")
                             ,("maggio","mag")
                             ,("giugno","giu")
                             ,("luglio","lug")
                             ,("agosto","ago")
                             ,("settembre","set")
                             ,("ottobre","ott")
                             ,("novembre","nov")
                             ,("dicembre","dic")],
                    amPm = ("AM","PM"),
                    knownTimeZones = [],
                    dateTimeFmt = "%a %e %b %Y, %H:%M:%S %Z",
                    dateFmt = "%d/%m/%y",
                    timeFmt = "%H:%M:%S",
                    time12Fmt = "%I:%M:%S %p"
                }

In Italian weekdays and monthes name are lower cased, unlike English.

I've adapted dateTimeFmt definition to the Italian way of representing long dates.

Sorry if my contribution has to go through copy-&.paste, but I don't have Haskell installed, nor I can work my way into that language — so I'd rather avoid messing up the source by commiting changes I don't fully understand and can't test thoroughly.

CDSoft commented 7 years ago

Thanks. I'll add a separate module for localization and add your contribution.

CDSoft commented 7 years ago

added.