Bidi aware formatted output

Chris Scaife scaife.chris at gmail.com
Thu Dec 23 09:25:26 GMT 2010


I'm not sure if people here want to look at developing new software, and I
see the mail system has deleted all the unicode direction controls from my
previous posts, however I did finish that output formatting algorithm for
C++ programs to use and I put it to the test localizing a little gui
program.

Attached an image showing it doing numeric base conversion in US locale and
then again in Saudi Arabia locale... That is if the mail system preserves
them.

My library has many many more localization capabilities, but in these images
it uses Middle Eastern digits. I even substituted other Arabic characters
for digits beyond 10, as shown in the duodecimal output. I'll be writing a
sequel to my internationalization.html document detailing how to use the
library in new software projects.

I also made a .po translation file but don't know any Arabic so I just put
"SA" in front of the English texts to confirm translation of the GUI is
happening. The source is in cs_lib-0.0.0.tar at
http://code.google.com/p/speaknumber/downloads/list


On 20 December 2010 01:00, <ubuntu-rtl-request at lists.ubuntu.com> wrote:

> Send Ubuntu-RTL mailing list submissions to
>        ubuntu-rtl at lists.ubuntu.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        https://lists.ubuntu.com/mailman/listinfo/ubuntu-rtl
> or, via email, send a message with subject or body 'help' to
>        ubuntu-rtl-request at lists.ubuntu.com
>
> You can reach the person managing the list at
>        ubuntu-rtl-owner at lists.ubuntu.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Ubuntu-RTL digest..."
>
>
> Today's Topics:
>
>   1. Bidi aware formatted output (Chris Scaife)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 19 Dec 2010 12:02:02 +1300
> From: Chris Scaife <scaife.chris at gmail.com>
> Subject: Bidi aware formatted output
> To: ubuntu-rtl at lists.ubuntu.com
> Message-ID:
>        <AANLkTi=UqFi++aeyW0F-qM1x5B+g4LobrFHmyZm-GuWC at mail.gmail.com<UqFi%2B%2BaeyW0F-qM1x5B%2Bg4LobrFHmyZm-GuWC at mail.gmail.com>
> >
> Content-Type: text/plain; charset="utf-8"
>
> Having got my ideas sorted about support for bidirectional formatted
> output,
> I've added it to my advanced formatted output library. The main aim of said
> library is to give better support for localization of software that uses
> the
> standard gettext package especially for formatting numbers.
> The experimental proto-type has now been restructured and I made a
> pre-release of the source code in cs_lib-0.0.0.tar to demonstrate
> bidirectional action.
>
> <Left  Margin testing ?Right to Left? override
>
> <Right Margin testing ?Left to Right? override
>
>
> above is demo output from following test program. IDK if the Unicode
> direction control get thru the e-mail system, but the rendered output uses
> %L to force left to right margin and then embeds a right to left string
> using %rs, while the second line uses %R to force right to left output and
> embeds left to right string with %ls
>
> Note: numerical output has many more features including localizable number
> formatting templates different digit sets and also supports direction
> specifiers as well as digit order in the text stream.
>
> // sudo ldconfig -n /usr/local/lib
>
> // g++ -Wall -L/usr/local/lib testso.cpp -lcs -o testso `pkg-config
> > gtkmm-2.4 --libs`
>
> #include "cs_item.h"
>
> #include <cstdio>
>
> #include <iostream>
>
>
> > using namespace std;
>
> using namespace cs_lib;
>
>
> > int main(int argc, char *argv[], char *envp[]) {
>
> cs_charptr_item aTextR("Right to Left");
>
> cs_charptr_item aTextL("Left to Right");
>
> cout << aTextR.gettext("%L<Left  Margin testing %rs override\n");
>
> cout << aTextL.gettext("%R<Right Margin testing %ls override\n");
>
> return !printf("exits normally\n");
>
> }
>
>
>  Documentation and installation scripts are under construction
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> https://lists.ubuntu.com/archives/ubuntu-rtl/attachments/20101219/2aced907/attachment-0001.htm
>
> ------------------------------
>
> --
> Ubuntu-RTL mailing list
> Ubuntu-RTL at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-rtl
>
>
> End of Ubuntu-RTL Digest, Vol 6, Issue 8
> ****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-rtl/attachments/20101223/dc07ce2d/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: base12SA.png
Type: image/png
Size: 5872 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/ubuntu-rtl/attachments/20101223/dc07ce2d/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: base12US.png
Type: image/png
Size: 5428 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/ubuntu-rtl/attachments/20101223/dc07ce2d/attachment-0001.png 


More information about the Ubuntu-RTL mailing list