1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 22:41:52 +02:00

(v1.4.0.9000) more extensive unit tests

This commit is contained in:
2020-10-15 09:46:41 +02:00
parent 28e77680c5
commit 833a1be36d
74 changed files with 2047 additions and 2120 deletions

View File

@ -82,7 +82,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
</span>
</div>
@ -242,14 +242,14 @@
<p>For language-dependent output of AMR functions, like <code><a href='mo_property.html'>mo_name()</a></code>, <code><a href='mo_property.html'>mo_gramstain()</a></code>, <code><a href='mo_property.html'>mo_type()</a></code> and <code><a href='ab_property.html'>ab_name()</a></code>.</p>
</div>
<pre class="usage"><span class='fu'>get_locale</span>()</pre>
<pre class="usage"><span class='fu'>get_locale</span><span class='op'>(</span><span class='op'>)</span></pre>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: <a href='https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv'>https://github.com/msberends/AMR/blob/master/data-raw/translations.tsv</a>. This file will be read by all functions where a translated output can be desired, like all <code><a href='mo_property.html'>mo_property()</a></code> functions (<code><a href='mo_property.html'>mo_name()</a></code>, <code><a href='mo_property.html'>mo_gramstain()</a></code>, <code><a href='mo_property.html'>mo_type()</a></code>, etc.) and <code><a href='ab_property.html'>ab_property()</a></code> functions (<code><a href='ab_property.html'>ab_name()</a></code>, <code><a href='ab_property.html'>ab_group()</a></code> etc.).</p>
<p>Currently supported languages are: Dutch, English, French, German, Italian, Portuguese, Spanish. Please note that currently not all these languages have translations available for all antimicrobial agents and colloquial microorganism names.</p>
<p>Please suggest your own translations <a href='https://github.com/msberends/AMR/issues/new?title=Translations'>by creating a new issue on our repository</a>.</p><h3>Changing the default language</h3>
<p>Please suggest your own translations <a href='https://github.com/msberends/AMR/issues/new?title=Translations'>by creating a new issue on our repository</a>.</p><h3 class='hasAnchor' id='arguments'><a class='anchor' href='#arguments'></a>Changing the default language</h3>
<p>The system language will be used at default (as returned by <code><a href='https://rdrr.io/r/base/Sys.getenv.html'>Sys.getenv("LANG")</a></code> or, if <code>LANG</code> is not set, <code><a href='https://rdrr.io/r/base/locales.html'>Sys.getlocale()</a></code>), if that language is supported. But the language to be used can be overwritten in two ways and will be checked in this order:</p><ol>
@ -278,27 +278,27 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
<span class='co'># with get_locale()</span>
<span class='co'># English</span>
<span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='st'>"CoNS"</span>, language = <span class='st'>"en"</span>)
<span class='fu'><a href='mo_property.html'>mo_name</a></span><span class='op'>(</span><span class='st'>"CoNS"</span>, language <span class='op'>=</span> <span class='st'>"en"</span><span class='op'>)</span>
<span class='co'>#&gt; "Coagulase-negative Staphylococcus (CoNS)"</span>
<span class='co'># German</span>
<span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='st'>"CoNS"</span>, language = <span class='st'>"de"</span>)
<span class='fu'><a href='mo_property.html'>mo_name</a></span><span class='op'>(</span><span class='st'>"CoNS"</span>, language <span class='op'>=</span> <span class='st'>"de"</span><span class='op'>)</span>
<span class='co'>#&gt; "Koagulase-negative Staphylococcus (KNS)"</span>
<span class='co'># Dutch</span>
<span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='st'>"CoNS"</span>, language = <span class='st'>"nl"</span>)
<span class='fu'><a href='mo_property.html'>mo_name</a></span><span class='op'>(</span><span class='st'>"CoNS"</span>, language <span class='op'>=</span> <span class='st'>"nl"</span><span class='op'>)</span>
<span class='co'>#&gt; "Coagulase-negatieve Staphylococcus (CNS)"</span>
<span class='co'># Spanish</span>
<span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='st'>"CoNS"</span>, language = <span class='st'>"es"</span>)
<span class='fu'><a href='mo_property.html'>mo_name</a></span><span class='op'>(</span><span class='st'>"CoNS"</span>, language <span class='op'>=</span> <span class='st'>"es"</span><span class='op'>)</span>
<span class='co'>#&gt; "Staphylococcus coagulasa negativo (SCN)"</span>
<span class='co'># Italian</span>
<span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='st'>"CoNS"</span>, language = <span class='st'>"it"</span>)
<span class='fu'><a href='mo_property.html'>mo_name</a></span><span class='op'>(</span><span class='st'>"CoNS"</span>, language <span class='op'>=</span> <span class='st'>"it"</span><span class='op'>)</span>
<span class='co'>#&gt; "Staphylococcus negativo coagulasi (CoNS)"</span>
<span class='co'># Portuguese</span>
<span class='fu'><a href='mo_property.html'>mo_name</a></span>(<span class='st'>"CoNS"</span>, language = <span class='st'>"pt"</span>)
<span class='fu'><a href='mo_property.html'>mo_name</a></span><span class='op'>(</span><span class='st'>"CoNS"</span>, language <span class='op'>=</span> <span class='st'>"pt"</span><span class='op'>)</span>
<span class='co'>#&gt; "Staphylococcus coagulase negativo (CoNS)"</span>
</pre>
</div>
@ -316,7 +316,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.9000.</p>
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>