https://wiki.freepascal.org/index.php?title=Using_Google_Translate/fr&feed=atom&action=history
Using Google Translate/fr - Revision history
2024-03-29T14:20:40Z
Revision history for this page on the wiki
MediaWiki 1.35.6
https://wiki.freepascal.org/index.php?title=Using_Google_Translate/fr&diff=148684&oldid=prev
Jurassic pork: Modify API url of the paid version
2021-12-17T06:35:39Z
<p>Modify API url of the paid version</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 06:35, 17 December 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l6" >Line 6:</td>
<td colspan="2" class="diff-lineno">Line 6:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Il existe au moins deux manières d'accéder à Google Translate:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Il existe au moins deux manières d'accéder à Google Translate:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Une API gratuite mais limitée (https://translate.googleapis.com/translate_a/). Limitation : 100 requêtes/heure (à confirmer).</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* Une API gratuite mais limitée (https://translate.googleapis.com/translate_a/). Limitation : 100 requêtes/heure (à confirmer).</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* Une API authentifiée avec OAuth2 (https://<del class="diffchange diffchange-inline">translate</del>.<del class="diffchange diffchange-inline">google</del>.com/<del class="diffchange diffchange-inline">translate_a</del>/).</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* Une API authentifiée avec OAuth2 (https://<ins class="diffchange diffchange-inline">translation</ins>.<ins class="diffchange diffchange-inline">googleapis</ins>.com/<ins class="diffchange diffchange-inline">language/translate</ins>/<ins class="diffchange diffchange-inline">v2</ins>).</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Pour plus d'informations sur l'API authentifiée avec OAuth2, veuillez consulter: [https://developers.google.com/translate/v2/getting_started Google Translate Getting Started]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Pour plus d'informations sur l'API authentifiée avec OAuth2, veuillez consulter: [https://developers.google.com/translate/v2/getting_started Google Translate Getting Started]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Jurassic pork
https://wiki.freepascal.org/index.php?title=Using_Google_Translate/fr&diff=148669&oldid=prev
Jurassic pork: /* Se connecter à Google Translate*/
2021-12-16T12:37:17Z
<p><span dir="auto"><span class="autocomment">Se connecter à Google Translate</span></span></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 12:37, 16 December 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l32" >Line 32:</td>
<td colspan="2" class="diff-lineno">Line 32:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>==<del class="diffchange diffchange-inline">Contacter </del>Google==</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>==<ins class="diffchange diffchange-inline">Se connecter à </ins>Google <ins class="diffchange diffchange-inline">Translate</ins>==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Cette fonction renverra la réponse JSON.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Cette fonction renverra la réponse JSON.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Jurassic pork
https://wiki.freepascal.org/index.php?title=Using_Google_Translate/fr&diff=148648&oldid=prev
Jurassic pork: Mise à jour
2021-12-16T11:43:24Z
<p>Mise à jour</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:43, 16 December 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l5" >Line 5:</td>
<td colspan="2" class="diff-lineno">Line 5:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Vue d'ensemble==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>==Vue d'ensemble==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Il existe au moins deux manières d'accéder à Google Translate:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Il existe au moins deux manières d'accéder à Google Translate:</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* <del class="diffchange diffchange-inline">Un moyen gratuit </del>mais <del class="diffchange diffchange-inline">dosé</del>.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins class="diffchange diffchange-inline">Une API gratuite </ins>mais <ins class="diffchange diffchange-inline">limitée (https://translate.googleapis.com/translate_a/). Limitation : 100 requêtes/heure (à confirmer)</ins>.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* <del class="diffchange diffchange-inline">Utilisation de </del>l'API authentifiée avec OAuth2.</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* <ins class="diffchange diffchange-inline">Une API authentifiée avec OAuth2 (https://translate.google.com/translate_a/).</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Pour plus d'informations sur </ins>l'API authentifiée avec OAuth2<ins class="diffchange diffchange-inline">, veuillez consulter: [https://developers.google</ins>.<ins class="diffchange diffchange-inline">com/translate/v2/getting_started Google Translate Getting Started]</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">Ceci est </del>un exemple d'utilisation <del class="diffchange diffchange-inline">du premier.</del></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">Voici </ins>un exemple d'utilisation <ins class="diffchange diffchange-inline">de l'API gratuite :</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del class="diffchange diffchange-inline">Pour plus d'informations sur le dernier, veuillez consulter: [https://developers.google.com/translate/v2/getting_started Google Translate Getting Started]</del></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>==Informations sur les paramètres <ins class="diffchange diffchange-inline">de l' API </ins>==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>==Informations sur les paramètres==</div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>D'après une réponse sur Stack Overflow ([https://stackoverflow.com/a/29537590/8167 What is the meaning of Google Translate query params?]) voici une liste des paramètres de l'appel HTTP GET:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>D'après une réponse sur Stack Overflow ([https://stackoverflow.com/a/29537590/8167 What is the meaning of Google Translate query params?]) voici une liste des paramètres de l'appel HTTP GET:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* sl - code de la langue source (auto pour la détection automatique)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* sl - code de la langue source (auto pour la détection automatique)</div></td></tr>
</table>
Jurassic pork
https://wiki.freepascal.org/index.php?title=Using_Google_Translate/fr&diff=148640&oldid=prev
Gcarreno at 06:02, 16 December 2021
2021-12-16T06:02:45Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 06:02, 16 December 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l150" >Line 150:</td>
<td colspan="2" class="diff-lineno">Line 150:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> +'&sl='+cArrayShortLanguages[0] // Détection automatique</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> +'&sl='+cArrayShortLanguages[0] // Détection automatique</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> +'&tl='+cArrayShortLanguages[1] // Anglais</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> +'&tl='+cArrayShortLanguages[1] // Anglais</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> +'&dt=t&dj=1' // dj=1 <del class="diffchange diffchange-inline">makes the response be a </del>JSON <del class="diffchange diffchange-inline">Object</del></div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> +'&dt=t&dj=1' // dj=1 <ins class="diffchange diffchange-inline">rend la réponse un objet </ins>JSON</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> +'&ie=UTF-8&oe=UTF-8'</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> +'&ie=UTF-8&oe=UTF-8'</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ;</div></td></tr>
</table>
Gcarreno
https://wiki.freepascal.org/index.php?title=Using_Google_Translate/fr&diff=148639&oldid=prev
Gcarreno at 05:54, 16 December 2021
2021-12-16T05:54:33Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 05:54, 16 December 2021</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l20" >Line 20:</td>
<td colspan="2" class="diff-lineno">Line 20:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* oe - encodage de sortie (une supposition)</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* oe - encodage de sortie (une supposition)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* dt - peut être inclus plusieurs fois et spécifie ce qu'il faut retourner dans la réponse</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* dt - peut être inclus plusieurs fois et spécifie ce qu'il faut retourner dans la réponse</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* dj - <del class="diffchange diffchange-inline">Réponse </del>JSON avec des noms au lieu de tableaux (dj=1)</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* dj - <ins class="diffchange diffchange-inline">réponse </ins>JSON avec des noms au lieu de tableaux (dj=1)</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Voici quelques valeurs pour dt:</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Voici quelques valeurs pour dt:</div></td></tr>
</table>
Gcarreno
https://wiki.freepascal.org/index.php?title=Using_Google_Translate/fr&diff=148638&oldid=prev
Gcarreno at 05:44, 16 December 2021
2021-12-16T05:44:17Z
<p></p>
<a href="//wiki.freepascal.org/index.php?title=Using_Google_Translate/fr&diff=148638&oldid=135841">Show changes</a>
Gcarreno
https://wiki.freepascal.org/index.php?title=Using_Google_Translate/fr&diff=135841&oldid=prev
E-ric: Total translation.
2020-05-01T21:30:41Z
<p>Total translation.</p>
<p><b>New page</b></p><div>{{Using_Google_Translate}}<br />
<br />
== Vue d'ensemble ==<br />
Google Translate a plusieurs frontaux (front ends). Si vous voulez traduire des textes, vous devez payer et obtenir une clé.<br />
<br />
https://developers.google.com/translate/v2/getting_started<br />
<br />
== Exemple simple Simple pour des traductions occasionnelles ==<br />
<br />
Cet example démontre comment interroger le traducteur via le TFPHTTPClient et analyser le premier tableau du JSON retourné. Même si cet exemple est écrit en utilisant Lazarus, il peut être facilement adapté pour une utilisation avec FPC.<br />
<br />
<syntaxhighlight lang="pascal"><br />
uses<br />
lazlogger, fpjson, fphttpclient, HTTPDefs;<br />
<br />
function DownloadText(const URL: string): TStrings;<br />
var<br />
client: TFPHTTPClient;<br />
doc: TStringList;<br />
begin<br />
Result:=nil;<br />
doc:=TStringList.Create;<br />
client:=TFPHTTPClient.Create(nil);<br />
try<br />
client.Get(URL,doc);<br />
Result:=doc;<br />
doc:=nil;<br />
finally<br />
doc.Free;<br />
client.Free;<br />
end;<br />
end;<br />
<br />
function AskGoogleTranslate(OriginalText, SourceLang, TargetLang: string;<br />
out TranslatedText, ErrorMessage: string): boolean;<br />
var<br />
doc: TStrings;<br />
URL: String;<br />
JSON: String;<br />
p: PChar;<br />
i: Integer;<br />
StartPos: PChar;<br />
Line: TJSONStringType;<br />
Level: Integer;<br />
begin<br />
Result:=false;<br />
ErrorMessage:='';<br />
TranslatedText:='';<br />
if (SourceLang='') or (TargetLang='') then begin<br />
ErrorMessage:='missing language parameter';<br />
exit;<br />
end;<br />
if OriginalText='' then exit;<br />
<br />
// download JSON<br />
URL:='http://translate.google.com/translate_a/t?client=t'<br />
+'&text='+HTTPEncode(OriginalText)<br />
+'&sl='+SourceLang<br />
+'&tl='+TargetLang<br />
+'&sc=1'<br />
+'&ssel=0&tsel=0'<br />
+'&ie=UTF-8&oe=UTF-8'<br />
;<br />
try<br />
doc:=DownloadText(URL);<br />
except<br />
on E: Exception do begin<br />
debugln(['AskGoogleTranslate failed URL=',URL,' Error=',E.Message]);<br />
ErrorMessage:='query failed: '+E.Message;<br />
exit;<br />
end;<br />
end;<br />
try<br />
// parse JSON<br />
// For example:<br />
// [[["Erster Satz . ","First sentence.","",""],["Zweiter Satz . ","Second sentence.","",""]],<br />
JSON:=doc.Text;<br />
p:=PChar(JSON);<br />
Level:=0;<br />
i:=0;<br />
repeat<br />
case p^ of<br />
#0: break;<br />
'[':<br />
begin<br />
inc(Level);<br />
i:=0;<br />
end;<br />
']':<br />
begin<br />
dec(Level);<br />
if Level=1 then break;<br />
end;<br />
',':<br />
inc(i);<br />
'"':<br />
begin<br />
inc(p);<br />
StartPos:=p;<br />
repeat<br />
case p^ of<br />
#0,'"': break;<br />
'\':<br />
begin<br />
inc(p);<br />
if p^=#0 then break;<br />
end;<br />
end;<br />
inc(p);<br />
until false;<br />
if i=0 then begin<br />
Line:=JSONStringToString(copy(JSON,StartPos-PChar(JSON)+1,p-StartPos));<br />
TranslatedText:=TranslatedText+Line;<br />
end;<br />
if p^=#0 then break;<br />
end;<br />
end;<br />
inc(p);<br />
until false;<br />
finally<br />
doc.Free;<br />
end;<br />
Result:=true;<br />
end;<br />
<br />
// here is an example how to translate English(en) to German(de)<br />
procedure TForm1.Button1Click(Sender: TObject);<br />
var<br />
ErrorMessage: string;<br />
TranslatedText: string;<br />
begin<br />
if not AskGoogleTranslate('First sentence. Second sentence.','en','de',TranslatedText,ErrorMessage)<br />
then begin<br />
debugln(['AskGoogleTranslate failed: ',ErrorMessage]);<br />
end else begin<br />
debugln(['TForm1.FormCreate Translation: ',TranslatedText]);<br />
end;<br />
end;<br />
</syntaxhighlight></div>
E-ric