I'm trying to compile and install both most recent version of 'make' and the
most recent version of 'openssh' on my Sparc20.
I've run into the following problems... and I don't know what they mean. Can
someone please help me resolve these issues?
I'm using the 'make' version that was... (5 Replies)
Hi,
does anybody knows about wc -l, how to transform it inot a just number?
this script ALWAYS executes the command3!!, However, the value of BMU_RUNNING is 1
case $BMU_RUNNING in
*0) command1
;;
*1) command 2;;
*)command 3;;
esac
The... (3 Replies)
Hi,
I have written a script to retrieve phone numbers from an error log and output the phone numbers into an text file. I then use the list of phone numbers to process each value into a variable so I can run a sql query and update the database. My problem is I can only process the first value... (2 Replies)
Hi all,
I have a variable say var1 (output from somewhere, which I can't change)which store something like this:
echo $var1
name=fred
age=25
address="123 abc"
password=pass1234
how can I make the variable $name, $age, $address and $password contain the info?
I mean do this in a... (1 Reply)
Hello everyone,
My problem looks quite simple , how to assign a string with spaces and lines "\n" to a variable.
I've tried all kind of quoting and is impossible, bash always try to execute the string and never executes a simple assignation.
This is part of the code
... (1 Reply)
#!/bin/bash
filecount=0
dirname=path.log
exec<$dirname
while read line # line by line read source file name and stored in a veribale
do
sourcedirname=$line
(
count=`ls $sourcedirname |wc -l`
filecount=`expr $filecount + $count`
echo $filecount
... (2 Replies)
The problem is
I need it too go from the main menu by pressing 6, to the submenu search_proc. In the search_proc menu/section it need to accept a variable and search the processes for it and sort by PID and Process name. I'm stuck and ran out of ideas. I also cannot figure out why it keeps... (2 Replies)
I am experimenting with some scripting as a way to learn more about it. I have a simple script that calls two other scripts. Each script echos some stuff to prove it ran and then sets a simple variable and exports it.
I cannot get one of the variables to display back in the main calling script... (2 Replies)
Hi All,
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Hi
I am setting the variables like this :
setenv MODULE1 modem5__3
setenv MODULE2 modem5__2
setenv MODULE3 modem_ctrl_1_1
setenv MODULE4 modem_1_0
setenv COUNT 10
I am having a bash script as shown below
################################################
#!/bin/bash
for ((... (5 Replies)
Discussion started by: kshitij
5 Replies
LEARN ABOUT DEBIAN
petal::i18n
Petal::I18N(3pm) User Contributed Perl Documentation Petal::I18N(3pm)NAME
Petal::I18N - Attempt at implementing ZPT I18N for Petal
SYNOPSIS
in your Perl code:
use Petal;
use Petal::TranslationService::Gettext;
my $translation_service = new Petal::TranslationService::Gettext (
locale_dir => '/path/to/my/app/locale',
target_lang => gimme_target_lang(),
);
my $template = new Petal (
file => 'example.html',
translation_service => $translation_service
);
# we want to internationalize to the h4x0rz 31337 l4nGu4g3z. w00t!
my $translation_service = Petal::TranslationService::h4x0r->new();
my $template = new Petal (
file => 'silly_example.xhtml',
translation_service => $ts,
);
print $template->process ();
I18N Howto
Preparing your templates:
Say your un-internationalized template looks like this:
<html xmlns:tal="http://purl.org/petal/1.0/">
<body>
<img src="/images/my_logo.png"
alt="the logo of our organisation" />
<p>Hello,
<span petal:content="user_name">Joe</span>.</p>
<p>How are you today?</p>
</body>
</html>
You need to markup your template according to the ZPT I18N specification, which can be found at
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ZPTInternationalizationSupport
<html xmlns:tal="http://purl.org/petal/1.0/"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="my_app">
<body>
<img src="/images/my_logo.png"
alt="the logo of our organisation"
i18n:attributes="alt" />
<p i18n:translate="">Hello, <span petal:content="user_name">Joe</span>.</p>
<p i18n:translate="">How are you today?</p>
</body>
</html>
Extracting I18N strings:
Once your templates are marked up properly, you will need to use a tool to extract the I18N strings into .pot (po template) files. To my
knowledge you can use i18ndude (standalone python executable), i18nextract.py (part of Zope 3), or I18NFool.
I use i18ndude to find strings which are not marked up properly with i18n:translate attributes and I18NFool for extracting strings and
managing .po files.
Assuming you're using i18nfool:
mkdir -p /path/to/my/app/locale
cd /path/to/my/app/locale
i18nfool-extract /path/to/my/template/example.html
mkdir en
mkdir fr
mkdir es
i18nfool-update
Then you translate the .po files into their respective target languages. When that's done, you type:
cd /path/to/my/app/locale
i18nfool-build
And it builds all the .mo files.
Making your application use a Gettext translation service:
Previously you might have had:
use Petal;
# lotsa code here
my $template = Petal->new ('example.html');
This needs to become:
use Petal;
use Petal::TranslationService::Gettext;
# lotsa code here
my $template = Petal->new ('example.html');
$template->{translation_service} = Petal::TranslationService::Gettext->new (
locale_dir => '/path/to/my/app/locale',
target_lang => gimme_language_code(),
);
Where gimme_language_code() returns a language code depending on LC_LANG, content-negotiation, config-file, or whatever mechanism you are
using to decide which language is desired.
And then?
And then that's it! Your application should be easily internationalizable. There are a few traps / gotchas thought, which are described
below.
BUGS, TRAPS, GOTCHAS and other niceties
Translation Phase
The translation step takes place ONLY ONCE THE TEMPLATE HAS BEEN PROCESSED.
So if you have:
<p i18n:translate="">Hello,
<span i18n:name="user_login" tal:replace="self/user_login">Joe</span>
</p>
It most likely will not work because the tal:replace would remove the <span> tag and also the i18n:name in the process.
This means that instead of receiving something such as:
Hello, ${user_login}
The translation service would receive:
Hello, Fred Flintstone
Or
Hello, Joe SixPack
etc.
To fix this issue, use tal:content instead of tal:replace and leave the span and its i18n:name attribute.
Character sets
I haven't worried too much about them (yet) so if you run into trouble join the Petal mailing list and we'll try to fix any issues
together.
Limitations
At the moment, Petal::I18N supports the following constructs:
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:translate
i18n:domain
i18n:name
i18n:attribute
It does *NOT* (well, not yet) support i18n:source, i18n:target or i18n:data.
perl v5.12.4 2011-08-25 Petal::I18N(3pm)