diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-11 12:36:08 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 12:36:08 +0100 |
commit | 39f2114f9797eb51994966c6bb8ff1814c9a4da8 (patch) | |
tree | 66dbd9c921f56e440f8816ed29ac23682a1ac4ef /files/fr/web/javascript/reference/global_objects/intl/pluralrules/select | |
parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
download | translated-content-39f2114f9797eb51994966c6bb8ff1814c9a4da8.tar.gz translated-content-39f2114f9797eb51994966c6bb8ff1814c9a4da8.tar.bz2 translated-content-39f2114f9797eb51994966c6bb8ff1814c9a4da8.zip |
unslug fr: move
Diffstat (limited to 'files/fr/web/javascript/reference/global_objects/intl/pluralrules/select')
-rw-r--r-- | files/fr/web/javascript/reference/global_objects/intl/pluralrules/select/index.html | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/files/fr/web/javascript/reference/global_objects/intl/pluralrules/select/index.html b/files/fr/web/javascript/reference/global_objects/intl/pluralrules/select/index.html new file mode 100644 index 0000000000..9d9b8eac11 --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/intl/pluralrules/select/index.html @@ -0,0 +1,79 @@ +--- +title: Intl.PluralRules.select() +slug: Web/JavaScript/Reference/Objets_globaux/Intl/PluralRules/select +tags: + - Internationalisation + - Intl + - JavaScript + - Méthode + - PluralRules + - Reference +translation_of: Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/select +--- +<div>{{JSRef}}</div> + +<p>La méthode <strong><code>Intl.PluralRules.prototype.select</code></strong> renvoie une chaîne de caractères qui indique la règle de nombre utilisée pour le formatage relatif à la locale.</p> + +<h2 id="Syntaxe">Syntaxe</h2> + +<pre class="syntaxbox"><code><var>pluralRule</var>.select(<var>nombre</var>)</code></pre> + +<h3 id="Paramètres">Paramètres</h3> + +<dl> + <dt><code>nombre</code></dt> + <dd>Le nombre pour lequel on souhaite obtenir la règle de nombre associée.</dd> +</dl> + +<h2 id="Description">Description</h2> + +<p>Cette fonction permet de sélectionner une règle de nombre en fonction de la locale et des options de formatage choisies via un objet {{jsxref("PluralRules")}}.</p> + +<h2 id="Exemples">Exemples</h2> + +<pre class="brush: js"> new Intl.PluralRules('ar-EG').select(0); +// → 'zero' + +new Intl.PluralRules('ar-EG').select(1); +// → 'one' + +new Intl.PluralRules('ar-EG').select(2); +// → 'two' + +new Intl.PluralRules('ar-EG').select(6); +// → 'few' + +new Intl.PluralRules('ar-EG').select(18); +// → 'many' +</pre> + +<h2 id="Spécifications">Spécifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Spécification</th> + <th scope="col">État</th> + <th scope="col">Commentaires</th> + </tr> + <tr> + <td><a href="https://rawgit.com/caridy/intl-plural-rules-spec/master/index.html">Brouillon pour les règles de nombre avec Intl</a></td> + <td>{{Spec2('ES Int Draft')}}</td> + <td>Définition initiale.</td> + </tr> + </tbody> +</table> + +<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> + +<div> +<div class="hidden">Ce tableau de compatibilité a été généré à partir de données structurées. Si vous souhaitez contribuer à ces données, n'hésitez pas à envoyer une <em>pull request</em> sur <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>.</div> + +<p>{{Compat("javascript.builtins.Intl.PluralRules.select")}}</p> +</div> + +<h2 id="Voir_aussi">Voir aussi</h2> + +<ul> + <li>{{jsxref("PluralRules", "Intl.PluralRules")}}</li> +</ul> |