Merge branch 'i18n' of https://github.com/astro/yammat into astro-i18n
Conflicts: Handler/CashCheck.hs Handler/NewUser.hs templates/journal.hamlet templates/modify.hamlet
This commit is contained in:
commit
8a525a1088
33 changed files with 331 additions and 160 deletions
|
@ -11,6 +11,32 @@ import Settings.StaticFiles
|
|||
--snip
|
||||
import qualified Data.Text as T
|
||||
import Network.Wai as Wai
|
||||
import Data.List (tail)
|
||||
import Data.List.Split
|
||||
import Text.Printf
|
||||
|
||||
|
||||
prependZero :: Text -> Text
|
||||
prependZero t0 = if T.null t1
|
||||
then t1
|
||||
else if T.head t1 == '.'
|
||||
then '0' `T.cons` t1
|
||||
else if "-." `T.isPrefixOf` t1
|
||||
then "-0." `T.append` (T.drop 2 t1)
|
||||
else t1
|
||||
|
||||
where t1 = T.dropWhile ((==) ' ') t0
|
||||
|
||||
formatFloat :: Double -> Text
|
||||
formatFloat d = T.pack (t ++ c)
|
||||
where
|
||||
t = reverse (intercalate "." $ chunksOf 3 $ reverse $ fst sp)
|
||||
c = "," ++ tail (snd sp)
|
||||
sp = (break (== '.') (printf "%.2f" d))
|
||||
-- T.pack . (splitEvery 3) . (printf "%,2f")
|
||||
|
||||
formatIntCurrency :: Int -> Text
|
||||
formatIntCurrency x = formatFloat $ ((fromIntegral x) / 100)
|
||||
|
||||
-- | The foundation datatype for your application. This can be a good place to
|
||||
-- keep settings and values requiring initialization before your application
|
||||
|
@ -27,6 +53,13 @@ data App = App
|
|||
instance HasHttpManager App where
|
||||
getHttpManager = appHttpManager
|
||||
|
||||
mkMessage "App" "messages" "de"
|
||||
|
||||
renderMessage' e = do
|
||||
m <- getYesod
|
||||
l <- languages
|
||||
return $ renderMessage m l e
|
||||
|
||||
-- This is where we define all of the routes in our application. For a full
|
||||
-- explanation of the syntax, please see:
|
||||
-- http://www.yesodweb.com/book/routing-and-handlers
|
||||
|
@ -168,3 +201,4 @@ instance RenderMessage App FormMessage where
|
|||
-- https://github.com/yesodweb/yesod/wiki/Sending-email
|
||||
-- https://github.com/yesodweb/yesod/wiki/Serve-static-files-from-a-separate-domain
|
||||
-- https://github.com/yesodweb/yesod/wiki/i18n-messages-in-the-scaffolding
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ getBuyR uId bId = do
|
|||
defaultLayout $ do
|
||||
$(widgetFile "buy")
|
||||
Nothing -> do
|
||||
setMessage "Benutzer oder Artikel unbekannt"
|
||||
setMessageI MsgUserOrArticleUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
postBuyR :: UserId -> BeverageId -> Handler Html
|
||||
|
@ -38,19 +38,19 @@ postBuyR uId bId = do
|
|||
liftIO $ notifyUser user bev price master
|
||||
case sw of
|
||||
False -> do
|
||||
setMessage "Viel Vergnügen"
|
||||
setMessageI MsgPurchaseSuccess
|
||||
redirect $ HomeR
|
||||
True -> do
|
||||
setMessage "Achtung: Guthaben im negativen Bereich"
|
||||
setMessageI MsgPurchaseDebtful
|
||||
redirect $ HomeR
|
||||
True -> do
|
||||
setMessage "So viele Artikel sind nicht vorhanden"
|
||||
setMessageI MsgNotEnoughItems
|
||||
redirect $ BuyR uId bId
|
||||
_ -> do
|
||||
setMessage "Etwas ist schief gelaufen"
|
||||
setMessageI MsgErrorOccured
|
||||
redirect $ HomeR
|
||||
Nothing -> do
|
||||
setMessage "Benutzer oder Artikel unbekannt"
|
||||
setMessageI MsgUserUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
notifyUser :: User -> Beverage -> Int -> App -> IO ()
|
||||
|
@ -80,7 +80,7 @@ getBuyCashR bId = do
|
|||
defaultLayout $ do
|
||||
$(widgetFile "buyCash")
|
||||
Nothing -> do
|
||||
setMessage "Getrank unbekannt"
|
||||
setMessageI MsgItemUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
postBuyCashR :: BeverageId -> Handler Html
|
||||
|
@ -98,20 +98,17 @@ postBuyCashR bId = do
|
|||
runDB $ update bId [BeverageAmount -=. quant]
|
||||
updateCashier price "Barzahlung"
|
||||
checkAlert bId
|
||||
setMessage $ Content $ Text $ "Viel Vergnügen. Bitte Zahle "
|
||||
`T.append` (formatIntCurrency price)
|
||||
`T.append` " "
|
||||
`T.append` (appCurrency $ appSettings master)
|
||||
`T.append` " in die Kasse ein"
|
||||
redirect $ HomeR
|
||||
let currency = appCurrency $ appSettings master
|
||||
setMessageI $ MsgPurchaseSuccessCash price currency
|
||||
redirect HomeR
|
||||
True -> do
|
||||
setMessage "So viele Artikel sind nicht vorhanden"
|
||||
setMessageI MsgNotEnoughItems
|
||||
redirect $ BuyCashR bId
|
||||
_ -> do
|
||||
setMessage "Etwas ist schief gelaufen"
|
||||
setMessageI MsgItemDisappeared
|
||||
redirect $ HomeR
|
||||
Nothing -> do
|
||||
setMessage "Artikel unbekannt"
|
||||
setMessageI MsgItemUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
checkData :: UserId -> BeverageId -> Handler (Maybe (User, Beverage))
|
||||
|
@ -127,4 +124,4 @@ checkData uId bId = do
|
|||
|
||||
buyForm :: Form Int
|
||||
buyForm = renderDivs
|
||||
$ areq amountField "Anzahl" (Just 1)
|
||||
$ areq amountField (fieldSettingsLabel MsgAmount) (Just 1)
|
||||
|
|
|
@ -17,13 +17,13 @@ postCashCheckR = do
|
|||
currentTime <- liftIO getCurrentTime
|
||||
runDB $ insert_ c
|
||||
runDB $ insert_ $ Cashier (cashCheckBalance c) currentTime
|
||||
setMessage "Kassensturz durchgeführt. Kasse aktualisiert"
|
||||
setMessageI MsgCashChecked
|
||||
redirect $ HomeR
|
||||
_ -> do
|
||||
setMessage "Fehler im Kassensturz"
|
||||
setMessageI MsgCashCheckError
|
||||
redirect $ CashCheckR
|
||||
|
||||
createCashCheckForm :: Form CashCheck
|
||||
createCashCheckForm = renderDivs $ CashCheck
|
||||
<$> areq currencyField "Gezählter Betrag" Nothing
|
||||
<$> areq currencyField (fieldSettingsLabel MsgCountedValue) Nothing
|
||||
<*> lift (liftIO getCurrentTime)
|
||||
|
|
|
@ -5,12 +5,9 @@ import Data.FileEmbed (embedFile)
|
|||
import qualified Data.Text as T
|
||||
import qualified Data.Text.Lazy.Encoding as E
|
||||
import qualified Data.Text.Read as R
|
||||
import Data.List (tail)
|
||||
import Data.List.Split
|
||||
import Yesod.Form.Functions
|
||||
import Text.Shakespeare.Text
|
||||
import Network.Mail.Mime
|
||||
import Text.Printf
|
||||
import Import
|
||||
|
||||
-- These handlers embed files in the executable at compile time to avoid a
|
||||
|
@ -113,25 +110,3 @@ sendMail to subject body =
|
|||
, partContent = E.encodeUtf8 body
|
||||
}]]
|
||||
}
|
||||
|
||||
prependZero :: Text -> Text
|
||||
prependZero t0 = if T.null t1
|
||||
then t1
|
||||
else if T.head t1 == '.'
|
||||
then '0' `T.cons` t1
|
||||
else if "-." `T.isPrefixOf` t1
|
||||
then "-0." `T.append` (T.drop 2 t1)
|
||||
else t1
|
||||
|
||||
where t1 = T.dropWhile ((==) ' ') t0
|
||||
|
||||
formatFloat :: Double -> Text
|
||||
formatFloat d = T.pack (t ++ c)
|
||||
where
|
||||
t = reverse (intercalate "." $ chunksOf 3 $ reverse $ fst sp)
|
||||
c = "," ++ tail (snd sp)
|
||||
sp = (break (== '.') (printf "%.2f" d))
|
||||
-- T.pack . (splitEvery 3) . (printf "%,2f")
|
||||
|
||||
formatIntCurrency :: Int -> Text
|
||||
formatIntCurrency x = formatFloat $ ((fromIntegral x) / 100)
|
||||
|
|
|
@ -39,8 +39,8 @@ getUserReactivateR uId = do
|
|||
time <- liftIO getCurrentTime
|
||||
secs <- return $ R.read $ formatTime defaultTimeLocale "%s" time
|
||||
runDB $ update uId [UserTimestamp =. secs]
|
||||
setMessage "Nutzer reaktiviert"
|
||||
setMessageI MsgUserReactivated
|
||||
redirect $ HomeR
|
||||
Nothing -> do
|
||||
setMessage "Nutzer unbekannt"
|
||||
setMessageI MsgUserUnknown
|
||||
redirect $ HomeR
|
||||
|
|
|
@ -12,7 +12,7 @@ getModifyR bId = do
|
|||
defaultLayout $ do
|
||||
$(widgetFile "modify")
|
||||
Nothing -> do
|
||||
setMessage "Artikel unbekannt"
|
||||
setMessageI MsgItemUnknown
|
||||
redirect $ SummaryR
|
||||
|
||||
postModifyR :: BeverageId -> Handler Html
|
||||
|
@ -29,21 +29,21 @@ postModifyR bId = do
|
|||
, BeverageAmount =. beverageAmount nBev
|
||||
, BeverageAlertAmount =. beverageAlertAmount nBev
|
||||
]
|
||||
setMessage "Bearbeitung erfolgreich"
|
||||
setMessageI MsgEditSuccess
|
||||
redirect $ SummaryR
|
||||
_ -> do
|
||||
setMessage "Bearbeitung nicht möglich"
|
||||
setMessageI MsgEditFail
|
||||
redirect $ SummaryR
|
||||
Nothing -> do
|
||||
setMessage "Artikel unbekannt"
|
||||
setMessageI MsgItemUnknown
|
||||
redirect $ SummaryR
|
||||
|
||||
modifyForm :: Beverage -> Form Beverage
|
||||
modifyForm bev = renderDivs $ Beverage
|
||||
<$> areq textField "Name" (Just $ beverageIdent bev)
|
||||
<*> areq currencyField "Preis" (Just $ beveragePrice bev)
|
||||
<*> areq amountField "aktueller Bestand" (Just $ beverageAmount bev)
|
||||
<*> areq amountField "Meldebestand" (Just $ beverageAlertAmount bev)
|
||||
<$> areq textField (fieldSettingsLabel MsgName) (Just $ beverageIdent bev)
|
||||
<*> areq currencyField (fieldSettingsLabel MsgPrice) (Just $ beveragePrice bev)
|
||||
<*> areq amountField (fieldSettingsLabel MsgCurrentStock) (Just $ beverageAmount bev)
|
||||
<*> areq amountField (fieldSettingsLabel MsgAnnouncedStock) (Just $ beverageAlertAmount bev)
|
||||
|
||||
getDeleteBeverageR :: BeverageId -> Handler Html
|
||||
getDeleteBeverageR bId = do
|
||||
|
@ -51,8 +51,8 @@ getDeleteBeverageR bId = do
|
|||
case mBev of
|
||||
Just bev -> do
|
||||
runDB $ delete bId
|
||||
setMessage "Artikel gelöscht"
|
||||
setMessageI MsgItemDeleted
|
||||
redirect $ HomeR
|
||||
Nothing -> do
|
||||
setMessage "Artikel unbekannt"
|
||||
setMessageI MsgItemUnknown
|
||||
redirect $ HomeR
|
||||
|
|
|
@ -21,18 +21,18 @@ postNewUserR = do
|
|||
case res of
|
||||
FormSuccess user -> do
|
||||
_ <- runDB $ insert user
|
||||
setMessage "Benutzer angelegt"
|
||||
setMessageI MsgUserCreated
|
||||
redirect $ HomeR
|
||||
_ -> do
|
||||
setMessage "Benutzer konnte nicht angelegt werden"
|
||||
setMessageI MsgUserNotCreated
|
||||
redirect $ NewUserR
|
||||
|
||||
newUserForm :: Int -> Form User
|
||||
newUserForm secs = renderDivs $ User
|
||||
<$> areq textField "Nickname" Nothing
|
||||
<$> areq textField (fieldSettingsLabel MsgName) Nothing
|
||||
<*> pure 0
|
||||
<*> pure secs
|
||||
<*> aopt emailField "E-mail eintragen, falls Benachrichtigungen erwünscht" Nothing
|
||||
<*> aopt emailField (fieldSettingsLabel MsgEmailNotify) Nothing
|
||||
|
||||
data UserConf = UserConf
|
||||
{ userConfEmail :: Maybe Text
|
||||
|
@ -48,7 +48,7 @@ getModifyUserR uId = do
|
|||
defaultLayout $ do
|
||||
$(widgetFile "modifyUser")
|
||||
Nothing -> do
|
||||
setMessage "Benutzer unbekannt"
|
||||
setMessageI MsgUserUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
postModifyUserR :: UserId -> Handler Html
|
||||
|
@ -63,18 +63,18 @@ postModifyUserR uId = do
|
|||
[ UserEmail =. email
|
||||
]
|
||||
liftIO $ notify user email
|
||||
setMessage "Nutzerdaten aktualisiert"
|
||||
setMessageI MsgUserEdited
|
||||
redirect $ SelectR uId
|
||||
_ -> do
|
||||
setMessage "Nutzerdatenaktualisierung nicht erfolgreich"
|
||||
setMessageI MsgUserNotEdited
|
||||
redirect $ SelectR uId
|
||||
Nothing -> do
|
||||
setMessage "Nutzer unbekannt"
|
||||
setMessageI MsgUserUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
modifyUserForm :: User -> Form (Maybe Text)
|
||||
modifyUserForm user = renderDivs $
|
||||
aopt emailField "E-Mail eintragen, falls Benchrichtigungen erwünscht" (Just $ userEmail user)
|
||||
aopt emailField (fieldSettingsLabel MsgEmailNotify) (Just $ userEmail user)
|
||||
|
||||
notify :: User -> Maybe Text -> IO ()
|
||||
notify user email
|
||||
|
|
|
@ -20,14 +20,15 @@ postPayoutR = do
|
|||
((res, _), _) <- runFormPost payoutForm
|
||||
case res of
|
||||
FormSuccess payment -> do
|
||||
updateCashier (- (paymentAmount payment)) ("Auszahlung: " `T.append` paymentDesc payment)
|
||||
setMessage "Betrag ausgezahlt"
|
||||
msg <- renderMessage' $ MsgPayout $ paymentDesc payment
|
||||
updateCashier (- (paymentAmount payment)) msg
|
||||
setMessageI MsgPaidOut
|
||||
redirect $ HomeR
|
||||
_ -> do
|
||||
setMessage "Auszahlung nicht möglich"
|
||||
setMessageI MsgNotPaidOut
|
||||
redirect $ JournalR
|
||||
|
||||
payoutForm :: Form Payment
|
||||
payoutForm = renderDivs $ Payment
|
||||
<$> areq currencyField "Betrag" Nothing
|
||||
<*> areq textField "Beschreibung" Nothing
|
||||
<$> areq currencyField (fieldSettingsLabel MsgValue) Nothing
|
||||
<*> areq textField (fieldSettingsLabel MsgDescription) Nothing
|
||||
|
|
|
@ -18,7 +18,7 @@ getUpstockR bId = do
|
|||
defaultLayout $ do
|
||||
$(widgetFile "upstock")
|
||||
Nothing -> do
|
||||
setMessage "Artikel unbekannt"
|
||||
setMessageI MsgItemUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
postUpstockR :: BeverageId -> Handler Html
|
||||
|
@ -32,21 +32,21 @@ postUpstockR bId = do
|
|||
case c > 0 of
|
||||
True -> do
|
||||
runDB $ update bId [BeverageAmount +=. c]
|
||||
setMessage "Bestand aufgefüllt"
|
||||
setMessageI MsgStockedUp
|
||||
redirect $ HomeR
|
||||
False -> do
|
||||
setMessage "Bestand kann nicht negativ aufgefüllt werden"
|
||||
setMessageI MsgNotStockedUp
|
||||
redirect $ UpstockR bId
|
||||
_ -> do
|
||||
setMessage "Fehler beim Auffüllen"
|
||||
setMessageI MsgStockupError
|
||||
redirect $ UpstockR bId
|
||||
Nothing -> do
|
||||
setMessage "Artikel unbekannt"
|
||||
setMessageI MsgItemUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
upstockForm :: Form Int
|
||||
upstockForm = renderDivs
|
||||
$ areq amountField "Anzahl hinzugefügt" (Just 0)
|
||||
$ areq amountField (fieldSettingsLabel MsgAmountAdded) (Just 0)
|
||||
|
||||
getNewArticleR :: Handler Html
|
||||
getNewArticleR = do
|
||||
|
@ -60,15 +60,15 @@ postNewArticleR = do
|
|||
case result of
|
||||
FormSuccess bev -> do
|
||||
runDB $ insert_ bev
|
||||
setMessage "Neuer Artikel hinzugefügt"
|
||||
setMessageI MsgItemAdded
|
||||
redirect $ HomeR
|
||||
_ -> do
|
||||
setMessage "Fehler beim Hinzufügen"
|
||||
setMessageI MsgItemNotAdded
|
||||
redirect $ HomeR
|
||||
|
||||
newArticleForm :: Form Beverage
|
||||
newArticleForm = renderDivs $ Beverage
|
||||
<$> areq textField "Name" Nothing
|
||||
<*> areq currencyField "Preis" (Just 100)
|
||||
<*> areq amountField "Anzahl Elemente" (Just 0)
|
||||
<*> areq amountField "Warnung bei Anzahl" (Just 0)
|
||||
<$> areq textField (fieldSettingsLabel MsgName) Nothing
|
||||
<*> areq currencyField (fieldSettingsLabel MsgPrice) (Just 100)
|
||||
<*> areq amountField (fieldSettingsLabel MsgAmount) (Just 0)
|
||||
<*> areq amountField (fieldSettingsLabel MsgAmountWarning) (Just 0)
|
||||
|
|
|
@ -15,7 +15,7 @@ getSelectR uId = do
|
|||
defaultLayout $ do
|
||||
$(widgetFile "select")
|
||||
Nothing -> do
|
||||
setMessage "Benutzer unbekannt"
|
||||
setMessageI MsgUserUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
getSelectCashR :: Handler Html
|
||||
|
@ -30,10 +30,11 @@ getRechargeR uId = do
|
|||
case mUser of
|
||||
Just user -> do
|
||||
(rechargeWidget, enctype) <- generateFormPost rechargeForm
|
||||
currency <- appCurrency <$> appSettings <$> getYesod
|
||||
defaultLayout $ do
|
||||
$(widgetFile "recharge")
|
||||
Nothing -> do
|
||||
setMessage "Benutzer unbekannt"
|
||||
setMessageI MsgUserUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
postRechargeR :: UserId -> Handler Html
|
||||
|
@ -48,15 +49,15 @@ postRechargeR uId = do
|
|||
time <- liftIO getCurrentTime
|
||||
secs <- return $ R.read $ formatTime defaultTimeLocale "%s" time
|
||||
runDB $ update uId [UserBalance +=. amount, UserTimestamp =. secs]
|
||||
setMessage "Guthaben erfolgreich aufgeladen"
|
||||
setMessageI MsgRecharged
|
||||
redirect $ HomeR
|
||||
_ -> do
|
||||
setMessage "Fehler beim Aufladen"
|
||||
setMessageI MsgRechargeError
|
||||
redirect $ HomeR
|
||||
Nothing -> do
|
||||
setMessage "Benutzer unbekannt"
|
||||
setMessageI MsgUserUnknown
|
||||
redirect $ HomeR
|
||||
|
||||
rechargeForm :: Form Int
|
||||
rechargeForm = renderDivs
|
||||
$ areq currencyField "Betrag" (Just 0)
|
||||
$ areq currencyField (fieldSettingsLabel MsgValue) (Just 0)
|
||||
|
|
|
@ -19,7 +19,7 @@ Transaction
|
|||
deriving Typeable Show
|
||||
Cashier
|
||||
balance Int
|
||||
created UTCTime
|
||||
created UTCTime default=now()
|
||||
deriving Typeable Show
|
||||
CashCheck
|
||||
balance Int
|
||||
|
|
76
messages/de.msg
Normal file
76
messages/de.msg
Normal file
|
@ -0,0 +1,76 @@
|
|||
UserReactivated: Nutzer reaktiviert
|
||||
UserUnknown: Nutzer unbekannt
|
||||
UserOrArticleUnknown: Benutzer oder Artikel unbekannt
|
||||
PurchaseSuccess: Viel Vergnügen
|
||||
PurchaseDebtful: Achtung: Guthaben im negativen Bereich
|
||||
NotEnoughItems: So viele Artikel sind nicht vorhanden
|
||||
ErrorOccured: Etwas ist schief gelaufen
|
||||
ItemUnknown: Artikel unbekannt
|
||||
PurchaseSuccessCash price@Int currency@Text: Viel Vergnügen. Bitte Zahle #{formatIntCurrency price} #{currency} in die Kasse ein
|
||||
ItemDisappeared: Artikel ist verschwunden o_0
|
||||
Amount: Anzahl
|
||||
EditSuccess: Bearbeitung erfolgreich
|
||||
EditFail: Bearbeitung nicht möglich
|
||||
Name: Name
|
||||
Price: Preis
|
||||
CurrentStock: Aktueller Bestand
|
||||
AnnouncedStock: Meldebestand
|
||||
DeleteItem: Artikel löschen
|
||||
ItemDeleted: Artikel gelöscht
|
||||
UserCreated: Benutzer angelegt
|
||||
UserNotCreated: Benutzer konnte nicht angelegt werden
|
||||
EmailNotify: E-Mail eintragen falls Benachrichtigungen erwünscht
|
||||
BuyNotification: Benachrichtigung bei Kauf
|
||||
UserEdited: Nutzerdaten aktualisiert
|
||||
UserNotEdited: Nutzerdatenaktualisierung nicht erfolgreich
|
||||
Payout desc@Text: Auszahlung: #{desc}
|
||||
PaidOut: Betrag ausgezahlt
|
||||
NotPaidOut: Auszahlung nicht möglich
|
||||
Value: Betrag
|
||||
Description: Beschreibung
|
||||
StockedUp: Bestand aufgefüllt
|
||||
NotStockedUp: Bestand kann nicht negativ aufgefüllt werden
|
||||
StockupError: Fehler beim Auffüllen
|
||||
AmountAdded: Anzahl hinzugefügt
|
||||
ItemAdded: Neuer Artikel hinzugefügt
|
||||
ItemNotAdded: Fehler beim Hinzufügen
|
||||
AmountWarning: Warnung bei Anzahl
|
||||
Recharged: Guthaben erfolgreich aufgeladen
|
||||
RechargeError: Fehler beim Aufladen
|
||||
CashCheck: Kassensturz
|
||||
CashChecked: Kassensturz durchgeführt. Kasse aktualisiert
|
||||
CashCheckError: Fehler im Kassensturz
|
||||
CountedValue: Gezählter Betrag
|
||||
PurchaseOf name@Text: Kauf von #{name}
|
||||
PricePerUnit price@Int currency@Text: Preis pro Einheit: #{formatIntCurrency price} #{currency}
|
||||
Purchase: Kaufen
|
||||
PleaseCountAndCheck: Bitte Kasse zählen und gezählten Betrag in unten stehendes Feld eintragen.
|
||||
Submit: Absenden
|
||||
Home: Nachhause
|
||||
Restock: Lager befüllen
|
||||
Journal: Journal
|
||||
Summary: Inventar
|
||||
PayCash: Bar bezahlen
|
||||
CreateUser: Neuen Nutzer anlegen
|
||||
ReactivateOldUser: Alten Nutzer reaktivieren
|
||||
Time: Zeit
|
||||
ValueIn currency@Text: Betrag in #{currency}
|
||||
TotalValue: Gesamtbetrag
|
||||
CashStock: Kassenbestand
|
||||
PayoutFromCash: Aus der Kasse auszahlen
|
||||
NothingToShow: Noch keine Bewegungen zu verzeichnen
|
||||
NewItem: Neuer Artikel
|
||||
NewUser: Neuer Benutzer
|
||||
DoPayout: Auszahlen
|
||||
ReactivateUser: Nutzer reaktivieren
|
||||
Recharge: Guthaben aufladen
|
||||
CurrentCharge charge@Int currency@Text: aktuelles Guthaben: #{formatIntCurrency charge} #{currency}
|
||||
AddItem: neuen Artikel hinzufügen
|
||||
EditUser: Nutzerdaten akutalisieren
|
||||
ChoosePrompt text@Text: Wähle deinen Artikel, #{text}
|
||||
SelectItem: Wähle deinen Artikel
|
||||
CurrentAmount: Aktuelle Anzahl
|
||||
NoItems: keine Getränke vorhanden
|
||||
StockUp name@Text: Bestand von #{name} auffüllen
|
||||
Fillup: Auffüllen
|
||||
CashCheckOf date@String: Kassensturz vom #{date}
|
76
messages/en.msg
Normal file
76
messages/en.msg
Normal file
|
@ -0,0 +1,76 @@
|
|||
UserReactivated: User reactivated
|
||||
UserUnknown: User unknown
|
||||
UserOrArticleUnknown: User or item unknown
|
||||
PurchaseSuccess: Enjoy!
|
||||
PurchaseDebtful: Attention: You are in debt!
|
||||
NotEnoughItems: Not enough items available
|
||||
ErrorOccured: Something went wrong
|
||||
ItemUnknown: Item unknown
|
||||
PurchaseSuccessCash price@Int currency@Text: Enjoy. Please pay #{currency} #{formatIntCurrency price} #{currency} in cash.
|
||||
ItemDisappeared: Item disappeared o_0
|
||||
Amount: Amount
|
||||
EditSuccess: Edited successfully
|
||||
EditFail: Editing failed
|
||||
Name: Name
|
||||
Price: Price
|
||||
CurrentStock: Current stock
|
||||
AnnouncedStock: Announced stock
|
||||
DeleteItem: Delete Item
|
||||
ItemDeleted: Item deleted
|
||||
UserCreated: User created
|
||||
UserNotCreated: Could not create user
|
||||
EmailNotify: enter eMail if you want notifications
|
||||
BuyNotification: Notify on purchase
|
||||
UserEdited: User edited
|
||||
UserNotEdited: Could not edit user
|
||||
Payout desc@Text: Payout: #{desc}
|
||||
PaidOut: Amount paid out
|
||||
NotPaidOut: Could not pay out
|
||||
Value: Value
|
||||
Description: Description
|
||||
StockedUp: Stocked up
|
||||
NotStockedUp: Could not stock up
|
||||
StockupError: Error stocking up
|
||||
AmountAdded: Amount added
|
||||
ItemAdded: New item added
|
||||
ItemNotAdded: Error when adding
|
||||
AmountWarning: Amount warning
|
||||
Recharged: Recharged!
|
||||
RechargeError: Error recharging
|
||||
CashCheck: Cash check
|
||||
CashChecked: Cash checked and updated.
|
||||
CashCheckError: Error on cash check
|
||||
CountedValue: Counted value
|
||||
PurchaseOf name@Text: Purchase of #{name}
|
||||
PricePerUnit price@Int currency@Text: Price per unit: #{currency} #{formatIntCurrency price}
|
||||
Purchase: Buy
|
||||
PleaseCountAndCheck: Please count cash reserves and update amount below.
|
||||
Submit: Submit
|
||||
Home: Home
|
||||
Restock: Restock inventory
|
||||
Journal: Journal
|
||||
Summary: Inventory
|
||||
PayCash: Pay cash
|
||||
CreateUser: Create user
|
||||
ReactivateOldUser: Reactivate old user
|
||||
Time: Time
|
||||
ValueIn currency@Text: Value in #{currency}
|
||||
TotalValue: Total value
|
||||
CashStock: Cash stock
|
||||
PayoutFromCash: Pay out cash
|
||||
NothingToShow: No movements
|
||||
NewItem: New item
|
||||
NewUser: New User
|
||||
DoPayout: Payout
|
||||
ReactivateUser: Reactivate user
|
||||
Recharge: Recharge
|
||||
CurrentCharge charge@Int currency@Text: Current charge: #{currency} #{formatIntCurrency charge} #{currency}
|
||||
AddItem: Add new item
|
||||
EditUser: Edit user
|
||||
ChoosePrompt text@Text: Choose an item, #{text}
|
||||
SelectItem: Select item
|
||||
CurrentAmount: Current amount
|
||||
NoItems: No items
|
||||
StockUp name@Text: Stock up #{name}
|
||||
Fillup: Fill up
|
||||
CashCheckOf date@String: Cash check of #{date}
|
|
@ -56,6 +56,11 @@ header a {
|
|||
box-shadow: 0px 0px 3px #c4c4c4;
|
||||
}
|
||||
|
||||
header .lang a {
|
||||
background-color: olive;
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
header ul {
|
||||
list-style: none outside none;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Kauf von #{beverageIdent bev}
|
||||
<h3>_{MsgPurchaseOf $ beverageIdent bev}
|
||||
|
||||
<p>
|
||||
Preis pro Einheit: #{formatIntCurrency (beveragePrice bev)} #{appCurrency $ appSettings master}
|
||||
_{MsgPricePerUnit (beveragePrice bev) (appCurrency $ appSettings master)}
|
||||
|
||||
<form method=post enctype=#{enctype}>
|
||||
^{buyWidget}
|
||||
<div>
|
||||
<input type=submit value="Kaufen">
|
||||
<input type=submit value="_{MsgPurchase}">
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Kauf von #{beverageIdent bev}
|
||||
<h3>_{MsgPurchaseOf $ beverageIdent bev}
|
||||
|
||||
<p>
|
||||
Preis pro Einheit: #{formatIntCurrency (beveragePrice bev + 50)} #{appCurrency $ appSettings master}
|
||||
_{MsgPricePerUnit (beveragePrice bev + 50) (appCurrency $ appSettings master)}
|
||||
|
||||
<form method=post enctype=#{enctype}>
|
||||
^{buyCashWidget}
|
||||
<div>
|
||||
<input type=submit value="Kaufen">
|
||||
<input type=submit value="_{MsgPurchase}">
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Kassensturz
|
||||
<h3>_{MsgCashCheck}
|
||||
|
||||
<p>
|
||||
Bitte Kasse zählen und gezählten Betrag in unten stehendes Feld eintragen.
|
||||
_{MsgPleaseCountAndCheck}
|
||||
|
||||
|
||||
<form method=post enctype=#{enctype}>
|
||||
^{cashCheckWidget}
|
||||
<div>
|
||||
<input type=submit value="Absenden">
|
||||
<input type=submit value="_{MsgSubmit}">
|
||||
|
|
|
@ -23,21 +23,7 @@ $newline never
|
|||
<script>
|
||||
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/,'js');
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href=@{HomeR}>Home
|
||||
<div id="main" role="main">
|
||||
^{pageBody pc}
|
||||
<footer>
|
||||
<span>
|
||||
<a href=@{RestockR}>Lager befüllen
|
||||
<span>
|
||||
<a href=@{JournalR}>Journal
|
||||
<span>
|
||||
<a href=@{SummaryR}>Inventar
|
||||
^{pageBody pc}
|
||||
|
||||
$maybe analytics <- appAnalytics $ appSettings master
|
||||
<script>
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
$maybe msg <- mmsg
|
||||
<div #message>#{msg}
|
||||
^{widget}
|
||||
<div class="container">
|
||||
<header>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href=@{HomeR}>_{MsgHome}
|
||||
<li .lang>
|
||||
<a onclick="document.cookie = '_LANG=en'; location.reload()">EN
|
||||
<a onclick="document.cookie = '_LANG=de'; location.reload()">DE
|
||||
|
||||
<div id="main" role="main">
|
||||
$maybe msg <- mmsg
|
||||
<div #message>#{msg}
|
||||
^{widget}
|
||||
|
||||
<footer>
|
||||
<span>
|
||||
<a href=@{RestockR}>_{MsgRestock}
|
||||
<span>
|
||||
<a href=@{JournalR}>_{MsgJournal}
|
||||
<span>
|
||||
<a href=@{SummaryR}>_{MsgSummary}
|
||||
|
|
|
@ -5,11 +5,11 @@ $if null beverages
|
|||
|
||||
<article .article #func>
|
||||
<a href=@{SelectCashR}>
|
||||
<p>Bar bezahlen
|
||||
<p>_{MsgPayCash}
|
||||
|
||||
<article .article #func>
|
||||
<a href=@{NewUserR}>
|
||||
<p>Neuen Nutzer anlegen
|
||||
<p>_{MsgCreateUser}
|
||||
|
||||
$forall (Entity uId user) <- users
|
||||
<article .article>
|
||||
|
@ -18,4 +18,4 @@ $forall (Entity uId user) <- users
|
|||
|
||||
<article .article #func>
|
||||
<a href=@{ReactivateR}>
|
||||
<p>Alten Nutzer reaktivieren
|
||||
<p>_{MsgReactivateOldUser}
|
||||
|
|
|
@ -6,9 +6,9 @@ $if not $ L.null entries
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Zeit
|
||||
<th>Beschreibung
|
||||
<th>Betrag in #{appCurrency $ appSettings master}
|
||||
<th>_{MsgTime}
|
||||
<th>_{MsgDescription}
|
||||
<th>_{MsgValueIn $ appCurrency $ appSettings master}
|
||||
$forall (eTransCash) <- list
|
||||
$case eTransCash
|
||||
$of Left trans
|
||||
|
@ -19,21 +19,21 @@ $if not $ L.null entries
|
|||
$of Right cash
|
||||
<tr #check>
|
||||
<td colspan="2">
|
||||
Kassensturz vom #{formatTime defaultTimeLocale "%A %F %H:%M" $ cashCheckTime cash}:
|
||||
_{MsgCashCheckOf $ formatTime defaultTimeLocale "%A %F %H:%M" $ cashCheckTime cash}:
|
||||
<td>#{formatIntCurrency (cashCheckBalance cash)} #{appCurrency $ appSettings master}
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">Gesamtbetrag:
|
||||
<td>#{formatIntCurrency total} #{appCurrency $ appSettings master}
|
||||
<td colspan="2">_{MsgTotalValue}:
|
||||
<td>#{formatIntCurrency (fromIntegral total)} #{appCurrency $ appSettings master}
|
||||
<p>
|
||||
Kassenbestand: #{formatIntCurrency (fromIntegral cashBalance)} #{appCurrency $ appSettings master}
|
||||
_{MsgCashStock}: #{formatIntCurrency (fromIntegral cashBalance)} #{appCurrency $ appSettings master}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href=@{PayoutR}>
|
||||
Aus der Kasse auszahlen
|
||||
_{MsgPayoutFromCash}
|
||||
<li>
|
||||
<a href=@{CashCheckR}>
|
||||
Kassensturz
|
||||
_{MsgCashCheck}
|
||||
$else
|
||||
<p>Noch keine Bewegungen zu verzeichnen
|
||||
<p>_{MsgNothingToShow}
|
||||
|
|
|
@ -8,4 +8,4 @@ $doctype 5
|
|||
<input type=submit value="Absenden">
|
||||
|
||||
<a href=@{DeleteBeverageR bId}>
|
||||
Artikel löschen
|
||||
_{MsgDeleteItem}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Benutzer bearbeiten
|
||||
<h3>_{MsgEditUser}
|
||||
|
||||
<form method=post enctype=#{enctype}>
|
||||
^{modifyUserWidget}
|
||||
<div>
|
||||
<input type=submit value="Absenden">
|
||||
<input type=submit value="_{MsgSubmit}">
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Neuer Artikel
|
||||
<h3>_{MsgNewItem}
|
||||
|
||||
<form method=post enctype=#{enctype}>
|
||||
^{newArticleWidget}
|
||||
<div>
|
||||
<input type=submit value="Absenden">
|
||||
<input type=submit value="_{MsgSubmit}">
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Neuer Benutzer
|
||||
<h3>_{MsgNewUser}
|
||||
|
||||
<form method=post enctype=#{enctype}>
|
||||
^{newUserWidget}
|
||||
<div>
|
||||
<input type=submit value="Absenden">
|
||||
<input type=submit value="_{MsgSubmit}">
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Auszahlung aus der Kasse
|
||||
<h3>_{MsgPayoutFromCash}
|
||||
|
||||
<p>Bitte gewünschten Betrag angeben
|
||||
|
||||
<form method=post enctype='{enctype}>
|
||||
<form method=post enctype=#{enctype}>
|
||||
^{payoutWidget}
|
||||
<div>
|
||||
<input type=submit value="Auszahlen">
|
||||
<input type=submit value="_{MsgDoPayout}">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Nutzer reaktivieren
|
||||
<h3>_{MsgReactivateUser}
|
||||
|
||||
$forall (Entity uId user) <- users
|
||||
<article .article>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>
|
||||
Guthaben aufladen
|
||||
_{MsgRecharge}
|
||||
|
||||
<p>
|
||||
aktuelles Guthaben: #{formatIntCurrency (userBalance user)}
|
||||
_{MsgCurrentCharge (userBalance user) currency}
|
||||
|
||||
<form method=post enctype=#{enctype}>
|
||||
^{rechargeWidget}
|
||||
<div>
|
||||
<input type=submit value="Aufladen">
|
||||
<input type=submit value="_{MsgRecharge}">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>
|
||||
Bestände wieder auffüllen
|
||||
_{MsgRestock}
|
||||
|
||||
$forall (Entity bId bev) <- beverages
|
||||
<article .article>
|
||||
|
@ -12,4 +12,4 @@ $forall (Entity bId bev) <- beverages
|
|||
<article .article #func>
|
||||
<a href=@{NewArticleR}>
|
||||
<p>
|
||||
neuen Artikel hinzufügen
|
||||
_{MsgAddItem}
|
||||
|
|
|
@ -3,15 +3,15 @@ $doctype 5
|
|||
<div .header>
|
||||
<ul>
|
||||
<li>
|
||||
aktuelles Guthaben: #{formatIntCurrency (userBalance user)} #{appCurrency $ appSettings master}
|
||||
_{MsgCurrentCharge (userBalance user) (appCurrency $ appSettings master)}
|
||||
<li>
|
||||
<a href=@{RechargeR uId}>
|
||||
Guthaben aufladen
|
||||
_{MsgRecharge}
|
||||
<li>
|
||||
<a href=@{ModifyUserR uId}>
|
||||
Nutzerdaten akutalisieren
|
||||
_{MsgEditUser}
|
||||
|
||||
<h3>Wähle deinen Artikel, #{userIdent user}
|
||||
<h3>_{MsgChoosePrompt $ userIdent user}
|
||||
|
||||
$if null beverages
|
||||
<h1>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Wähle deinen Artikel
|
||||
<h3>_{MsgSelectItem}
|
||||
|
||||
$forall (Entity bId bev) <- beverages
|
||||
<article .article>
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Übersicht
|
||||
<h3>_{MsgSummary}
|
||||
|
||||
$if not $ L.null bevs
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name
|
||||
<th>aktuelle Anzahl
|
||||
<th>Meldebestand
|
||||
<th>Preis in #{appCurrency $ appSettings master}
|
||||
<th>_{MsgName}
|
||||
<th>_{MsgCurrentAmount}
|
||||
<th>_{MsgAnnouncedStock}
|
||||
<th>_{MsgValueIn $ appCurrency $ appSettings master}
|
||||
<th>
|
||||
$forall (Entity bId bev) <- bevs
|
||||
<tr>
|
||||
|
@ -19,4 +19,4 @@ $if not $ L.null bevs
|
|||
<td>#{formatIntCurrency (beveragePrice bev)} #{appCurrency $ appSettings master}
|
||||
<td><a href=@{ModifyR bId}>bearbeiten
|
||||
$else
|
||||
<p>keine Getränke vorhanden
|
||||
<p>_{MsgNoItems}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
$doctype 5
|
||||
|
||||
<h3>Bestand von #{beverageIdent bev} auffüllen
|
||||
<h3>_{MsgStockUp $ beverageIdent bev}
|
||||
|
||||
<p>
|
||||
Aktueller Bestand: #{beverageAmount bev}
|
||||
_{MsgCurrentStock}: #{beverageAmount bev}
|
||||
|
||||
<form method=post enctype=#{enctype}>
|
||||
^{upstockWidget}
|
||||
<div>
|
||||
<input type=submit value="Auffüllen">
|
||||
<input type=submit value="_{MsgFillup}">
|
||||
|
|
Loading…
Reference in a new issue