23.01.2018 Views

MICROSOFT_PRESS_EBOOK_PROGRAMMING_WINDOWS_8_APPS_WITH_HTML_CSS_AND_JAVASCRIPT_PDF

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>HTML</strong>: The final place we need to look for strings is our <strong>HTML</strong>, which I’ve saved for last because it’s<br />

the most involved. In <strong>HTML</strong>, really scrub, scrub, scrub your markup for any hard-coded text that will<br />

become visible in the UI. Check the body content of elements like p, h1, span, div, button, option, and so<br />

on, as well as the value of attributes like title, alt, aria-label, etc. Also look inside WinJS controls like<br />

AppBar and Flyout, and look for any embedded URIs that you’ll want to localize, including those of<br />

services you employ and content you show in an iframe. Note, though, that title elements in a page<br />

head are not shown and do not need localization.<br />

In Here My Am! I found lots of strings in pages/html/home.html, which I’ve highlighted below:<br />

<br />

<br />

<br />

Here My Am! (8)<br />

Photo<br />

<br />

<br />

Location<br />

Unable to obtain geolocation; check<br />

permissions and use the app bar to try again.<br />

<br />

Attempting to obtain geolocation...<br />

<br />

where I also made a note that I’ll need to localize the taphere.png image, as it contains text, but this is<br />

for the next section. In default.html, I also found labels and tooltips in the data-win-options attributes<br />

of the appbar commands (and I’m omitting some of the other markup for brevity):<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Tip When preparing for localization, consider whether your appbar icons have a universal meaning. If<br />

not, they’ll also need to be localized. Fortunately, the icon values are strings and can be localized as<br />

such, in which case you can treat them like the labels and tooltips.<br />

810

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!