From 2c2ed5e52a1b4e55b3f819b27246417fcd2a378b Mon Sep 17 00:00:00 2001 From: Cezar Halmagean Date: Tue, 30 Aug 2016 13:10:59 +0300 Subject: [PATCH] Add Romanian translations --- src/Date/Extra/Config/Config_ro_ro.elm | 33 ++++++++++ src/Date/Extra/I18n/I_ro_ro.elm | 84 ++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 src/Date/Extra/Config/Config_ro_ro.elm create mode 100644 src/Date/Extra/I18n/I_ro_ro.elm diff --git a/src/Date/Extra/Config/Config_ro_ro.elm b/src/Date/Extra/Config/Config_ro_ro.elm new file mode 100644 index 0000000..1c6da91 --- /dev/null +++ b/src/Date/Extra/Config/Config_ro_ro.elm @@ -0,0 +1,33 @@ +module Date.Extra.Config.Config_ro_ro exposing (..) + +{-| This is the Romanian config for formatting dates. + +@docs config + +Copyright (c) 2016 Cezar Halmagean +-} + +import Date +import Date.Extra.Config as Config +import Date.Extra.I18n.I_ro_ro as Romanian + + +{-| Config for ro_ro. -} +config : Config.Config +config = + { i18n = + { dayShort = Romanian.dayShort + , dayName = Romanian.dayName + , monthShort = Romanian.monthShort + , monthName = Romanian.monthName + , dayOfMonthWithSuffix = Romanian.dayOfMonthWithSuffix + } + , format = + { date = "%d.%m.%Y" -- dd.MM.yyyy + , longDate = "%A, %-d %B %Y" -- dddd, d MMMM yyyy + , time = "%-H:%M" -- h:mm + , longTime = "%-H:%M:%S" -- h:mm:ss + , dateTime = "%-d.%m.%Y %-H:%M" -- date + time + , firstDayOfWeek = Date.Mon + } + } diff --git a/src/Date/Extra/I18n/I_ro_ro.elm b/src/Date/Extra/I18n/I_ro_ro.elm new file mode 100644 index 0000000..860645e --- /dev/null +++ b/src/Date/Extra/I18n/I_ro_ro.elm @@ -0,0 +1,84 @@ +module Date.Extra.I18n.I_ro_ro exposing (..) + +{-| Romanian values for day and month names. + +@docs dayShort +@docs dayName +@docs monthShort +@docs monthName +@docs dayOfMonthWithSuffix + +Copyright (c) 2016 Cezar Halmagean +-} + + +import Date exposing (Day (..), Month (..)) + + +{-| Day short name. -} +dayShort : Day -> String +dayShort day = + case day of + Mon -> "Lun" + Tue -> "Mar" + Wed -> "Mie" + Thu -> "Joi" + Fri -> "Vin" + Sat -> "Sâm" + Sun -> "Dum" + + +{-| Day full name. -} +dayName : Day -> String +dayName day = + case day of + Mon -> "Luni" + Tue -> "Marți" + Wed -> "Miercuri" + Thu -> "Joi" + Fri -> "Vineri" + Sat -> "Sâmbătă" + Sun -> "Duminică" + + +{-| Month short name. -} +monthShort : Month -> String +monthShort month = + case month of + Jan -> "Ian" + Feb -> "Feb" + Mar -> "Mar" + Apr -> "Apr" + May -> "Mai" + Jun -> "Iun" + Jul -> "Iul" + Aug -> "Aug" + Sep -> "Sep" + Oct -> "Oct" + Nov -> "Noi" + Dec -> "Dec" + + +{-| Month full name. -} +monthName : Month -> String +monthName month = + case month of + Jan -> "Ianuarie" + Feb -> "Februarie" + Mar -> "Martie" + Apr -> "Aprilie" + May -> "Mai" + Jun -> "Iunie" + Jul -> "Iulie" + Aug -> "August" + Sep -> "Septembrie" + Oct -> "Octombrie" + Nov -> "Noiembrie" + Dec -> "Decembrie" + + +{-| No suffixes for Romanian -} +dayOfMonthWithSuffix : Bool -> Int -> String +dayOfMonthWithSuffix pad day = + case day of + _ -> (toString day)