fix: translation

This commit is contained in:
egarette@silique.fr 2026-06-13 06:50:05 +02:00
parent e986de4637
commit f1d212b4b6
24 changed files with 98 additions and 29 deletions

View file

@ -4,7 +4,7 @@ include_toc: true
--- ---
[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) [🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md)
## Charger les variables d'environnement ## Charge les variables d'environnement
> [!NOTE] > [!NOTE]
> >
@ -17,12 +17,10 @@ include_toc: true
> Pour les valeurs, il n'y a pas de différence entre un nombre et une lettre (ils peuvent être entre guillemets ou non). Cependant, les booléens sont True ou False. Le séparateur pour les variables multiple est la virgule.\ > Pour les valeurs, il n'y a pas de différence entre un nombre et une lettre (ils peuvent être entre guillemets ou non). Cependant, les booléens sont True ou False. Le séparateur pour les variables multiple est la virgule.\
> **Chemin** : environment\ > **Chemin** : environment\
> *`désactivé`*\ > *`désactivé`*\
> **Désactivé** : si environment n'est pas défini dans "[Sélection pour données utilisateur](#step.user_data)" > **Désactivé** : si environment n'est pas défini dans "[sélection pour user data](#step.user_data)".
| Variable | Description | Valeur par défaut | Type | Validateur |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|---------------------------------------------------------------------------------------------------|------------------------------------------------------|
| **<a id="environment.default_environment_name" name="environment.default_environment_name">environment.default_environment_name</a>**<br/>**Ligne de commande** : <br/>--environment.default_environment_name<br/>**Variable d'environnement** : ENVIRONMENT.DEFAULT_ENVIRONMENT_NAME | Nom du préfix d&#x27;environnement par défaut. | ROUGAIL | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | Doit seulement utiliser des caractères en majuscule. |
| **<a id="environment.custom_separator" name="environment.custom_separator">environment.custom_separator</a>**<br/>**Ligne de commande** : <br/>--environment.custom_separator<br/>**Variable d'environnement** : ENVIRONMENT.CUSTOM_SEPARATOR | Remplace le caractère séparateur « . » dans les chemins par un autre.<br/>Le caractère point (« . ») peut ne pas être autorisé dans le nom de la variable d&#x27;environnement. Attention, le nom de la variable avec des points est toujours disponible en plus du nom avec ce caractère. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | |
| **<a id="environment.with_secrets" name="environment.with_secrets">environment.with_secrets</a>**<br/>**Ligne de commande** : <br/>&nbsp;--environment.with_secrets<br/>&nbsp;--environment.no-with_secrets<br/>**Variable d'environnement** : ENVIRONMENT.WITH_SECRETS | Les variables d&#x27;environnement peuvent contenir des secrets. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | |
| Variable | Description | Valeur par défaut | Type | Validateur |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|---------------------------------------------------------------------------------------------------|------------------------------------------------------|
| **<a id="environment.default_environment_name" name="environment.default_environment_name">environment.default_environment_name</a>**<br/>**Ligne de commande** : <br/>--environment.default_environment_name<br/>**Variable d'environnement** : ROUGAILCLI_ENVIRONMENT.DEFAULT_ENVIRONMENT_NAME | Nom du préfix d&#x27;environnement par défaut. | ROUGAIL | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | Doit seulement utiliser des caractères en majuscule. |
| **<a id="environment.custom_separator" name="environment.custom_separator">environment.custom_separator</a>**<br/>**Ligne de commande** : <br/>--environment.custom_separator<br/>**Variable d'environnement** : ROUGAILCLI_ENVIRONMENT.CUSTOM_SEPARATOR | Remplace le caractère séparateur « . » dans les chemins par un autre.<br/>Le caractère point (« . ») peut ne pas être autorisé dans le nom de la variable d&#x27;environnement. Attention, le nom de la variable avec des points est toujours disponible en plus du nom avec ce caractère. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | |
| **<a id="environment.with_secrets" name="environment.with_secrets">environment.with_secrets</a>**<br/>**Ligne de commande** : <br/>&nbsp;--environment.with_secrets<br/>&nbsp;--environment.no-with_secrets<br/>**Variable d'environnement** : ROUGAILCLI_ENVIRONMENT.WITH_SECRETS | Les variables d&#x27;environnement peuvent contenir des secrets. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | |

View file

@ -4,7 +4,7 @@ include_toc: true
--- ---
[🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md) [🇬🇧 (EN)](README.md) - [🇫🇷 (FR)](README.fr.md)
## Load environment variables ## Load user data from environment variables
> [!NOTE] > [!NOTE]
> >
@ -17,12 +17,10 @@ include_toc: true
> For values, there is no difference between a number and a letter (they can be enclosed in quotes or not). However, booleans are True or False. The separator for multiple variables is a comma.\ > For values, there is no difference between a number and a letter (they can be enclosed in quotes or not). However, booleans are True or False. The separator for multiple variables is a comma.\
> **Path**: environment\ > **Path**: environment\
> *`disabled`*\ > *`disabled`*\
> **Disabled**: if environment is not set in "[Select for user datas](#step.user_data)" > **Disabled**: if environment is not set in "[select for user data](#step.user_data)".
| Variable | Description | Default value | Type | Validator |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|-------------------------------------------------------------------------------------------------|--------------------------------------|
| **<a id="environment.default_environment_name" name="environment.default_environment_name">environment.default_environment_name</a>**<br/>**Command line**: <br/>--environment.default_environment_name<br/>**Environment variable**: ENVIRONMENT.DEFAULT_ENVIRONMENT_NAME | Name of the default environment prefix. | ROUGAIL | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Should only use uppercase character. |
| **<a id="environment.custom_separator" name="environment.custom_separator">environment.custom_separator</a>**<br/>**Command line**: <br/>--environment.custom_separator<br/>**Environment variable**: ENVIRONMENT.CUSTOM_SEPARATOR | Replace the separator character &quot;.&quot; in path by an other.<br/>The character dot (&quot;.&quot;) may not be allowed in the environment variable name. Note that the variable name with dots is always available in addition to the name with this character. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | |
| **<a id="environment.with_secrets" name="environment.with_secrets">environment.with_secrets</a>**<br/>**Command line**: <br/>&nbsp;--environment.with_secrets<br/>&nbsp;--environment.no-with_secrets<br/>**Environment variable**: ENVIRONMENT.WITH_SECRETS | Environnement variables may contain secrets. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | |
| Variable | Description | Default value | Type | Validator |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------|-------------------------------------------------------------------------------------------------|--------------------------------------|
| **<a id="environment.default_environment_name" name="environment.default_environment_name">environment.default_environment_name</a>**<br/>**Command line**: <br/>--environment.default_environment_name<br/>**Environment variable**: ROUGAILCLI_ENVIRONMENT.DEFAULT_ENVIRONMENT_NAME | Name of the default environment prefix. | ROUGAIL | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Should only use uppercase character. |
| **<a id="environment.custom_separator" name="environment.custom_separator">environment.custom_separator</a>**<br/>**Command line**: <br/>--environment.custom_separator<br/>**Environment variable**: ROUGAILCLI_ENVIRONMENT.CUSTOM_SEPARATOR | Replace the separator character &quot;.&quot; in path by an other.<br/>The character dot (&quot;.&quot;) may not be allowed in the environment variable name. Note that the variable name with dots is always available in addition to the name with this character. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | |
| **<a id="environment.with_secrets" name="environment.with_secrets">environment.with_secrets</a>**<br/>**Command line**: <br/>&nbsp;--environment.with_secrets<br/>&nbsp;--environment.no-with_secrets<br/>**Environment variable**: ROUGAILCLI_ENVIRONMENT.WITH_SECRETS | Environnement variables may contain secrets. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | |

View file

@ -5,8 +5,8 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"POT-Creation-Date: 2025-12-29 17:45+0100\n" "POT-Creation-Date: 2026-06-13 06:47+0200\n"
"PO-Revision-Date: 2025-12-29 17:52+0100\n" "PO-Revision-Date: 2026-06-13 06:48+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: fr\n" "Language: fr\n"
@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
"X-Generator: Poedit 3.8\n" "X-Generator: Poedit 3.9\n"
#: src/rougail/user_data_environment/annotator.py:46 #: src/rougail/user_data_environment/annotator.py:46
msgid "" msgid ""
@ -33,8 +33,8 @@ msgstr ""
"utiliser de données utilisateur \"environment\", donc \"{0}\" est invalide" "utiliser de données utilisateur \"environment\", donc \"{0}\" est invalide"
#: src/rougail/user_data_environment/config.py:34 #: src/rougail/user_data_environment/config.py:34
msgid "Load environment variables" msgid "Load user data from environment variables"
msgstr "Charger les variables d'environnement" msgstr "Charge les variables d'environnement"
#: src/rougail/user_data_environment/config.py:36 #: src/rougail/user_data_environment/config.py:36
msgid "Variable values can be defined directly from an environment variable." msgid "Variable values can be defined directly from an environment variable."
@ -104,6 +104,10 @@ msgstr ""
msgid "Environnement variables may contain secrets" msgid "Environnement variables may contain secrets"
msgstr "Les variables d'environnement peuvent contenir des secrets" msgstr "Les variables d'environnement peuvent contenir des secrets"
#: src/rougail/user_data_environment/data.py:64
msgid "environment variable"
msgstr "les variables d'environnement"
#~ msgid "The \".\" character could be not allowed in path name" #~ msgid "The \".\" character could be not allowed in path name"
#~ msgstr "" #~ msgstr ""
#~ "Le caractère \".\" peut ne pas être autorisé dans le nom des chemins" #~ "Le caractère \".\" peut ne pas être autorisé dans le nom des chemins"

View file

@ -5,7 +5,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2025-12-29 17:52+0100\n" "POT-Creation-Date: 2026-06-13 06:49+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -24,7 +24,7 @@ msgid "variable name must be a lowercase name when we want to use user data \"en
msgstr "" msgstr ""
#: src/rougail/user_data_environment/config.py:34 #: src/rougail/user_data_environment/config.py:34
msgid "Load environment variables" msgid "Load user data from environment variables"
msgstr "" msgstr ""
#: src/rougail/user_data_environment/config.py:36 #: src/rougail/user_data_environment/config.py:36
@ -67,3 +67,7 @@ msgstr ""
msgid "Environnement variables may contain secrets" msgid "Environnement variables may contain secrets"
msgstr "" msgstr ""
#: src/rougail/user_data_environment/data.py:64
msgid "environment variable"
msgstr ""

View file

@ -31,7 +31,7 @@ def get_rougail_config(
) -> dict: ) -> dict:
options = f""" options = f"""
environment: environment:
description: {_("Load environment variables")} description: {_("Load user data from environment variables")}
help: |- help: |-
{_('Variable values can be defined directly from an environment variable.')} {_('Variable values can be defined directly from an environment variable.')}

View file

@ -25,6 +25,8 @@ from rougail.config import RougailConfig
from rougail.error import ExtensionError from rougail.error import ExtensionError
from tiramisu.error import ValueOptionError from tiramisu.error import ValueOptionError
from .i18n import _
class RougailUserDataEnvironment: class RougailUserDataEnvironment:
def __init__( def __init__(
@ -59,7 +61,7 @@ class RougailUserDataEnvironment:
values = self.parse() values = self.parse()
return [ return [
{ {
"source": "environment variable", "source": _("environment variable"),
"errors": self.errors, "errors": self.errors,
"warnings": self.warnings, "warnings": self.warnings,
"values": values, "values": values,

View file

@ -1,3 +1,3 @@
{ {
"variable": "string_1_True_" "variable": "string_1_True_None"
} }

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,3 @@
ROUGAIL_VAR="val1,val2"
ROUGAIL_DYNVAL1oVARIABLE="string1"
ROUGAIL_DYNVAL2.VARIABLE="string1"

View file

@ -0,0 +1,2 @@
ROUGAIL_DYNVAL1.VARIABLE="string1"
ROUGAIL_DYNVAL2oVARIABLE="string1"

View file

@ -0,0 +1,2 @@
ROUGAIL_DYNVAL1.VARIABLE="string1"
ROUGAIL_DYNVAL2oVARIABLE="string1"

View file

@ -0,0 +1,8 @@
{
"var": [
"val1",
"val2"
],
"dynval1.variable": "string1",
"dynval2.variable": "string1"
}

View file

@ -0,0 +1,8 @@
{
"var": [
"val1",
"val2"
],
"dynval1.variable": "string1",
"dynval2.variable": "string1"
}

View file

@ -1,3 +1,3 @@
{ {
"rougail.variable": "string_1_True_" "rougail.variable": "string_1_True_None"
} }

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,4 @@
{
"errors": [],
"warnings": []
}

View file

@ -0,0 +1,3 @@
ROUGAIL.VAR="val1,val2"
ROUGAILoDYNVAL1oVARIABLE="string1"
ROUGAIL.DYNVAL2.VARIABLE="string1"

View file

@ -0,0 +1,2 @@
ROUGAIL.DYNVAL1.VARIABLE="string1"
ROUGAILoDYNVAL2oVARIABLE="string1"

View file

@ -0,0 +1,2 @@
ROUGAIL.DYNVAL1.VARIABLE="string1"
ROUGAILoDYNVAL2oVARIABLE="string1"

View file

@ -0,0 +1,8 @@
{
"rougail.var": [
"val1",
"val2"
],
"rougail.dynval1.variable": "string1",
"rougail.dynval2.variable": "string1"
}

View file

@ -0,0 +1,8 @@
{
"rougail.var": [
"val1",
"val2"
],
"rougail.dynval1.variable": "string1",
"rougail.dynval2.variable": "string1"
}

View file

@ -225,6 +225,7 @@ def test_file_error(request):
def test_structural_files_error(test_file_error): def test_structural_files_error(test_file_error):
rougailconfig = get_rougail_config(test_file_error.parent.parent / 'structure') rougailconfig = get_rougail_config(test_file_error.parent.parent / 'structure')
print(rougailconfig)
################################## ##################################
rougailconfig['step.user_data'] = ['environment'] rougailconfig['step.user_data'] = ['environment']
rougail = Rougail(rougailconfig) rougail = Rougail(rougailconfig)