Support

Home Forums Event Espresso Premium [bug] Badly formed i18n strings

[bug] Badly formed i18n strings

Posted: September 27, 2012 at 9:26 am

Viewing 6 reply threads


Charles St-Pierre

    September 27, 2012 at 9:26 am

    Instead of concatenating bits and pieces of get text calls, you need to use sprintf features. That way, translation (and translators) will be able to translate respecting their own language structure.

    <a href="admin.php?page=event_locales"> </a>

    should be

    &lt;?php printf(<strong>('You have not created any locales yet. To create Locales please visit %s page.', 'event_espresso'), '<a href="admin.php?page=event_locales">'.</strong>('Manage Locales/Regions', 'event_espresso').'</a>') ; ?&gt;


    Charles St-Pierre

      September 27, 2012 at 9:33 am

      Can’t paste code. What am I supposed to do?

      Original is in edit_venue.php:134


      Charles St-Pierre

        September 27, 2012 at 11:14 am

        Same kind of error in gateway_developer.php:43 and template_files.php:100

        &lt;?php printf(__(&#039;In order to use this this feature, you will need to move the files located in the %1$s directory into the %2$s directory.&#039;, &#039;event_espresso&#039;),&#039;<strong>'.EVENT_ESPRESSO_PLUGINFULLPATH.'gateways/</strong>','<strong>'.EVENT_ESPRESSO_GATEWAY_DIR.'</strong>'); ?&gt;
        


        Charles St-Pierre

          September 27, 2012 at 1:39 pm

          Huge one here. Even if this is suppose to be personalized, it should be formatted way better than this.

          event-espresso/templates/alt_reg_page_display.php:27

          event-espresso/templates/multi_registration_page_display.php:60

          event-espresso/templates/multi_registration_page_display.php:33

                    &lt;?php _e(&#039;Please <a href="contact" title="contact us">contact us</a> if you would like to know if spaces are still available.', 'event_espresso'); ?&gt;
          

          The URL is hard coded. To prevent trouble

                    &lt;?php printf(__(&#039;Please <a href="%s" title="contact us">contact us</a> if you would like to know if spaces are still available.', 'event_espresso'),get_permalink( $N ); /* where $N is the ID of your contact page */ ?&gt;
          


          Charles St-Pierre

            September 27, 2012 at 1:58 pm

            Gross error of gettext usage.

            event-espresso/templates/alt_reg_page_display.php:41

            event-espresso/templates/multi_registration_page_display.php:42

            event-espresso/templates/registration_page_display.php:80 (less awful)

            should be


            Charles St-Pierre

              September 27, 2012 at 2:13 pm

              file event-espresso/gateways/gateway_display.php:38

              Multiple errors: must use printf with one gettext string containing substitution variables.
              Use get_permalink() with your $org_options[‘return_url’] variable, plus the add_query_arg function to add arguments, will work no matter the permalink (might solve this: http://staging.eventespresso.com/topic/wpml-and-espress/#post-18745)

              Wish I could write the code.


              Dean

              • Support Staff

              September 28, 2012 at 2:02 am

              Hi Charles,

              Thanks for the list, I will pass this onto the developers to look into.

              Cheers,

              Dean

              Viewing 6 reply threads

              The support post ‘[bug] Badly formed i18n strings’ is closed to new replies.

              Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

              Event Espresso - Staging Server