Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Localization of DataTable

Expand Messages
  • Satyam
    I don t dynamically localize those string, but I had changed them and others in other components simply by adding a
    Message 1 of 2 , Aug 30, 2007
    • 0 Attachment
      I don't dynamically localize those string, but I had changed them and others
      in other components simply by adding a

      <script src="myCustomization.js"></script>

      right after all the library ones have loaded.

      Though the file is a static .js file, there is nothing preventing me from
      doing

      <script src="localization.php"></script>

      and in that file do something like:

      <?php
      echo 'YAHOO.widget.DataTable.MSG_LOADING = ' , _('Loading data...') ,
      ';' ;
      ?>

      Unfortunately, you will have to manually extract the constant names and
      their text first into the PHP file since the originals are not prepared for
      text extraction.

      As an alternative, you might also check for Caridy's translator:

      http://www.bubbling-library.com/eng/api/docs/plugins/translator

      Satyam



      ----- Original Message -----
      From: "vojtech.jasny" <vojtech.jasny@...>
      To: <ydn-javascript@yahoogroups.com>
      Sent: Thursday, August 30, 2007 4:03 PM
      Subject: [ydn-javascript] Localization of DataTable


      > Hello,
      >
      > In my app I need to localize all english strings in the DataTable
      > class. I'm using a custom gettext-based solution and I've found three
      > strings which need to be translated: DataTable.MSG_ERROR, LOADING and
      > EMPTY. I am not sure however at what phase to assign my localization
      > function result to the class prototype. I instantiate DataTables
      > onload and if I assign the translations in the same phase I can never
      > be sure I don't create instances before the translation is done.
      >
      > Kind regards,
      > Vojtech Jasny
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      > --
      > No virus found in this incoming message.
      > Checked by AVG Free Edition.
      > Version: 7.5.484 / Virus Database: 269.12.12/979 - Release Date:
      > 29/08/2007 20:21
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.