SVN::Web::I18N(3pm)
π 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::MaketextLocale::Maketext::LexiconSVN::Web
π AUTHORS π
Nik Clayton <nik@FreeBSD.org>
π COPYRIGHT π
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
- debian trixie: libsvn-web-perl 0.63-4 Β· Artistic-1.0-Perl
- ubuntu resolute: libsvn-web-perl 0.63-4 Β· Artistic-1.0-Perl
- ubuntu stonking: libsvn-web-perl 0.63-4 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms