Opened 6 years ago

Last modified 3 years ago

#644 new Erweiterung

Ersetzungs-Array für Monatsnamen bei nicht vorhandenen "de-locales"

Reported by: Tomcraft Owned by: somebody
Priority: normal Milestone:
Component: Admin Version: 2.0.1.0

Description

Nicht alle Server haben standardmäßig die "de-locales" installiert. Stellt man auf solchen Server unter "Konfiguration" -> "Mein Shop" -> "Datum im Kurzformat anzeigen" auf "Nein", so hat das englische Monatsnamen zur Folge.

Hierzu gibt es in der "/lang/german/admin/german.php" auch bereits entsprechende Übersetzungen:

define('_JANUARY', 'Januar');
define('_FEBRUARY', 'Februar');
define('_MARCH', 'März');
define('_APRIL', 'April');
define('_MAY', 'Mai');
define('_JUNE', 'Juni');
define('_JULY', 'Juli');
define('_AUGUST', 'August');
define('_SEPTEMBER', 'September');
define('_OCTOBER', 'Oktober');
define('_NOVEMBER', 'November');
define('_DECEMBER', 'Dezember');

Eine entsprechende Funktion ist bereits in der "/admin/includes/functions/general.php" vorhanden:

  /**
   * xtc_draw_date_selector()
   *
   * @param mixed $prefix
   * @param string $date
   * @return
   */
  function xtc_draw_date_selector($prefix, $date = '') {
    $month_array = array ();
    $month_array[1] = _JANUARY;
    $month_array[2] = _FEBRUARY;
    $month_array[3] = _MARCH;
    $month_array[4] = _APRIL;
    $month_array[5] = _MAY;
    $month_array[6] = _JUNE;
    $month_array[7] = _JULY;
    $month_array[8] = _AUGUST;
    $month_array[9] = _SEPTEMBER;
    $month_array[10] = _OCTOBER;
    $month_array[11] = _NOVEMBER;
    $month_array[12] = _DECEMBER;
    $usedate = getdate($date);
    $day = $usedate['mday'];
    $month = $usedate['mon'];
    $year = $usedate['year'];
    $date_selector = '<select name="'.$prefix.'_day">';
    for ($i = 1; $i < 32; $i ++) {
      $date_selector .= '<option value="'.$i.'"';
      if ($i == $day) {
        $date_selector .= 'selected';
      }
      $date_selector .= '>'.$i.'</option>';
    }
    $date_selector .= '</select>';
    $date_selector .= '<select name="'.$prefix.'_month">';
    for ($i = 1; $i < 13; $i ++) {
      $date_selector .= '<option value="'.$i.'"';
      if ($i == $month) {
        $date_selector .= 'selected';
      }
      $date_selector .= '>'.$month_array[$i].'</option>';
    }
    $date_selector .= '</select>';
    $date_selector .= '<select name="'.$prefix.'_year">';
    for ($i = 2001; $i < 2019; $i ++) {
      $date_selector .= '<option value="'.$i.'"';
      if ($i == $year) {
        $date_selector .= 'selected';
      }
      $date_selector .= '>'.$i.'</option>';
    }
    $date_selector .= '</select>';
    return $date_selector;
  }

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by GTB

  • Milestone changed from modified-shop-2.00 to modified-shop-2.10
  • Version changed from 2.0 to 2.10

comment:2 Changed 3 years ago by Tomcraft

  • Milestone modified-shop-2.1.0.0 deleted

Add Comment

Modify Ticket

Action
as new
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.