-
-
29 Sep 2004 15:03:40 UTC
- Distribution: MKDoc-Core
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (3 / 1 / 1)
- Kwalitee
Bus factor: 0- % Coverage
- License: unknown
- Activity
24 month- Tools
- Download (45.73KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Apache
- Cache::Cache
- Digest::MD5
- File::Touch
- HTTP::Date
- Petal
- Scalar::Util
- Test::More
- URI
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
MKDoc::Core::Language - Language class for the MKDoc::Core framework
SUMMARY
The list of languages supported by MKDoc::Core is defined in two config files.
These two config files are loaded from (by order of preference):
The two file are the following:
- languages.conf - All the languages to support, including those from right to left
- languages_rtl.conf - Just the languages which are written from right to left
Methods / API
$class->new ($iso_code);
Instantiates a new MKDoc::Core::Language object for $iso_code.
Returns undef if $iso_code is not defined in the languages.conf file.
$class->as_hash();
Returns a hash as follows:
( $iso_code_1 => $label_1, $iso_code_2 => $label_2, $iso_code_3 => $label_3, ... $iso_code_4 => $label_4 )
For all languages.
$class->as_hash_rtl();
Returns a hash as follows:
( $iso_code_1 => $label_1, $iso_code_2 => $label_2, $iso_code_3 => $label_3, ... $iso_code_4 => $label_4 )
For RTL languages.
$self->code();
Returns the iso code of a given language object, e.g:
my $lang = new MKDoc::Core::Language ('en'); print $lang->code(); # should print 'en'
$self->label();
Returns the label associated with a given language object, e.g:
my $lang = new MKDoc::Core::Language ('en'); print $lang->label(); # should print 'English'
$thing->code_list()
Returns a list of ISO codes of all languages, sorted by the Unicode value of their associated label.
$self->align();
In order to do proper multilingual HTML formatting, you need to have a sensible value for the XHTML align="left|right" attribute.
If the language is written left to right, this method returns 'left'.
If the language is written right to left, this method returns 'right'.
$self->align_opposite();
In order to do proper multilingual HTML formatting, you need to have a sensible value for the XHTML align="left|right" attribute.
This method does the exact opposite as $self->align(), i.e.
If the language is written left to right, this method returns 'right'.
If the language is written right to left, this method returns 'left'.
$self->dir()
In order to do proper multilingual HTML formatting, you need to have a sensible value for the XHTML dir="ltr|rtl" attribute.
If the language is written left to right, this method returns 'ltr'.
If the language is written right to left, this method returns 'rtl'.
AUTHOR
Copyright 2003 - MKDoc Holdings Ltd.
Author: Jean-Michel Hiver
This module is free software and is distributed under the same license as Perl itself. Use it at your own risk.
SEE ALSO
L<Petal> TAL for perl MKDoc: http://www.mkdoc.com/
Help us open-source MKDoc. Join the mkdoc-modules mailing list:
mkdoc-modules@lists.webarch.co.uk
Module Install Instructions
To install MKDoc::Core, copy and paste the appropriate command in to your terminal.
cpanm MKDoc::Core
perl -MCPAN -e shell install MKDoc::Core
For more information on module installation, please visit the detailed CPAN module installation guide.