Author Topic: New Russian translation  (Read 1073 times)

Offline Klimentiy

  • Posts: 12
New Russian translation
« on: January 22, 2016, 12:06:12 AM »
Hello!
I have completed the translation in Russian.

Fixed check Russian characters in the file save_form.php

Code: [Select]
// Check the textfields
foreach ($_POST as $field => $value) {
if ($field != 'pay_methods') {
$field  = strip_tags($field);
$value  = strip_tags($value);

if (strpos($field, 'company') !== false) {
if (!preg_match('#^[а-яёА-Яa-zA-ZЁ0-9'.$add_chars.' +&-]{0,50}$#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_NAME'];
}
}

if (strpos($field, 'first_name') !== false) {
if (!preg_match('#^[а-яёА-Яa-zA-ZЁ'.$add_chars.'. -]{1,50}$#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_NAME'];
}
}

if (strpos($field, 'last_name') !== false) {
if (!preg_match('#^[а-яёА-Яa-zA-ZЁ'.$add_chars.' \'-]{1,50}$#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_NAME'];
}
}

if (strpos($field, 'cust_tax_no') !== false &&
strpos($setting_tax_group, $setting_shop_country) !== false) {
include('check_vat.php');
$value = trim($value);
if (!check_vat($value, $setting_tax_group)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_CUST_TAX_NO'];
}
}

if (strpos($field, 'street') !== false) {
if (!preg_match('#^[а-яёА-Яa-zA-ZЁ0-9.'.$add_chars.', -]{1,50}$#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_STREET'];
}
}

if (strpos($field, 'city') !== false) {
if (!preg_match('#[а-яёА-Яa-zA-ZЁ.'.$add_chars.' -]{1,50}#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_CITY'];
}
}

if (strpos($field, 'state') !== false) {
if (!preg_match('#^[а-яёА-Яa-zA-ZЁ0-9.'.$add_chars.' -]{1,50}$#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_STATE'];
}
}

if (strpos($field, 'country') !== false) {
if (!preg_match('#^[а-яёА-Яa-zA-ZЁ]{2}$#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_COUNTRY'];
}
}

if (strpos($field, 'email') !== false) {
if (!preg_match('#^.+@.+\..+$#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_EMAIL'];
}
}

if (strpos($field, 'zip') !== false) {
if (!preg_match('#^[A-Za-z0-9 -]{4,10}$#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_ZIP'];
}
}

if (strpos($field, 'phone') !== false) {
if (!preg_match('#^[0-9)(xX +.-/]{7,20}$#', $value)) {
$error_bg[] = $field;
$errors[]   = htmlspecialchars($value, ENT_QUOTES).' '.$MOD_BAKERY['ERR_INVAL_PHONE'];
}
}

$$field = strip_tags(trim($value));
}
}

freeSbee

  • Guest
Re: New Russian translation
« Reply #1 on: January 22, 2016, 03:38:37 PM »
Hi Klimentiy

Thanks a lot for translating Bakery! I will include your language file in the next release.

Regards Christoph

 

postern-length