{"id":156,"date":"2008-01-23T14:04:54","date_gmt":"2008-01-23T20:04:54","guid":{"rendered":"http:\/\/www.cortig.net\/wordpress\/?p=156"},"modified":"2016-05-27T12:34:36","modified_gmt":"2016-05-27T18:34:36","slug":"basculer-entre-les-langues-dans-word-switching-between-langugages-in-word","status":"publish","type":"post","link":"http:\/\/www.cortig.net\/wordpress\/2008\/01\/23\/basculer-entre-les-langues-dans-word-switching-between-langugages-in-word\/","title":{"rendered":"Basculer entre les langues dans Word \/ Switching between languages in Word"},"content":{"rendered":"<p>(the English version of this post is further down below)<\/p>\n<p>J&#8217;\u00e9cris souvent dans deux langues diff\u00e9rentes (par exemple, dans ce blog :-> ). Dans Word, on peut basculer les r\u00e9glages d&#8217;une s\u00e9lection de texte d&#8217;une langue \u00e0 une autre en fonction des besoins par Outils>Langues. C&#8217;est assez fastidieux (surtout quand on le fait souvent) et n\u00e9cessite un nombre certain de clics. On peut utiliser diff\u00e9rents mod\u00e8les pour diff\u00e9rentes langues, ou utiliser des styles particuliers pour diff\u00e9rentes langues, mais je ne trouve pas cette approche tr\u00e8s souple. J&#8217;utilisais donc jusque l\u00e0 des scripts en VBA, affect\u00e9s \u00e0 diff\u00e9rents boutons sur une palette personnalis\u00e9e pour basculer une s\u00e9lection dans une langue ou dans l&#8217;autre.<br \/>\nDans Word 2008, sorti la semaine derni\u00e8re, plus de VBA, et plus de possibilit\u00e9 d&#8217;affecter des scripts \u00e0 des boutons.<br \/>\nFor heureusement il y a une solution de remplacement qui fonctionne tr\u00e8s bien.<br \/>\nPaul Berkowitz m&#8217;a fait d\u00e9couvrir que l&#8217;on pouvait tr\u00e8s facilement faire la m\u00eame chose en AppleScript<\/p>\n<p>Voil\u00e0 par exemple pour modifier une s\u00e9lection de texte et faire en sorte que Word sache qu&#8217;elle est en anglais (US) :<\/p>\n<blockquote><p>\n<span style=\"color: blue\"><strong>tell<\/strong> application<\/span> &#8220;Microsoft Word&#8221;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: blue\"><strong>set<\/strong> language ID <strong>of<\/strong> selection <strong>to<\/strong> english us<br \/>\n<strong>end tell<\/strong><\/span>\n<\/p><\/blockquote>\n<p>On peut alors s\u00e9lectionner le texte, lancer le script et voili \ud83d\ude42<br \/>\nPour les autres langues, il suffit de changer \u00ab\u00a0english us \u00bb par le nom de la langue voulue (voir le bas de ce billet dans la section \u00e9tendue).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.cortig.net\/wordpress\/wp-content\/script.png\" alt=\"script menu\" border=\"0\" width=\"391\" height=\"172\" align=\"left\" \/>Le script peut alors \u00eatre plac\u00e9 dans <span style=\"color: grey\">~\/Documents\/Donn\u00e9es Utilisateur Microsoft\/Word Script Menu Items\/<\/span> (<span style=\"color: grey\">~\/<\/span> repr\u00e9sente votre compte utilisateur \u00e2\u20ac\u201d je ne suis pas 100% certain du fait que le nom du dernier dossier soit localis\u00e9 ou pas avec la version fran\u00e7aise car je ne l&#8217;ai pas actuellement sur mon Mac)<\/p>\n<p>Il est possible d&#8217;ajouter un suffixe au nom que l&#8217;on donne au script dans le Finder pour que l&#8217;on puisse le lancer d&#8217;un simple raccourcis clavier.<br \/>\nLa syntaxe est la m\u00eame que pour Entourage. <span style=\"color: grey\">English US\\cU<\/span> par exemple cr\u00e9e une cr\u00e9e une commande dans le menu Script de Word avec le raccourcis <span style=\"color: grey\">Ctrl-U<\/span><\/p>\n<p><\/p>\n<p>\u00c0 titre d&#8217;exemple, le script pour le fran\u00e7ais et l&#8217;anglais (US) peuvent \u00eatre t\u00e9l\u00e9charg\u00e9s <a href=\"http:\/\/www.cortig.net\/files\/FrenchANDEnglish.zip\">l\u00e0<\/a>.<br \/>\nVous pouvez en faire ce que vous voulez, les \u00e9diter pour utiliser une autre langue, etc\u2026<br \/>\nMille mercis \u00e0 Paul pour l&#8217;information!<\/p>\n<hr align=\"center\" \/>\n<p>I often write in more than one language (eg: in this blog :-> ). In word, you can set the language for a selection of text to the language you need through Tools>Languages. I find this rather tedious (especially if you often have to do it) and requires quite a few clicks. You can use different templates for different languages, or different styles, but I don&#8217;t find this approach flexible enough. Until recently, I was using VBA scripts. They were assigned to a button on a custom toolbar and did the job quite well.<br \/>\nWord 2008 just came out, and the new version doesn&#8217;t support VBA anymore. You can&#8217;t bind a script to a button on a toolbar either.<br \/>\nI was discussing the issue with Paul Berkowitz lately and he suggested a wonderful alternate way to do the same thing through AppleScripts that works in Word 2008.<\/p>\n<p>Here is how you can change the settings for a text selection so that Word knows it&#8217;s in French for instance:<\/p>\n<blockquote><p>\n<span style=\"color: blue\"><strong>tell<\/strong> application<\/span> &#8220;Microsoft Word&#8221;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: blue\"><strong>set<\/strong> language ID <strong>of<\/strong> selection <strong>to<\/strong> french<br \/>\n<strong>end tell<\/strong><\/span>\n<\/p><\/blockquote>\n<p>All you have to do is to select the text, invoke the script and that&#8217;s it \ud83d\ude42<br \/>\nFor other languages, you just need to edit the script and replace \u201dfrench\u201d with the appropriate name for the language you need (see below in the extended section for this post).<\/p>\n<p>As illustrated in the capture above, the script can be placed in  <span style=\"color: grey\">~\/Documents\/Microsoft User Data\/Word Script Menu Items\/<\/span> (<span style=\"color: grey\">~\/<\/span> represents your user account)<\/p>\n<p>You can add a suffix, following the same syntax as in Entourage, to the name of the script in the Finder to provide a shortcut to invoke the script in Word. A name like <span style=\"color: grey\">French\\cF<\/span> for instance, provides the <span style=\"color: grey\">Ctrl-F<\/span> shortcut to switch a selection in Word to French (see capture).<\/p>\n<p>To make things easier, the scripts for French and English (US) can be downloaded <a href=\"http:\/\/www.cortig.net\/files\/FrenchANDEnglish.zip\">here<\/a>.<br \/>\nYou can do whatever you want with them: edit them, use them for other languages, etc\u2026<\/p>\n<p>Many thanks to Paul for the tip!<\/p>\n<p><!--more--><\/p>\n<hr align=\"center\" \/>\n<p>Liste des langues support\u00e9es \/ list of supported languages:<\/p>\n<blockquote><p>language none<br \/>\nlanguage no proofing<br \/>\ndanish<br \/>\ngerman<br \/>\nswiss german<br \/>\nenglish aus<br \/>\nenglish uk<br \/>\nenglish us<br \/>\nenglish canadian<br \/>\nenglish new zealand<br \/>\nenglish south africa<br \/>\nspanish<br \/>\nfrench<br \/>\nfrench canadian<br \/>\nitalian<br \/>\ndutch<br \/>\nnorwegian bokmol<br \/>\nnorwegian nynorsk<br \/>\nbrazilian portuguese<br \/>\nportuguese<br \/>\nfinnish<br \/>\nswedish<br \/>\ncatalan<br \/>\ngreek<br \/>\nturkish<br \/>\nrussian<br \/>\nczech<br \/>\nhungarian<br \/>\npolish<br \/>\nslovenian<br \/>\nbasque<br \/>\nmalaysian<br \/>\njapanese<br \/>\nkorean<br \/>\nsimplified chinese<br \/>\ntraditional chinese<br \/>\nswiss french<br \/>\nsesotho<br \/>\ntsonga<br \/>\ntswana<br \/>\nvenda<br \/>\nxhosa<br \/>\nzulu<br \/>\nafrikaans<br \/>\narabic<br \/>\nhebrew<br \/>\nslovak<br \/>\nfarsi<br \/>\nromanian<br \/>\ncroatian<br \/>\nukrainian<br \/>\nbyelorussian<br \/>\nestonian<br \/>\nlatvian<br \/>\nmacedonian<br \/>\nserbian latin<br \/>\nserbian cyrillic<br \/>\nicelandic<br \/>\nbelgian french<br \/>\nbelgian dutch<br \/>\nbulgarian<br \/>\nmexican spanish<br \/>\nspanish modern sort<br \/>\nswiss italian<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>(the English version of this post is further down below) J&#8217;\u00e9cris souvent dans deux langues diff\u00e9rentes (par exemple, dans ce blog :-> ). Dans Word, on peut basculer les r\u00e9glages d&#8217;une s\u00e9lection de texte d&#8217;une langue \u00e0 une autre en fonction des besoins par Outils>Langues. C&#8217;est assez fastidieux (surtout quand on le fait souvent) et n\u00e9cessite un nombre certain de clics. On peut utiliser diff\u00e9rents mod\u00e8les pour diff\u00e9rentes langues, ou utiliser des styles particuliers pour diff\u00e9rentes langues, mais je ne trouve pas cette approche tr\u00e8s&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-156","post","type-post","status-publish","format-standard","hentry","category-macms-apps"],"_links":{"self":[{"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/comments?post=156"}],"version-history":[{"count":2,"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":301,"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/156\/revisions\/301"}],"wp:attachment":[{"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/media?parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/categories?post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/tags?post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}