1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wxWidgets: wxTranslations Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
<tbody>
<tr>
<td id="projectlogo">
<a href="http://www.wxwidgets.org/" target="_new">
<img alt="wxWidgets" src="logo.png"/>
</a>
</td>
<td style="padding-left: 0.5em; text-align: right;">
<span id="projectnumber">Version: 3.0.2</span>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Categories</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="classwx_translations-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">wxTranslations Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <wx/translation.h></code></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class allows to get translations for strings. </p>
<p>In wxWidgets this class manages message catalogs which contain the translations of the strings used to the current language. Unlike <a class="el" href="classwx_locale.html" title="wxLocale class encapsulates all language-dependent settings and is a generalization of the C locale c...">wxLocale</a>, it isn't bound to locale. It can be used either independently of, or in conjunction with <a class="el" href="classwx_locale.html" title="wxLocale class encapsulates all language-dependent settings and is a generalization of the C locale c...">wxLocale</a>. In the latter case, you should initialize <a class="el" href="classwx_locale.html" title="wxLocale class encapsulates all language-dependent settings and is a generalization of the C locale c...">wxLocale</a> (which creates <a class="el" href="classwx_translations.html" title="This class allows to get translations for strings.">wxTranslations</a> instance) first; in the former, you need to create a <a class="el" href="classwx_translations.html" title="This class allows to get translations for strings.">wxTranslations</a> object and <a class="el" href="classwx_translations.html#a7e919eb4e20865fb0f5f75d67791351d" title="Sets current translations object.">Set()</a> it manually.</p>
<p>Only one <a class="el" href="classwx_translations.html" title="This class allows to get translations for strings.">wxTranslations</a> instance is active at a time; it is set with the <a class="el" href="classwx_translations.html#a7e919eb4e20865fb0f5f75d67791351d" title="Sets current translations object.">Set()</a> method and obtained using <a class="el" href="classwx_translations.html#ab384ea68c44e74cfd2cd59e782529540" title="Returns current translations object, may return NULL.">Get()</a>.</p>
<p>Unlike <a class="el" href="classwx_locale.html" title="wxLocale class encapsulates all language-dependent settings and is a generalization of the C locale c...">wxLocale</a>, <a class="el" href="classwx_translations.html" title="This class allows to get translations for strings.">wxTranslations</a>' primary mean of identifying language is by its "canonical name", i.e. ISO 639 code, possibly combined with ISO 3166 country code and additional modifiers (examples include "fr", "en_GB" or "ca@valencia"; see <a class="el" href="classwx_locale.html#a89f8b4899148e754d1300bda2fe6600f" title="Returns the canonical form of current locale name.">wxLocale::GetCanonicalName()</a> for more information). This allows apps using <a class="el" href="classwx_translations.html" title="This class allows to get translations for strings.">wxTranslations</a> API to use even languages not recognized by the operating system or not listed in wxLanguage enum.</p>
<dl class="section since"><dt>Since</dt><dd>2.9.1</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_locale.html" title="wxLocale class encapsulates all language-dependent settings and is a generalization of the C locale c...">wxLocale</a>, <a class="el" href="classwx_translations_loader.html" title="Abstraction of translations discovery and loading.">wxTranslationsLoader</a>, <a class="el" href="classwx_file_translations_loader.html" title="Standard wxTranslationsLoader implementation.">wxFileTranslationsLoader</a> </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0ff17f13b973eb8a5b8a10403b9c4e27"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a0ff17f13b973eb8a5b8a10403b9c4e27">wxTranslations</a> ()</td></tr>
<tr class="memdesc:a0ff17f13b973eb8a5b8a10403b9c4e27"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#a0ff17f13b973eb8a5b8a10403b9c4e27"></a><br/></td></tr>
<tr class="separator:a0ff17f13b973eb8a5b8a10403b9c4e27"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a45c81bf49c3645eebb2032a18fe37056"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a45c81bf49c3645eebb2032a18fe37056">SetLoader</a> (<a class="el" href="classwx_translations_loader.html">wxTranslationsLoader</a> *loader)</td></tr>
<tr class="memdesc:a45c81bf49c3645eebb2032a18fe37056"><td class="mdescLeft"> </td><td class="mdescRight">Changes loader use to read catalogs to a non-default one. <a href="#a45c81bf49c3645eebb2032a18fe37056"></a><br/></td></tr>
<tr class="separator:a45c81bf49c3645eebb2032a18fe37056"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a098d9f1c908b8c756866c99720c35787"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a098d9f1c908b8c756866c99720c35787">SetLanguage</a> (<a class="el" href="language_8h.html#a7d1c74ce43b2fb7acf7a6fa438c0ee86">wxLanguage</a> lang)</td></tr>
<tr class="memdesc:a098d9f1c908b8c756866c99720c35787"><td class="mdescLeft"> </td><td class="mdescRight">Sets translations language to use. <a href="#a098d9f1c908b8c756866c99720c35787"></a><br/></td></tr>
<tr class="separator:a098d9f1c908b8c756866c99720c35787"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3f69c37cb245569da0cbae9577a606f5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a3f69c37cb245569da0cbae9577a606f5">SetLanguage</a> (const <a class="el" href="classwx_string.html">wxString</a> &lang)</td></tr>
<tr class="memdesc:a3f69c37cb245569da0cbae9577a606f5"><td class="mdescLeft"> </td><td class="mdescRight">Sets translations language to use. <a href="#a3f69c37cb245569da0cbae9577a606f5"></a><br/></td></tr>
<tr class="separator:a3f69c37cb245569da0cbae9577a606f5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2f88b45d68673e72324713142be95557"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_array_string.html">wxArrayString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a2f88b45d68673e72324713142be95557">GetAvailableTranslations</a> (const <a class="el" href="classwx_string.html">wxString</a> &domain) const </td></tr>
<tr class="memdesc:a2f88b45d68673e72324713142be95557"><td class="mdescLeft"> </td><td class="mdescRight">Returns list of all translations of <em>domain</em> that were found. <a href="#a2f88b45d68673e72324713142be95557"></a><br/></td></tr>
<tr class="separator:a2f88b45d68673e72324713142be95557"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adb8979906e44477affb150f12c5f145c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#adb8979906e44477affb150f12c5f145c">GetBestTranslation</a> (const <a class="el" href="classwx_string.html">wxString</a> &domain, <a class="el" href="language_8h.html#a7d1c74ce43b2fb7acf7a6fa438c0ee86">wxLanguage</a> msgIdLanguage)</td></tr>
<tr class="memdesc:adb8979906e44477affb150f12c5f145c"><td class="mdescLeft"> </td><td class="mdescRight">Returns the best UI language for the <em>domain</em>. <a href="#adb8979906e44477affb150f12c5f145c"></a><br/></td></tr>
<tr class="separator:adb8979906e44477affb150f12c5f145c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad09e07c63a43e02e3665088908c583b0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#ad09e07c63a43e02e3665088908c583b0">GetBestTranslation</a> (const <a class="el" href="classwx_string.html">wxString</a> &domain, const <a class="el" href="classwx_string.html">wxString</a> &msgIdLanguage="en")</td></tr>
<tr class="memdesc:ad09e07c63a43e02e3665088908c583b0"><td class="mdescLeft"> </td><td class="mdescRight">Returns the best UI language for the <em>domain</em>. <a href="#ad09e07c63a43e02e3665088908c583b0"></a><br/></td></tr>
<tr class="separator:ad09e07c63a43e02e3665088908c583b0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab76302f702b7559c8a7274e2969f4df2"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#ab76302f702b7559c8a7274e2969f4df2">AddStdCatalog</a> ()</td></tr>
<tr class="memdesc:ab76302f702b7559c8a7274e2969f4df2"><td class="mdescLeft"> </td><td class="mdescRight">Add standard wxWidgets catalogs ("wxstd" and possible port-specific catalogs). <a href="#ab76302f702b7559c8a7274e2969f4df2"></a><br/></td></tr>
<tr class="separator:ab76302f702b7559c8a7274e2969f4df2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3074f9d91c92bd0ade9e6aea4affc652"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a3074f9d91c92bd0ade9e6aea4affc652">AddCatalog</a> (const <a class="el" href="classwx_string.html">wxString</a> &domain)</td></tr>
<tr class="memdesc:a3074f9d91c92bd0ade9e6aea4affc652"><td class="mdescLeft"> </td><td class="mdescRight">Add a catalog for use with the current locale. <a href="#a3074f9d91c92bd0ade9e6aea4affc652"></a><br/></td></tr>
<tr class="separator:a3074f9d91c92bd0ade9e6aea4affc652"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8b0bc47ae1b33f14ae294dbe55da76bd"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a8b0bc47ae1b33f14ae294dbe55da76bd">AddCatalog</a> (const <a class="el" href="classwx_string.html">wxString</a> &domain, <a class="el" href="language_8h.html#a7d1c74ce43b2fb7acf7a6fa438c0ee86">wxLanguage</a> msgIdLanguage)</td></tr>
<tr class="memdesc:a8b0bc47ae1b33f14ae294dbe55da76bd"><td class="mdescLeft"> </td><td class="mdescRight">Same as <a class="el" href="classwx_translations.html#a3074f9d91c92bd0ade9e6aea4affc652" title="Add a catalog for use with the current locale.">AddCatalog(const wxString&)</a>, but takes an additional argument, <em>msgIdLanguage</em>. <a href="#a8b0bc47ae1b33f14ae294dbe55da76bd"></a><br/></td></tr>
<tr class="separator:a8b0bc47ae1b33f14ae294dbe55da76bd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7e049aa6b090972e7924392c6f5d6a99"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a7e049aa6b090972e7924392c6f5d6a99">AddCatalog</a> (const <a class="el" href="classwx_string.html">wxString</a> &domain, <a class="el" href="language_8h.html#a7d1c74ce43b2fb7acf7a6fa438c0ee86">wxLanguage</a> msgIdLanguage, const <a class="el" href="classwx_string.html">wxString</a> &msgIdCharset)</td></tr>
<tr class="memdesc:a7e049aa6b090972e7924392c6f5d6a99"><td class="mdescLeft"> </td><td class="mdescRight">Same as <a class="el" href="classwx_translations.html#a8b0bc47ae1b33f14ae294dbe55da76bd" title="Same as AddCatalog(const wxString&), but takes an additional argument, msgIdLanguage.">AddCatalog(const wxString&, wxLanguage)</a>, but takes two additional arguments, <em>msgIdLanguage</em> and <em>msgIdCharset</em>. <a href="#a7e049aa6b090972e7924392c6f5d6a99"></a><br/></td></tr>
<tr class="separator:a7e049aa6b090972e7924392c6f5d6a99"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1baf790dc4226869a727e03a59ff5b25"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a1baf790dc4226869a727e03a59ff5b25">IsLoaded</a> (const <a class="el" href="classwx_string.html">wxString</a> &domain) const </td></tr>
<tr class="memdesc:a1baf790dc4226869a727e03a59ff5b25"><td class="mdescLeft"> </td><td class="mdescRight">Check if the given catalog is loaded, and returns <span class="literal">true</span> if it is. <a href="#a1baf790dc4226869a727e03a59ff5b25"></a><br/></td></tr>
<tr class="separator:a1baf790dc4226869a727e03a59ff5b25"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a210a2a9ae46e7596d6f7883b26b68953"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_string.html">wxString</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a210a2a9ae46e7596d6f7883b26b68953">GetTranslatedString</a> (const <a class="el" href="classwx_string.html">wxString</a> &origString, const <a class="el" href="classwx_string.html">wxString</a> &domain=<a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a>) const </td></tr>
<tr class="memdesc:a210a2a9ae46e7596d6f7883b26b68953"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the translation for a string in all loaded domains unless the <em>domain</em> parameter is specified (and then only this catalog/domain is searched). <a href="#a210a2a9ae46e7596d6f7883b26b68953"></a><br/></td></tr>
<tr class="separator:a210a2a9ae46e7596d6f7883b26b68953"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a35e577c7618811340a70ace024774e62"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_string.html">wxString</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a35e577c7618811340a70ace024774e62">GetTranslatedString</a> (const <a class="el" href="classwx_string.html">wxString</a> &origString, unsigned n, const <a class="el" href="classwx_string.html">wxString</a> &domain=<a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a>) const </td></tr>
<tr class="memdesc:a35e577c7618811340a70ace024774e62"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the translation for a string in all loaded domains unless the <em>domain</em> parameter is specified (and then only this catalog/domain is searched). <a href="#a35e577c7618811340a70ace024774e62"></a><br/></td></tr>
<tr class="separator:a35e577c7618811340a70ace024774e62"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a49b9c3ec1e9487a4473f09259284c61a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a49b9c3ec1e9487a4473f09259284c61a">GetHeaderValue</a> (const <a class="el" href="classwx_string.html">wxString</a> &header, const <a class="el" href="classwx_string.html">wxString</a> &domain=<a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a>) const </td></tr>
<tr class="memdesc:a49b9c3ec1e9487a4473f09259284c61a"><td class="mdescLeft"> </td><td class="mdescRight">Returns the header value for header <em>header</em>. <a href="#a49b9c3ec1e9487a4473f09259284c61a"></a><br/></td></tr>
<tr class="separator:a49b9c3ec1e9487a4473f09259284c61a"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ab384ea68c44e74cfd2cd59e782529540"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classwx_translations.html">wxTranslations</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#ab384ea68c44e74cfd2cd59e782529540">Get</a> ()</td></tr>
<tr class="memdesc:ab384ea68c44e74cfd2cd59e782529540"><td class="mdescLeft"> </td><td class="mdescRight">Returns current translations object, may return NULL. <a href="#ab384ea68c44e74cfd2cd59e782529540"></a><br/></td></tr>
<tr class="separator:ab384ea68c44e74cfd2cd59e782529540"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7e919eb4e20865fb0f5f75d67791351d"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_translations.html#a7e919eb4e20865fb0f5f75d67791351d">Set</a> (<a class="el" href="classwx_translations.html">wxTranslations</a> *t)</td></tr>
<tr class="memdesc:a7e919eb4e20865fb0f5f75d67791351d"><td class="mdescLeft"> </td><td class="mdescRight">Sets current translations object. <a href="#a7e919eb4e20865fb0f5f75d67791351d"></a><br/></td></tr>
<tr class="separator:a7e919eb4e20865fb0f5f75d67791351d"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a0ff17f13b973eb8a5b8a10403b9c4e27"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxTranslations::wxTranslations </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3074f9d91c92bd0ade9e6aea4affc652"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxTranslations::AddCatalog </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add a catalog for use with the current locale. </p>
<p>By default, it is searched for in standard places (see <a class="el" href="classwx_file_translations_loader.html" title="Standard wxTranslationsLoader implementation.">wxFileTranslationsLoader</a>), but you may also prepend additional directories to the search path with <a class="el" href="classwx_file_translations_loader.html#aef1c18a8e931eaff259e0d1b84e4bd94" title="Add a prefix to the catalog lookup path: the message catalog files will be looked up under prefix/lan...">wxFileTranslationsLoader::AddCatalogLookupPathPrefix()</a>.</p>
<p>All loaded catalogs will be used for message lookup by GetString() for the current locale.</p>
<p>In this overload, <code>msgid</code> strings are assumed to be in English and written only using 7-bit ASCII characters. If you have to deal with non-English strings or 8-bit characters in the source code, see the instructions in <a class="el" href="overview_nonenglish.html">Writing Non-English Applications</a>.</p>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> if catalog was successfully loaded, <span class="literal">false</span> otherwise (which might mean that the catalog is not found or that it isn't in the correct format). </dd></dl>
</div>
</div>
<a class="anchor" id="a8b0bc47ae1b33f14ae294dbe55da76bd"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxTranslations::AddCatalog </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="language_8h.html#a7d1c74ce43b2fb7acf7a6fa438c0ee86">wxLanguage</a> </td>
<td class="paramname"><em>msgIdLanguage</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Same as <a class="el" href="classwx_translations.html#a3074f9d91c92bd0ade9e6aea4affc652" title="Add a catalog for use with the current locale.">AddCatalog(const wxString&)</a>, but takes an additional argument, <em>msgIdLanguage</em>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">domain</td><td>The catalog domain to add.</td></tr>
<tr><td class="paramname">msgIdLanguage</td><td>Specifies the language of "msgid" strings in source code (i.e. arguments to GetString(), <a class="el" href="group__group__funcmacro__string.html#ga223e9aea5b1a2252c7e632613c7b9a74" title="This function returns the translation of string in the current locale().">wxGetTranslation()</a> and the <a class="el" href="group__group__funcmacro__string.html#ga8a02b8875a521df57263a9e6f090f2d0" title="Macro to be used around all literal strings that should be translated.">_()</a> macro). It is used if <a class="el" href="classwx_translations.html#a3074f9d91c92bd0ade9e6aea4affc652" title="Add a catalog for use with the current locale.">AddCatalog()</a> cannot find any catalog for current language: if the language is same as source code language, then strings from source code are used instead.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> if catalog was successfully loaded, <span class="literal">false</span> otherwise (which might mean that the catalog is not found or that it isn't in the correct format). </dd></dl>
</div>
</div>
<a class="anchor" id="a7e049aa6b090972e7924392c6f5d6a99"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxTranslations::AddCatalog </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="language_8h.html#a7d1c74ce43b2fb7acf7a6fa438c0ee86">wxLanguage</a> </td>
<td class="paramname"><em>msgIdLanguage</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>msgIdCharset</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Same as <a class="el" href="classwx_translations.html#a8b0bc47ae1b33f14ae294dbe55da76bd" title="Same as AddCatalog(const wxString&), but takes an additional argument, msgIdLanguage.">AddCatalog(const wxString&, wxLanguage)</a>, but takes two additional arguments, <em>msgIdLanguage</em> and <em>msgIdCharset</em>. </p>
<p>This overload is only available in non-Unicode build.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">domain</td><td>The catalog domain to add.</td></tr>
<tr><td class="paramname">msgIdLanguage</td><td>Specifies the language of "msgid" strings in source code (i.e. arguments to GetString(), <a class="el" href="group__group__funcmacro__string.html#ga223e9aea5b1a2252c7e632613c7b9a74" title="This function returns the translation of string in the current locale().">wxGetTranslation()</a> and the <a class="el" href="group__group__funcmacro__string.html#ga8a02b8875a521df57263a9e6f090f2d0" title="Macro to be used around all literal strings that should be translated.">_()</a> macro). It is used if <a class="el" href="classwx_translations.html#a3074f9d91c92bd0ade9e6aea4affc652" title="Add a catalog for use with the current locale.">AddCatalog()</a> cannot find any catalog for current language: if the language is same as source code language, then strings from source code are used instead.</td></tr>
<tr><td class="paramname">msgIdCharset</td><td>Lets you specify the charset used for msgids in sources in case they use 8-bit characters (e.g. German or French strings).</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> if catalog was successfully loaded, <span class="literal">false</span> otherwise (which might mean that the catalog is not found or that it isn't in the correct format). </dd></dl>
</div>
</div>
<a class="anchor" id="ab76302f702b7559c8a7274e2969f4df2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxTranslations::AddStdCatalog </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add standard wxWidgets catalogs ("wxstd" and possible port-specific catalogs). </p>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> if a suitable catalog was found, <span class="literal">false</span> otherwise</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_translations.html#a3074f9d91c92bd0ade9e6aea4affc652" title="Add a catalog for use with the current locale.">AddCatalog()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ab384ea68c44e74cfd2cd59e782529540"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classwx_translations.html">wxTranslations</a>* wxTranslations::Get </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns current translations object, may return NULL. </p>
<p>You must either call this early in app initialization code, or let <a class="el" href="classwx_locale.html" title="wxLocale class encapsulates all language-dependent settings and is a generalization of the C locale c...">wxLocale</a> do it for you. </p>
</div>
</div>
<a class="anchor" id="a2f88b45d68673e72324713142be95557"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_array_string.html">wxArrayString</a> wxTranslations::GetAvailableTranslations </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns list of all translations of <em>domain</em> that were found. </p>
<p>This method can be used e.g. to populate list of application's translations offered to the user. To do this, pass the app's main catalog as <em>domain</em>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_translations.html#adb8979906e44477affb150f12c5f145c" title="Returns the best UI language for the domain.">GetBestTranslation()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="adb8979906e44477affb150f12c5f145c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_string.html">wxString</a> wxTranslations::GetBestTranslation </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="language_8h.html#a7d1c74ce43b2fb7acf7a6fa438c0ee86">wxLanguage</a> </td>
<td class="paramname"><em>msgIdLanguage</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the best UI language for the <em>domain</em>. </p>
<p>The language is determined from the preferred UI language or languages list the user configured in the OS. Notice that this may or may not correspond to the default <em>locale</em> as obtained from <a class="el" href="classwx_locale.html#ae8f67045995e55b8d853405a66365fd5" title="Tries to detect the user's default locale setting.">wxLocale::GetSystemLanguage()</a>; modern operation systems (Windows Vista+, OS X) have separate language and regional (= locale) settings.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">domain</td><td>The catalog domain to look for.</td></tr>
<tr><td class="paramname">msgIdLanguage</td><td>Specifies the language of "msgid" strings in source code (i.e. arguments to GetString(), <a class="el" href="group__group__funcmacro__string.html#ga223e9aea5b1a2252c7e632613c7b9a74" title="This function returns the translation of string in the current locale().">wxGetTranslation()</a> and the <a class="el" href="group__group__funcmacro__string.html#ga8a02b8875a521df57263a9e6f090f2d0" title="Macro to be used around all literal strings that should be translated.">_()</a> macro).</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Language code if a suitable match was found, empty string otherwise.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>2.9.5 </dd></dl>
</div>
</div>
<a class="anchor" id="ad09e07c63a43e02e3665088908c583b0"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_string.html">wxString</a> wxTranslations::GetBestTranslation </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>msgIdLanguage</em> = <code>"en"</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the best UI language for the <em>domain</em>. </p>
<p>The language is determined from the preferred UI language or languages list the user configured in the OS. Notice that this may or may not correspond to the default <em>locale</em> as obtained from <a class="el" href="classwx_locale.html#ae8f67045995e55b8d853405a66365fd5" title="Tries to detect the user's default locale setting.">wxLocale::GetSystemLanguage()</a>; modern operation systems (Windows Vista+, OS X) have separate language and regional (= locale) settings.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">domain</td><td>The catalog domain to look for.</td></tr>
<tr><td class="paramname">msgIdLanguage</td><td>Specifies the language of "msgid" strings in source code (i.e. arguments to GetString(), <a class="el" href="group__group__funcmacro__string.html#ga223e9aea5b1a2252c7e632613c7b9a74" title="This function returns the translation of string in the current locale().">wxGetTranslation()</a> and the <a class="el" href="group__group__funcmacro__string.html#ga8a02b8875a521df57263a9e6f090f2d0" title="Macro to be used around all literal strings that should be translated.">_()</a> macro).</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Language code if a suitable match was found, empty string otherwise.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>2.9.5 </dd></dl>
</div>
</div>
<a class="anchor" id="a49b9c3ec1e9487a4473f09259284c61a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_string.html">wxString</a> wxTranslations::GetHeaderValue </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>header</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em> = <code><a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the header value for header <em>header</em>. </p>
<p>The search for <em>header</em> is case sensitive. If an <em>domain</em> is passed, this domain is searched. Else all domains will be searched until a header has been found.</p>
<p>The return value is the value of the header if found. Else this will be empty. </p>
</div>
</div>
<a class="anchor" id="a210a2a9ae46e7596d6f7883b26b68953"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_string.html">wxString</a>* wxTranslations::GetTranslatedString </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>origString</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em> = <code><a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the translation for a string in all loaded domains unless the <em>domain</em> parameter is specified (and then only this catalog/domain is searched). </p>
<p>Returns <span class="literal">NULL</span> if translation is not available.</p>
<p>This function is thread-safe.</p>
<dl class="section remark"><dt>Remarks</dt><dd>Domains are searched in the last to first order, i.e. catalogs added later override those added before.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>3.0 </dd></dl>
</div>
</div>
<a class="anchor" id="a35e577c7618811340a70ace024774e62"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_string.html">wxString</a>* wxTranslations::GetTranslatedString </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>origString</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned </td>
<td class="paramname"><em>n</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em> = <code><a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the translation for a string in all loaded domains unless the <em>domain</em> parameter is specified (and then only this catalog/domain is searched). </p>
<p>Returns <span class="literal">NULL</span> if translation is not available.</p>
<p>This form is used when retrieving translation of string that has different singular and plural form in English or different plural forms in some other language.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">origString</td><td>The singular form of the string to be converted. </td></tr>
<tr><td class="paramname">n</td><td>The number on which the plural form choice depends on. (In some languages, there are different plural forms for e.g. n=2 and n=3 etc., in addition to the singular form (n=1) being different.) </td></tr>
<tr><td class="paramname">domain</td><td>The only domain (i.e. message catalog) to search if specified. By default this parameter is empty, indicating that all loaded catalogs should be searched.</td></tr>
</table>
</dd>
</dl>
<p>See GNU gettext manual for additional information on plural forms handling. This method is called by the <a class="el" href="group__group__funcmacro__string.html#ga223e9aea5b1a2252c7e632613c7b9a74" title="This function returns the translation of string in the current locale().">wxGetTranslation()</a> function and <a class="el" href="group__group__funcmacro__string.html#ga8a02b8875a521df57263a9e6f090f2d0" title="Macro to be used around all literal strings that should be translated.">_()</a> macro.</p>
<p>This function is thread-safe.</p>
<dl class="section remark"><dt>Remarks</dt><dd>Domains are searched in the last to first order, i.e. catalogs added later override those added before.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>3.0 </dd></dl>
</div>
</div>
<a class="anchor" id="a1baf790dc4226869a727e03a59ff5b25"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxTranslations::IsLoaded </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>domain</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Check if the given catalog is loaded, and returns <span class="literal">true</span> if it is. </p>
<p>According to GNU gettext tradition, each catalog normally corresponds to 'domain' which is more or less the application name.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_translations.html#a3074f9d91c92bd0ade9e6aea4affc652" title="Add a catalog for use with the current locale.">AddCatalog()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a7e919eb4e20865fb0f5f75d67791351d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void wxTranslations::Set </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_translations.html">wxTranslations</a> * </td>
<td class="paramname"><em>t</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets current translations object. </p>
<p>Deletes previous translation object and takes ownership of <em>t</em>. </p>
</div>
</div>
<a class="anchor" id="a098d9f1c908b8c756866c99720c35787"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxTranslations::SetLanguage </td>
<td>(</td>
<td class="paramtype"><a class="el" href="language_8h.html#a7d1c74ce43b2fb7acf7a6fa438c0ee86">wxLanguage</a> </td>
<td class="paramname"><em>lang</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets translations language to use. </p>
<p>wxLANGUAGE_DEFAULT has special meaning: best suitable translation, given user's preference and available translations, will be used. </p>
</div>
</div>
<a class="anchor" id="a3f69c37cb245569da0cbae9577a606f5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxTranslations::SetLanguage </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>lang</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets translations language to use. </p>
<p>Empty <em>lang</em> string has the same meaning as wxLANGUAGE_DEFAULT in <a class="el" href="classwx_translations.html#a098d9f1c908b8c756866c99720c35787" title="Sets translations language to use.">SetLanguage(wxLanguage)</a>: best suitable translation, given user's preference and available translations, will be used. </p>
</div>
</div>
<a class="anchor" id="a45c81bf49c3645eebb2032a18fe37056"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxTranslations::SetLoader </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_translations_loader.html">wxTranslationsLoader</a> * </td>
<td class="paramname"><em>loader</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Changes loader use to read catalogs to a non-default one. </p>
<p>Deletes previous loader and takes ownership of <em>loader</em>.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_translations_loader.html" title="Abstraction of translations discovery and loading.">wxTranslationsLoader</a>, <a class="el" href="classwx_file_translations_loader.html" title="Standard wxTranslationsLoader implementation.">wxFileTranslationsLoader</a>, <a class="el" href="classwx_resource_translations_loader.html" title="This loader makes it possible to load translations from Windows resources.">wxResourceTranslationsLoader</a> </dd></dl>
</div>
</div>
</div><!-- contents -->
<address class="footer">
<small>
Generated on Thu Nov 27 2014 13:47:01 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>
|