Merge branch 'croatian_translation'

This commit is contained in:
nek0 2017-08-04 07:08:34 +02:00
commit 671eab1697
4 changed files with 19 additions and 20 deletions

View file

@ -47,12 +47,14 @@ postTransferR from to =
((res, _), _) <- runFormPost ((res, _), _) <- runFormPost
$ renderBootstrap3 BootstrapBasicForm transferForm $ renderBootstrap3 BootstrapBasicForm transferForm
case res of case res of
FormSuccess amount -> do FormSuccess amount
if amount < 0 | amount < 0 -> do
then do
setMessageI MsgNegativeTransfer setMessageI MsgNegativeTransfer
redirect $ TransferR from to redirect $ TransferR from to
else do | userBalance sender < amount -> do
setMessageI MsgNotEnoughFunds
redirect HomeR
| otherwise -> do
runDB $ update from [UserBalance -=. amount] runDB $ update from [UserBalance -=. amount]
runDB $ update to [UserBalance +=. amount] runDB $ update to [UserBalance +=. amount]
master <- getYesod master <- getYesod
@ -71,10 +73,9 @@ transferForm = areq currencyField (bfs MsgValue) (Just 0)
notify :: User -> User -> Int -> App -> IO () notify :: User -> User -> Int -> App -> IO ()
notify sender rcpt amount master = do notify sender rcpt amount master = do
case userEmail sender of when (isJust $ userEmail sender) $
Just email -> liftIO $ sendMail (fromJust $ userEmail sender) "Guthabentransfer beim Matematen"
liftIO $ sendMail email "Guthabentransfer beim Matematen" [stext|
[stext|
Hallo #{userIdent sender} Hallo #{userIdent sender}
Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} an #{userIdent rcpt} transferiert. Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} an #{userIdent rcpt} transferiert.
@ -82,13 +83,10 @@ Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} an
Viele Grüße, Viele Grüße,
Dein Matemat Dein Matemat
|] |]
Nothing -> when (isJust $ userEmail rcpt) $
return () liftIO $ sendMail (fromJust $ userEmail rcpt) "Guthabentransfer eingetroffen"
case userEmail rcpt of [stext|
Just email ->
liftIO $ sendMail email "Guthabentransfer eingetroffen"
[stext|
Hallo #{userIdent rcpt} Hallo #{userIdent rcpt}
Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} von #{userIdent sender} erhalten. Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} von #{userIdent sender} erhalten.
@ -96,6 +94,4 @@ Du hast gerade #{formatIntCurrency amount}#{appCurrency $ appSettings master} vo
Viele Grüße, Viele Grüße,
Dein Matemat Dein Matemat
|] |]
Nothing ->
return ()

View file

@ -146,3 +146,4 @@ UserIdentNotUnique: Uživatelské jméno není jedinečný
Login: Přihlásit Login: Přihlásit
Logout: Odhlásit Logout: Odhlásit
CreationBlocked: Nelze vytvořit nové uživatele. CreationBlocked: Nelze vytvořit nové uživatele.
NotEnoughFunds: Nedostatek kreditu

View file

@ -146,3 +146,4 @@ UserIdentNotUnique: Benutzername ist nicht einzigartig
Login: Login Login: Login
Logout: Logout Logout: Logout
CreationBlocked: Es können keine neuen Nutzer angelegt werden. CreationBlocked: Es können keine neuen Nutzer angelegt werden.
NotEnoughFunds: Nicht genügen Guthaben

View file

@ -14,7 +14,7 @@ EditFail: Editing failed
Name: Name Name: Name
Price: Price Price: Price
CurrentStock: Current stock CurrentStock: Current stock
AnnouncedStock: Announced stock AnnouncedStock: Warning limit
DeleteItem: Delete Item DeleteItem: Delete Item
ItemDeleted: Item deleted ItemDeleted: Item deleted
UserCreated: User created UserCreated: User created
@ -111,7 +111,7 @@ BarcodeAdded: barcode succesfully added
BarcodeDuplicate: This barcode is already in use BarcodeDuplicate: This barcode is already in use
Transfer: Credit transfer Transfer: Credit transfer
TransferTo: Transfer credit to TransferTo: Transfer credit to
NegativeTransfer: Please do not transfer negative amounts NegativeTransfer: You can not transfer negative amounts
TransferComplete: Transfer complete TransferComplete: Transfer complete
TransferError: Transfer error TransferError: Transfer error
PreviousPage: previous page PreviousPage: previous page
@ -146,3 +146,4 @@ UserIdentNotUnique: Username is not unique
Login: Login Login: Login
Logout: Logout Logout: Logout
CreationBlocked: New users can not be created. CreationBlocked: New users can not be created.
NotEnoughFunds: Not enough funds!