/usr/share/doc/libjuce/apiref/classLocalisedStrings.html is in libjuce-doc 4.3.0~repack-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!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"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: LocalisedStrings 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="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JUCE
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</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="classLocalisedStrings-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">LocalisedStrings Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Used to convert strings to localised foreign-language versions.
<a href="classLocalisedStrings.html#details">More...</a></p>
<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:afaa3a94f9ca94eb11b519f734e2adc08"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#afaa3a94f9ca94eb11b519f734e2adc08">LocalisedStrings</a> (const <a class="el" href="classString.html">String</a> &fileContents, bool ignoreCaseOfKeys)</td></tr>
<tr class="memdesc:afaa3a94f9ca94eb11b519f734e2adc08"><td class="mdescLeft"> </td><td class="mdescRight">Creates a set of translations from the text of a translation file. <a href="#afaa3a94f9ca94eb11b519f734e2adc08">More...</a><br /></td></tr>
<tr class="separator:afaa3a94f9ca94eb11b519f734e2adc08"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7227cbea1f200fe77615c6a39bd3a2f8"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#a7227cbea1f200fe77615c6a39bd3a2f8">LocalisedStrings</a> (const <a class="el" href="classFile.html">File</a> &fileToLoad, bool ignoreCaseOfKeys)</td></tr>
<tr class="memdesc:a7227cbea1f200fe77615c6a39bd3a2f8"><td class="mdescLeft"> </td><td class="mdescRight">Creates a set of translations from a file. <a href="#a7227cbea1f200fe77615c6a39bd3a2f8">More...</a><br /></td></tr>
<tr class="separator:a7227cbea1f200fe77615c6a39bd3a2f8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a781d562968f3cc492816751d7b91bdfe"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#a781d562968f3cc492816751d7b91bdfe">LocalisedStrings</a> (const <a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> &)</td></tr>
<tr class="separator:a781d562968f3cc492816751d7b91bdfe"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af19c7ad780aadf0881da80c11d4ef6c6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#af19c7ad780aadf0881da80c11d4ef6c6">operator=</a> (const <a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> &)</td></tr>
<tr class="separator:af19c7ad780aadf0881da80c11d4ef6c6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aba56315c628fc24aee1fb9c41e0e4fca"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#aba56315c628fc24aee1fb9c41e0e4fca">~LocalisedStrings</a> ()</td></tr>
<tr class="memdesc:aba56315c628fc24aee1fb9c41e0e4fca"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#aba56315c628fc24aee1fb9c41e0e4fca">More...</a><br /></td></tr>
<tr class="separator:aba56315c628fc24aee1fb9c41e0e4fca"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5545fd7648fcd404913fbba46c1eee4b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#a5545fd7648fcd404913fbba46c1eee4b">translate</a> (const <a class="el" href="classString.html">String</a> &text) const</td></tr>
<tr class="memdesc:a5545fd7648fcd404913fbba46c1eee4b"><td class="mdescLeft"> </td><td class="mdescRight">Attempts to look up a string and return its localised version. <a href="#a5545fd7648fcd404913fbba46c1eee4b">More...</a><br /></td></tr>
<tr class="separator:a5545fd7648fcd404913fbba46c1eee4b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aed17f9bfb5456ac258f908f10786d256"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#aed17f9bfb5456ac258f908f10786d256">translate</a> (const <a class="el" href="classString.html">String</a> &text, const <a class="el" href="classString.html">String</a> &resultIfNotFound) const</td></tr>
<tr class="memdesc:aed17f9bfb5456ac258f908f10786d256"><td class="mdescLeft"> </td><td class="mdescRight">Attempts to look up a string and return its localised version. <a href="#aed17f9bfb5456ac258f908f10786d256">More...</a><br /></td></tr>
<tr class="separator:aed17f9bfb5456ac258f908f10786d256"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac49d8221ed6dceca9417396be4ed6682"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classString.html">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#ac49d8221ed6dceca9417396be4ed6682">getLanguageName</a> () const</td></tr>
<tr class="memdesc:ac49d8221ed6dceca9417396be4ed6682"><td class="mdescLeft"> </td><td class="mdescRight">Returns the name of the language specified in the translation file. <a href="#ac49d8221ed6dceca9417396be4ed6682">More...</a><br /></td></tr>
<tr class="separator:ac49d8221ed6dceca9417396be4ed6682"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a37a5718db8bfdf097a0eb8f9eb5c4a1d"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classStringArray.html">StringArray</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#a37a5718db8bfdf097a0eb8f9eb5c4a1d">getCountryCodes</a> () const</td></tr>
<tr class="memdesc:a37a5718db8bfdf097a0eb8f9eb5c4a1d"><td class="mdescLeft"> </td><td class="mdescRight">Returns the list of suitable country codes listed in the translation file. <a href="#a37a5718db8bfdf097a0eb8f9eb5c4a1d">More...</a><br /></td></tr>
<tr class="separator:a37a5718db8bfdf097a0eb8f9eb5c4a1d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a54880b8f2b8b2e62c47c946747448c7a"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classStringPairArray.html">StringPairArray</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#a54880b8f2b8b2e62c47c946747448c7a">getMappings</a> () const</td></tr>
<tr class="memdesc:a54880b8f2b8b2e62c47c946747448c7a"><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the actual list of mappings. <a href="#a54880b8f2b8b2e62c47c946747448c7a">More...</a><br /></td></tr>
<tr class="separator:a54880b8f2b8b2e62c47c946747448c7a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a50e7ac83c272b655123821397b87549d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#a50e7ac83c272b655123821397b87549d">addStrings</a> (const <a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> &)</td></tr>
<tr class="memdesc:a50e7ac83c272b655123821397b87549d"><td class="mdescLeft"> </td><td class="mdescRight">Adds and merges another set of translations into this set. <a href="#a50e7ac83c272b655123821397b87549d">More...</a><br /></td></tr>
<tr class="separator:a50e7ac83c272b655123821397b87549d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7d31b6c45aa1317612f2bc2466357651"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#a7d31b6c45aa1317612f2bc2466357651">setFallback</a> (<a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> *fallbackStrings)</td></tr>
<tr class="memdesc:a7d31b6c45aa1317612f2bc2466357651"><td class="mdescLeft"> </td><td class="mdescRight">Gives this object a set of strings to use as a fallback if a string isn't found. <a href="#a7d31b6c45aa1317612f2bc2466357651">More...</a><br /></td></tr>
<tr class="separator:a7d31b6c45aa1317612f2bc2466357651"><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:a4916d09e4d881362a6d35d753d902bf5"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#a4916d09e4d881362a6d35d753d902bf5">setCurrentMappings</a> (<a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> *newTranslations)</td></tr>
<tr class="memdesc:a4916d09e4d881362a6d35d753d902bf5"><td class="mdescLeft"> </td><td class="mdescRight">Selects the current set of mappings to be used by the system. <a href="#a4916d09e4d881362a6d35d753d902bf5">More...</a><br /></td></tr>
<tr class="separator:a4916d09e4d881362a6d35d753d902bf5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0131361dde468bffc6c76a6f97b768eb"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#a0131361dde468bffc6c76a6f97b768eb">getCurrentMappings</a> ()</td></tr>
<tr class="memdesc:a0131361dde468bffc6c76a6f97b768eb"><td class="mdescLeft"> </td><td class="mdescRight">Returns the currently selected set of mappings. <a href="#a0131361dde468bffc6c76a6f97b768eb">More...</a><br /></td></tr>
<tr class="separator:a0131361dde468bffc6c76a6f97b768eb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adbb25081e75842b43db17d585cf00c6d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classString.html">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#adbb25081e75842b43db17d585cf00c6d">translateWithCurrentMappings</a> (const <a class="el" href="classString.html">String</a> &text)</td></tr>
<tr class="memdesc:adbb25081e75842b43db17d585cf00c6d"><td class="mdescLeft"> </td><td class="mdescRight">Tries to translate a string using the currently selected set of mappings. <a href="#adbb25081e75842b43db17d585cf00c6d">More...</a><br /></td></tr>
<tr class="separator:adbb25081e75842b43db17d585cf00c6d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af6fe719801fc2c136e408d9392e45384"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classString.html">String</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classLocalisedStrings.html#af6fe719801fc2c136e408d9392e45384">translateWithCurrentMappings</a> (const char *text)</td></tr>
<tr class="memdesc:af6fe719801fc2c136e408d9392e45384"><td class="mdescLeft"> </td><td class="mdescRight">Tries to translate a string using the currently selected set of mappings. <a href="#af6fe719801fc2c136e408d9392e45384">More...</a><br /></td></tr>
<tr class="separator:af6fe719801fc2c136e408d9392e45384"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Used to convert strings to localised foreign-language versions. </p>
<p>This is basically a look-up table of strings and their translated equivalents. It can be loaded from a text file, so that you can supply a set of localised versions of strings that you use in your app.</p>
<p>To use it in your code, simply call the <a class="el" href="classLocalisedStrings.html#a5545fd7648fcd404913fbba46c1eee4b" title="Attempts to look up a string and return its localised version. ">translate()</a> method on each string that might have foreign versions, and if none is found, the method will just return the original string.</p>
<p>The translation file should start with some lines specifying a description of the language it contains, and also a list of ISO country codes where it might be appropriate to use the file. After that, each line of the file should contain a pair of quoted strings with an '=' sign.</p>
<p>E.g. for a french translation, the file might be:</p>
<div class="fragment"><div class="line">language: French</div><div class="line">countries: fr be mc ch lu</div><div class="line"></div><div class="line"><span class="stringliteral">"hello"</span> = <span class="stringliteral">"bonjour"</span></div><div class="line"><span class="stringliteral">"goodbye"</span> = <span class="stringliteral">"au revoir"</span></div></div><!-- fragment --><p>If the strings need to contain a quote character, they can use '"' instead, and if the first non-whitespace character on a line isn't a quote, then it's ignored, (you can use this to add comments).</p>
<p>Note that this is a singleton class, so don't create or destroy the object directly. There's also a <a class="el" href="juce__LocalisedStrings_8h.html#af3c28ad27b0d8fa2f615888701e32b07" title="Uses the LocalisedStrings class to translate the given string literal. ">TRANS(text)</a> macro defined to make it easy to use the this.</p>
<p>E.g.</p><div class="fragment"><div class="line">printSomething (<a class="code" href="juce__LocalisedStrings_8h.html#af3c28ad27b0d8fa2f615888701e32b07">TRANS</a>(<span class="stringliteral">"hello"</span>));</div></div><!-- fragment --><p>This macro is used in the Juce classes themselves, so your application has a chance to intercept and translate any internal Juce text strings that might be shown. (You can easily get a list of all the messages by searching for the <a class="el" href="juce__LocalisedStrings_8h.html#af3c28ad27b0d8fa2f615888701e32b07" title="Uses the LocalisedStrings class to translate the given string literal. ">TRANS()</a> macro in the Juce source code). </p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="afaa3a94f9ca94eb11b519f734e2adc08"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afaa3a94f9ca94eb11b519f734e2adc08">§ </a></span>LocalisedStrings() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LocalisedStrings::LocalisedStrings </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>fileContents</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>ignoreCaseOfKeys</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a set of translations from the text of a translation file. </p>
<p>When you create one of these, you can call <a class="el" href="classLocalisedStrings.html#a4916d09e4d881362a6d35d753d902bf5" title="Selects the current set of mappings to be used by the system. ">setCurrentMappings()</a> to make it the set of mappings that the system's using. </p>
</div>
</div>
<a id="a7227cbea1f200fe77615c6a39bd3a2f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7227cbea1f200fe77615c6a39bd3a2f8">§ </a></span>LocalisedStrings() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LocalisedStrings::LocalisedStrings </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classFile.html">File</a> & </td>
<td class="paramname"><em>fileToLoad</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>ignoreCaseOfKeys</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a set of translations from a file. </p>
<p>When you create one of these, you can call <a class="el" href="classLocalisedStrings.html#a4916d09e4d881362a6d35d753d902bf5" title="Selects the current set of mappings to be used by the system. ">setCurrentMappings()</a> to make it the set of mappings that the system's using. </p>
</div>
</div>
<a id="a781d562968f3cc492816751d7b91bdfe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a781d562968f3cc492816751d7b91bdfe">§ </a></span>LocalisedStrings() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LocalisedStrings::LocalisedStrings </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> & </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="aba56315c628fc24aee1fb9c41e0e4fca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba56315c628fc24aee1fb9c41e0e4fca">§ </a></span>~LocalisedStrings()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">LocalisedStrings::~LocalisedStrings </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="af19c7ad780aadf0881da80c11d4ef6c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af19c7ad780aadf0881da80c11d4ef6c6">§ </a></span>operator=()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classLocalisedStrings.html">LocalisedStrings</a>& LocalisedStrings::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> & </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a4916d09e4d881362a6d35d753d902bf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4916d09e4d881362a6d35d753d902bf5">§ </a></span>setCurrentMappings()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static void LocalisedStrings::setCurrentMappings </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> * </td>
<td class="paramname"><em>newTranslations</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>Selects the current set of mappings to be used by the system. </p>
<p>The object you pass in will be automatically deleted when no longer needed, so don't keep a pointer to it. You can also pass in nullptr to remove the current mappings.</p>
<p>See also the <a class="el" href="juce__LocalisedStrings_8h.html#af3c28ad27b0d8fa2f615888701e32b07" title="Uses the LocalisedStrings class to translate the given string literal. ">TRANS()</a> macro, which uses the current set to do its translation.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classLocalisedStrings.html#adbb25081e75842b43db17d585cf00c6d" title="Tries to translate a string using the currently selected set of mappings. ">translateWithCurrentMappings</a> </dd></dl>
</div>
</div>
<a id="a0131361dde468bffc6c76a6f97b768eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0131361dde468bffc6c76a6f97b768eb">§ </a></span>getCurrentMappings()</h2>
<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="classLocalisedStrings.html">LocalisedStrings</a>* LocalisedStrings::getCurrentMappings </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 the currently selected set of mappings. </p>
<p>This is the object that was last passed to <a class="el" href="classLocalisedStrings.html#a4916d09e4d881362a6d35d753d902bf5" title="Selects the current set of mappings to be used by the system. ">setCurrentMappings()</a>. It may be nullptr if none has been created. </p>
</div>
</div>
<a id="adbb25081e75842b43db17d585cf00c6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adbb25081e75842b43db17d585cf00c6d">§ </a></span>translateWithCurrentMappings() <span class="overload">[1/2]</span></h2>
<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="classString.html">String</a> LocalisedStrings::translateWithCurrentMappings </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>text</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>Tries to translate a string using the currently selected set of mappings. </p>
<p>If no mapping has been set, or if the mapping doesn't contain a translation for the string, this will just return the original string.</p>
<p>See also the <a class="el" href="juce__LocalisedStrings_8h.html#af3c28ad27b0d8fa2f615888701e32b07" title="Uses the LocalisedStrings class to translate the given string literal. ">TRANS()</a> macro, which uses this method to do its translation.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classLocalisedStrings.html#a4916d09e4d881362a6d35d753d902bf5" title="Selects the current set of mappings to be used by the system. ">setCurrentMappings</a>, <a class="el" href="classLocalisedStrings.html#a0131361dde468bffc6c76a6f97b768eb" title="Returns the currently selected set of mappings. ">getCurrentMappings</a> </dd></dl>
</div>
</div>
<a id="af6fe719801fc2c136e408d9392e45384"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af6fe719801fc2c136e408d9392e45384">§ </a></span>translateWithCurrentMappings() <span class="overload">[2/2]</span></h2>
<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="classString.html">String</a> LocalisedStrings::translateWithCurrentMappings </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>text</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>Tries to translate a string using the currently selected set of mappings. </p>
<p>If no mapping has been set, or if the mapping doesn't contain a translation for the string, this will just return the original string.</p>
<p>See also the <a class="el" href="juce__LocalisedStrings_8h.html#af3c28ad27b0d8fa2f615888701e32b07" title="Uses the LocalisedStrings class to translate the given string literal. ">TRANS()</a> macro, which uses this method to do its translation.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classLocalisedStrings.html#a4916d09e4d881362a6d35d753d902bf5" title="Selects the current set of mappings to be used by the system. ">setCurrentMappings</a>, <a class="el" href="classLocalisedStrings.html#a0131361dde468bffc6c76a6f97b768eb" title="Returns the currently selected set of mappings. ">getCurrentMappings</a> </dd></dl>
</div>
</div>
<a id="a5545fd7648fcd404913fbba46c1eee4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5545fd7648fcd404913fbba46c1eee4b">§ </a></span>translate() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classString.html">String</a> LocalisedStrings::translate </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>text</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Attempts to look up a string and return its localised version. </p>
<p>If the string isn't found in the list, the original string will be returned. </p>
</div>
</div>
<a id="aed17f9bfb5456ac258f908f10786d256"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aed17f9bfb5456ac258f908f10786d256">§ </a></span>translate() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classString.html">String</a> LocalisedStrings::translate </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>text</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classString.html">String</a> & </td>
<td class="paramname"><em>resultIfNotFound</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Attempts to look up a string and return its localised version. </p>
<p>If the string isn't found in the list, the resultIfNotFound string will be returned. </p>
</div>
</div>
<a id="ac49d8221ed6dceca9417396be4ed6682"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac49d8221ed6dceca9417396be4ed6682">§ </a></span>getLanguageName()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classString.html">String</a> LocalisedStrings::getLanguageName </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the name of the language specified in the translation file. </p>
<p>This is specified in the file using a line starting with "language:", e.g. </p><div class="fragment"><div class="line">language: german</div></div><!-- fragment -->
</div>
</div>
<a id="a37a5718db8bfdf097a0eb8f9eb5c4a1d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37a5718db8bfdf097a0eb8f9eb5c4a1d">§ </a></span>getCountryCodes()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classStringArray.html">StringArray</a>& LocalisedStrings::getCountryCodes </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the list of suitable country codes listed in the translation file. </p>
<p>These is specified in the file using a line starting with "countries:", e.g. </p><div class="fragment"><div class="line">countries: fr be mc ch lu</div></div><!-- fragment --><p>The country codes are supposed to be 2-character ISO complient codes. </p>
</div>
</div>
<a id="a54880b8f2b8b2e62c47c946747448c7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54880b8f2b8b2e62c47c946747448c7a">§ </a></span>getMappings()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classStringPairArray.html">StringPairArray</a>& LocalisedStrings::getMappings </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Provides access to the actual list of mappings. </p>
</div>
</div>
<a id="a50e7ac83c272b655123821397b87549d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a50e7ac83c272b655123821397b87549d">§ </a></span>addStrings()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void LocalisedStrings::addStrings </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> & </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds and merges another set of translations into this set. </p>
<p>Note that the language name and country codes of the new <a class="el" href="classLocalisedStrings.html" title="Used to convert strings to localised foreign-language versions. ">LocalisedStrings</a> object must match that of this object - an assertion will be thrown if they don't match.</p>
<p>Any existing values will have their mappings overwritten by the new ones. </p>
</div>
</div>
<a id="a7d31b6c45aa1317612f2bc2466357651"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d31b6c45aa1317612f2bc2466357651">§ </a></span>setFallback()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void LocalisedStrings::setFallback </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classLocalisedStrings.html">LocalisedStrings</a> * </td>
<td class="paramname"><em>fallbackStrings</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gives this object a set of strings to use as a fallback if a string isn't found. </p>
<p>The object that is passed-in will be owned and deleted by this object when no longer needed. It can be nullptr to clear the existing fallback object. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__LocalisedStrings_8h.html">juce_LocalisedStrings.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content © ROLI Ltd.</small></address><br/>
</body>
</html>
|