Forum How do I...?

Page numbering language

Initiator
Is it possible to have page numbers/footnote numberings in languages other than English?

Edited by Initiator

mikeday
Which language do you have in mind? You can use counter(page, urdu) and a few others. :)
Initiator
I need Bengali.
mikeday
There is no support for Bengali numbering in CSS yet. But in Prince you could implement this yourself using a script function. If you let us know how it works, perhaps in future we can add a "bengali" counter style.
Initiator
This is my test code to try out the script function:

CSS:
@page main {
    @bottom-left {
        margin-bottom:20pt;
        font-size:40pt;
        color:#231F20;
        content: prince-script(bengalicounter,counter(page))
    }


JS:
Prince.addScriptFunc("bengalicounter", function(n) {
    if (n == 1) return "one";
    else if (n == 2) return "two";
    else if (n == 3) return "three";
    else return n;
});


But it doesn't seem to make a difference. What could I be missing out?
mikeday
Are you running with --javascript enabled? Are there any warnings in the output log?
Initiator
You're right, I had to set
$prince->setJavaScript(true);
for my instance of Prince for this to work.

Thanks!

Edited by Initiator