NAME

Mojolicious::Plugin::Localize::Command::localize - Generate dictionary files for Localize

SYNOPSIS

Usage: APPLICATION localize <lang> [OPTIONS]

  perl app.pl localize pl

Options:
  -h, --help            Show this summary of available options
  -b, --base <lang>     Base language locale, defaults to "en"
  -o, --output <file>   Output file for dictionary, defaults to
                        the moniker, the locale and the extension 'dict'

DESCRIPTION

Generates a localized dictionary template based on an existent dictionary.

Given the following merged dictionary of an application:

{
  _ => sub { $_->locale },
  de => {
    welcome => 'Willkommen!',
    thankyou => 'Danke!'
  },
  fr => {
    thankyou => 'Merci!'
  },
  -en => {
    welcome => 'Welcome!',
    thankyou => 'Thank you!',
  },
  MyPlugin => {
    bye => {
      _ => sub { $_->locale },
      de => 'Auf Wiedersehen!',
      en => 'Good bye!'
    },
    user => {
      _ => sub { $_->locale },
      de => 'Nutzer'
    }
  }
}

To create a translation template for the locale french based on all entries of the english locale, call ...

$ perl app.pl localize fr --base en

The created dictionary template in short notation will look like this:

{
  # "fr_welcome" => \"Welcome!",
  # "MyPlugin_bye_fr" => \"Good Bye!",
};

ATTRIBUTES

Mojolicious::Plugin::Localize::Command::localize inherits all attributes from Mojolicious::Command and implements the following new ones.

description

my $description = $localize->description;
$localize = $localize->description('Foo!');

Short description of this command, used for the command list.

usage

my $usage = $localize->usage;
$localize = $localize->usage('Foo!');

Usage information for this command, used for the help screen.

METHODS

Mojolicious::Plugin::Localize::Command::localize inherits all methods from Mojolicious::Command and implements the following new ones.

run

$localize->run;

Run this command.

DEPENDENCIES

Mojolicious.

AVAILABILITY

https://github.com/Akron/Mojolicious-Plugin-Localize

COPYRIGHT AND LICENSE

Copyright (C) 2014-2018, Nils Diewald.

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.

The documentation is based on Mojolicious::Command::eval, written by Sebastian Riedel.