App-SpreadRevolutionaryDate

 view release on metacpan or  search on metacpan

bin/spread-revolutionary-date  view on Meta::CPAN


  'Which famous people have their birthday on June 21? Give a list of up to 6 people, then after the list give the unformatted URL of the Wikipedia page of only one of them, no comments and no need for an introduction like "Here are some famous peopl...

You should be careful that such variables are not interpreted by the C<Shell> before calling C<spread-revolutionary-date>, specially if specified as command line parameters. You can prevent such intepretation by the C<Shell> by enclosing the option i...

=item L</intro>

You may want that the spread message to start with your own introducing words before displaying I<Gemini> answer. You can specify this with the L</intro> option.

Likewise, this option use the same syntactic sugar relative to methods of L<DateTime> module. For example, the message spread on June 21st by the C<FamousBirthday> example bellow, would be something like

  Famous people born on June 21 for better or for worse:
  First Name
  Second Name
  Third Name
  Fourth Name
  Fifth Name
  Sixth Name

  https://en.wikipedia.org/wiki/Third_Name
  #IAGenerated #FamousBirthday

=item L</search>

I<Gemini> answer is based on data that have been used to train the AI. But sometimes you want accurate answers grounded on some real time searches. In this case, you should specify the L</search> option with a true value, and I<Gemini> answers will b...

This is used in the C<MeteoParis> example bellow, to have I<Gemini> search for today's weather in Paris from C<meteo-paris.com> website.

=item L</img_path>

This option allows to add a local image on the spread message.

=item L</img_alt>

This option specifies an alternative text to an image added on the spread message. If unset, the alternative text will be the name of the file specified in L</img_path> or L</img_url> options.

=item L</img_url>

This option allows to add a remote image on the spread message.

=back

Finally, one word of localization: you don't need it, since I<Gemini> will answer in the language you've used in your prompt. Or you can ask in your prompt to be answered in another language, like:

  prompt   FamousBirthday      = 'Which famous people have their birthday on $month_name $day? Give a list of up to 6 people, then after the list give the unformatted URL of the Wikipedia page of only one of them, no comments and no need for an intro...

The only place where you should be concerned by localization is when you define an introduction to be prepended to I<Gemini> answer. Since it is a configured static string, it should be written in the desired language, like:

  intro    FamousBirthday      = 'FamousBirthday=Berühmte Personen, die am $day $month_name geboren wurden, im Guten wie im Schlechten:'

Also, if you use some syntactic sugars relative to methods of L<DateTime> module that are localizable, like C<month_name>, you should use the L</locale> option to have it translated in the desired language.

And now you are ready to spread whatever your like, with just some configuration tweaks!

Be aware that I<Gemini>, like any other AI, has no concept of truth. It can only give formally probable answers, based on its training data. So do not ask somehing where truth matters… Also, all data you're sending to I<Gemini> are assumed to not b...

=head1 INTERNATIONALIZATION AND LOCALIZATION

Starting from version 0.11, this distribution uses the widespread internationalization and localization system L<gettext|https://en.wikipedia.org/wiki/Gettext>, commonly used for writing multilingual programs. See L<GNU gettext documentation|https://...

Translators can find a portable object template C<po/App-SpreadRevolutionaryDate.pot> which includes all translatable strings used by C<spread-revolutionary-date> (but not translations of days, months, feasts used in the French Revolutionary Calendar...

  msgid "Please, enter message to spread"

A German translator would have to replace the next line:

 msgstr ""

by:

 msgstr "Bitte geben Sie die Nachricht zu verbreiten ein"

When the string to be translated includes some words in curly braces, these words are actually named variables and should be left as is in the translation. E.g.:

  msgid "or {abort} to abort"
  msgstr "oder {abort}, um abzubrechen"

And that's it! As of version 0.11 of C<spread-revolutionary-date>, there is only about a dozen of strings to translate, mainly for C<PromptUser> message maker. But with the possibility to extend to other message makers, you may need more and more str...

Translating days, months and feasts used in the C<RevolutionaryDate> message maker do not use the C<gettext> system. Mainly because it uses L<DateTime::Calendar::FrenchRevolutionary> which proposes French and English translations in dedicated Perl mo...

Just copy the French class (from C<lib/App/SpreadRevolutionaryDate/MsgMaker/RevolutionaryDate/Locale/fr.pm> file) into the desired language, change the name of the class and replace every French string. E.g.: the names of the months should be replace...

  has '+months' => (
    default => sub {[
      'Vendémiaire', 'Brumaire',  'Frimaire',
      'Nivôse',      'Pluviôse',  'Ventôse',
      'Germinal',    'Floréal',   'Prairial',
      'Messidor',    'Thermidor', 'Fructidor',
      'jour complémentaire',
    ]},
  );

by names in German:

  has '+months' => (
    default => sub {[
      'Herbstmonat',    'Nebelmonat',  'Reifmonat',
      'Schneemonat',    'Regenmonat',  'Windmonat',
      'Keimmonat',      'Blütenmonat', 'Wiesenmonat',
      'Erntemonat',     'Hitzemonat',  'Fruchtmonat',
      'Ergänzungstage',
    ]},
  );

Feasts include a special trick, because they can be used in sentences like I<this is C<feast name> day> or I<c'est le jour de la C<feast name>>. Depending on the language, it could then be prefixed or suffixed: in English it is suffixed by C< day>, w...

Note also that any space in the name of the feast of the day should be replaced by an underscore (C<_>).

Finally, these translation classes include a mapping between the feast of the day and the wikipedia entry for this word. This is useful when the feast of the day corresponds to an ambiguous entry, or a different word, in wikipedia. If the wikipedia e...

  has '+wikipedia_entries' => (
    default => sub {{
      2 => {
        'water chestnut' => 'Water_caltrop',
      },
      8 => {
        'hoe'            => 'Hoe_(tool)',
      },
    }},
  );

Because of the trick on prefix and suffix for feasts and the needed mapping for wikipedia entries, using the C<gettext> system would be quite difficult. It wouldn't be an issue for translating names of months or days. But for consistency reasons, I'd...

=head1 SEE ALSO

=over

=item L<App::SpreadRevolutionaryDate>

=item L<DateTime::Calendar::FrenchRevolutionary>

=item L<AppConfig>

=item L<App::SpreadRevolutionaryDate::BlueskyLite>



( run in 1.361 second using v1.01-cache-2.11-cpan-524268b4103 )