docbook-apps

  • 1.  Design for moving English strings out of the webhelp JavaScript file nwSearchFnt.js

    Posted 06-02-2011 03:59
    Hi.

    I'm customizing the web help output. My team decided that when the
    search returns no results, it would be better to not report the search
    query entered because the query is still displayed in the entry box.
    We also plan to use the empty pane to provide some explanation of the
    search functionality.

    I opened nwSearchFnt.js and removed the variable reference that
    included the search query text:

    } else {

    results = "

    " + "Your search returned no results." + "

    ";

    }

    Before adding my explanation, I thought it would be best to prepare
    for localization. The English string "Your search returned no results"
    is embedded in the JavaScript here. Is there a design for moving it to
    a resource file? I'm not sure how that would work but I know I'll need
    to support different languages soon.

    Thanks.

    Peter



  • 2.  Re: [docbook-apps] Design for moving English strings out of the webhelp JavaScript file nwSearchFnt.js

    Posted 06-02-2011 05:28
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Hi Peter,
    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.

    Thanks,
    David

    On 06/01/2011 10:59 PM, Peter Desjardins wrote:
    > Hi.
    >
    > I'm customizing the web help output. My team decided that when the
    > search returns no results, it would be better to not report the search
    > query entered because the query is still displayed in the entry box.
    > We also plan to use the empty pane to provide some explanation of the
    > search functionality.
    >
    > I opened nwSearchFnt.js and removed the variable reference that
    > included the search query text:
    >
    > } else {
    >
    > results = "

    " + "Your search returned no results." + "

    ";
    >
    > }
    >
    > Before adding my explanation, I thought it would be best to prepare
    > for localization. The English string "Your search returned no results"
    > is embedded in the JavaScript here. Is there a design for moving it to
    > a resource file? I'm not sure how that would work but I know I'll need
    > to support different languages soon.
    >
    > Thanks.
    >
    > Peter
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.11 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQEcBAEBAgAGBQJN5x8/AAoJEMHeSXG7afUh9LEH/joj1ZWlwOT++gijEdCf152X
    NAn3/Q2xh7JbNq6FHCvu70u56rHKHbsz3TGDSTV62PzTTHbbEqHzOiTngLfq/NjW
    Uemf0tjiCP/EIqD8OmOxwzEOM5g9j2/KV/vkL3mEW384hIWuYcF36uK357wmH1gx
    pZVzeprgyF5H2h8/B7GUUGcuKJm7zky0ZFSUuR0S1NAPFwXuJj45Jd+sothF5US3
    X7iRteiPJC7qMI8m3Sr6vH1OKo2+M2x8GmiipjCxHhV8jgkFbXQUhz41GyMp4u/E
    p4jVY2bJMvQlDq1nZrib/ZBwlUmaguJ2HWHA8M0NVAsvrnnorFAkMK7iaqVgqsQ=
    =Ecqx
    -----END PGP SIGNATURE-----



  • 3.  Re: [docbook-apps] Design for moving English strings out of the webhelp JavaScript file nwSearchFnt.js

    Posted 06-02-2011 15:54
    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:



  • 4.  Re: [docbook-apps] Design for moving English strings out of the webhelp JavaScript file nwSearchFnt.js

    Posted 06-02-2011 16:08
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    On 06/02/2011 10:54 AM, Peter Desjardins wrote:
    > I'm not sure this is more elegant. It might be easier to maintain though.
    >
    > I added this on every HTML page:
    >
    >