Variable names and comments in French?

9 points by nier ↗ HN
Can anybody with a company registered in France share their experience delivering source code to their French clients in the public sector?

Under Loi Toubon, is it illegal for comments and variable names to be English only? Or is it sufficient when user manual and user interface is delivered in French?

In other words, do comments in source code represent documentation as understood by the Loi Toubon and thus need to be delivered in French?

Is the law in this regard applied differently when dealing with the private sector?

The resources I could find in English do not mention any requirements when it comes to source code. I’m also questioning the practicality of delivering a software project that includes open source packages that in addition to having a suitable license will need to have their readme files translated let alone their comments.

13 comments

[ 5.2 ms ] story [ 47.0 ms ] thread
As a french dev guy, all I can say is ... it depends, and you will need to have this conversation with your customer. Manual and user interface will probably have to be in french. Regarding the code, you will probably be able to code/comment in whatever language you want, but ... some customer can be picky for whatever reason (internal IT guy/expert does not speak English, there is a current french power move against english at the european commission, etc..)
just do coders traditional practices,

have a script to search any comment/identifier and then make use of google (any online) translator then put it back replace to original and save as different new file

I'm also a French developer and I have delivered projects used by French customers in the public sector and it really depends. I have worked for/with French public sector customers on open source projects in popular open source foundations where everything is in English (code, comments, user manual, etc) with a regular open source license but I also know of teams in public sector customers where everything they build has to be in French including the code itself. Ask your customer.
The law is here: https://www.legifrance.gouv.fr/loda/id/LEGITEXT000005616341/ Here the relevant translations:

Article 2: In the designation, offer, presentation, instructions for use or use, description of the scope and warranty conditions of a good, product or service, as well as in invoices and receipts, the use of the French language is compulsory. The same provisions apply to all written, spoken or audiovisual advertising.

Article 3: Any inscription or advertisement affixed or made on the public highway, in a place open to the public or in a means of public transport and intended for the information of the public must be formulated in French.

Article 5: ...contracts to which a legal person governed by public law or a private person performing a public service mission are parties are drawn up in French. They may not contain any foreign expression or term when there is a French expression or term with the same meaning approved under the conditions provided for by the regulatory provisions relating to the enrichment of the French language. ... The contracts referred to in this article concluded with one or more foreign co-contractors may include, in addition to being written in French, one or more versions in a foreign language which may also be authentic.

Article 6: Anyone participating in an event, a conference or a congress organized in France by natural or legal persons of French nationality has the right to speak French. Documents distributed to participants before and during the meeting to present the program must be written in French and may include translations into one or more foreign languages.

When an event, a colloquium or a congress gives rise to the distribution to the participants of preparatory documents or working documents, or to the publication of proceedings or reports of proceedings, the texts or interventions presented in a foreign language must be accompanied by at least a summary in French. ... When a legal person governed by public law or a legal person governed by private law entrusted with a public service mission initiates the events referred to in this article, a translation system must be set up.

Article 7: The publications, reviews and communications disseminated in France and which emanate from a legal person governed by public law, a private person exercising a public service mission or a private person benefiting from a public subsidy must, when they are written in a foreign language, include at least a summary in French.

Article 14: I. The use of a trademark, trade or service made up of a foreign expression or term is prohibited for legal persons governed by public law when there is a French expression or term of the same. meaning approved under the conditions provided for by the regulatory provisions relating to the enrichment of the French language.

This prohibition applies to legal persons governed by private law entrusted with a public service mission, in the execution of that mission.

II. The provisions of this article do not apply to trademarks used for the first time before the entry into force of this law.

Comments do not seem to be covered. Whether your customer wants comments in French is another matter entirely, but the Loi Toubon seems to be directed at external use of language - contracts, events, invoices, advertising, manuals etc. As scope is specifically mentioned (la description de l'étendue), specificatons need to be in French (or a regional language - see article 21).

(Usual provisions apply - IANAL, don't believe anything you read on the internet, etc.)

Depends... If one considers the source code as being (part of) the program's documentation, then it should be in French?
(comment deleted)
(comment deleted)
The law does not require documentation to be in French, only manuals and operating instructions. But, as two other people have pointed out, the buyer may require comments to be in French. This is then a contractual requirement, not a requirement of the Loi Toubon.
You should also use a programming language where the keywords are in french.
I can recommend WinDev. They use pictures of women to advertise their technology. It can't be bad (ignore the people complaining about the database corruptions, they are jealous because they didn't get the latest WinDev sexy calendar).
Company registered in France and dealt with the public sector.

Communication, invoices, and all things related to the tender and the offer (technical and commercial), contract, NDA, etc. were in French, but the code/comments was in English. The interface's text was in French for convenience.

From what I understand (perfunctory reading), it's mostly the legal documents and media/ads/copywriting/billboards/warranties/receipts/etc. that fall under this, and there's leeway for industrial activities (Article 5).

Not that I had heard of this law before today, but we mostly did what was helpful and useful for the clients.

In Quebec there is Bill 101. Working in IT I have never seen, except for student homeworks, variable names or comments exclusively in French. I guess it depends of your workplace norms / what clients pay for but I think programming languages with English keywords should stick to English name variables. I find it easier to understand the logic this way. As for comments, being a beacon of hope for whoever will have to debug your code in the future, why not have both or include a link to a popular online translation service?