1 page.title=Localization 2 parent.title=Application Resources 3 parent.link=index.html 4 @jd:body 5 6 <div id="qv-wrapper"> 7 <div id="qv"> 8 9 <h2>Localization quickview</h2> 10 11 <ul> 12 <li>Android lets you create different resource sets for different locales.</li> 13 <li>When your application runs, Android will load the resource set 14 that match the device's locale.</li> 15 <li>If locale-specific resources are not available, Android falls back to 16 defaults.</li> 17 <li>The emulator has features for testing localized apps. </li> 18 </ul> 19 20 <h2>In this document</h2> 21 <ol> 22 <li><a href="#resource-switching">Overview: Resource-Switching in Android</a> 23 24 </li> 25 <ol><li><a href="#defaults-r-important">Why Default Resources Are Important</a></li></ol> 26 <li><a href="#using-framework">Using Resources for Localization</a> 27 <ol> 28 <li><a href="#creating-defaults">How to Create Default Resources</a></li> 29 <li><a href="#creating-alternatives">How to Create Alternative Resources</a></li> 30 <li><a href="#resource-precedence">Which Resources Take Precedence?</a></li> 31 <li><a href="#referring-to-resources">Referring to Resources in Java</a></li> 32 </ol> 33 </li> 34 <li><a href="#strategies">Localization Strategies</a></li> 35 <li><a href="#testing">Testing Localized Applications</a></li> 36 <ol> 37 <li><a href="#device">Testing on a Device</a></li> 38 <li><a href="#emulator">Testing on an Emulator</a></li> 39 <li><a href="#test-for-default">Testing for Default Resources</a></li> 40 </ol> 41 <li><a href="#publishing">Publishing</a></li> 42 <li><a href="#checklist">Localization Checklists</a></li> 43 <ol> 44 <li><a href="#planning-checklist">Planning and Design Checklist</a></li> 45 <li><a href="#content-checklist">Content Checklist</a></li> 46 <li><a href="#testing-checklist">Testing and Publishing Checklist</a></li> 47 </ol> 48 </ol> 49 50 <h2>See also</h2> 51 <ol> 52 <li><a 53 href="{@docRoot}resources/tutorials/localization/index.html">Hello, L10N Tutorial</a></li> 54 <li><a href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a></li> 55 <li><a href="{@docRoot}guide/topics/ui/declaring-layout.html">Declaring Layout</a></li> 56 <li><a href="{@docRoot}reference/android/app/Activity.html#ActivityLifecycle">Activity Lifecycle</a></li> 57 </ol> 58 </div> 59 </div> 60 61 <p>Android will run on many devices in many regions. To reach the most users, 62 your application should handle text, audio files, numbers, currency, and 63 graphics in ways appropriate to the locales where your application will be used. 64 </p> 65 66 <p>This document describes best practices for localizing Android 67 applications. The principles apply whether you are developing your application 68 using ADT with Eclipse, Ant-based tools, or any other IDE. </p> 69 70 <p>You should already have a working knowledge of Java and be familiar with 71 Android resource loading, the declaration of user interface elements in XML, 72 development considerations such as Activity lifecycle, and general principles of 73 internationalization and localization. </p> 74 75 <p>It is good practice to use the Android resource framework to separate the 76 localized aspects of your application as much as possible from the core Java 77 functionality:</p> 78 79 <ul> 80 <li>You can put most or all of the <em>contents</em> of your application's 81 user interface into resource files, as described in this document and in <a 82 href="{@docRoot}guide/topics/resources/providing-resources.html">Providing Resources</a>.</li> 83 <li>The <em>behavior</em> of the user interface, on the other hand, is driven 84 by your Java code. 85 For example, if users input data that needs to be formatted or sorted 86 differently depending on locale, then you would use Java to handle the data 87 programmatically. This document does not cover how to localize your Java code. 88 </li> 89 </ul> 90 91 <p>The <a 92 href="{@docRoot}resources/tutorials/localization/index.html">Hello, L10N 93 </a> tutorial takes you through the steps of creating a simple localized 94 application that uses locale-specific resources in the way described in this 95 document. </p> 96 97 98 <h2 id="resource-switching">Overview: Resource-Switching in Android</h2> 99 100 <p>Resources are text strings, layouts, sounds, graphics, and any other static 101 data that your Android application needs. An application can include multiple 102 sets of resources, each customized for a different device configuration. When a 103 user runs the application, Android automatically selects and loads the 104 resources that best match the device.</p> 105 106 <p>(This document focuses on localization and locale. For a complete description 107 of resource-switching and all the types of configurations that you can 108 specify — screen orientation, touchscreen type, and so on — see <a 109 href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">Providing 110 Alternative Resources</a>.)</p> 111 112 <table border="0" cellspacing="0" cellpadding="0"> 113 <tr border="0"> 114 <td width="180" style="border: 0pt none ;"><p class="special-note"> 115 <strong>When you write your application:</strong> 116 <br><br> 117 You create a set of default resources, plus alternatives to be used in 118 different locales.</p></td> 119 <td style="border: 0pt none; padding:0"> 120 <p style="border:0; padding:0"><img src="../../../images/resources/right-arrow.png" alt="right-arrow" 121 width="51" height="17"></p></td> 122 <td width="180" style="border: 0pt none ;"><p class="special-note"> 123 <strong>When a user runs your application:</strong> 124 <br><br>The Android system selects which resources to load, based on the 125 device's locale.</p></td> 126 </tr> 127 </table> 128 129 <p>When you write your application, you create default and alternative resources 130 for your application to use. To create resources, you place files within 131 specially named subdirectories of the project's <code>res/</code> directory. 132 </p> 133 134 135 136 <h3 id="defaults-r-important">Why Default Resources Are Important</h3> 137 138 <p>Whenever the application runs in a locale for which you have not provided 139 locale-specific text, Android will load the default strings from 140 <code>res/values/strings.xml</code>. If this default file is absent, or if it 141 is missing a string that your application needs, then your application will not run 142 and will show an error. 143 The example below illustrates what can happen when the default text file is incomplete. </p> 144 145 <p><em>Example:</em> 146 <p>An application's Java code refers to just two strings, <code>text_a</code> and 147 <code>text_b</code>. This application includes a localized resource file 148 (<code>res/values-en/strings.xml</code>) that defines <code>text_a</code> and 149 <code>text_b</code> in English. This application also includes a default 150 resource file (<code>res/values/strings.xml</code>) that includes a 151 definition for <code>text_a</code>, but not for <code>text_b</code>: 152 <ul> 153 <li>This application might compile without a problem. An IDE such as Eclipse 154 will not highlight any errors if a resource is missing.</li> 155 <li>When this application is launched on a device with locale set to English, 156 the application might run without a problem, because 157 <code>res/values-en/strings.xml</code> contains both of the needed text 158 strings.</li> 159 <li>However, <strong>the user will see an error message and a Force Close 160 button</strong> when this application is launched on a device set to a 161 language other than English. The application will not load.</li> 162 </ul> 163 164 165 <p>To prevent this situation, make sure that a <code>res/values/strings.xml</code> 166 file exists and that it defines every needed string. The situation applies to 167 all types of resources, not just strings: You 168 need to create a set of default resource files containing all 169 the resources that your application calls upon — layouts, drawables, 170 animations, etc. For information about testing, see <a href="#test-for-default"> 171 Testing for Default Resources</a>.</p> 172 173 <h2 id="using-framework">Using Resources for Localization</h2> 174 175 <h3 id="creating-defaults">How to Create Default Resources</h3> 176 177 <p>Put the application's default text in 178 a file with the following location and name:</p> 179 <p><code> res/values/strings.xml</code> (required directory)</p> 180 181 <p>The text strings in <code>res/values/strings.xml</code> should use the 182 default language, which is the language that you expect most of your application's users to 183 speak. </p> 184 185 <p>The default resource set must also include any default drawables and layouts, 186 and can include other types of resources such as animations. 187 <br> 188 <code> res/drawable/</code>(required directory holding at least 189 one graphic file, for the application's icon in the Market)<br> 190 <code> res/layout/</code> (required directory holding an XML 191 file that defines the default layout)<br> 192 <code> res/anim/</code> (required if you have any 193 <code>res/anim-<em><qualifiers></em></code> folders)<br> 194 <code> res/xml/</code> (required if you have any 195 <code>res/xml-<em><qualifiers></em></code> folders)<br> 196 <code> res/raw/</code> (required if you have any 197 <code>res/raw-<em><qualifiers></em></code> folders) 198 </p> 199 200 <p class="note"><strong>Tip:</strong> In your code, examine each reference to 201 an Android resource. Make sure that a default resource is defined for each 202 one. Also make sure that the default string file is complete: A <em> 203 localized</em> string file can contain a subset of the strings, but the 204 <em>default</em> string file must contain them all. 205 </p> 206 207 <h3 id="creating-alternatives">How to Create Alternative Resources</h3> 208 209 <p>A large part of localizing an application is providing alternative text for 210 different languages. In some cases you will also provide alternative graphics, 211 sounds, layouts, and other locale-specific resources. </p> 212 213 <p>An application can specify many <code>res/<em><qualifiers></em>/</code> 214 directories, each with different qualifiers. To create an alternative resource for 215 a different locale, you use a qualifier that specifies a language or a 216 language-region combination. (The name of a resource directory must conform 217 to the naming scheme described in 218 <a href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">Providing 219 Alternative Resources</a>, 220 or else it will not compile.)</p> 221 222 <p><em>Example:</em></p> 223 224 <p>Suppose that your application's default language is English. Suppose also 225 that you want to localize all the text in your application to French, and most 226 of the text in your application (everything except the application's title) to 227 Japanese. In this case, you could create three alternative <code>strings.xml</code> 228 files, each stored in a locale-specific resource directory:</p> 229 230 <ol> 231 <li><code>res/values/strings.xml</code><br> 232 Contains English text for all the strings that the application uses, 233 including text for a string named <code>title</code>.</li> 234 <li><code>res/values-fr/strings.xml</code><br> 235 Contain French text for all the strings, including <code>title</code>.</li> 236 <li><code>res/values-ja/strings.xml</code><br> 237 Contain Japanese text for all the strings <em>except</em> 238 <code>title</code>.<br> 239 <code></code></li> 240 </ol> 241 242 <p>If your Java code refers to <code>R.string.title</code>, here is what will 243 happen at runtime:</p> 244 245 <ul> 246 <li>If the device is set to any language other than French, Android will load 247 <code>title</code> from the <code>res/values/strings.xml</code> file.</li> 248 <li>If the device is set to French, Android will load <code>title</code> from 249 the <code>res/values-fr/strings.xml</code> file.</li> 250 </ul> 251 252 <p>Notice that if the device is set to Japanese, Android will look for 253 <code>title</code> in the <code>res/values-ja/strings.xml</code> file. But 254 because no such string is included in that file, Android will fall back to the 255 default, and will load <code>title</code> in English from the 256 <code>res/values/strings.xml</code> file. </p> 257 258 <h3 id="resource-precedence">Which Resources Take Precedence?</h3> 259 260 <p> If multiple resource files match a device's configuration, Android follows a 261 set of rules in deciding which file to use. Among the qualifiers that can be 262 specified in a resource directory name, <strong>locale almost always takes 263 precedence</strong>. </p> 264 <p><em>Example:</em></p> 265 266 <p>Assume that an application includes a default set of graphics and two other 267 sets of graphics, each optimized for a different device setup:</p> 268 269 <ul> 270 <li><code>res/drawable/</code><br> 271 Contains 272 default graphics.</li> 273 <li><code>res/drawable-small-land-stylus/</code><br> 274 Contains graphics optimized for use with a device that expects input from a 275 stylus and has a QVGA low-density screen in landscape orientation.</li> 276 <li><code>res/drawable-ja/</code> <br> 277 Contains graphics optimized for use with Japanese.</li> 278 </ul> 279 280 <p>If the application runs on a device that is configured to use Japanese, 281 Android will load graphics from <code>res/drawable-ja/</code>, even if the 282 device happens to be one that expects input from a stylus and has a QVGA 283 low-density screen in landscape orientation.</p> 284 285 <p class="note"><strong>Exception:</strong> The only qualifiers that take 286 precedence over locale in the selection process are MCC and MNC (mobile country 287 code and mobile network code). </p> 288 289 <p><em>Example:</em></p> 290 291 <p>Assume that you have the following situation:</p> 292 293 <ul> 294 <li>The application code calls for <code>R.string.text_a</code></li> 295 <li>Two relevant resource files are available: 296 <ul> 297 <li><code>res/values-mcc404/strings.xml</code>, which includes 298 <code>text_a</code> in the application's default language, in this case 299 English.</li> 300 <li><code>res/values-hi/strings.xml</code>, which includes 301 <code>text_a</code> in Hindi.</li> 302 </ul> 303 </li> 304 <li>The application is running on a device that has the following 305 configuration: 306 <ul> 307 <li>The SIM card is connected to a mobile network in India (MCC 404).</li> 308 <li>The language is set to Hindi (<code>hi</code>).</li> 309 </ul> 310 </li> 311 </ul> 312 313 <p>Android will load <code>text_a</code> from 314 <code>res/values-mcc404/strings.xml</code> (in English), even if the device is 315 configured for Hindi. That is because in the resource-selection process, Android 316 will prefer an MCC match over a language match. </p> 317 318 <p>The selection process is not always as straightforward as these examples 319 suggest. Please read <a 320 href="{@docRoot}guide/topics/resources/providing-resources.html#BestMatch">How Android Finds 321 the Best-matching Resource</a> for a more nuanced description of the 322 process. All the qualifiers are described and listed in order of 323 precedence in <a 324 href="{@docRoot}guide/topics/resources/providing-resources.html#table2">Table 2 of Providing 325 Alternative Resources</a>.</p> 326 327 <h3 id="referring-to-resources">Referring to Resources in Java</h3> 328 329 <p>In your application's Java code, you refer to resources using the syntax 330 <code>R.<em>resource_type</em>.<em>resource_name</em></code> or 331 <code>android.R.<em>resource_type</em>.<em>resource_name</em></code><em>.</em> 332 For more about this, see <a 333 href="{@docRoot}guide/topics/resources/accessing-resources.html">Accessing Resources</a>.</p> 334 335 <h2 id="strategies">Localization Strategies</h2> 336 337 <h4 id="failing2">Design your application to work in any locale</h4> 338 339 <p>You cannot assume anything about the device on which a user will 340 run your application. The device might have hardware that you were not 341 anticipating, or it might be set to a locale that you did not plan for or that 342 you cannot test. Design your application so that it will function normally or fail gracefully no 343 matter what device it runs on.</p> 344 345 <p class="note"><strong>Important:</strong> Make sure that your application 346 includes a full set of default resources.</p> <p>Make sure to include 347 <code>res/drawable/</code> and a <code>res/values/</code> folders (without any 348 additional modifiers in the folder names) that contain all the images and text 349 that your application will need. </p> 350 351 <p>If an application is missing even one default resource, it will not run on a 352 device that is set to an unsupported locale. For example, the 353 <code>res/values/strings.xml</code> default file might lack one string that 354 the application needs: When the application runs in an unsupported locale and 355 attempts to load <code>res/values/strings.xml</code>, the user will see an 356 error message and a Force Close button. An IDE such as Eclipse will not 357 highlight this kind of error, and you will not see the problem when you 358 test the application on a device or emulator that is set to a supported locale.</p> 359 360 <p>For more information, see <a href="#test-for-default">Testing for Default Resources</a>.</p> 361 362 <h4>Design a flexible layout</h4> 363 364 <p> If you need to rearrange your layout to fit a certain language (for example 365 German with its long words), you can create an alternative layout for that 366 language (for example <code>res/layout-de/main.xml</code>). However, doing this 367 can make your application harder to maintain. It is better to create a single 368 layout that is more flexible.</p> 369 370 <p>Another typical situation is a language that requires something different in 371 its layout. For example, you might have a contact form that should include two 372 name fields when the application runs in Japanese, but three name fields when 373 the application runs in some other language. You could handle this in either of 374 two ways:</p> 375 376 <ul> 377 <li>Create one layout with a field that you can programmatically enable or 378 disable, based on the language, or</li> 379 <li>Have the main layout include another layout that includes the changeable 380 field. The second layout can have different configurations for different 381 languages.</li> 382 </ul> 383 384 <h4>Avoid creating more resource files and text strings than you need</h4> 385 386 <p>You probably do not need to create a locale-specific 387 alternative for every resource in your application. For example, the layout 388 defined in the <code>res/layout/main.xml</code> file might work in any locale, 389 in which case there would be no need to create any alternative layout files. 390 </p> 391 392 <p>Also, you might not need to create alternative text for every 393 string. For example, assume the following:</p> 394 395 <ul> 396 <li>Your application's default language is American 397 English. Every string that the application uses is defined, using American 398 English spellings, in <code>res/values/strings.xml</code>. </li> 399 400 <li>For a few important phrases, you want to provide 401 British English spelling. You want these alternative strings to be used when your 402 application runs on a device in the United Kingdom. </li> 403 </ul> 404 405 <p>To do this, you could create a small file called 406 <code>res/values-en-rGB/strings.xml</code> that includes only the strings that 407 should be different when the application runs in the U.K. For all the rest of 408 the strings, the application will fall back to the defaults and use what is 409 defined in <code>res/values/strings.xml</code>.</p> 410 411 <h4>Use the Android Context object for manual locale lookup</h4> 412 413 <p>You can look up the locale using the {@link android.content.Context} object 414 that Android makes available:</p> 415 416 <pre>String locale = context.getResources().getConfiguration().locale.getDisplayName();</pre> 417 418 <h2 id="testing">Testing Localized Applications</h2> 419 420 <h3 id="device">Testing on a Device</h3> 421 <p>Keep in mind that the device you are testing may be significantly different from 422 the devices available to consumers in other geographies. The locales available 423 on your device may differ from those available on other devices. Also, the 424 resolution and density of the device screen may differ, which could affect 425 the display of strings and drawables in your UI.</p> 426 427 <p>To change the locale on a device, use the Settings application (Home > 428 Menu > Settings > Locale & text > Select locale). </p> 429 430 <h3 id="emulator">Testing on an Emulator</h3> 431 432 <p>For details about using the emulator, see See <a 433 href="{@docRoot}guide/developing/tools/emulator.html">Android Emulator</a>.</p> 434 <h4>Creating and using a custom locale</h4> 435 436 <p>A "custom" locale is a language/region combination that the Android 437 system image does not explicitly support. (For a list of supported locales in 438 Android platforms see the Version Notes in the <a 439 href="{@docRoot}sdk/index.html">SDK</a> tab). You can test 440 how your application will run in a custom locale by creating a custom locale in 441 the emulator. There are two ways to do this:</p> 442 443 <ul> 444 <li>Use the Custom Locale application, which is accessible from the 445 Application tab. (After you create a custom locale, switch to it by 446 pressing and holding the locale name.)</li> 447 <li>Change to a custom locale from the adb shell, as described below.</li> 448 </ul> 449 450 <p>When you set the emulator to a locale that is not available in the Android 451 system image, the system itself will display in its default language. Your 452 application, however, should localize properly.</p> 453 454 <h4>Changing the emulator locale from the adb shell</h4> 455 456 <p>To change the locale in the emulator by using the adb shell. </p> 457 458 <ol> 459 <li>Pick the locale you want to test and determine its language and region codes, for 460 example <code>fr</code> for French and <code>CA</code> for Canada.<br> 461 </li> 462 <li>Launch an emulator.</li> 463 <li>From a command-line shell on the host computer, run the following 464 command:<br> 465 <code>adb shell</code><br> 466 or if you have a device attached, specify that you want the emulator by adding 467 the <code>-e</code> option:<br> 468 <code>adb -e shell</code></li> 469 <li>At the adb shell prompt (<code>#</code>), run this command: <br> 470 <code>setprop persist.sys.language [<em>language code</em>];setprop 471 persist.sys.country [<em>country code</em>];stop;sleep 5;start <br> 472 </code>Replace bracketed sections with the appropriate codes from Step 473 1.</li> 474 </ol> 475 476 <p>For instance, to test in Canadian French:</p> 477 478 <p><code>setprop persist.sys.language fr;setprop persist.sys.country 479 CA;stop;sleep 5;start </code></p> 480 481 <p>This will cause the emulator to restart. (It will look like a full reboot, 482 but it is not.) Once the Home screen appears again, re-launch your application (for 483 example, click the Run icon in Eclipse), and the application will launch with 484 the new locale. </p> 485 486 <h3 id="test-for-default">Testing for Default Resources</h3> 487 <p>Here's how to test whether an application includes every string resource that it needs: </p> 488 <ol><li>Set the emulator or device to a language that your application does not 489 support. For example, if the application has French strings in 490 <code>res/values-fr/</code> but does not have any Spanish strings in 491 <code>res/values-es/</code>, then set the emulator's locale to Spanish. 492 (You can use the Custom Locale application to set the emulator to an 493 unsupported locale.)</li> 494 <li>Run the application.</li> 495 <li>If the application shows an error message and a Force Close button, it might 496 be looking for a string that is not available. Make sure that your 497 <code>res/values/strings.xml</code> file includes a definition for 498 every string that the application uses.</li> 499 </ol> 500 </p> 501 502 <p>If the test is successful, repeat it for other types of 503 configurations. For example, if the application has a layout file called 504 <code>res/layout-land/main.xml</code> but does not contain a file called 505 <code>res/layout-port/main.xml</code>, then set the emulator or device to 506 portrait orientation and see if the application will run. 507 508 <h2 id="publishing">Publishing Localized Applications</h2> 509 510 <p>The Android Market is 511 the main application distribution system for Android devices. To publish a 512 localized application, you need to sign your application, version it, and go 513 through all the other steps described in <a 514 href="{@docRoot}guide/publishing/preparing.html">Preparing to Publish</a>. </p> 515 516 <p>If you split your application in several .apk files, each targeted to a 517 different locale, follow these guidelines:</p> 518 519 <ul> 520 <li>Sign each .apk file with the same certificate. For more about this, see <a 521 href="{@docRoot}guide/publishing/app-signing.html#strategies">Signing 522 Strategies</a>. </li> 523 <li>Give each .apk file a different application name. Currently it is 524 impossible to put two applications into the Android Market that have exactly the 525 same name.</li> 526 <li>Include a complete set of default resources in each .apk file.</li> 527 </ul> 528 529 <h2 id="checklist">Localization Checklists</h2> 530 531 <p>These checklists summarize the process of localizing an Android application. 532 Not everything on these lists will apply to every application.</p> 533 534 <h3 id="planning-checklist">Planning and Design Checklist</h3> 535 536 <table width="100%" border="0" cellpadding="5" cellspacing="0"> 537 <tr> 538 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 539 border="0"></td> 540 <td>Choose a localization strategy. Which countries and which languages will 541 your application support? What is your application's default country and 542 language? How will your application behave when it does not have specific 543 resources available for a given locale?</td> 544 </tr> 545 <tr> 546 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 547 border="0"></td> 548 <td><p>Identify everything in your application that will need to be 549 localized: </p> 550 <ul> 551 <li>Consider specific details of your application — text, images, 552 sounds, music, numbers, money, dates and times. You might not need to localize 553 everything. For example, you don't need to localize text that the user never 554 sees, or images that are culturally neutral, or icons that convey the same 555 meaning in every locale. </li> 556 <li>Consider broad themes. For example, if you hope to sell your 557 application in two very culturally different markets, you might want to design 558 your UI and present your application in an entirely different way for each 559 locale.</li> 560 </ul></td> 561 </tr> 562 <tr> 563 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 564 border="0"></td> 565 <td><p>Design your Java code to externalize resources wherever possible:</p> 566 <ul> 567 <li>Use <code>R.string</code> and <code>strings.xml</code> files instead 568 of hard-coded strings or string constants. </li> 569 <li>Use <code>R.drawable</code> and <code>R.layout</code> instead of 570 hard-coded drawables or layouts. </li> 571 </ul></td> 572 </tr> 573 </table> 574 <h3 id="content-checklist">Content Checklist</h3> 575 <table border="0" cellspacing="0" cellpadding="5" width="100%"> 576 <tr> 577 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 578 border="0"></td> 579 <td>Create a full set of default resources in <code>res/values/</code> and 580 other <code>res/</code> folders, as described in <a 581 href="#creating-defaults">Creating Default Resources</a>.</td> 582 </tr> 583 <tr> 584 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 585 border="0"></td> 586 <td>Obtain reliable translations of the static text, including menu text, 587 button names, error messages, and help text. Place the translated strings in 588 <code>res/values-<em><qualifiers></em>/strings.xml</code> files. </td> 589 </tr> 590 <tr> 591 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 592 border="0"></td> 593 <td>Make sure that your application correctly formats dynamic text (for 594 example numbers and dates) for each supported locale. Make sure that your 595 application handles word breaks, punctuation, and alphabetical sorting correctly 596 for each supported language.</td> 597 </tr> 598 <tr> 599 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 600 border="0"></td> 601 <td>If necessary, create locale-specific versions of your graphics and 602 layout, and place them in <code>res/drawable-<em><qualifiers></em>/</code> and 603 <code>res/layout-<em><qualifiers></em>/</code> folders.</td> 604 </tr> 605 <tr> 606 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 607 border="0"></td> 608 <td>Create any other localized content that your application requires; for 609 example, create recordings of sound files for each language, as needed.</td> 610 </tr> 611 </table> 612 <h3 id="testing-checklist">Testing and Publishing Checklist</h3> 613 <table border="0" cellspacing="0" cellpadding="5" width="100%"> 614 <tr> 615 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 616 border="0"></td> 617 <td>Test your application for each supported locale. If possible, have a 618 person who is native to each locale test your application and give you 619 feedback.</td> 620 </tr> 621 <tr> 622 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 623 border="0"></td> 624 <td>Test the default resources by loading a locale that is not available on 625 the device or emulator. For instructions, see <a href="#test-for-default"> 626 Testing for Default Resources</a>. </td> 627 </tr> 628 <tr> 629 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 630 border="0"></td> 631 <td>Test the localized strings in both landscape and portrait display modes.</td> 632 </tr> 633 <tr> 634 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 635 border="0"></td> 636 <td>Sign your application and create your final build or builds.</td> 637 </tr> 638 <tr> 639 <td valign="top" align="center"><img src="../../../images/resources/arrow.png" alt="arrow" width="26" 640 border="0"></td> 641 <td>Upload your .apk file or files to Market, selecting the appropriate 642 languages as 643 you upload. (For more details, see <a 644 href="{@docRoot}guide/publishing/publishing.html">Publishing Your 645 Applications</a>.)</td> 646 </tr> 647 </table>