SVN::Web::I18N(3pm)

πŸ“¦
version 0.63 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– SVN::Web::I18N πŸ’–

okay bestie, so this is SVN::Web::I18N, a user contributed Perl doc, and it's literally the internationalisation class for SVN::Web. yes, the whole "make it speak every language" situation. let's get into it 🫢


✨ NAME ✨

SVN::Web::I18N β€” the SVN::Web internationalisation class. it's giving "the translator of the group chat" πŸ’…


🌸 SYNOPSIS 🌸

use SVN::Web::I18N;                    # Nothing exported

# Add a directory that contains .po and/or .mo files
SVN::Web::I18N::add_directory('/path/to/directory');

# Specify the current language
SVN::Web::I18N::loc_lang('en');

# Get a translated string
my $xlated = SVN::Web::I18N::loc('(a string to translate)');

see that # Nothing exported? that's not me being shady, that's just facts. nothing gets exported, periodt. πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

SVN::Web::I18N is the whole interface through which SVN::Web gets internationalised, and it's also how the different localisations actually get implemented. it's the backstage pass to the multilingual era of your web app. iconic behavior. πŸ‘‘


πŸŽ€ SUBROUTINES πŸŽ€

SVN::Web::I18N::add_directory($path)

this one adds a brand new directory to the list of directories where localisations get found. any *.po and *.mo files chilling in there will automatically get scanned for localisations, and they get added to the language key that's named after the file's basename. auto-scanning? we love to see it. ✨

and if two different directories both have a localisation file defining the same localisation key for the same language? no drama, the localisation key from the most recently added directory wins. newest one takes the crown. πŸ‘‘

SVN::Web::I18N::loc_lang($lang)

this picks the language for all the subsequent loc() calls. the $lang parameter has to be a valid language name β€” meaning there's gotta be at least one $lang.po file in one of the directories you used in a call to SVN::Web::I18N::add_directory(). no file, no language, fr fr. 😭

SVN::Web::I18N::loc($text)

and

SVN::Web::I18N::loc($text, $param1, ...)

these return the localised form of $text, based on whatever localisation was selected by the most recent call to loc_lang(). it's literally following the vibe you set. 🌈

if the localisation is expecting parameters to fill in the localisation result, you pass them as the second and subsequent arguments. don't be shy with them.

and if $text doesn't have a defined localised form? it just comes back with the parameters interpolated into it. no translation, but the params still show up. still ate. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

  • Locale::Maketext
  • Locale::Maketext::Lexicon
  • SVN::Web

πŸ’œ AUTHORS πŸ’œ

Nik Clayton <nik@FreeBSD.org>


Copyright 2006-2007 by Nik Clayton <nik@FreeBSD.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See <http://www.perl.com/perl/misc/Artistic.html>


okay and that's the whole page bestie!! this was perl v5.40.1, dated 2025-04-09, filed under SVN::Web::I18N(3pm) β€” user contributed Perl documentation, as always πŸ“βœ¨ mwah, go translate something cute πŸ’–

πŸ“¦ where this page comes from