Commit 0fb3037d authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

added some more localization

parent 8df28d4a
......@@ -101,6 +101,15 @@ class MailController extends Controller
$data['betrag'] = $betrag;
}
# Check for valid frequency
$validFrequencies = [
"once",
"monthly",
"quarterly",
"six-monthly",
"annual",
];
# Der enthaltene String wird dem Benutzer nach der Spende ausgegeben
$messageToUser = "";
$messageType = ""; # [success|error]
......@@ -120,13 +129,16 @@ class MailController extends Controller
}
if (!$iban->Verify()) {
$messageToUser = "Die eingegebene IBAN scheint nicht Korrekt zu sein. Nachricht wurde nicht gesendet";
$messageToUser = trans('spende.error.iban');
$messageType = "error";
} elseif (!$isSEPA && $bic === '') {
$messageToUser = "Die eingegebene IBAN gehört nicht zu einem Land aus dem SEPA Raum. Für einen Bankeinzug benötigen wir eine BIC von Ihnen.";
$messageToUser = trans('spende.error.bic');
$messageType = "error";
} elseif (!$validBetrag) {
$messageToUser = "Der eingegebene Spendenbetrag ist ungültig. Bitte korrigieren Sie Ihre Eingabe und versuchen es erneut.\n";
$messageToUser = trans('spende.error.amount');
$messageType = "error";
} elseif (!in_array($frequency, $validFrequencies)) {
$messageToUser = trans('spende.error.frequency');
$messageType = "error";
} else {
......@@ -148,7 +160,7 @@ class MailController extends Controller
}
$message .= "\r\nBetrag: " . $betrag;
$message .= "\r\nHäufigkeit: " . $frequency;
$message .= "\r\nHäufigkeit: " . trans('spende.frequency.' . $frequency);
$message .= "\r\nNachricht: " . $nachricht;
try {
......
......@@ -13,11 +13,11 @@ return [
'wunschbetrag.placeholder' => 'Betrag in €',
'frequency' => 'Häufigkeit',
'frequency.1' => 'Einmalig',
'frequency.2' => 'Monatlich',
'frequency.3' => 'Vierteljährlich',
'frequency.4' => 'Halbjährlich',
'frequency.5' => 'Jährlich',
'frequency.once' => 'Einmalig',
'frequency.monthly' => 'Monatlich',
'frequency.quarterly' => 'Vierteljährlich',
'frequency.six-monthly' => 'Halbjährlich',
'frequency.annual' => 'Jährlich',
'head.lastschrift' => 'Lastschrift',
'ueberweisung' => 'Überweisung',
......@@ -70,4 +70,8 @@ return [
'betrag' => 'Betrag',
'danke.message' => 'Ihre Nachricht',
'error.iban' => 'Die eingegebene IBAN scheint nicht Korrekt zu sein. Nachricht wurde nicht gesendet.',
'error.bic' => 'Die eingegebene IBAN gehört nicht zu einem Land aus dem SEPA Raum. Für einen Bankeinzug benötigen wir eine BIC von Ihnen.',
'error.amount' => 'Der eingegebene Spendenbetrag ist ungültig. Bitte korrigieren Sie Ihre Eingabe und versuchen es erneut.',
'error.frequency' => 'Die eingegebene Häufigkeit für Ihre Spende ist ungültig.',
];
......@@ -14,11 +14,11 @@ return [
'frequency' => 'Frequency',
'frequency.1' => 'Once',
'frequency.2' => 'Monthly',
'frequency.3' => 'Quarterly',
'frequency.4' => 'Semi-annual',
'frequency.5' => 'Annual',
'frequency.once' => 'Once',
'frequency.monthly' => 'Monthly',
'frequency.quarterly' => 'Quarterly',
'frequency.six-monthly' => 'Six-Monthly',
'frequency.annual' => 'Annual',
'head.lastschrift' => 'Sepa direct debit',
'ueberweisung' => 'Bank transfer',
......@@ -34,13 +34,13 @@ return [
"lastschrift.1" => "Donate by Sepa direct debit",
"lastschrift.2" => "Enter your account data along with the desired amount. We will debit your bank account accordingly.",
"lastschrift.2" => "Enter your account data along with the desired amount. We will debit your bank account accordingly. This method is only available for SEPA area.",
"lastschrift.3" => "Please enter your name:",
"lastschrift.3.placeholder" => "Name",
"lastschrift.4" => "Your E-Mail adress:",
"lastschrift.5" => "Your phone number to verify your donation by callback:",
"lastschrift.6" => "Your IBAN or bank account number:",
"lastschrift.7" => "Your BIC or bank code:",
"lastschrift.6" => "Your IBAN:",
"lastschrift.7" => "Your BIC:",
"lastschrift.8.value" => "Here you can tell us, what amount you want to donate:",
"lastschrift.8.message" => "Here you can informally add a message to your donation:",
"lastschrift.8.message.placeholder" => "message",
......@@ -71,4 +71,9 @@ return [
"bic" => "BIC/bank code",
'betrag' => 'Amount',
"danke.message" => "Your message",
'error.iban' => 'The IBAN entered does not seem to be correct. Message was not sent.',
'error.bic' => 'The IBAN entered does not belong to a country in the SEPA area. For a direct debit we need a BIC from you.',
'error.amount' => 'The donation amount entered is invalid. Please correct your entry and try again.',
'error.frequency' => 'The frequency you entered for your donation is invalid.',
];
<form class="bitpay-donate" action="https://bitpay.com/checkout" method="post" onsubmit="return bitpayCheckRequiredFields(this);" target="_blank">
<input name="action" type="hidden" value="checkout">
<fieldset>
<ul>
<li class="bitpay-donate-field">
<label>{{ trans('bitpay.amount') }}</label>
<div class="field-input-wrapper">
<input class="bitpay-donate-field-price field-input" name="price" type="number" value="10.00" placeholder="{{ trans('bitpay.amount') }}" maxlength="10" min="1" step="0.01"/>
<select class="bitpay-donate-field-currency field-input" name="currency" value="">
<option value="USD">USD</option>
<option value="BTC">BTC</option>
<option selected="selected" value="EUR">EUR</option>
<option value="GBP">GBP</option>
<option value="AUD">AUD</option>
<option value="BGN">BGN</option>
<option value="BRL">BRL</option>
<option value="CAD">CAD</option>
<option value="CHF">CHF</option>
<option value="CNY">CNY</option>
<option value="CZK">CZK</option>
<option value="DKK">DKK</option>
<option value="HKD">HKD</option>
<option value="HRK">HRK</option>
<option value="HUF">HUF</option>
<option value="IDR">IDR</option>
<option value="ILS">ILS</option>
<option value="INR">INR</option>
<option value="JPY">JPY</option>
<option value="KRW">KRW</option>
<option value="LTL">LTL</option>
<option value="LVL">LVL</option>
<option value="MXN">MXN</option>
<option value="MYR">MYR</option>
<option value="NOK">NOK</option>
<option value="NZD">NZD</option>
<option value="PHP">PHP</option>
<option value="PLN">PLN</option>
<option value="RON">RON</option>
<option value="RUB">RUB</option>
<option value="SEK">SEK</option>
<option value="SGD">SGD</option>
<option value="THB">THB</option>
<option value="TRY">TRY</option>
<option value="ZAR">ZAR</option>
</select>
<div>
</li>
</ul>
<input type="hidden" name="data" value="7vfsM4tlJTE54JMpsAbG/vza+uhjCUlwTLyNfRIxcXxYZKp0AjWMJdRX/EiOkwvyysCmCtCJew937VQ3e+/NxT79NJMGmDwDFTXOA1P8NSMf2J4skBfMzOVYxEdM5CRiT9M9T+JOpZZUQGD8OVEJ5QbZavJKM/x+5TCagn/l6v9tEOIQrt4t0Qh4qs3GpZlqI0vmyNs+/fNnfdvrI512wBU0dTwM9Qi2+D18wUn2CfvjICMFhKF+j1N9nhow7tjs">
<div class="bitpay-donate-button-wrapper">
<input class="bitpay-donate-button" name="submit" src="/meta/picture?url=https%3A%2F%2Fbitpay.com%2Fcdn%2Fen_US%2Fbp-btn-donate-currencies.svg" onerror="this.onerror=null; this.src='/meta/picture?url=https%3A%2F%2Fbitpay.com%2Fcdn%2Fen_US%2Fbp-btn-donate-currencies.svg'" type="image" alt="BitPay, the easy way to pay with bitcoins.">
</div>
</fieldset>
</form>
<script src="{{ mix('js/bitpay.js') }}"></script>
......@@ -34,7 +34,7 @@
</tr>
<tr>
<td>{{ trans('spende.frequency') }}</td>
<td>{{ $data['frequency'] }} </td>
<td>{{ trans('spende.frequency.' . $data['frequency'] }} </td>
</tr>
<tr>
<td>{{ trans('spende.danke.message') }}</td>
......
......@@ -86,11 +86,11 @@
</div>
<h3>{!! trans('spende.headline.4') !!}</h3>
<div id="frequency">
<input type="radio" class="frequency-radio" name="frequency" id="once" value="once" required="required" @if(empty($data) || $data["frequency"] === "once")checked="checked"@endif><label class="frequency-label" for="once"><nobr>{!! trans('spende.frequency.1') !!}</nobr></label>
<input type="radio" class="frequency-radio" name="frequency" id="monthly" value="monthly" required="required" @if(!empty($data) && $data["frequency"] === "monthly")checked="checked"@endif><label class="frequency-label" for="monthly"><nobr>{!! trans('spende.frequency.2') !!}</nobr></label>
<input type="radio" class="frequency-radio" name="frequency" id="quarterly" value="quarterly" required="required" @if(!empty($data) && $data["frequency"] === "quarterly")checked="checked"@endif><label class="frequency-label" for="quarterly"><nobr>{!! trans('spende.frequency.3') !!}</nobr></label>
<input type="radio" class="frequency-radio" name="frequency" id="six-monthly" value="six-monthly" required="required" @if(!empty($data) && $data["frequency"] === "six-monthly")checked="checked"@endif><label class="frequency-label" for="six-monthly"><nobr>{!! trans('spende.frequency.4') !!}</nobr></label>
<input type="radio" class="frequency-radio" name="frequency" id="annual" value="annual" required="required" @if(!empty($data) && $data["frequency"] === "annual")checked="checked"@endif><label class="frequency-label" for="annual"><nobr>{!! trans('spende.frequency.5') !!}</nobr></label>
<input type="radio" class="frequency-radio" name="frequency" id="once" value="once" required="required" @if(empty($data) || $data["frequency"] === "once")checked="checked"@endif><label class="frequency-label" for="once"><nobr>{!! trans('spende.frequency.once') !!}</nobr></label>
<input type="radio" class="frequency-radio" name="frequency" id="monthly" value="monthly" required="required" @if(!empty($data) && $data["frequency"] === "monthly")checked="checked"@endif><label class="frequency-label" for="monthly"><nobr>{!! trans('spende.frequency.monthly') !!}</nobr></label>
<input type="radio" class="frequency-radio" name="frequency" id="quarterly" value="quarterly" required="required" @if(!empty($data) && $data["frequency"] === "quarterly")checked="checked"@endif><label class="frequency-label" for="quarterly"><nobr>{!! trans('spende.frequency.quarterly') !!}</nobr></label>
<input type="radio" class="frequency-radio" name="frequency" id="six-monthly" value="six-monthly" required="required" @if(!empty($data) && $data["frequency"] === "six-monthly")checked="checked"@endif><label class="frequency-label" for="six-monthly"><nobr>{!! trans('spende.frequency.six-monthly') !!}</nobr></label>
<input type="radio" class="frequency-radio" name="frequency" id="annual" value="annual" required="required" @if(!empty($data) && $data["frequency"] === "annual")checked="checked"@endif><label class="frequency-label" for="annual"><nobr>{!! trans('spende.frequency.annual') !!}</nobr></label>
</div>
<h3>{!! trans('spende.headline.6') !!}</h3>
<p>{!! trans('spende.lastschrift.2') !!}</p>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment