Show
Ignore:
Timestamp:
06/17/07 22:04:18 (1 year ago)
Author:
gerd
Message:

Switched to patI18n

  • removed all setLocale / getLocale functions from patForms, elements etc.
  • use patI18n::dgettext with textdomain "patForms"
  • added patI18n example
  • added helper script to setup patI18n
  • mended examples accordingly
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/gettext/examples/example_api_autovalidate.php

    r373 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33     
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    34     include dirname( __FILE__ ) . '/setup_gettext.php'; 
    3539     
    3640    // element definitions for this example 
  • branches/gettext/examples/example_api_default_attributes.php

    r373 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333     
    34     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3538     
     39     
    3640    // element definitions for this example 
    3741    $elementsDefinition = array( 
  • branches/gettext/examples/example_api_factory_customModule.php

    r379 r394  
    3434    require_once $neededFiles['patErrorManager']; 
    3535 
     36    /** 
     37     * localisation stuff 
     38     */ 
     39    require_once $neededFiles['patI18n_configure']; 
     40 
    3641 
    3742    // tell patForms where to find custom modules 
  • branches/gettext/examples/example_api_factory_detailed.php

    r373 r394  
    3535    require_once $neededFiles['patErrorManager']; 
    3636     
    37     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     37    /** 
     38     * localisation stuff 
     39     */ 
     40    require_once $neededFiles['patI18n_configure']; 
    3841 
    3942    // username element attribute collection 
  • branches/gettext/examples/example_api_factory_simple.php

    r373 r394  
    3434    require_once $neededFiles['patErrorManager']; 
    3535     
    36     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     36    /** 
     37     * localisation stuff 
     38     */ 
     39    require_once $neededFiles['patI18n_configure']; 
    3740 
    3841     
  • branches/gettext/examples/example_api_locale.php

    r373 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333     
    34     include dirname( __FILE__ ) . '/setup_gettext.php'; 
    35  
     34    /** 
     35     * internationalisaion 
     36     */ 
     37    require_once $neededFiles['patI18n']; 
     38     
     39    // Internal 
     40    $moduleConf =   array(); 
     41    patI18n::addModule( 'Internal', $moduleConf ); 
     42     
     43    // Gettext 
     44    $moduleConf =   array( 
     45                'domain'    =>  'this_domain_is_not_used', 
     46                'dir'       =>  '/tmp', 
     47                'domains'   =>  array( 
     48                    array( 
     49                            'domain'    =>  'patForms', 
     50                            'dir'       =>  dirname( __FILE__ ) . '/locales', 
     51                        ) 
     52                    ) 
     53        ); 
     54    patI18n::addModule( 'Gettext', $moduleConf ); 
     55    patI18n::setLocale( $_GET['lang'] ); 
     56     
     57    // all the above is done by the following include 
     58    // require_once $neededFiles['patI18n_configure']; 
    3659 
    3760    // element definitions for this example 
  • branches/gettext/examples/example_api_locale_gettext.php

    r373 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333     
    34     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3538 
    3639 
  • branches/gettext/examples/example_api_replace_element.php

    r373 r394  
    3434    require_once $neededFiles['patErrorManager']; 
    3535     
    36     include dirname( __FILE__ ) . '/setup_gettext.php'; 
    37  
     36    /** 
     37     * localisation stuff 
     38     */ 
     39    require_once $neededFiles['patI18n_configure']; 
    3840     
    3941    // element definitions for this example - note 
  • branches/gettext/examples/example_api_setvalues.php

    r373 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333     
    34     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3538 
    3639     
  • branches/gettext/examples/example_api_toxml.php

    r373 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333     
    34     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3538 
    3639 
  • branches/gettext/examples/example_api_toxml_ns.php

    r373 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333     
    34     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3538 
    3639 
  • branches/gettext/examples/example_attributefilter_applyform.php

    r373 r394  
    3131    require_once $neededFiles['patErrorManager']; 
    3232     
    33     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     33    /** 
     34     * localisation stuff 
     35     */ 
     36    require_once $neededFiles['patI18n_configure']; 
    3437 
    3538    // element definitions for this example 
  • branches/gettext/examples/example_attributefilter_gettext.php

    r373 r394  
    3131    require_once $neededFiles['patErrorManager']; 
    3232     
    33     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     33    /** 
     34     * localisation stuff 
     35     */ 
     36    require_once $neededFiles['patI18n_configure']; 
    3437 
    3538    // element definitions for this example 
  • branches/gettext/examples/example_attributefilter_test.php

    r373 r394  
    3131    require_once $neededFiles['patErrorManager']; 
    3232     
    33     include dirname( __FILE__ ) . '/setup_gettext.php'; 
     33    /** 
     34     * localisation stuff 
     35     */ 
     36    require_once $neededFiles['patI18n_configure']; 
    3437 
    3538    // element definitions for this example 
  • branches/gettext/examples/example_creator_autosave.php

    r373 r394  
    3333    require_once $neededFiles['patForms']; 
    3434         
    35     include dirname( __FILE__ ) . '/setup_gettext.php'; 
    36  
    3735    /** 
    3836     * patErrorManager class 
    3937     */ 
    4038    require_once $neededFiles['patErrorManager']; 
     39 
     40    /** 
     41     * localisation stuff 
     42     */ 
     43    require_once $neededFiles['patI18n_configure']; 
     44 
    4145 
    4246    // the DSN to your database 
  • branches/gettext/examples/example_creator_db.php

    r117 r394  
    3838    require_once $neededFiles['patErrorManager']; 
    3939 
     40    /** 
     41     * localisation stuff 
     42     */ 
     43    require_once $neededFiles['patI18n_configure']; 
     44 
    4045 
    4146    // create the creator :) 
  • branches/gettext/examples/example_creator_db_mysql.php

    r117 r394  
    3737     */ 
    3838    require_once $neededFiles['patErrorManager']; 
     39     
     40    /** 
     41     * localisation stuff 
     42     */ 
     43    require_once $neededFiles['patI18n_configure']; 
    3944 
    4045 
  • branches/gettext/examples/example_datasrc_countries.php

    r278 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
     38 
     39    /** 
     40     * localisation stuff 
     41     */ 
     42    require_once $neededFiles['patI18n_configure']; 
     43 
    3344 
    3445     
     
    6576    // create the form 
    6677    $form   =&  patForms::createForm($elementsDefinition, array('name' => 'myForm')); 
    67  
    68     // set the form locale, the country selection is adjusted automatically 
    69     $form->setLocale('de'); 
    70      
    7178 
    7279    $countries = &patForms::createDatasource('Countries');   
  • branches/gettext/examples/example_datasrc_function.php

    r267 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
     38 
    3339 
    3440     
  • branches/gettext/examples/example_datasrc_object.php

    r117 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_element_combobox.php

    r185 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_element_date.php

    r176 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439   /** 
  • branches/gettext/examples/example_element_enum.php

    r117 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_element_enum_optgroup.php

    r347 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_element_file.php

    r355 r394  
    3333     */ 
    3434    require_once $neededFiles['patErrorManager']; 
     35 
     36    /** 
     37     * localisation stuff 
     38     */ 
     39    require_once $neededFiles['patI18n_configure']; 
    3540 
    3641     
  • branches/gettext/examples/example_element_group.php

    r168 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_element_hidden.php

    r117 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_element_number.php

    r117 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
     38 
    3439     
    3540    // element definitions for this example 
     
    5964                // you can set the separator character to use 
    6065                // for the number format string: 
    61                 //'formatseparator' =>  '§', 
     66                //'formatseparator' =>  '', 
    6267            ), 
    6368        ), 
  • branches/gettext/examples/example_element_pool.php

    r117 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33     
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_element_pool_multi.php

    r117 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
    33  
     33     
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3438     
    3539    // element definitions for this example 
     
    100104                     ), 
    101105                    array(   
    102                         'label' =>  'Björn Schotte', 
     106                        'label' =>  'Bjᅵn Schotte', 
    103107                        'value' =>  1004, 
    104108                     ), 
  • branches/gettext/examples/example_element_radio.php

    r360 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3438 
    3539    // element definitions for this example 
  • branches/gettext/examples/example_element_radiogroup.php

    r380 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3438 
    3539    // element definitions for this example 
  • branches/gettext/examples/example_element_set.php

    r271 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33     
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
     
    5863                    ), 
    5964                    array(  
    60                         'label' =>  'More Jägerschnitzel', 
     65                        'label' =>  'More Jᅵerschnitzel', 
    6166                        'value' =>  'w3' 
    6267                    ), 
  • branches/gettext/examples/example_element_string.php

    r268 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3438     
    3539    // element definitions for this example 
  • branches/gettext/examples/example_element_switch.php

    r321 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33     
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_element_switchgroup.php

    r380 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33     
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439 
  • branches/gettext/examples/example_element_text.php

    r380 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33     
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_event_combined.php

    r294 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3438     
    3539    // element definitions for this example 
  • branches/gettext/examples/example_event_object.php

    r117 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_event_onerror.php

    r117 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3438     
    3539    // element definitions for this example 
     
    5357    // register the event handler for the onSubmit event - in this case, 
    5458    // a custom function. 
    55     $form->registerEventHandler( 'onError', 'displayErrors' ); 
     59    $form->registerEventHandler( 'onError', 'myDisplayErrors' ); 
    5660 
    5761   /** 
     
    6468    * @see          patForms::registerEventHandler() 
    6569    */ 
    66     function displayErrors( &$form, $event ) 
     70    function myDisplayErrors( &$form, $event ) 
    6771    { 
    6872        // get and display errors as needed 
  • branches/gettext/examples/example_event_onsubmit.php

    r274 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3438     
    3539    // element definitions for this example 
  • branches/gettext/examples/example_event_onsuccess.php

    r117 r394  
    3232    require_once $neededFiles['patErrorManager']; 
    3333 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3438     
    3539    // element definitions for this example 
     
    6973                    ), 
    7074                    array(  
    71                         'label' =>  'More Jägerschnitzel', 
     75                        'label' =>  'More Jᅵerschnitzel', 
    7276                        'value' =>  'w3' 
    7377                    ), 
  • branches/gettext/examples/example_filter_auto.php

    r117 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439     
  • branches/gettext/examples/example_filter_function.php

    r187 r394  
    3131     */ 
    3232    require_once $neededFiles['patErrorManager']; 
     33 
     34    /** 
     35     * localisation stuff 
     36     */ 
     37    require_once $neededFiles['patI18n_configure']; 
    3338 
    3439