Wikibase::Datatype::Value::Monolingual - Wikibase monolingual value datatype.
use Wikibase::Datatype::Value::Monolingual; my $obj = Wikibase::Datatype::Value::Monolingual->new(%params); my $language = $obj->language; my $type = $obj->type; my $value = $obj->value;
This datatype is string class for representation of translatable string.
new
my $obj = Wikibase::Datatype::Value::Monolingual->new(%params);
Constructor.
Returns instance of object.
language
Language shortcut. Parameter is optional. Value is checked to ISO 639-1 language code. Default value is 'en'.
value
Value of instance. Parameter is required.
my $language = $obj->language;
Get language shortcut.
Returns string.
type
my $type = $obj->type;
Get type. This is constant 'monolingualtext'.
my $value = $obj->value;
Get value.
new(): From Wikibase::Datatype::Value::new(): Parameter 'value' is required. From Wikibase::Datatype::Utils::check_language(): Language code '%s' isn't ISO 639-1 code. Language with ISO 639-1 code '%s' doesn't exist.
use strict; use warnings; use Wikibase::Datatype::Value::Monolingual; # Object. my $obj = Wikibase::Datatype::Value::Monolingual->new( 'language' => 'en', 'value' => 'English text', ); # Get language. my $language = $obj->language; # Get type. my $type = $obj->type; # Get value. my $value = $obj->value; # Print out. print "Language: $language\n"; print "Type: $type\n"; print "Value: $value\n"; # Output: # Language: en # Type: monolingualtext # Value: English text
Mo, Wikibase::Datatype::Value.
Wikibase datatypes.
https://github.com/michal-josef-spacek/Wikibase-Datatype
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2020-2023 Michal Josef Špaček
BSD 2-Clause License
0.31
To install Wikibase::Datatype, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wikibase::Datatype
CPAN shell
perl -MCPAN -e shell install Wikibase::Datatype
For more information on module installation, please visit the detailed CPAN module installation guide.