Locale-TextDomain-OO
view release on metacpan or search on metacpan
javascript/Example.html view on Meta::CPAN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css"></style>
<!-- depends on -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="http://st.aticpan.org/source/STEFFENW/Locale-TextDomain-OO-Util-3.006/javascript/Locale/TextDomain/OO/Util/Constants.js"></script>
<script type="text/javascript" src="http://st.aticpan.org/source/STEFFENW/Locale-TextDomain-OO-Util-3.006/javascript/Locale/TextDomain/OO/Util/JoinSplitLexiconKeys.js"></script>
<script type="text/javascript" src="http://st.aticpan.org/source/STEFFENW/Locale-Utils-PlaceholderNamed-1.002/javascript/Locale/Utils/PlaceholderNamed.js"></script>
<!--script type="text/javascript" src="http://st.aticpan.org/source/STEFFENW/Locale-Utils-PlaceholderBabelFish-0.004/javascript/Locale/Utils/PlaceholderBabelFish.js"></script-->
<script type="text/javascript" src="../../../Locale-Utils-PlaceholderBabelFish/trunk/javascript/Locale/Utils/PlaceholderBabelFish.js"></script>
<!-- the lexicon -->
<script type="text/javascript">
// normally external filled from JSON (defined empty, header only)
var localeTextDomainOOLexicon = {
// fake an empty lexicon without domain and category
'en::' : { '' : { 'plural' : 'n != 1' } },
'de::' : { '' : { 'plural' : 'n != 1' } },
// fake an empty lexicon for mydomain
'en::mydomain' : { '' : { 'plural' : 'n != 1' } },
'de::mydomain' : { '' : { 'plural' : 'n != 1' } },
// fake an empty lexicon for mycategory
'en:mycategory:' : { '' : { 'plural' : 'n != 1' } },
'de:mycategory:' : { '' : { 'plural' : 'n != 1' } },
// fake an empty lexicon for mydomain and mycategory
'en:mycategory:mydomain' : { '' : { 'plural' : 'n != 1' } },
'de:mycategory:mydomain' : { '' : { 'plural' : 'n != 1' } }
};
</script>
<script type="text/javascript" src="./Locale/TextDomain/OO.js"></script>
<script type="text/javascript" src="./Locale/TextDomain/OO/Plugin/Expand/Gettext/Loc.js"></script>
<script type="text/javascript" src="./Locale/TextDomain/OO/Plugin/Expand/Gettext/Loc/DomainAndCategory.js"></script>
<script type="text/javascript" src="./Locale/TextDomain/OO/Plugin/Expand/BabelFish/Loc.js"></script>
<script type="text/javascript">
var ltdoo = new localeTextDomainOO({
plugins : [
'localeTextDomainOOExpandGettextLocDomainAndCategory',
'localeTextDomainOOExpandGettextLocDomainAndCategory',
'localeTextDomainOOExpandBabelFishLoc'
],
lexicon : localeTextDomainOOLexicon,
// language : '@{[ $language_tag ]}', // server side from Perl
language : 'de', // fake static
filter : function(translation) { // optional filter
return 'filtered: ' + translation;
},
logger : function (message, argMap) { // optional logger
console.log(message);
return;
}
});
</script>
</head>
<body>
<h1>version 1.023</h1>
<script type="text/javascript">
var gettext = [
'loc_: ' + ltdoo.loc_('translation test'),
'loc_n 1: ' + ltdoo.loc_n('translation test', 'translation tests', 1),
'loc_n 2: ' + ltdoo.loc_n('translation test', 'translation tests', 2),
( run in 2.603 seconds using v1.01-cache-2.11-cpan-119454b85a5 )