Skip to content
Permalink
Browse files
Poprawki do tłumaczenie polskiej daty
  • Loading branch information
Inscure committed Aug 9, 2013
1 parent 9a24b35 commit 3a8d56a
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 116 deletions.
@@ -1,4 +1,4 @@
/config.php
/system/opt/plugins/plugins.php
/system/opt/plugins/compile.php
/nbproject/*
/nbproject/
@@ -42,7 +42,7 @@
if ($_request->post('value')->show())
{
$strf_time = time() + ($_sett->get('offset_timezone')*3600);
echo @HELP::strfTimeToUTF($_request->post('value')->show(), $strf_time);
echo HELP::strfTimeInUTF($_request->post('value')->show(), $strf_time); exit;
}
}
}
@@ -91,7 +91,7 @@
unset($permissions);
}

$_system->clearCache('system', array('groups', 'permissions'));
$_system->clearCacheRecursive($_files);

if ($count)
{
@@ -184,7 +184,7 @@

unset($permissions);

$_system->clearCache('system', array('groups', 'permissions'));
$_system->clearCacheRecursive($_files);

if ($count)
{
@@ -243,7 +243,7 @@

$_pdo->exec('UPDATE [users] SET `role` = 2 WHERE `role` = '.$_request->get('id')->show());

$_system->clearCache('system', array('groups', 'permissions'));
$_system->clearCacheRecursive($_files);

if ($count)
{
@@ -13,7 +13,7 @@
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
|
|
**********************************************************
ORIGINALLY BASED ON
---------------------------------------------------------+
@@ -32,20 +32,20 @@
| written permission from the original author(s).
+--------------------------------------------------------*/
try
{
{ header('Content-Type: text/html; charset=UTF-8');
require_once '../../config.php';
require DIR_SITE.'bootstrap.php';
require_once DIR_SYSTEM.'admincore.php';

$_locale->load('settings_time');

if ( ! $_user->hasPermission('admin.settings_time'))
{
throw new userException(__('Access denied'));
}

$_fav->setFavByLink('settings_time.php', $_user->get('id'));

$_tpl = new Iframe;

if ($_request->get(array('status', 'act'))->show())
@@ -67,9 +67,9 @@
'offset_timezone' => $_request->post('offset_timezone')->strip(),
'user_custom_offset_timezone' => $_request->post('user_custom_offset_timezone')->isNum(TRUE)
));

$_system->clearCacheRecursive($_files);

$_tpl->printMessage('valid', $_log->insertSuccess('edit', __('Data has been saved.')));
$_tpl->assign('view', 'settings');
}
@@ -142,27 +142,27 @@
$strf_time = time()+($_sett->get('offset_timezone')*3600);

$date_opts = array(
'%m/%d/%Y' => HELP::strfTimeToUTF("%m/%d/%Y", $strf_time),
'%d/%m/%Y' => HELP::strfTimeToUTF("%d/%m/%Y", $strf_time),
'%d-%m-%Y' => HELP::strfTimeToUTF("%d-%m-%Y", $strf_time),
'%d.%m.%Y' => HELP::strfTimeToUTF("%d.%m.%Y", $strf_time),
'%m/%d/%Y %H:%M' => HELP::strfTimeToUTF("%m/%d/%Y %H:%M", $strf_time),
'%d/%m/%Y %H:%M' => HELP::strfTimeToUTF("%d/%m/%Y %H:%M", $strf_time),
'%d-%m-%Y %H:%M' => HELP::strfTimeToUTF("%d-%m-%Y %H:%M", $strf_time),
'%d.%m.%Y %H:%M' => HELP::strfTimeToUTF("%d.%m.%Y %H:%M", $strf_time),
'%m/%d/%Y %H:%M:%S' => HELP::strfTimeToUTF("%m/%d/%Y %H:%M:%S", $strf_time),
'%d/%m/%Y %H:%M:%S' => HELP::strfTimeToUTF("%d/%m/%Y %H:%M:%S", $strf_time),
'%d-%m-%Y %H:%M:%S' => HELP::strfTimeToUTF("%d-%m-%Y %H:%M:%S", $strf_time),
'%d.%m.%Y %H:%M:%S' => HELP::strfTimeToUTF("%d.%m.%Y %H:%M:%S", $strf_time),
'%B %d %Y' => HELP::strfTimeToUTF("%B %d %Y", $strf_time),
'%d. %B %Y' => HELP::strfTimeToUTF("%d. %B %Y", $strf_time),
'%d %B %Y' => HELP::strfTimeToUTF("%d %B %Y", $strf_time),
'%B %d %Y %H:%M' => HELP::strfTimeToUTF("%B %d %Y %H:%M", $strf_time),
'%d. %B %Y %H:%M' => HELP::strfTimeToUTF("%d. %B %Y %H:%M", $strf_time),
'%d %B %Y %H:%M' => HELP::strfTimeToUTF("%d %B %Y %H:%M", $strf_time),
'%B %d %Y %H:%M:%S' => HELP::strfTimeToUTF("%B %d %Y %H:%M:%S", $strf_time),
'%d. %B %Y %H:%M:%S' => HELP::strfTimeToUTF("%d. %B %Y %H:%M:%S", $strf_time),
'%d %B %Y %H:%M:%S' => HELP::strfTimeToUTF("%d %B %Y %H:%M:%S", $strf_time)
'%m/%d/%Y' => HELP::strfTimeInUTF("%m/%d/%Y", $strf_time),
'%d/%m/%Y' => HELP::strfTimeInUTF("%d/%m/%Y", $strf_time),
'%d-%m-%Y' => HELP::strfTimeInUTF("%d-%m-%Y", $strf_time),
'%d.%m.%Y' => HELP::strfTimeInUTF("%d.%m.%Y", $strf_time),
'%m/%d/%Y %H:%M' => HELP::strfTimeInUTF("%m/%d/%Y %H:%M", $strf_time),
'%d/%m/%Y %H:%M' => HELP::strfTimeInUTF("%d/%m/%Y %H:%M", $strf_time),
'%d-%m-%Y %H:%M' => HELP::strfTimeInUTF("%d-%m-%Y %H:%M", $strf_time),
'%d.%m.%Y %H:%M' => HELP::strfTimeInUTF("%d.%m.%Y %H:%M", $strf_time),
'%m/%d/%Y %H:%M:%S' => HELP::strfTimeInUTF("%m/%d/%Y %H:%M:%S", $strf_time),
'%d/%m/%Y %H:%M:%S' => HELP::strfTimeInUTF("%d/%m/%Y %H:%M:%S", $strf_time),
'%d-%m-%Y %H:%M:%S' => HELP::strfTimeInUTF("%d-%m-%Y %H:%M:%S", $strf_time),
'%d.%m.%Y %H:%M:%S' => HELP::strfTimeInUTF("%d.%m.%Y %H:%M:%S", $strf_time),
'%B %d %Y' => HELP::strfTimeInUTF("%B %d %Y", $strf_time),
'%d. %B %Y' => HELP::strfTimeInUTF("%d. %B %Y", $strf_time),
'%d %B %Y' => HELP::strfTimeInUTF("%d %B %Y", $strf_time),
'%B %d %Y %H:%M' => HELP::strfTimeInUTF("%B %d %Y %H:%M", $strf_time),
'%d. %B %Y %H:%M' => HELP::strfTimeInUTF("%d. %B %Y %H:%M", $strf_time),
'%d %B %Y %H:%M' => HELP::strfTimeInUTF("%d %B %Y %H:%M", $strf_time),
'%B %d %Y %H:%M:%S' => HELP::strfTimeInUTF("%B %d %Y %H:%M:%S", $strf_time),
'%d. %B %Y %H:%M:%S' => HELP::strfTimeInUTF("%d. %B %Y %H:%M:%S", $strf_time),
'%d %B %Y %H:%M:%S' => HELP::strfTimeInUTF("%d %B %Y %H:%M:%S", $strf_time)
);

// Dołączanie niestandardowych formatów stworzonych przez użytkownika
@@ -171,7 +171,7 @@
$i = 0; $format = array();
foreach($db_formats as $row)
{
$preview = HELP::strfTimeToUTF($row['value'], $strf_time);
$preview = HELP::strfTimeInUTF($row['value'], $strf_time);
$date_opts[$row['value']] = $preview;

$format[] = array(
@@ -3,6 +3,7 @@
<head>
<title></title>
<meta charset="{i18n('html_charset')}" />

<link rel="shortcut icon" href="{$ADDR_FAVICON}" type="image/x-icon" />
<link href="{$ADDR_COMMON_CSS}grid.reset.css" media="screen" rel="stylesheet" />
<link href="{$ADDR_COMMON_CSS}grid.text.css" media="screen" rel="stylesheet" />
@@ -23,7 +23,7 @@
Affero GPL license.*/

/** TODO: Konfiguracja języka w osobnym pliku (`locale.php`) ***/
setlocale(LC_TIME, array('cs_CS.UTF-8', 'Czech'));
setlocale(LC_TIME, array('cs_CS', 'cs', 'Czech_Czech.28592'));

return array(

@@ -23,7 +23,7 @@
Affero GPL license.*/

/** TODO: Konfiguracja języka w osobnym pliku (`locale.php`) ***/
setlocale(LC_TIME, array('pl_PL.UTF-8', 'Polish'));
setlocale(LC_TIME, array('pl', 'pl_PL', 'Polish_Poland.28592'));

return array(

@@ -96,7 +96,7 @@

'User Panel' => 'Panel użytkownika',
'Admin Panel' => 'Administracja',

'--No selection--' => '--Brak wyboru--',
'--Default--' => '--Domyślne--',

@@ -342,15 +342,15 @@
'Confirm new password:' => 'Potwierdź nowe hasło:',
'Edit account' => 'Edytuj konto',
'Language:' => 'Język:',

'Never logged in' => 'Nie był na stronie',

'Polish' => 'Polski',
'English' => 'Angielski',
'Czech' => 'Czeski',

'Modules under Development.' => 'Moduł w trakcie rozwoju.',

// Footer
'Unique visits:' => 'Unikalnych wizyt:',

This file was deleted.

@@ -161,6 +161,8 @@ public function clearCacheRecursive(Files $_files)

/**
* Opróżnia katalog pamięci podręcznej usuwając tylko pliki o roszerzeniach tpl, php lub txt.
*
* Nie usuwa plików z podfolderów folderu $dir! Aby je uunąć, użyj clearCacheRecursive().
*
* // Usuwa całą pamięć podręczną z głównego katalogu pamięci podręcznej.
* $_system->clearCache();
@@ -85,15 +85,15 @@ function optUrl(optClass &$_tpl)
{
return $_tpl->getFunc('url', 'path', $value);
}

if ($value)
{
if (method_exists($_tpl, 'route'))
{
return $_tpl->route()->path($value);
}
}

throw new systemException('Routing is not available.');
}
// Function for AJAX response
@@ -102,6 +102,11 @@ function _e($val)
echo $val; exit;
}

function arrLast($src)
{
return $src[count($src)-1];
}

// Sprawdza, czy element istnieje w tablicy dwuwymiarowej
// o indeksie drugiego poziomu podanym trzecim parametrem
function inArray($value, $array, $id = NULL)
@@ -142,7 +147,7 @@ function __autoload($class_name)
{
$name = $class_name;
}

$tmp_path = array(DIR_CLASS.$name.'.php');
foreach (new DirectoryIterator(DIR_MODULES) as $file)
{
@@ -154,7 +159,7 @@ function __autoload($class_name)
}
}
}

foreach($tmp_path as $path)
{
if (file_exists($path))
@@ -210,7 +215,7 @@ public static function validUpVersion($current, $new)
{
$current = (int) str_replace('.', '', $current);
$new = (int) str_replace('.', '', $new);

return $current === ($new-1);
}

@@ -378,18 +383,10 @@ public static function arrayRemoveElement($key, &$array)
}

// Konwertuje znaki językowe w nazwach miesięcy i innych wyrażeniach na UTF8
public static function strfTimeUTF($keys, $time)
public static function strfTimeInUTF($keys, $time)
{
$ttime = strftime($keys, $time);
// Sprawdzamy czy znaki są kodowane w UTF-8
if (mb_detect_encoding($ttime) === 'UTF-8')
{
// Jeśli tak wyświetlamy je bez zmiany kodowania
return $ttime;
}
echo mb_detect_encoding($ttime);
// Zmiana kodowania na UTF-8
return iconv(mb_detect_encoding($ttime), 'UTF-8', $ttime);
return iconv('ISO-8859-2', 'UTF-8', strftime($keys, $time));
}

//==================================
@@ -988,7 +985,7 @@ public static function formatOrphan($content)
public static function showDate($format, $val)
{
$val += intval(self::$_sett->get('offset_timezone')) * 3600;

if ($format === 'shortdate' || $format == 'longdate')
{
$format = self::$_sett->get($format);
@@ -997,27 +994,27 @@ public static function showDate($format, $val)
{
$format = self::$_sett->get('shortdate');
}

$strftime = strftime($format, $val);
return self::toUTF($strftime);
}

public static function date2UTF($date)
{
return self::toUTF($date);
}

public static function toUTF($src)
{
$encoding = mb_detect_encoding($src);

// Sprawdzamy czy znaki są kodowane w UTF-8
if ($encoding === 'UTF-8')
{
{
// Jeśli tak wyświetlamy je bez zmiany kodowania
return $src;
}

// Zmiana kodowania na UTF-8
return iconv($encoding, 'UTF-8', $src);
}

0 comments on commit 3a8d56a

Please sign in to comment.