How do I change the original language in PHP files and Twig files? I have installed a Drupal 8.5 site in French (monolingual). Then, I added content.

Of course, there are many strings in the PHP files of my custom theme/module I pass to t(). There are also many strings in the Twig files I translated with {{ 'a string'|trans }}.

After a while, I added English.

Unfortunately, I discovered that all the strings (interface) I just mentioned are seen by Drupal as English string.

For example, using the Translation template extractor module, I don't have the choice to extract the strings in English. I have only 2 options for the extraction: Language independent template and Template file for French translations.
When I use the Translation Management Tool module, all the locale sources strings have Original language under the English column and Not translated under the French column.

How do I tell Drupal that all my strings (PHP and Twig) are French strings?
Alternatively, what is the process to be able to export/translate in English, and import files (PO or XLIFF) into my site?
How do I tell Drupal that all my strings (PHP and Twig) are French strings?


You can not. There is no setting for that, the source code must be english.

Drupal does allow to translate the code/system-english to the actual english if you enable the checkbox when editing the english language. I don't know what that does exactly to potx and I don't think TMGMT supports it either.