OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Design for moving English strings out of thewebhelp JavaScript file nwSearchFnt.js


On Thu, Jun 2, 2011 at 1:27 AM, David Cramer <david@thingbag.net> wrote:

> Indeed, string in that file is currently not internationalized. One
> approach would be to generate nwSearchFnt.js from an xslt. The xslt
> would mostly spit out large chunks of CDATA containing the javascript
> code, but would replace portions with content pulled in by the gentext
> mechanism.
>
> Let me know if you can think of a more elegant way to do it.

I'm not sure this is more elegant. It might be easier to maintain though.

I added this on every HTML page:

  <script type="text/javascript" src="common/localization-strings.js">

I added common/localization-strings.js with this content:

  //Resource strings for localization
  var localeresource = new Object;
  localeresource["search_no_results"]="Your search returned no results.";

I changed the line in nwSearchFnt.js this way:

  } else {
        results = "<p>" + localeresource.search_no_results + "</p>";
  }

Now the webhelp XSLT can generate common/localization-strings.js using
its language strings. Any of the other JavaScript files in the webhelp
can draw from the localeresource object.

Sound reasonable?

Peter


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]