dc3b7bab8ee8b59e7a1d60315b59e296dce51f2e
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1) # SPDX-FileCopyrightText: 2024 Marco Ricci <software@the13thletter.info>
2) #
3) # SPDX-Licence-Identifier: MIT
4) 
5) """Internal module.  Do not use.  Contains error strings and functions."""
6) 
7) from __future__ import annotations
8) 
9) import enum
10) import gettext
11) import inspect
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

12) import textwrap
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

13) import types
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

14) from typing import TYPE_CHECKING, NamedTuple, cast
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

15) 
16) import derivepassphrase as dpp
17) 
18) if TYPE_CHECKING:
19)     from collections.abc import Iterable, Mapping
20) 
21)     from typing_extensions import Any, Self
22) 
23) __author__ = dpp.__author__
24) __version__ = dpp.__version__
25) 
26) __all__ = ('PROG_NAME',)
27) 
28) PROG_NAME = 'derivepassphrase'
29) translation = gettext.translation(PROG_NAME, fallback=True)
30) 
31) 
32) class TranslatableString(NamedTuple):
33)     singular: str
34)     plural: str
35)     l10n_context: str
36)     translator_comments: str
37)     flags: frozenset[str]
38) 
39) 
40) def _prepare_translatable(
41)     msg: str,
42)     comments: str = '',
43)     context: str = '',
44)     plural_msg: str = '',
45)     *,
46)     flags: Iterable[str] = (),
47) ) -> TranslatableString:
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

48)     def maybe_rewrap(string: str) -> str:
49)         string = inspect.cleandoc(string)
50)         if not any(s.strip() == '\b' for s in string.splitlines()):
51)             string = '\n'.join(
52)                 textwrap.wrap(
53)                     string,
54)                     width=float('inf'),  # type: ignore[arg-type]
55)                     fix_sentence_endings=True,
56)                 )
57)             )
58)         else:  # pragma: no cover
59)             string = ''.join(
60)                 s
61)                 for s in string.splitlines(True)  # noqa: FBT003
62)                 if s.strip() == '\b'
63)             )
64)         return string
65) 
66)     msg = maybe_rewrap(msg)
67)     plural_msg = maybe_rewrap(plural_msg)
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

68)     context = context.strip()
69)     comments = inspect.cleandoc(comments)
70)     flags = (
71)         frozenset(f.strip() for f in flags)
72)         if not isinstance(flags, str)
73)         else frozenset({flags})
74)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

75)     assert '{' not in msg or bool(
76)         flags & {'python-brace-format', 'no-python-brace-format'}
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

77)     ), f'Missing flag for how to deal with brace in {msg!r}'
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

78)     assert '%' not in msg or bool(
79)         flags & {'python-format', 'no-python-format'}
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

80)     ), f'Missing flag for how to deal with percent character in {msg!r}'
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

81)     assert (
82)         not flags & {'python-format', 'python-brace-format'}
83)         or '%' in msg
84)         or '{' in msg
85)     ), f'Missing format string parameters in {msg!r}'
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

86)     return TranslatableString(msg, plural_msg, context, comments, flags)
87) 
88) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

89) class TranslatedString:
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

90)     def __init__(
91)         self,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

92)         template: (
93)             str
94)             | TranslatableString
95)             | Label
96)             | InfoMsgTemplate
97)             | WarnMsgTemplate
98)             | ErrMsgTemplate
99)         ),
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

100)         args_dict: Mapping[str, Any] = types.MappingProxyType({}),
101)         /,
102)         **kwargs: Any,  # noqa: ANN401
103)     ) -> None:
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

104)         if isinstance(
105)             template, (Label, InfoMsgTemplate, WarnMsgTemplate, ErrMsgTemplate)
106)         ):
107)             template = cast(TranslatableString, template.value)
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

108)         self.template = template
109)         self.kwargs = {**args_dict, **kwargs}
110)         self._rendered: str | None = None
111) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

112)     def __bool__(self) -> bool:
113)         return bool(str(self))
114) 
115)     def __eq__(self, other: object) -> bool:  # pragma: no cover
116)         return str(self) == other
117) 
118)     def __hash__(self) -> int:  # pragma: no cover
119)         return hash(str(self))
120) 
121)     def __repr__(self) -> str:  # pragma: no cover
122)         return (
123)             f'{self.__class__.__name__}({self.template!r}, '
124)             f'{dict(self.kwargs)!r})'
125)         )
126) 
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

127)     def __str__(self) -> str:
128)         if self._rendered is None:
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

129)             # raw str support is currently unneeded, so excluded from coverage
130)             if isinstance(self.template, str):  # pragma: no cover
131)                 context = None
132)                 template = self.template
133)             else:
134)                 context = self.template.l10n_context
135)                 template = self.template.singular
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

136)             if context is not None:
137)                 template = translation.pgettext(context, template)
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

138)             else:  # pragma: no cover
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

139)                 template = translation.gettext(template)
140)             self._rendered = template.format(**self.kwargs)
141)         return self._rendered
142) 
143)     def maybe_without_filename(self) -> Self:
144)         if (
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

145)             not isinstance(self.template, str)
146)             and self.kwargs.get('filename') is None
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

147)             and ': {filename!r}' in self.template.singular
148)         ):
149)             singular = ''.join(
150)                 self.template.singular.split(': {filename!r}', 1)
151)             )
152)             plural = (
153)                 ''.join(self.template.plural.split(': {filename!r}', 1))
154)                 if self.template.plural
155)                 else self.template.plural
156)             )
157)             return self.__class__(
158)                 self.template._replace(singular=singular, plural=plural),
159)                 self.kwargs,
160)             )
161)         return self
162) 
163) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

164) class Label(enum.Enum):
165)     DEPRECATION_WARNING_LABEL = _prepare_translatable(
166)         'Deprecation warning', comments='', context='diagnostic label'
167)     )
168)     WARNING_LABEL = _prepare_translatable(
169)         'Warning', comments='', context='diagnostic label'
170)     )
171)     DERIVEPASSPHRASE_01 = _prepare_translatable(
172)         msg="""
173)         Derive a strong passphrase, deterministically, from a master secret.
174)         """,
175)         comments='',
176)         context='help text (long form)',
177)     )
178)     DERIVEPASSPHRASE_02 = _prepare_translatable(
179)         msg="""
180)         The currently implemented subcommands are "vault" (for the
181)         scheme used by vault) and "export" (for exporting foreign
182)         configuration data).  See the respective `--help` output for
183)         instructions.  If no subcommand is given, we default to "vault".
184)         """,
185)         comments='',
186)         context='help text (long form)',
187)     )
188)     DERIVEPASSPHRASE_03 = _prepare_translatable(
189)         msg="""
190)         Deprecation notice: Defaulting to "vault" is deprecated.
191)         Starting in v1.0, the subcommand must be specified explicitly.
192)         """,
193)         comments='',
194)         context='help text (long form)',
195)     )
196)     DERIVEPASSPHRASE_EPILOG_01 = _prepare_translatable(
197)         msg=r"""
198)         Configuration is stored in a directory according to the
199)         `DERIVEPASSPHRASE_PATH` variable, which defaults to
200)         `~/.derivepassphrase` on UNIX-like systems and
201)         `C:\Users\<user>\AppData\Roaming\Derivepassphrase` on Windows.
202)         """,
203)         comments='',
204)         context='help text (long form)',
205)     )
206)     DERIVEPASSPHRASE_EXPORT_01 = _prepare_translatable(
207)         msg="""
208)         Export a foreign configuration to standard output.
209)         """,
210)         comments='',
211)         context='help text (long form)',
212)     )
213)     DERIVEPASSPHRASE_EXPORT_02 = _prepare_translatable(
214)         msg="""
215)         The only available subcommand is "vault", which implements the
216)         vault-native configuration scheme.  If no subcommand is given,
217)         we default to "vault".
218)         """,
219)         comments='',
220)         context='help text (long form)',
221)     )
222)     DERIVEPASSPHRASE_EXPORT_03 = DERIVEPASSPHRASE_03
223)     DERIVEPASSPHRASE_EXPORT_VAULT_01 = _prepare_translatable(
224)         msg="""
225)         Export a vault-native configuration to standard output.
226)         """,
227)         comments='',
228)         context='help text (long form)',
229)     )
230)     DERIVEPASSPHRASE_EXPORT_VAULT_02 = _prepare_translatable(
231)         msg="""
232)         Depending on the configuration format, {path_metavar!s} may
233)         either be a file or a directory.  We support the vault "v0.2",
234)         "v0.3" and "storeroom" formats.
235)         """,
236)         comments='',
237)         context='help text (long form)',
238)         flags='python-brace-format',
239)     )
240)     DERIVEPASSPHRASE_EXPORT_VAULT_03 = _prepare_translatable(
241)         msg="""
242)         If {path_metavar!s} is explicitly given as `VAULT_PATH`, then
243)         use the `VAULT_PATH` environment variable to determine the
244)         correct path.  (Use `./VAULT_PATH` or similar to indicate
245)         a file/directory actually named `VAULT_PATH`.)
246)         """,
247)         comments='',
248)         context='help text (long form)',
249)         flags='python-brace-format',
250)     )
251)     DERIVEPASSPHRASE_VAULT_01 = _prepare_translatable(
252)         msg="""
253)         Derive a passphrase using the vault derivation scheme.
254)         """,
255)         comments='',
256)         context='help text (long form)',
257)     )
258)     DERIVEPASSPHRASE_VAULT_02 = _prepare_translatable(
259)         msg="""
260)         If operating on global settings, or importing/exporting
261)         settings, then {service_metavar!s} must be omitted.  Otherwise
262)         it is required.
263)         """,
264)         comments='',
265)         context='help text (long form)',
266)         flags='python-brace-format',
267)     )
268)     DERIVEPASSPHRASE_VAULT_EPILOG_01 = _prepare_translatable(
269)         msg="""
270)         WARNING: There is NO WAY to retrieve the generated passphrases
271)         if the master passphrase, the SSH key, or the exact passphrase
272)         settings are lost, short of trying out all possible
273)         combinations.  You are STRONGLY advised to keep independent
274)         backups of the settings and the SSH key, if any.
275)         """,
276)         comments='',
277)         context='help text (long form)',
278)     )
279)     DERIVEPASSPHRASE_VAULT_EPILOG_02 = _prepare_translatable(
280)         msg="""
281)         The configuration is NOT encrypted, and you are STRONGLY
282)         discouraged from using a stored passphrase.
283)         """,
284)         comments='',
285)         context='help text (long form)',
286)     )
287)     DEPRECATED_COMMAND_LABEL = _prepare_translatable(
288)         msg='(Deprecated) {text}',
289)         comments='',
290)         context='help text (long form, label)',
291)         flags='python-brace-format',
292)     )
293)     DEBUG_OPTION_HELP_TEXT = _prepare_translatable(
294)         'also emit debug information (implies --verbose)',
295)         comments='',
296)         context='help text (option one-line description)',
297)     )
298)     EXPORT_VAULT_FORMAT_HELP_TEXT = _prepare_translatable(
299)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

300)         TRANSLATORS: The defaults_hint is
301)         Label.EXPORT_VAULT_FORMAT_DEFAULTS_HELP_TEXT, the metavar is
302)         Label.EXPORT_VAULT_FORMAT_METAVAR_FMT.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

303)         """,
304)         msg=r"""
305)         try the following storage format {metavar!s}; may be
306)         specified multiple times, formats will be tried in order
307)         {defaults_hint!s}
308)         """,
309)         context='help text (option one-line description)',
310)         flags='python-brace-format',
311)     )
312)     EXPORT_VAULT_FORMAT_DEFAULTS_HELP_TEXT = _prepare_translatable(
313)         comments=r"""
314)         TRANSLATORS: See EXPORT_VAULT_FORMAT_HELP_TEXT.  The format
315)         names/labels "v0.3", "v0.2" and "storeroom" should not be
316)         translated.
317)         """,
318)         msg=r"""
319)         (default: v0.3, v0.2, storeroom)
320)         """,
321)         context='help text (option one-line description)',
322)     )
323)     EXPORT_VAULT_KEY_HELP_TEXT = _prepare_translatable(
324)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

325)         TRANSLATORS: The defaults_hint is
326)         Label.EXPORT_VAULT_KEY_DEFAULTS_HELP_TEXT, the metavar is
327)         Label.EXPORT_VAULT_KEY_METAVAR_K.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

328)         """,
329)         msg=r"""
330)         use {metavar!s} as the storage master key {defaults_hint!s}
331)         """,
332)         context='help text (option one-line description)',
333)         flags='python-brace-format',
334)     )
335)     EXPORT_VAULT_KEY_DEFAULTS_HELP_TEXT = _prepare_translatable(
336)         comments=r"""
337)         TRANSLATORS: See EXPORT_VAULT_KEY_HELP_TEXT.
338)         """,
339)         msg=r"""
340)         (default: check the `VAULT_KEY`, `LOGNAME`, `USER`, or
341)         `USERNAME` environment variables)
342)         """,
343)         context='help text (option one-line description)',
344)     )
345)     QUIET_OPTION_HELP_TEXT = _prepare_translatable(
346)         'suppress even warnings, emit only errors',
347)         comments='',
348)         context='help text (option one-line description)',
349)     )
350)     VERBOSE_OPTION_HELP_TEXT = _prepare_translatable(
351)         'emit extra/progress information to standard error',
352)         comments='',
353)         context='help text (option one-line description)',
354)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

355) 
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

356)     DERIVEPASSPHRASE_VAULT_PHRASE_HELP_TEXT = _prepare_translatable(
357)         msg='prompt for a master passphrase',
358)         comments='',
359)         context='help text (option one-line description)',
360)     )
361)     DERIVEPASSPHRASE_VAULT_KEY_HELP_TEXT = _prepare_translatable(
362)         msg='select a suitable SSH key from the SSH agent',
363)         comments='',
364)         context='help text (option one-line description)',
365)     )
366)     DERIVEPASSPHRASE_VAULT_LENGTH_HELP_TEXT = _prepare_translatable(
367)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

368)         TRANSLATORS: The metavar is
369)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

370)         """,
371)         msg='ensure a passphrase length of {metavar!s} characters',
372)         context='help text (option one-line description)',
373)         flags='python-brace-format',
374)     )
375)     DERIVEPASSPHRASE_VAULT_REPEAT_HELP_TEXT = _prepare_translatable(
376)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

377)         TRANSLATORS: The metavar is
378)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

379)         """,
380)         msg='forbid any run of {metavar!s} identical characters',
381)         context='help text (option one-line description)',
382)         flags='python-brace-format',
383)     )
384)     DERIVEPASSPHRASE_VAULT_LOWER_HELP_TEXT = _prepare_translatable(
385)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

386)         TRANSLATORS: The metavar is
387)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

388)         """,
389)         msg='ensure at least {metavar!s} lowercase characters',
390)         context='help text (option one-line description)',
391)         flags='python-brace-format',
392)     )
393)     DERIVEPASSPHRASE_VAULT_UPPER_HELP_TEXT = _prepare_translatable(
394)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

395)         TRANSLATORS: The metavar is
396)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

397)         """,
398)         msg='ensure at least {metavar!s} uppercase characters',
399)         context='help text (option one-line description)',
400)         flags='python-brace-format',
401)     )
402)     DERIVEPASSPHRASE_VAULT_NUMBER_HELP_TEXT = _prepare_translatable(
403)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

404)         TRANSLATORS: The metavar is
405)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

406)         """,
407)         msg='ensure at least {metavar!s} digits',
408)         context='help text (option one-line description)',
409)         flags='python-brace-format',
410)     )
411)     DERIVEPASSPHRASE_VAULT_SPACE_HELP_TEXT = _prepare_translatable(
412)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

413)         TRANSLATORS: The metavar is
414)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

415)         """,
416)         msg='ensure at least {metavar!s} spaces',
417)         context='help text (option one-line description)',
418)         flags='python-brace-format',
419)     )
420)     DERIVEPASSPHRASE_VAULT_DASH_HELP_TEXT = _prepare_translatable(
421)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

422)         TRANSLATORS: The metavar is
423)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

424)         """,
425)         msg='ensure at least {metavar!s} "-" or "_" characters',
426)         context='help text (option one-line description)',
427)         flags='python-brace-format',
428)     )
429)     DERIVEPASSPHRASE_VAULT_SYMBOL_HELP_TEXT = _prepare_translatable(
430)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

431)         TRANSLATORS: The metavar is
432)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

433)         """,
434)         msg='ensure at least {metavar!s} symbol characters',
435)         context='help text (option one-line description)',
436)         flags='python-brace-format',
437)     )
438) 
439)     DERIVEPASSPHRASE_VAULT_NOTES_HELP_TEXT = _prepare_translatable(
440)         msg='spawn an editor to edit notes for {service_metavar!s}',
441)         comments='',
442)         context='help text (option one-line description)',
443)         flags='python-brace-format',
444)     )
445)     DERIVEPASSPHRASE_VAULT_CONFIG_HELP_TEXT = _prepare_translatable(
446)         msg='save the given settings for {service_metavar!s}, or global',
447)         comments='',
448)         context='help text (option one-line description)',
449)         flags='python-brace-format',
450)     )
451)     DERIVEPASSPHRASE_VAULT_DELETE_HELP_TEXT = _prepare_translatable(
452)         msg='delete the settings for {service_metavar!s}',
453)         comments='',
454)         context='help text (option one-line description)',
455)         flags='python-brace-format',
456)     )
457)     DERIVEPASSPHRASE_VAULT_DELETE_GLOBALS_HELP_TEXT = _prepare_translatable(
458)         msg='delete the global settings',
459)         comments='',
460)         context='help text (option one-line description)',
461)     )
462)     DERIVEPASSPHRASE_VAULT_DELETE_ALL_HELP_TEXT = _prepare_translatable(
463)         msg='delete all settings',
464)         comments='',
465)         context='help text (option one-line description)',
466)     )
467)     DERIVEPASSPHRASE_VAULT_EXPORT_HELP_TEXT = _prepare_translatable(
468)         comments="""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

469)         TRANSLATORS: The metavar is
470)         Label.STORAGE_MANAGEMENT_METAVAR_SERVICE.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

471)         """,
472)         msg='export all saved settings to {metavar!s}',
473)         context='help text (option one-line description)',
474)         flags='python-brace-format',
475)     )
476)     DERIVEPASSPHRASE_VAULT_IMPORT_HELP_TEXT = _prepare_translatable(
477)         comments="""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

478)         TRANSLATORS: The metavar is
479)         Label.STORAGE_MANAGEMENT_METAVAR_SERVICE.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

480)         """,
481)         msg='import saved settings from {metavar!s}',
482)         context='help text (option one-line description)',
483)         flags='python-brace-format',
484)     )
485)     DERIVEPASSPHRASE_VAULT_OVERWRITE_HELP_TEXT = _prepare_translatable(
486)         comments="""
487)         TRANSLATORS: The corresponding option is displayed as
488)         "--overwrite-existing / --merge-existing", so you may want to
489)         hint that the default (merge) is the second of those options.
490)         """,
491)         msg='overwrite or merge (default) the existing configuration',
492)         context='help text (option one-line description)',
493)     )
494)     DERIVEPASSPHRASE_VAULT_UNSET_HELP_TEXT = _prepare_translatable(
495)         comments="""
496)         TRANSLATORS: The corresponding option is displayed as
497)         "--unset=phrase|key|...|symbol", so the "given setting" is
498)         referring to "phrase", "key", "lower", ..., or "symbol",
499)         respectively.  "with --config" here means that the user must
500)         also specify "--config" for this option to have any effect.
501)         """,
502)         msg="""
503)         with --config, also unsets the given setting; may be specified
504)         multiple times
505)         """,
506)         context='help text (option one-line description)',
507)     )
508)     DERIVEPASSPHRASE_VAULT_EXPORT_AS_HELP_TEXT = _prepare_translatable(
509)         comments="""
510)         TRANSLATORS: The corresponding option is displayed as
511)         "--export-as=json|sh", so json refers to the JSON format
512)         (default) and sh refers to the POSIX sh format.
513)         """,
514)         msg='when exporting, export as JSON (default) or POSIX sh',
515)         context='help text (option one-line description)',
516)     )
517) 
518)     EXPORT_VAULT_FORMAT_METAVAR_FMT = _prepare_translatable(
519)         msg='FMT',
520)         comments='',
521)         context='help text, metavar (export vault subcommand)',
522)     )
523)     EXPORT_VAULT_KEY_METAVAR_K = _prepare_translatable(
524)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

525)         TRANSLATORS: See Label.EXPORT_VAULT_KEY_HELP_TEXT.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

526)         """,
527)         msg='K',
528)         context='help text, metavar (export vault subcommand)',
529)     )
530)     EXPORT_VAULT_METAVAR_PATH = _prepare_translatable(
531)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

532)         TRANSLATORS: Used as "path_metavar" in
533)         Label.DERIVEPASSPHRASE_EXPORT_VAULT_02 and others.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

534)         """,
535)         msg='PATH',
536)         context='help text, metavar (export vault subcommand)',
537)     )
538)     PASSPHRASE_GENERATION_METAVAR_NUMBER = _prepare_translatable(
539)         comments=r"""
540)         TRANSLATORS: This metavar is also used in a matching epilog.
541)         """,
542)         msg='NUMBER',
543)         context='help text, metavar (passphrase generation group)',
544)     )
545)     STORAGE_MANAGEMENT_METAVAR_PATH = _prepare_translatable(
546)         comments=r"""
547)         TRANSLATORS: This metavar is also used in multiple one-line help
548)         texts.
549)         """,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

550)         msg='PATH',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

551)         context='help text, metavar (storage management group)',
552)     )
553)     VAULT_METAVAR_SERVICE = _prepare_translatable(
554)         comments=r"""
555)         TRANSLATORS: This metavar is also used in multiple one-line help
556)         texts, as "service_metavar".
557)         """,
558)         msg='SERVICE',
559)         context='help text, metavar (vault subcommand)',
560)     )
561)     CONFIGURATION_EPILOG = _prepare_translatable(
562)         'Use $VISUAL or $EDITOR to configure the spawned editor.',
563)         comments='',
564)         context='help text, option group epilog (configuration group)',
565)     )
566)     PASSPHRASE_GENERATION_EPILOG = _prepare_translatable(
567)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

568)         TRANSLATORS: The metavar is
569)         Label.PASSPHRASE_GENERATION_METAVAR_NUMBER.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

570)         """,
571)         msg=r"""
572)         Use {metavar!s}=0 to exclude a character type from the output.
573)         """,
574)         context='help text, option group epilog (passphrase generation group)',
575)         flags='python-brace-format',
576)     )
577)     STORAGE_MANAGEMENT_EPILOG = _prepare_translatable(
578)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

579)         TRANSLATORS: The metavar is
580)         Label.STORAGE_MANAGEMENT_METAVAR_PATH.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

581)         """,
582)         msg=r"""
583)         Using "-" as {metavar!s} for standard input/standard output
584)         is supported.
585)         """,
586)         context='help text, option group epilog (storage management group)',
587)         flags='python-brace-format',
588)     )
589)     COMMANDS_LABEL = _prepare_translatable(
590)         'Commands', comments='', context='help text, option group name'
591)     )
592)     COMPATIBILITY_OPTION_LABEL = _prepare_translatable(
593)         'Compatibility and extension options',
594)         comments='',
595)         context='help text, option group name',
596)     )
597)     CONFIGURATION_LABEL = _prepare_translatable(
598)         'Configuration', comments='', context='help text, option group name'
599)     )
600)     LOGGING_LABEL = _prepare_translatable(
601)         'Logging', comments='', context='help text, option group name'
602)     )
603)     OPTIONS_LABEL = _prepare_translatable(
604)         'Options', comments='', context='help text, option group name'
605)     )
606)     OTHER_OPTIONS_LABEL = _prepare_translatable(
607)         'Other options', comments='', context='help text, option group name'
608)     )
609)     PASSPHRASE_GENERATION_LABEL = _prepare_translatable(
610)         'Passphrase generation',
611)         comments='',
612)         context='help text, option group name',
613)     )
614)     STORAGE_MANAGEMENT_LABEL = _prepare_translatable(
615)         'Storage management',
616)         comments='',
617)         context='help text, option group name',
618)     )
619)     CONFIRM_THIS_CHOICE_PROMPT_TEXT = _prepare_translatable(
620)         comments=r"""
621)         TRANSLATORS: There is no support for "yes" or "no" in other
622)         languages than English, so it is advised that your translation
623)         makes it clear that only the strings "y", "yes", "n" or "no" are
624)         supported, even if the prompt becomes a bit longer.
625)         """,
626)         msg='Confirm this choice? (y/N)',
627)         context='interactive prompt',
628)     )
629)     SUITABLE_SSH_KEYS_LABEL = _prepare_translatable(
630)         comments=r"""
631)         TRANSLATORS: This label is the heading of the list of suitable
632)         SSH keys.
633)         """,
634)         msg='Suitable SSH keys:',
635)         context='interactive prompt',
636)     )
637)     YOUR_SELECTION_PROMPT_TEXT = _prepare_translatable(
638)         'Your selection? (1-{n}, leave empty to abort)',
639)         comments='',
640)         context='interactive prompt',
641)         flags='python-brace-format',
642)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

643) 
644) 
645) class InfoMsgTemplate(enum.Enum):
646)     CANNOT_LOAD_AS_VAULT_CONFIG = _prepare_translatable(
647)         comments=r"""
648)         TRANSLATORS: "fmt" is a string such as "v0.2" or "storeroom",
649)         indicating the format which we tried to load the vault
650)         configuration as.
651)         """,
652)         msg='Cannot load {path!r} as a {fmt!s} vault configuration.',
653)         context='info message',
654)         flags='python-brace-format',
655)     )
656)     PIP_INSTALL_EXTRA = _prepare_translatable(
657)         comments=r"""
658)         TRANSLATORS: This message immediately follows an error message
659)         about a missing library that needs to be installed.  The Python
660)         Package Index (PyPI) supports declaring sets of optional
661)         dependencies as "extras", so users installing from PyPI can
662)         request reinstallation with a named "extra" being enabled.  This
663)         would then let the installer take care of the missing libraries
664)         automatically, hence this suggestion to PyPI users.
665)         """,
666)         msg='(For users installing from PyPI, see the {extra_name!r} extra.)',
667)         context='info message',
668)         flags='python-brace-format',
669)     )
670)     SUCCESSFULLY_MIGRATED = _prepare_translatable(
671)         comments=r"""
672)         TRANSLATORS: This info message immediately follows the "Using
673)         deprecated v0.1-style ..." deprecation warning.
674)         """,
675)         msg='Successfully migrated to {path!r}.',
676)         context='info message',
677)         flags='python-brace-format',
678)     )
679) 
680) 
681) class WarnMsgTemplate(enum.Enum):
682)     EMPTY_SERVICE_NOT_SUPPORTED = _prepare_translatable(
683)         comments='',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

684)         msg="""
685)         An empty {service_metavar!s} is not supported by vault(1).
686)         For compatibility, this will be treated as if SERVICE was not
687)         supplied, i.e., it will error out, or operate on global settings.
688)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

689)         context='warning message',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

690)         flags='python-brace-format',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

691)     )
692)     EMPTY_SERVICE_SETTINGS_INACCESSIBLE = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

693)         msg="""
694)         An empty {service_metavar!s} is not supported by vault(1).
695)         The empty-string service settings will be inaccessible and
696)         ineffective.  To ensure that vault(1) and {PROG_NAME!s} see the
697)         settings, move them into the "global" section.
698)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

699)         comments='',
700)         context='warning message',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

701)         flags='python-brace-format',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

702)     )
703)     FAILED_TO_MIGRATE_CONFIG = _prepare_translatable(
704)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

705)         TRANSLATORS: "error" is supplied by the operating system
706)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

707)         """,
708)         msg='Failed to migrate to {path!r}: {error!s}: {filename!r}.',
709)         context='warning message',
710)         flags='python-brace-format',
711)     )
712)     GLOBAL_PASSPHRASE_INEFFECTIVE = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

713)         msg=r"""
714)         Setting a global passphrase is ineffective
715)         because a key is also set.
716)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

717)         comments='',
718)         context='warning message',
719)     )
720)     PASSPHRASE_NOT_NORMALIZED = _prepare_translatable(
721)         comments=r"""
722)         TRANSLATORS: The key is a (vault) configuration key, in JSONPath
723)         syntax, typically "$.global" for the global passphrase or
724)         "$.services.service_name" or "$.services["service with spaces"]"
725)         for the services "service_name" and "service with spaces",
726)         respectively.  The form is one of the four Unicode normalization
727)         forms: NFC, NFD, NFKC, NFKD.
728) 
729)         The asterisks are not special.  Please feel free to substitute
730)         any other appropriate way to mark up emphasis of the word
731)         "displays".
732)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

733)         msg=r"""
734)         The {key!s} passphrase is not {form!s}-normalized.  Its
735)         serialization as a byte string may not be what you expect it to
736)         be, even if it *displays* correctly.  Please make sure to
737)         double-check any derived passphrases for unexpected results.
738)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

739)         context='warning message',
740)         flags='python-brace-format',
741)     )
742)     SERVICE_PASSPHRASE_INEFFECTIVE = _prepare_translatable(
743)         comments=r"""
744)         TRANSLATORS: The key that is set need not necessarily be set at
745)         the service level; it may be a global key as well.
746)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

747)         msg=r"""
748)         Setting a service passphrase is ineffective because a key is
749)         also set: {service!s}.
750)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

751)         context='warning message',
752)         flags='python-brace-format',
753)     )
754)     STEP_REMOVE_INEFFECTIVE_VALUE = _prepare_translatable(
755)         'Removing ineffective setting {path!s} = {old!s}.',
756)         comments='',
757)         context='warning message',
758)         flags='python-brace-format',
759)     )
760)     STEP_REPLACE_INVALID_VALUE = _prepare_translatable(
761)         'Replacing invalid value {old!s} for key {path!s} with {new!s}.',
762)         comments='',
763)         context='warning message',
764)         flags='python-brace-format',
765)     )
766)     V01_STYLE_CONFIG = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

767)         msg=r"""
768)         Using deprecated v0.1-style config file {old!r}, instead of
769)         v0.2-style {new!r}.  Support for v0.1-style config filenames
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

770)         will be removed in v1.0.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

771)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

772)         comments='',
773)         context='deprecation warning message',
774)         flags='python-brace-format',
775)     )
776)     V10_SUBCOMMAND_REQUIRED = _prepare_translatable(
777)         comments=r"""
778)         TRANSLATORS: This deprecation warning may be issued at any
779)         level, i.e. we may actually be talking about subcommands, or
780)         sub-subcommands, or sub-sub-subcommands, etc., which is what the
781)         "here" is supposed to indicate.
782)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

783)         msg="""
784)         A subcommand will be required here in v1.0.  See --help for
785)         available subcommands.  Defaulting to subcommand "vault".
786)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

787)         context='deprecation warning message',
788)     )
789) 
790) 
791) class ErrMsgTemplate(enum.Enum):
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

792)     AGENT_REFUSED_LIST_KEYS = _prepare_translatable(
793)         comments=r"""
794)         TRANSLATORS: "loaded keys" being keys loaded into the agent.
795)         """,
796)         msg="""
797)         The SSH agent failed to or refused to supply a list of loaded keys.
798)         """,
799)         context='error message',
800)     )
801)     AGENT_REFUSED_SIGNATURE = _prepare_translatable(
802)         comments=r"""
803)         TRANSLATORS: The message to be signed is the vault UUID, but
804)         there's no space to explain that here, so ideally the error
805)         message does not go into detail.
806)         """,
807)         msg="""
808)         The SSH agent failed to or refused to issue a signature with the
809)         selected key, necessary for deriving a service passphrase.
810)         """,
811)         context='error message',
812)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

813)     CANNOT_CONNECT_TO_AGENT = _prepare_translatable(
814)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

815)         TRANSLATORS: "error" is supplied by the operating system
816)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

817)         """,
818)         msg='Cannot connect to the SSH agent: {error!s}: {filename!r}.',
819)         context='error message',
820)         flags='python-brace-format',
821)     )
822)     CANNOT_DECODEIMPORT_VAULT_SETTINGS = _prepare_translatable(
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

823)         comments=r"""
824)         TRANSLATORS: "error" is supplied by the operating system
825)         (errno/strerror).
826)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

827)         msg='Cannot import vault settings: cannot decode JSON: {error!s}.',
828)         context='error message',
829)         flags='python-brace-format',
830)     )
831)     CANNOT_EXPORT_VAULT_SETTINGS = _prepare_translatable(
832)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

833)         TRANSLATORS: "error" is supplied by the operating system
834)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

835)         """,
836)         msg='Cannot export vault settings: {error!s}: {filename!r}.',
837)         context='error message',
838)         flags='python-brace-format',
839)     )
840)     CANNOT_IMPORT_VAULT_SETTINGS = _prepare_translatable(
841)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

842)         TRANSLATORS: "error" is supplied by the operating system
843)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

844)         """,
845)         msg='Cannot import vault settings: {error!s}: {filename!r}.',
846)         context='error message',
847)         flags='python-brace-format',
848)     )
849)     CANNOT_LOAD_USER_CONFIG = _prepare_translatable(
850)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

851)         TRANSLATORS: "error" is supplied by the operating system
852)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

853)         """,
854)         msg='Cannot load user config: {error!s}: {filename!r}.',
855)         context='error message',
856)         flags='python-brace-format',
857)     )
858)     CANNOT_LOAD_VAULT_SETTINGS = _prepare_translatable(
859)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

860)         TRANSLATORS: "error" is supplied by the operating system
861)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

862)         """,
863)         msg='Cannot load vault settings: {error!s}: {filename!r}.',
864)         context='error message',
865)         flags='python-brace-format',
866)     )
867)     CANNOT_PARSE_AS_VAULT_CONFIG = _prepare_translatable(
868)         comments=r"""
869)         TRANSLATORS: Unlike the "Cannot load {path!r} as a {fmt!s} vault
870)         configuration." message, *this* error message is emitted when we
871)         have tried loading the path in each of our supported formats,
872)         and failed.  The user will thus see the above "Cannot load ..."
873)         warning message potentially multiple times, and this error
874)         message at the very bottom.
875)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

876)         msg=r"""
877)         Cannot parse {path!r} as a valid vault-native configuration
878)         file/directory.
879)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

880)         context='error message',
881)         flags='python-brace-format',
882)     )
883)     CANNOT_STORE_VAULT_SETTINGS = _prepare_translatable(
884)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

885)         TRANSLATORS: "error" is supplied by the operating system
886)         (errno/strerror).
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

887)         """,
888)         msg='Cannot store vault settings: {error!s}: {filename!r}.',
889)         context='error message',
890)         flags='python-brace-format',
891)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

892)     CANNOT_UNDERSTAND_AGENT = _prepare_translatable(
893)         comments=r"""
894)         TRANSLATORS: This error message is used whenever we cannot make
895)         any sense of a response from the SSH agent because the response
896)         is ill-formed (truncated, improperly encoded, etc.) or otherwise
897)         violates the communications protocol.  Well-formed responses
898)         that adhere to the protocol, even if they indicate that the
899)         requested operation failed, are handled with a different error
900)         message.
901)         """,
902)         msg="""
903)         Cannot understand the SSH agent's response because it violates
904)         the communications protocol.
905)         """,
906)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

907)     CANNOT_UPDATE_SETTINGS_NO_SETTINGS = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

908)         msg=r"""
909)         Cannot update {settings_type!s} settings without any given
910)         settings.  You must specify at least one of --lower, ...,
911)         --symbol, or --phrase or --key.
912)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

913)         comments='',
914)         context='error message',
915)         flags='python-brace-format',
916)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

917)     INVALID_USER_CONFIG = _prepare_translatable(
918)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

919)         TRANSLATORS: "error" is supplied by the operating system
920)         (errno/strerror).
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

921)         """,
922)         msg=r"""
923)         The user configuration file is invalid.  {error!s}: {filename!r}.
924)         """,
925)         context='error message',
926)         flags='python-brace-format',
927)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

928)     INVALID_VAULT_CONFIG = _prepare_translatable(
929)         comments=r"""
930)         TRANSLATORS: This error message is a reaction to a validator
931)         function saying *that* the configuration is not valid, but not
932)         *how* it is not valid.  The configuration file is principally
933)         parsable, however.
934)         """,
935)         msg='Invalid vault config: {config!r}.',
936)         context='error message',
937)         flags='python-brace-format',
938)     )
939)     MISSING_MODULE = _prepare_translatable(
940)         'Cannot load the required Python module {module!r}.',
941)         comments='',
942)         context='error message',
943)         flags='python-brace-format',
944)     )
945)     NO_AF_UNIX = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

946)         msg=r"""
947)         Cannot connect to an SSH agent because this Python version does
948)         not support UNIX domain sockets.
949)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

950)         comments='',
951)         context='error message',
952)     )
953)     NO_KEY_OR_PHRASE = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

954)         msg=r"""
955)         No passphrase or key was given in the configuration.  In this
956)         case, the --phrase or --key argument is required.
957)         """,
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

958)         comments='',
959)         context='error message',
960)     )
961)     NO_SSH_AGENT_FOUND = _prepare_translatable(
962)         'Cannot find any running SSH agent because SSH_AUTH_SOCK is not set.',
963)         comments='',
964)         context='error message',
965)     )
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

966)     NO_SUITABLE_SSH_KEYS = _prepare_translatable(
967)         msg="""
968)         The SSH agent contains no keys suitable for {PROG_NAME!s}.
969)         """,  # noqa: RUF027
970)         comments='',
971)         context='error message',
972)         flags='python-brace-format',
973)     )
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

974)     PARAMS_MUTUALLY_EXCLUSIVE = _prepare_translatable(
975)         comments=r"""
976)         TRANSLATORS: The params are long-form command-line option names.
977)         Typical example: "--key is mutually exclusive with --phrase."
978)         """,
979)         msg='{param1!s} is mutually exclusive with {param2!s}.',
980)         context='error message',
981)         flags='python-brace-format',
982)     )
983)     PARAMS_NEEDS_SERVICE_OR_CONFIG = _prepare_translatable(
984)         comments=r"""
985)         TRANSLATORS: The param is a long-form command-line option name,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

986)         the metavar is Label.VAULT_METAVAR_SERVICE.
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

987)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

988)         msg='{param!s} requires a {service_metavar!s} or --config.',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

989)         context='error message',
990)         flags='python-brace-format',
991)     )
992)     PARAMS_NEEDS_SERVICE = _prepare_translatable(
993)         comments=r"""
994)         TRANSLATORS: The param is a long-form command-line option name,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

995)         the metavar is Label.VAULT_METAVAR_SERVICE.
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

996)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

997)         msg='{param!s} requires a {service_metavar!s}.',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

998)         context='error message',
999)         flags='python-brace-format',
1000)     )
1001)     PARAMS_NO_SERVICE = _prepare_translatable(
1002)         comments=r"""
1003)         TRANSLATORS: The param is a long-form command-line option name,
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

1004)         the metavar is Label.VAULT_METAVAR_SERVICE.
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1005)         """,
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1006)         msg='{param!s} does not take a {service_metavar!s} argument.',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1007)         context='error message',
1008)         flags='python-brace-format',
1009)     )
1010)     SERVICE_REQUIRED = _prepare_translatable(
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1011)         comments=r"""
Marco Ricci Fix some translation typos...

Marco Ricci authored 1 week ago

1012)         TRANSLATORS: The metavar is Label.VAULT_METAVAR_SERVICE.
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1013)         """,
1014)         msg='Deriving a passphrase requires a {service_metavar!s}.',
1015)         context='error message',
1016)         flags='python-brace-format',
1017)     )
1018)     SET_AND_UNSET_SAME_SETTING = _prepare_translatable(
1019)         comments=r"""
1020)         TRANSLATORS: The rephrasing "Attempted to unset and set the same
1021)         setting (--unset={setting!s} --{setting!s}=...) at the same
1022)         time." may or may not be more suitable as a basis for
1023)         translation instead.
1024)         """,
1025)         msg='Attempted to unset and set --{setting!s} at the same time.',
Marco Ricci Extract translatable log me...

Marco Ricci authored 2 weeks ago

1026)         context='error message',
Marco Ricci Add more translatable strin...

Marco Ricci authored 1 week ago

1027)         flags='python-brace-format',