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

Re: standard i18n mechanism for inline html?

Expand Messages
  • Bryan Berry
    ... No, my example was supposed to be ... without using data-_ as a class name. -- Bryan W. Berry Senior Engineer OLE Nepal, http://www.olenepal.org
    Message 1 of 5 , Oct 30 11:37 AM
      On Fri, 2009-10-30 at 10:04 -0700, Mike Samuel wrote:
      > Your example
      > <p data-_> Translate <strong>me</strong>!</p>
      > does not use classes.
      >
      > Was your example supposed to be
      > <p class=data-_> Translate <strong>me</strong>!</p>

      No, my example was supposed to be <p data-_> ...
      without using data-_ as a class name.

      --
      Bryan W. Berry
      Senior Engineer
      OLE Nepal, http://www.olenepal.org
    • Bryan Berry
      ... by other I mean css class names already in use in the webapp. I am assuming that when a webapp is first created that the developer didn t make any
      Message 2 of 5 , Nov 3, 2009
        On Fri, 2009-10-30 at 13:22 -0700, Mike Samuel wrote:
        > 2009/10/30 Bryan Berry <bryan@...>:
        > >
        > > On Fri, 2009-10-30 at 10:04 -0700, Mike Samuel wrote:
        > >> Your example
        > >> <p data-_> Translate <strong>me</strong>!</p>
        > >> does not use classes.
        > >>
        > >> Was your example supposed to be
        > >> <p class=data-_> Translate <strong>me</strong>!</p>
        > >
        > > No, my example was supposed to be <p data-_> ...
        > > without using data-_ as a class name.
        >
        > Ok, I don't yet understand your proposal.
        > When you say
        > 2) more semantically meaningful, won't lead to clashes
        > w/ other potential class names
        > what is a "class name" if not one of the runs of non-whitespace
        > characters appearing in the "class" attribute value of an HTML
        > element? Is the word "other" a mistake in that sentence?

        by "other" I mean css class names already in use in the webapp. I am
        assuming that when a webapp is first created that the developer didn't
        make any initial provisions regarding i18n so my have css class names
        that start w/ the prefix data

        I intend to use the data-_ attribute for two purposes

        1) Getting translatable strings out the document for farming out to
        translators volunteer or non-volunteer. This would happen off-line in a
        shell script, probably using narwhal and env.js

        That script would essentially do:

        pls excuse if the XPath syntax is off

        $('*[@data-_]').map(function(elem){ translations.push(elem.innerHTML);})
        // then write the translations to a .po file

        the functionality is the same as using $ xgettext filename from the
        command-line

        2) loading translations from a .po file (translations file) at page load

        $('*[@data-_]').map(function(elem){ elem.innerHTML =
        translations[elem.innerHTML];})


        >
        > > --
        > > Bryan W. Berry
        > > Senior Engineer
        > > OLE Nepal, http://www.olenepal.org
        > >
        > >
        > > >
        > >
        >
        > --~--~---------~--~----~------------~-------~--~----~
        > Please keep in mind all of the emails on this list are publicly archived and readable, so
        > don't mention anything you don't want to be public.
        > All participants in this group represent themselves and not their employers.
        >
        > You received this message because you are subscribed to the Google
        > Groups "Open Web Advocacy" group.
        > To post to this group, send email to openweb-group@...
        > To unsubscribe from this group, send email to
        > openweb-group+unsubscribe@...
        > For more options, visit this group at
        > http://groups.google.com/group/openweb-group?hl=en
        > -~----------~----~----~----~------~----~------~--~---
        >
        --
        Bryan W. Berry
        Senior Engineer
        OLE Nepal, http://www.olenepal.org
      Your message has been successfully submitted and would be delivered to recipients shortly.