{"id":16198049,"url":"https://github.com/benoitvallon/titlecase-french","last_synced_at":"2025-03-19T05:30:31.081Z","repository":{"id":53551576,"uuid":"45860957","full_name":"benoitvallon/titlecase-french","owner":"benoitvallon","description":"\"Capital and Lowercase Letters in French Title\" using capital letters for the principal words ","archived":false,"fork":false,"pushed_at":"2021-03-24T21:12:59.000Z","size":20,"stargazers_count":14,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T07:17:12.827Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benoitvallon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-09T19:20:06.000Z","updated_at":"2024-10-27T12:58:52.000Z","dependencies_parsed_at":"2022-09-13T11:52:03.721Z","dependency_job_id":null,"html_url":"https://github.com/benoitvallon/titlecase-french","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitvallon%2Ftitlecase-french","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitvallon%2Ftitlecase-french/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitvallon%2Ftitlecase-french/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitvallon%2Ftitlecase-french/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitvallon","download_url":"https://codeload.github.com/benoitvallon/titlecase-french/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971156,"owners_count":20376784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T09:10:53.543Z","updated_at":"2025-03-19T05:30:30.778Z","avatar_url":"https://github.com/benoitvallon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Title Case for French\n\n[![Build Status](https://travis-ci.org/benoitvallon/titlecase-french.svg)](https://travis-ci.org/benoitvallon/titlecase-french)\n\n# What is Title Case?\n\nBasically it is using \"Capital and Lowercase Letters in Titles\". This means only using capital letters for the principal words. Articles, conjunctions, and prepositions do not get capital letters unless they start the title. For example:\n\n- The Last of the Mohicans\n\n## In English\n\nThere are quite a few nice libraries to Title Case a text in English. This [implementation by John Resig](http://ejohn.org/blog/title-capitalization-in-javascript) is one of them and works well. In English, the first word in the title and all subsequent \"important\" words (everything except articles, conjunctions, and prepositions) are capitalized.\n\n## In French\n\nThe capitalization of titles in French and English is quite a bit different. The rules are more complicated in French, so complicated, in fact, that even *Le Petit Robert* (the quintessential French dictionary) and *Le Bon Usage* (the French grammar bible) can't seem to agree on how to capitalize titles.\n\nIt is clear that either there is no standard system or that the standard is not well known. As a French person I tried to apply the rules that I have most commonly seen.\n\n# Using the package\n\n## Installation\n\n```js\nnpm install titlecase-french\n```\n\n## Basic usage\n\nYou just need to require the package and call the `convert('mon texte de démonstration')` function.\n\n```js\nvar titleCaseFrench = require('titlecase-french');\n\nvar myText = titleCaseFrench.convert('mon texte de démonstration');\nconsole.log(myText); // =\u003e Mon Texte de Démonstration\n```\n\n## API\n\n### `addLowerCaseWords`\n\n#### Description\n\nIf you do not want specific words to be capitalized then include them to the list with the function.\n\n#### Signature\n\n`addLowerCaseWords(words: String)`\n\nWhere `words` is a list of words separated by Commas.\n\n#### Example\n\nIn the first example the 'démonstration' word is added to the list and won't be capitalized. In the second example both words 'démonstration' and 'texte' won't be capitalized.\n\n```js\nvar titleCaseFrench = require('titlecase-french');\ntitleCaseFrench.addLowerCaseWords('démonstration');\n\nvar myText = titleCaseFrench.convert('mon texte de démonstration');\nconsole.log(myText); // =\u003e Mon Texte de démonstration\n\ntitleCaseFrench.addLowerCaseWords('démonstration,texte');\n\nvar myText = titleCaseFrench.convert('mon texte de démonstration');\nconsole.log(myText); // =\u003e Mon texte de démonstration\n```\n\n### `removeLowerCaseWords`\n\n#### Description\n\nIf you want to remove specific words from the default list (see words in the rules below) then call this function with your list of words.\n\n#### Signature\n\n`removeLowerCaseWords(words: String)`\n\nWhere `words` is a list of words separated by Commas.\n\n#### Example\n\nIn this example the 'de' word should have been in lowercase because it is in the default list of words that are not capitalized. We are going to remove it from the list to get it capitalized.\n\n```js\nvar titleCaseFrench = require('titlecase-french');\ntitleCaseFrench.removeLowerCaseWords('de,du,la,la');\n\nvar myText = titleCaseFrench.convert('mon texte de démonstration');\nconsole.log(myText); // =\u003e Mon Texte De Démonstration\n```\n\n### `keepCapitalizedSpecials`\n\n#### Description\n\nSometimes you do not want to replace all the capitalized special letters. You can avoid replacement by declaring which letter you want to keep.\n\n#### Signature\n\n`keepCapitalizedSpecials(letters: String)`\n\nWhere `letters` is a list of uppercase special letters separated by Commas.\n\n#### Example\n\n```js\nvar titleCaseFrench = require('titlecase-french');\ntitleCaseFrench.keepCapitalizedSpecials('À,Ç,É');\n\nvar myText = titleCaseFrench.convert('ça va!');\nconsole.log(myText); // =\u003e Ça Va!\n```\n\n# Tests\n\n```js\nnpm test\n```\n\n# The rules\n\nThere are 5 main rules:\n\n- A title always starts with a word in uppercase\n- A specific list of words are in lowercase\n- After an apostrophe *'* words can be in lowercase or uppercase depending of the word before the apostrophe\n- Acronyms are in uppercase\n- Special uppercase letters (with accent for example) are replaced with their simple version\n\nSome examples ([see below for a bigger list](#samples-of-converted-titles)).\n\n```js\n/*\nLe Dernier des Mohicans\nDu Vent dans les Branches\nJunior l'Aventurier\nCa m'intéresse\nAvec S.A.M.\nCet Eté à la Plage\n*/\n```\n\n## List of lowercase words\n\n- Definite articles:\n    - *le, la, les*\n\n- Indefinite articles:\n    - *un, une, des*\n\n- Partitive articles:\n    - *du, de, des*\n\n- Contracted articles:\n    - *au, aux, du, des*\n\n- Demonstrative adjectives:\n    - *ce, cet, cette, ces*\n\n- Exclamative adjectives:\n    - *quel, quels, quelle, quelles*\n\n- Possessive adjectives:\n    - *mon, ton, son, notre, votre, leur, ma, ta, sa, mes, tes, ses, nos, vos, leurs*\n\n- Coordinating conjunctions:\n    - *mais, ou, et, donc, or, ni, car, voire*\n\n- Subordinating conjunctions:\n    - *que, qu, quand, comme, si, lorsque, lorsqu, puisque, puisqu, quoique, quoiqu*\n\n- Prepositions:\n    - *à, chez, dans, entre, jusque, jusqu, hors, par, pour, sans, vers, sur, pas, parmi, avec, sous, en*\n\n- Personal pronouns:\n    - *je, tu, il, elle, on, nous, vous, ils, elles, me, te, se, y*\n\n- Relative pronouns:\n    - *qui, que, quoi, dont, où*\n\n- Other words:\n    - *ne*\n\n## After an apostrophe\n\n- Words after an apostrophe are in lowercase if the word before the apostrophe is:\n    - *c', j', m', n', s', t'*\n\n- Words after an apostrophe are in uppercase if the word before the apostrophe is:\n    - *d', l'*\n\n## Special uppercase letters\n\n- All the following special uppercase letters are replaced:\n    - *À, Â, Ä, É, È, Ê, Ë, Ç, Î, Ï, Ô, Ö, Û, Ü, Ù*\n\n# Samples of converted titles\n\n```js\n/*\nLe Triangle Rouge\nLoki, le Détective Mythique\nLa Secte\nLeon la Came\nLittlest Petshop les Aventures\nLes Banquiers\nJunior l'Aventurier\nL'Accordeur\nJe Suis un Vampire\nUn Messager\nIl Etait une Fois...\nUne Histoire de France\nLe Haut des Arbres\nDes Mohicans\nDanse du Temps\nDu Côté de chez Poje\nLe Masque de Fer\nDe Beaux Moments\nLe Marteau des Sorcières\nDes Bêtes\nRentre au Pays\nAu Pays des Monstres\nRentrez aux Pays\nAux Pays des Monstres\nHistoires du Passé\nDu Vent dans les Branches\nAvant des Lustres\nDes Répétitions\nRegarde ce Chemin\nCe Chemin Est Long\nA la Plage cet Eté\nCet Eté à la Plage\nIls Font cette Liste\nCette Liste\nRegarde-Moi ces Hommes\nCes Longs Trajets\nDis Moi quel Nom\nQuel Beau Paysage\nEn quel Pays\nQuels Sapins pour Noël\nEn quelle Saison\nQuelle Ville\nElles Font quelles Recettes\nQuelles Couleurs\nSauf mon Père\nMon Ancètre\nVis ton Rêve\nTon Espoir ne Meurt pas\nLouna et son Fils\nSon Coeur Résistera\nA notre Bourse\nNotre Vie\nAvec votre Accord\nVotre Avis\nC'est leur Choix\nLeur Style\nTout Est de ma Faute\nMa Mère\nRange ta Chambre\nTa Lumière\nUn Père et sa Fille\nSa Dulciné\nPourtant mes Choix Etaient Bons\nMes Devoirs\nPrends tes Responsabilités\nTes Dessins Sont Brillants\nLui et ses Frères\nSes Cousins et Cousines\nCe Sont nos Femmes\nNos Clients\nA vos Marques\nVos Idées\nJamais sans leurs Bicyclettes\nLeurs Régions Ont du Talents\nIl Est Studieux mais Turbulent\nMais Comment Font-Ils?\nIci ou Là\nOu Bien\nEntre Ciel et Terre\nBoule et Bill\nJe Pense donc je Suis\nDonc nous Partons\nLe Temps Est Chaud or il A Froid\nOr il Tomba\nJe ne Bois, ni ne Fume\nNi Eux ni Moi\nPart car il Est Temps\nCar il Partait\nDeux voire Trois\nVoire Même Trois\nIl Faut que je Parte\nQue Faire\nA Moins qu'elle Parte\nQu'en Dise les Gens\nElle Rêve quand elle Dors\nQuand Viendra le Temps\nElle Est Belle comme le Jour\nComme si nous Pouvions\nNous Sommes Allé si Loin\nSi Loin\nElle Partit lorsque tu Arrivas\nLorsque tu Pars\nIl Partit lorsqu'elle Arriva\nLorsqu'elle Arriva\nIl Est Là puisque je l'Ai Vu\nPuisque tu Pars\nIls Viennent puisqu'elle Part\nPuisqu'elle Part\nIl Ira quoique tu Fasses\nQuoique nous Fassions\nIl l'Aime quoiqu'elle Fasse\nQuoiqu'elle Fasse\nMotards à Jamais\nA Toute Allure\nViens chez nous\nChez nous\nLe Pont dans la Vase\nDans mes Veines\nLe Jour entre les Lattes\nEntre Lui et elle\nDepuis Là jusque dans la Maison\nJusque Par-Dessus la Tête\nRévêr jusqu'au Jour\nJusqu'au Lendemain\nSortez hors de chez Moi\nHors la Loi\nDeçue par la Vie\nPar Dessus les Nuages\nTout pour le Tout\nPour la Vie\nVivre sans Limite\nSans Foi ni Loi\nLe Regard vers le Large\nVers l'Infini et Au-Delà\nArgent sur Providence\nSur Lui\nIl ne Faut pas\nPas Toi\nL'Intru parmi Eux\nParmi nous\nLui avec ses Amis\nAvec Eux\nL'Eau sous la Glace\nSous la Neige\nEn Route\nEscales en Terres Inconnues\nPourquoi je Pleure\nJe Suis Moi\nToi au Moins, tu Es Mort Avant\nTu Mourras Moins Bête\nAprès il Est Parti\nIl Etait Seul\nEn Chemin elle Rencontre...\nElle et Lui\nAprès on Ira au Bois\nOn nous Dit Rien\nLe Monde Est à nous\nNous Rentrons\nSi vous Acceptez\nVous et Eux\nAprès ils Sont Partis\nIls Etaient Dix\nComme elles\nElles Etaient Dix\nLaisse Moi me Prendre en Charge\nMe Perdre\nJe te Rejoindrai\nTe Dira pas\nIl Faut se Connaître Soi-Même\nSe Perdre\nIl y Avait\nY A pas\nCeux qui Ont des Ailes\nQui Est La?\nPendant que le Roi de Prusse...\nQue sa Volonté Soit Faite\nA quoi Bon\nQuoi Faire\nCelui dont on Parle\nDont nous Aimons la Compagnie\nLe Pays où il Est Né\nOù Aller?\nIl ne Viendra pas\nNe Fais pas Ca\nCa, c'est Paris\nC'est Triste\nLe Marquis d'Anaon\nD'Artagnan\nDites-Moi que j'existe\nJ'ai Tué François\nMoi l'Homme\nL'Emmerdeur\nCa m'intéresse\nAvoue tu m'aimes\nJe n'ai pas Raison\nN'ai pas Peur\nElle s'est Fait Mal\nS'affoler pour Rien\nSimon's Cat\nSi tu Freines t'es un Lâche\nT'abuses Ikko\nEn Extrême-Orient\nExtrême-Orient\nComment s'appelle-t-il?\nCe Mot Existe-t-il?\nAvec S.A.M.\nS.A.M.\nMotards à Jamais\nA Toute Allure\nLe Bruit de l'Echo\nEcho des Savanes\nPost Ere Moderne\nEre Moderne\nCa m'intéresse\nTu Aimes Ca\n*/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitvallon%2Ftitlecase-french","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitvallon%2Ftitlecase-french","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitvallon%2Ftitlecase-french/lists"}