NAME
App::Actions::I18N::de - the German message catalogue of App::Actions
SYNOPSIS
You do not normally use this module directly. Choose the language through App::Actions::I18N:
use App::Actions::I18N;
my $i18n = App::Actions::I18N->new(language => 'de');
binmode STDOUT, ':encoding(UTF-8)';
print $i18n->message('workflow.empty', { file => 'ci.yml' }), "\n";
# Der Workflow 'ci.yml' ist leer
Or for a whole run of the command:
ACTION_RUN_LANG=de action-run run .github/workflows/ci.yml
Read the catalogue itself, for example to check a translation:
use App::Actions::I18N::de;
my $entries = App::Actions::I18N::de->messages;
print scalar(keys %{$entries}), " messages\n";
DESCRIPTION
This module holds the German texts of App::Actions' messages. A key that is missing here is shown in English instead.
Data only: App::Actions::I18N loads it and renders its entries. Keys, placeholders and the plural and gender forms are described there.
METHODS
messages
Returns a hash reference of message key to entry.
EXAMPLE
my $entries = App::Actions::I18N::de->messages;
API SPECIFICATION
INPUT
{}
OUTPUT
{ type => q{hashref} }
MESSAGES
None.
COMMON PITFALLS
Do not change the returned hash to translate. "messages" returns a copy, so changes to it are lost. Use "add_messages" in App::Actions::I18N.
Keep the placeholders. A translation must use the same placeholder names as the English text, for example
%(file)s. The test t/i18n.t checks this.Plurals follow the German rule. 1 uses the
oneform (1 Image), every other number theotherform (2 Images).LANGdoes not choose this language. UseACTION_RUN_LANG=deor thelanguageargument.
ENCODING
The source file is UTF-8 and uses use utf8, so every text is a Perl character string. The texts contain non-ASCII characters (letters such as ü and ß), and may contain any Unicode character. Encode the text when you print it, for example with binmode STDOUT, ':encoding(UTF-8)', or Perl prints a "Wide character" warning.
AUTHOR
Nigel Horne, njh@nigelhorne.com
FORMAL SPECIFICATION
This section describes each routine in the Z notation, a precise mathematical language for describing programs. You do not need to read it to use the module: everything here is also said in plain words in the sections above. It is for readers who want to check exactly what a routine promises.
How to read it: a box names a routine. The lines above the middle rule declare the values it works with. A name ending in ? is an input, and a name ending in ! is an output. ΞState means the routine changes nothing, and ΔState means it can change the state. The lines below the rule are the conditions that are always true when the routine returns.
KEY == { k : seq CHAR | k matches [a-z][a-z0-9_]*(\.[a-z0-9_]+)+ }
ENTRY ::= text⟨⟨seq CHAR⟩⟩
| plural⟨⟨{one, other} ⇸ seq CHAR⟩⟩
| gender⟨⟨{female, male, other} ⇸ ENTRY⟩⟩
MESSAGES : KEY ⇸ ENTRY the fixed catalogue in this file
messages
┌─ Messages ────────────────────────────────────────
│ r! : KEY ⇸ ENTRY
├───────────────────────────────────────────────────
│ r! = MESSAGES
│ r! is a new hash each call: changing it leaves MESSAGES unchanged
└───────────────────────────────────────────────────
STATE DIAGRAM
The catalogue never changes. This is how one of its texts is used:
App::Actions::I18N->new(language => 'de')
(or ACTION_RUN_LANG=de, or a country that speaks German)
|
v
+---------------------+ message($key, \%args)
| TRANSLATOR (de) |------------------------+
+---------------------+ |
v
+-------------------------------------+
| $key in this catalogue? |
+-------------------------------------+
| yes | no
v v
+----------------+ +----------------------+
| entry from | | English entry |
| this module | | (App::Actions::I18N::|
+----------------+ | en); none: the key |
| +----------------------+
+-----------+-----------+
v
gender form, then plural form (German rule),
then the %(name)s placeholders filled in
|
v
the finished text
LICENSE AND COPYRIGHT
Copyright 2026 Nigel Horne.
This program is released under the GNU General Public License, version 2. See the LICENSE file that comes with this distribution. If you use it, please let me know.