பெயர்
- Provided by: po4a (Version: 0.74-3)
- Report a bug
PO4A (எதற்கும் PO) திட்ட குறிக்கோள் என்பது ஆவணப்படங்களைப் போல எதிர்பார்க்கப்படாத பகுதிகளில் உரைபெறு கருவிகளைப் பயன்படுத்தி மொழிபெயர்ப்புகளை (மேலும் சுவாரச்யமாக, மொழிபெயர்ப்புகளைப் பராமரிப்பது) எளிதாக்குவதாகும்.
இந்த வகுப்பு ஒரு ஆவணத்தை அலசுவதற்கும், மொழிபெயர்க்கக்கூடிய சரங்களைத் தேடுவதற்கும், அவற்றை ஒரு PO கோப்பில் பிரித்தெடுப்பதற்கும், வெளியீட்டு ஆவணத்தில் அவற்றின் மொழிபெயர்ப்பால் அவற்றை மாற்றுவதற்கும் பயன்படுத்தப்படும் ஒவ்வொரு PO4A பாகுபடுத்தியின் மூதாதையர் ஆகும்.
இன்னும் முறையாக, இது பின்வரும் வாதங்களை உள்ளீடாக எடுக்கும்:
வெளியீடாக, இது உருவாக்குகிறது:
இதன் வரைகலை பிரதிநிதித்துவம் இங்கே:
Input document --\ /---> Output document
\ / (translated)
+-> parse() function -----+
/ \
Input PO --------/ \---> Output PO
(extracted)
இந்த செயல்பாடு கீழே உள்ள செயல்முறை () செயல்பாட்டால் அழைக்கப்படுகிறது, ஆனால் நீங்கள் புதிய () செயல்பாட்டைப் பயன்படுத்தவும், உங்கள் ஆவணத்தில் உள்ளடக்கத்தை கைமுறையாக சேர்க்கவும் தேர்வுசெய்தால், இந்த செயல்பாட்டை நீங்களே அழைக்க வேண்டும்.
பின்வரும் எடுத்துக்காட்டு "<p>" உடன் தொடங்கும் பத்திகளின் பட்டியலை பாகுபடுத்துகிறது. எளிமைக்காக, ஆவணம் நன்கு வடிவமைக்கப்பட்டுள்ளது என்று நாங்கள் கருதுகிறோம், அதாவது '<p>' குறிச்சொற்கள் மட்டுமே குறிச்சொற்கள், இந்த குறிச்சொல் ஒவ்வொரு பத்தியின் ஆரம்பத்திலிருந்தும் உள்ளது.
sub parse {
my $self = shift;
PARAGRAPH: while (1) {
my ($paragraph,$pararef)=("","");
my $first=1;
my ($line,$lref)=$self->shiftline();
while (defined($line)) {
if ($line =~ m/<p>/ && !$first--; ) {
# Not the first time we see <p>.
# Reput the current line in input,
# and put the built paragraph to output
$self->unshiftline($line,$lref);
# Now that the document is formed, translate it:
# - Remove the leading tag
$paragraph =~ s/^<p>//s;
# - push to output the leading tag (untranslated) and the
# rest of the paragraph (translated)
$self->pushline( "<p>"
. $self->translate($paragraph,$pararef)
);
next PARAGRAPH;
} else {
# Append to the paragraph
$paragraph .= $line;
$pararef = $lref unless(length($pararef));
}
# Reinit the loop
($line,$lref)=$self->shiftline();
}
# Did not get a defined line? End of input file.
return;
}
}
நீங்கள் பாகுபடுத்தும் செயல்பாட்டை செயல்படுத்தியதும், அடுத்த பகுதியில் வழங்கப்பட்ட பொது இடைமுகத்தைப் பயன்படுத்தி உங்கள் ஆவண வகுப்பைப் பயன்படுத்தலாம்.
புதிய () (எதிர்பார்க்கப்படும் வகையுடன்) ஏற்றுக்கொள்ளப்பட்ட வாதங்கள்:
எதிர்மறை மதிப்பு என்பது கோடுகளை மடக்கக்கூடாது என்பதாகும்.
இது அடிப்படை PO- கோப்புகளுக்கான அடுத்த விருப்பங்களை ஏற்றுக்கொள்கிறது: b <porefs>, b <பதிப்புரிமை-வைத்திருப்பவர்>, b <msgid-Bugs-address>, b <cackation- பெயர்>, b <தொகுப்பு-பதிப்பு>, b <rap- போ>.
This function takes two mandatory arguments and an optional
one.
* The filename to read on disk;
* The name to use as filename when building the reference in the PO file;
* The charset to use to read that file (UTF-8 by default)
This array
"@{$self->{TT}{doc_in}}" holds this
input document data as an array of strings with alternating meanings.
* The string $textline holding each line of the
input text data.
* The string "$filename:$linenum"
holding its location and called as
"reference" ("linenum" starts
with 1).
இது எதையும் அலசவில்லை என்பதை நினைவில் கொள்க. உள்ளீட்டு கோப்புகளை ஆவணத்தில் பொதி செய்து முடித்தால் நீங்கள் பாகுபடுத்தும் () செயல்பாட்டைப் பயன்படுத்த வேண்டும்.
This translated document data are provided by:
* "$self->docheader()" holding the
header text for the plugin, and
* "@{$self->{TT}{doc_out}}" holding
each line of the main translated text in the array.
[normal use of the po4a document...]
($percent,$hit,$queries) = $document->stats();
print "We found translations for $percent\% ($hit from $queries) of strings.\n";
இந்த செயல்பாடு பிழையில் பூஞ்சை அல்லாத முழு எண்ணை வழங்குகிறது.
உள்ளீடு மற்றும் திரும்ப வெளியீட்டைப் பெற நான்கு செயல்பாடுகள் வழங்கப்படுகின்றன. அவை சிப்ட்/அன்சிப்ட் மற்றும் பெர்லின் புச்/பாப் ஆகியவற்றிற்கு மிகவும் ஒத்தவை.
* Perl shift returns the first array item and drop it from the array. * Perl unshift prepends an item to the array as the first array item. * Perl pop returns the last array item and drop it from the array. * Perl push appends an item to the array as the last array item.
முதல் இணை உள்ளீட்டைப் பற்றியது, இரண்டாவது வெளியீடு பற்றியது. நினைவூட்டல்: உள்ளீட்டில், நீங்கள் முதல் வரியில் ஆர்வமாக உள்ளீர்கள், சிப்ட் தருகிறது, மற்றும் வெளியீட்டில் உங்கள் முடிவை முடிவில் சேர்க்க விரும்புகிறீர்கள், புச் செய்வது போல.
மொழிபெயர்க்கப்பட வேண்டிய உரையை கையாள ஒரு செயல்பாடு வழங்கப்படுகிறது.
இந்த செயல்பாடு சில கூடுதல் வாதங்களையும் எடுக்கலாம். அவை ஒரு ஆசாக ஒழுங்கமைக்கப்பட வேண்டும். உதாரணமாக:
$self->translate("string","ref","type",
'wrap' => 1);
எதிர்மறை மதிப்பு இயல்புநிலையிலிருந்து விலக்கப்படும்.
செயல்கள்:
இது கட்டளை வரியில் குறிப்பிடப்பட்டுள்ள வெளியீட்டு சார்ச்செட்டைப் பயன்படுத்தும். இது குறிப்பிடப்படாவிட்டால், அது உள்ளீட்டு PO இன் சார்செட்டைப் பயன்படுத்தும், மேலும் உள்ளீட்டு PO க்கு இயல்புநிலை "சார்ச்செட்" இருந்தால், அது உள்ளீட்டு ஆவணத்தின் சார்சத்தை திருப்பித் தரும், இதனால் குறியாக்கம் எதுவும் செய்யப்படாது.
தற்போதைய டிரான்ச்ட்ராக்டரின் ஒரு குறைபாடு என்னவென்றால், டெப்கான்ஃப் வார்ப்புருக்கள் அல்லது .desktop கோப்புகள் போன்ற அனைத்து மொழிகளையும் கொண்ட மொழிபெயர்க்கப்பட்ட ஆவணத்தை இது கையாள முடியாது.
இந்த சிக்கலை தீர்க்க, தேவையான ஒரே இடைமுக மாற்றங்கள்:
$self->pushline_all({ "Description[".$langcode."]=".
$self->translate($line,$ref,$langcode)
});
இது போதுமா என்று பார்ப்பேன்;)
Denis Barbier <barbier@linuxfr.org> Martin Quinson (mquinson#debian.org) Jordi Vilalta <jvprat@gmail.com>