QPlugs PAText Add Persian and Arabic support to WindowsCE Mobile applications: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
'''English''' [[QPlugs PAText Add Persian and Arabic support to WindowsCE Mobile applications Arabic|عربي]] [[QPlugs PAText Add Persian and Arabic support to WindowsCE Mobile applications Persian|فارسی]]
'''English''' [[QPlugs_PAText_Add_Persian_and_Arabic_support_to_WindowsCE_Mobile_applications_Arabic|عربي]] [[QPlugs_PAText_Add_Persian_and_Arabic_support_to_WindowsCE_Mobile_applications_Persian|فارسی]]


=<span class="caps">PAT</span>ext supports Persian and Arabic text in Qt applications=
[toc align_right=&quot;yes&amp;quot; depth=&quot;3&amp;quot;]


Persian and Arabic Text (known as “<span class="caps">PAT</span>ext”) fixes problems with glyphs in some environment which does not support the “FA” and “AR” keyboard layouts by default. The class acts like a translator for pointing Persian characters to the correct style in the <span class="caps">UTF</span>-8 character set.
= PAText supports Persian and Arabic text in Qt applications =


[[Image:patextss.gif|PAText]]
Persian and Arabic Text (known as &quot;PAText&amp;quot;) fixes problems with glyphs in some environment which does not support the &quot;FA&amp;quot; and &quot;AR&amp;quot; keyboard layouts by default. The class acts like a translator for pointing Persian characters to the correct style in the UTF-8 character set.


==Applications==
[[Image:http://picturehosting.com/images/madagon/patextss.gif|PAText]]
 
== Applications ==


Useful as a solution for displaying Persian and Arabic texts in applications written in Qt for WindowsCE/Mobile platforms as well as creating Persian or Arabic virtual keyboards.
Useful as a solution for displaying Persian and Arabic texts in applications written in Qt for WindowsCE/Mobile platforms as well as creating Persian or Arabic virtual keyboards.


==Source Code==
== Source Code ==
 
=== &quot;PAText.h&amp;quot; ===
 
<code>/*''''''<br /> Persian and Arabic support for WindowsCE/Mobile<br /> by Mohsen Akhlaghi<br /> Ver 1.0.0 Release 2010/12/31<br /> www.madagon.com<br />'''/<br />#ifndef QPlugsPAText<br />#define QPlugsPAText<br />#include &lt;QString&amp;gt;
<br />static const int mapsize=42;<br />static ushort PAMap[42][5]=<br />{<br /> {0, 0, 0, 0, 0}, //dummy<br /> {ushort(0x630), ushort(0xfeac), ushort(0xfeab), ushort(0xfeac), ushort(0xfeab)}, //ذ<br /> {ushort(0x62f), ushort(0xfeaa), ushort(0xfea9), ushort(0xfeaa), ushort(0xfea9)}, //د<br /> {ushort(0x62c), ushort(0xfe9e), ushort(0xfe9f), ushort(0xfea0), ushort(0xfe9d)}, //ج<br /> {ushort(0x62d), ushort(0xfea2), ushort(0xfea3), ushort(0xfea4), ushort(0xfea1)}, //ح<br /> {ushort(0x62e), ushort(0xfea6), ushort(0xfea7), ushort(0xfea8), ushort(0xfea5)}, //خ<br /> {ushort(0x647), ushort(0xfeea), ushort(0xfeeb), ushort(0xfeec), ushort(0xfee9)}, //ه<br /> {ushort(0x639), ushort(0xfeca), ushort(0xfecb), ushort(0xfecc), ushort(0xfec9)}, //ع<br /> {ushort(0x63a), ushort(0xfece), ushort(0xfecf), ushort(0xfed0), ushort(0xfecd)}, //غ<br /> {ushort(0x641), ushort(0xfed2), ushort(0xfed3), ushort(0xfed4), ushort(0xfed1)}, //ف<br /> {ushort(0x642), ushort(0xfed6), ushort(0xfed7), ushort(0xfed8), ushort(0xfed5)}, //ق<br /> {ushort(0x62b), ushort(0xfe9a), ushort(0xfe9b), ushort(0xfe9c), ushort(0xfe99)}, //ث<br /> {ushort(0x635), ushort(0xfeba), ushort(0xfebb), ushort(0xfebc), ushort(0xfeb9)}, //ص<br /> {ushort(0x636), ushort(0xfebe), ushort(0xfebf), ushort(0xfec0), ushort(0xfebd)}, //ض<br /> {ushort(0x637), ushort(0xfec2), ushort(0xfec3), ushort(0xfec4), ushort(0xfec1)}, //ط<br /> {ushort(0x643), ushort(0xfeda), ushort(0xfedb), ushort(0xfedc), ushort(0xfed9)}, //ك<br /> {ushort(0x645), ushort(0xfee2), ushort(0xfee3), ushort(0xfee4), ushort(0xfee1)}, //م<br /> {ushort(0x646), ushort(0xfee6), ushort(0xfee7), ushort(0xfee8), ushort(0xfee5)}, //ن<br /> {ushort(0x62a), ushort(0xfe96), ushort(0xfe97), ushort(0xfe98), ushort(0xfe95)}, //ت<br /> {ushort(0x627), ushort(0xfe8e), ushort(0xfe8d), ushort(0xfe8e), ushort(0xfe8d)}, //ا<br /> {ushort(0x644), ushort(0xfede), ushort(0xfedf), ushort(0xfee0), ushort(0xfedd)}, //ل<br /> {ushort(0x628), ushort(0xfe90), ushort(0xfe91), ushort(0xfe92), ushort(0xfe8f)}, //ب<br /> {ushort(0x64a), ushort(0xfef2), ushort(0xfef3), ushort(0xfef4), ushort(0xfef1)}, //ي<br /> {ushort(0x633), ushort(0xfeb2), ushort(0xfeb3), ushort(0xfeb4), ushort(0xfeb1)}, //س<br /> {ushort(0x634), ushort(0xfeb6), ushort(0xfeb7), ushort(0xfeb8), ushort(0xfeb5)}, //ش<br /> {ushort(0x638), ushort(0xfec6), ushort(0xfec7), ushort(0xfec8), ushort(0xfec5)}, //ظ<br /> {ushort(0x632), ushort(0xfeb0), ushort(0xfeaf), ushort(0xfeb0), ushort(0xfeaf)}, //ز<br /> {ushort(0x625), ushort(0xfe88), ushort(0xfe87), ushort(0xfe88), ushort(0xfe87)}, //إ<br /> {ushort(0x6A9), ushort(0xfb8f), ushort(0xfb90), ushort(0xfb91), ushort(0xfb8e)}, //ک<br /> {ushort(0x6Af), ushort(0xfb93), ushort(0xfb94), ushort(0xfb95), ushort(0xfb92)}, //گ<br /> {ushort(0x698), ushort(0xfb8b), ushort(0xfb8a), ushort(0xfb8b), ushort(0xfb8a)}, //ژ<br /> {ushort(0x686), ushort(0xfb7b), ushort(0xfb7c), ushort(0xfb7d), ushort(0xfb7a)}, //چ<br /> {ushort(0x67E), ushort(0xfb57), ushort(0xfb58), ushort(0xfb59), ushort(0xfb56)}, //پ<br /> {ushort(0x648), ushort(0xfeee), ushort(0xfeed), ushort(0xfeee), ushort(0xfeed)}, //و<br /> {ushort(0x629), ushort(0xfe94), ushort(0xfe93), ushort(0xfe93), ushort(0xfe93)}, //ة<br /> {ushort(0x649), ushort(0xfbfd), ushort(0xfbfe), ushort(0xfbff), ushort(0xfeef)}, //ى<br /> {ushort(0x631), ushort(0xfeae), ushort(0xfead), ushort(0xfeae), ushort(0xfead)}, //ر<br /> {ushort(0x624), ushort(0xfe86), ushort(0xfe85), ushort(0xfe86), ushort(0xfe85)}, //ؤ<br /> {ushort(0x621), ushort(0xfe80), ushort(0xfe80), ushort(0xfe80), ushort(0xfe7f)}, //ء<br /> {ushort(0x626), ushort(0xfe8a), ushort(0xfe8b), ushort(0xfe8c), ushort(0xfe89)}, //ئ<br /> {ushort(0x623), ushort(0xfe84), ushort(0xfe83), ushort(0xfe84), ushort(0xfe83)}, //أ<br /> {ushort(0x622), ushort(0xfe82), ushort(0xfe81), ushort(0xfe82), ushort(0xfe81)}, //آ<br />};
<br />namespace QPlugs<br />{<br />class PAText<br />{<br />public:<br /> static QString Translate(QString pText);<br />};<br />}
<br />#endif // QPlugsPAText<br /></code>
<br />h3. &quot;PAText.cpp&amp;quot;
<br /><code>/'''<br /> Persian and Arabic support for WindowsCE/Mobile<br /> by Mohsen Akhlaghi<br /> Ver 1.0.0 Release 2010/12/31<br /> www.madagon.com<br />''''''*/<br />#include &quot;PAText.h&amp;quot;<br />using namespace QPlugs;
 
static int CharInMap(QChar pChar)<br />{<br /> char ch = pChar.toAscii();<br /> switch (ch)<br /> {<br /> case 'ذ': return 1;<br /> case 'د': return 2;<br /> case 'ج': return 3;<br /> case 'ح': return 4;<br /> case 'خ': return 5;<br /> case 'ه': return 6;<br /> case 'ع': return 7;<br /> case 'غ': return 8;<br /> case 'ف': return 9;<br /> case 'ق': return 10;<br /> case 'ث': return 11;<br /> case 'ص': return 12;<br /> case 'ض': return 13;<br /> case 'ط': return 14;<br /> case 'ك': return 15;<br /> case 'م': return 16;<br /> case 'ن': return 17;<br /> case 'ت': return 18;<br /> case 'ا': return 19;<br /> case 'ل': return 20;<br /> case 'ب': return 21;<br /> case 'ي': return 22;<br /> case 'س': return 23;<br /> case 'ش': return 24;<br /> case 'ظ': return 25;<br /> case 'ز': return 26;<br /> case 'إ': return 27;<br /> case 'ک': return 28;<br /> case 'گ': return 29;<br /> case 'ژ': return 30;<br /> case 'چ': return 31;<br /> case 'پ': return 32;<br /> case 'و': return 33;<br /> case 'ة': return 34;<br /> case 'ى': return 35;<br /> case 'ر': return 36;<br /> case 'ؤ': return 37;<br /> case 'ء': return 38;<br /> case 'ئ': return 39;<br /> case 'أ': return 40;<br /> case 'آ': return 41;<br /> default :<br /> return 0;<br /> }<br />}
 
static bool isSpecialChar(QChar pChar, int pCharPoint)<br />{<br /> if (pChar==' ') return true;
 
ushort vchars[12] = {1,2,19,26,27,30,31,36,37,40,41,42}; //valid chars for special mode<br /> for (int i=0;i&amp;lt;12;i+'')<br /> {<br /> if(pCharPoint==vchars[i])<br /> return true;<br /> }<br /> return false;<br />}
<br />static QString AppendChar(QString pText, int pCharPoint, int pPrevCharPoint)<br />{<br /> if (pCharPoint==0) return pText; //no conversion needed for new character
<br /> int textlen=pText.length();<br /> int ncpos=textlen-1; //new char position<br /> int pcpos=ncpos-1; //prev char position
<br /> if (textlen==1)<br /> {<br /> return QChar(PAMap[pCharPoint][0]); //return its capital face<br /> }<br /> else<br /> {<br /> QString r = pText.left(textlen-2);<br /> QChar prevchar = pText[pcpos];
<br /> if (isSpecialChar(prevchar, pPrevCharPoint)) //if prev char is special<br /> {<br /> r''= prevchar; //leave the prev char as it was<br /> r ''= QChar(PAMap[pCharPoint][0]); //print the new char with its capital face<br /> }<br /> else<br /> {<br /> //check prev char to see if it is capital face<br /> if(prevchar  PAMap[pPrevCharPoint][0] ||
                    prevchar  PAMap[pPrevCharPoint][4]) //is capital<br /> r''=QChar(PAMap[pPrevCharPoint][2]);<br /> else //is not capital<br /> r ''=QChar(PAMap[pPrevCharPoint][3]);
<br /> r''= QChar(PAMap[pCharPoint][1]);<br /> }
 
return r;<br /> }<br />}
 
QString PAText::Translate(QString pText)<br />{<br /> QString r = &quot;&quot;;<br /> int charpoint=0;<br /> int prevcharpoint=0;<br /> int textlen=pText.length();<br /> for (int i=0;i&amp;lt;textlen;i++)<br /> {<br /> charpoint = CharInMap(pText[i]);<br /> if (charpoint==0)<br /> r = AppendChar(r+pText[i],charpoint,prevcharpoint);<br /> else<br /> r = AppendChar(r+QChar(PAMap[charpoint][0]),charpoint,prevcharpoint);
 
prevcharpoint=charpoint;<br /> }<br /> return r;<br />}<br /></code>


===“<span class="caps">PAT</span>ext.h”===
== Sample Code ==


===“<span class="caps">PAT</span>ext.cpp”===
<code>#include &quot;PAText.h&amp;quot;<br />using namespace QPlugs;


==Sample Code==
void Widget::Test()<br />{<br /> ui-&gt;textBrowser-&gt;setText(PAText::Translate(&quot;تست ميشود Testing&amp;quot;));

Revision as of 10:36, 24 February 2015

English عربي فارسی

[toc align_right="yes&quot; depth="3&quot;]

PAText supports Persian and Arabic text in Qt applications

Persian and Arabic Text (known as "PAText&quot;) fixes problems with glyphs in some environment which does not support the "FA&quot; and "AR&quot; keyboard layouts by default. The class acts like a translator for pointing Persian characters to the correct style in the UTF-8 character set.

PAText

Applications

Useful as a solution for displaying Persian and Arabic texts in applications written in Qt for WindowsCE/Mobile platforms as well as creating Persian or Arabic virtual keyboards.

Source Code

"PAText.h&quot;

/*''''''<br /> Persian and Arabic support for WindowsCE/Mobile<br /> by Mohsen Akhlaghi<br /> Ver 1.0.0 Release 2010/12/31<br /> www.madagon.com<br />'''/<br />#ifndef QPlugsPAText<br />#define QPlugsPAText<br />#include &lt;QString&amp;gt;
<br />static const int mapsize=42;<br />static ushort PAMap[42][5]=<br />{<br /> {0, 0, 0, 0, 0}, //dummy<br /> {ushort(0x630), ushort(0xfeac), ushort(0xfeab), ushort(0xfeac), ushort(0xfeab)}, //ذ<br /> {ushort(0x62f), ushort(0xfeaa), ushort(0xfea9), ushort(0xfeaa), ushort(0xfea9)}, //د<br /> {ushort(0x62c), ushort(0xfe9e), ushort(0xfe9f), ushort(0xfea0), ushort(0xfe9d)}, //ج<br /> {ushort(0x62d), ushort(0xfea2), ushort(0xfea3), ushort(0xfea4), ushort(0xfea1)}, //ح<br /> {ushort(0x62e), ushort(0xfea6), ushort(0xfea7), ushort(0xfea8), ushort(0xfea5)}, //خ<br /> {ushort(0x647), ushort(0xfeea), ushort(0xfeeb), ushort(0xfeec), ushort(0xfee9)}, //ه<br /> {ushort(0x639), ushort(0xfeca), ushort(0xfecb), ushort(0xfecc), ushort(0xfec9)}, //ع<br /> {ushort(0x63a), ushort(0xfece), ushort(0xfecf), ushort(0xfed0), ushort(0xfecd)}, //غ<br /> {ushort(0x641), ushort(0xfed2), ushort(0xfed3), ushort(0xfed4), ushort(0xfed1)}, //ف<br /> {ushort(0x642), ushort(0xfed6), ushort(0xfed7), ushort(0xfed8), ushort(0xfed5)}, //ق<br /> {ushort(0x62b), ushort(0xfe9a), ushort(0xfe9b), ushort(0xfe9c), ushort(0xfe99)}, //ث<br /> {ushort(0x635), ushort(0xfeba), ushort(0xfebb), ushort(0xfebc), ushort(0xfeb9)}, //ص<br /> {ushort(0x636), ushort(0xfebe), ushort(0xfebf), ushort(0xfec0), ushort(0xfebd)}, //ض<br /> {ushort(0x637), ushort(0xfec2), ushort(0xfec3), ushort(0xfec4), ushort(0xfec1)}, //ط<br /> {ushort(0x643), ushort(0xfeda), ushort(0xfedb), ushort(0xfedc), ushort(0xfed9)}, //ك<br /> {ushort(0x645), ushort(0xfee2), ushort(0xfee3), ushort(0xfee4), ushort(0xfee1)}, //م<br /> {ushort(0x646), ushort(0xfee6), ushort(0xfee7), ushort(0xfee8), ushort(0xfee5)}, //ن<br /> {ushort(0x62a), ushort(0xfe96), ushort(0xfe97), ushort(0xfe98), ushort(0xfe95)}, //ت<br /> {ushort(0x627), ushort(0xfe8e), ushort(0xfe8d), ushort(0xfe8e), ushort(0xfe8d)}, //ا<br /> {ushort(0x644), ushort(0xfede), ushort(0xfedf), ushort(0xfee0), ushort(0xfedd)}, //ل<br /> {ushort(0x628), ushort(0xfe90), ushort(0xfe91), ushort(0xfe92), ushort(0xfe8f)}, //ب<br /> {ushort(0x64a), ushort(0xfef2), ushort(0xfef3), ushort(0xfef4), ushort(0xfef1)}, //ي<br /> {ushort(0x633), ushort(0xfeb2), ushort(0xfeb3), ushort(0xfeb4), ushort(0xfeb1)}, //س<br /> {ushort(0x634), ushort(0xfeb6), ushort(0xfeb7), ushort(0xfeb8), ushort(0xfeb5)}, //ش<br /> {ushort(0x638), ushort(0xfec6), ushort(0xfec7), ushort(0xfec8), ushort(0xfec5)}, //ظ<br /> {ushort(0x632), ushort(0xfeb0), ushort(0xfeaf), ushort(0xfeb0), ushort(0xfeaf)}, //ز<br /> {ushort(0x625), ushort(0xfe88), ushort(0xfe87), ushort(0xfe88), ushort(0xfe87)}, //إ<br /> {ushort(0x6A9), ushort(0xfb8f), ushort(0xfb90), ushort(0xfb91), ushort(0xfb8e)}, //ک<br /> {ushort(0x6Af), ushort(0xfb93), ushort(0xfb94), ushort(0xfb95), ushort(0xfb92)}, //گ<br /> {ushort(0x698), ushort(0xfb8b), ushort(0xfb8a), ushort(0xfb8b), ushort(0xfb8a)}, //ژ<br /> {ushort(0x686), ushort(0xfb7b), ushort(0xfb7c), ushort(0xfb7d), ushort(0xfb7a)}, //چ<br /> {ushort(0x67E), ushort(0xfb57), ushort(0xfb58), ushort(0xfb59), ushort(0xfb56)}, //پ<br /> {ushort(0x648), ushort(0xfeee), ushort(0xfeed), ushort(0xfeee), ushort(0xfeed)}, //و<br /> {ushort(0x629), ushort(0xfe94), ushort(0xfe93), ushort(0xfe93), ushort(0xfe93)}, //ة<br /> {ushort(0x649), ushort(0xfbfd), ushort(0xfbfe), ushort(0xfbff), ushort(0xfeef)}, //ى<br /> {ushort(0x631), ushort(0xfeae), ushort(0xfead), ushort(0xfeae), ushort(0xfead)}, //ر<br /> {ushort(0x624), ushort(0xfe86), ushort(0xfe85), ushort(0xfe86), ushort(0xfe85)}, //ؤ<br /> {ushort(0x621), ushort(0xfe80), ushort(0xfe80), ushort(0xfe80), ushort(0xfe7f)}, //ء<br /> {ushort(0x626), ushort(0xfe8a), ushort(0xfe8b), ushort(0xfe8c), ushort(0xfe89)}, //ئ<br /> {ushort(0x623), ushort(0xfe84), ushort(0xfe83), ushort(0xfe84), ushort(0xfe83)}, //أ<br /> {ushort(0x622), ushort(0xfe82), ushort(0xfe81), ushort(0xfe82), ushort(0xfe81)}, //آ<br />};
<br />namespace QPlugs<br />{<br />class PAText<br />{<br />public:<br /> static QString Translate(QString pText);<br />};<br />}
<br />#endif // QPlugsPAText<br />


h3. "PAText.cpp&quot;


/'''<br /> Persian and Arabic support for WindowsCE/Mobile<br /> by Mohsen Akhlaghi<br /> Ver 1.0.0 Release 2010/12/31<br /> www.madagon.com<br />''''''*/<br />#include &quot;PAText.h&amp;quot;<br />using namespace QPlugs;

static int CharInMap(QChar pChar)<br />{<br /> char ch = pChar.toAscii();<br /> switch (ch)<br /> {<br /> case 'ذ': return 1;<br /> case 'د': return 2;<br /> case 'ج': return 3;<br /> case 'ح': return 4;<br /> case 'خ': return 5;<br /> case 'ه': return 6;<br /> case 'ع': return 7;<br /> case 'غ': return 8;<br /> case 'ف': return 9;<br /> case 'ق': return 10;<br /> case 'ث': return 11;<br /> case 'ص': return 12;<br /> case 'ض': return 13;<br /> case 'ط': return 14;<br /> case 'ك': return 15;<br /> case 'م': return 16;<br /> case 'ن': return 17;<br /> case 'ت': return 18;<br /> case 'ا': return 19;<br /> case 'ل': return 20;<br /> case 'ب': return 21;<br /> case 'ي': return 22;<br /> case 'س': return 23;<br /> case 'ش': return 24;<br /> case 'ظ': return 25;<br /> case 'ز': return 26;<br /> case 'إ': return 27;<br /> case 'ک': return 28;<br /> case 'گ': return 29;<br /> case 'ژ': return 30;<br /> case 'چ': return 31;<br /> case 'پ': return 32;<br /> case 'و': return 33;<br /> case 'ة': return 34;<br /> case 'ى': return 35;<br /> case 'ر': return 36;<br /> case 'ؤ': return 37;<br /> case 'ء': return 38;<br /> case 'ئ': return 39;<br /> case 'أ': return 40;<br /> case 'آ': return 41;<br /> default :<br /> return 0;<br /> }<br />}

static bool isSpecialChar(QChar pChar, int pCharPoint)<br />{<br /> if (pChar==' ') return true;

ushort vchars[12] = {1,2,19,26,27,30,31,36,37,40,41,42}; //valid chars for special mode<br /> for (int i=0;i&amp;lt;12;i+'')<br /> {<br /> if(pCharPoint==vchars[i])<br /> return true;<br /> }<br /> return false;<br />}
<br />static QString AppendChar(QString pText, int pCharPoint, int pPrevCharPoint)<br />{<br /> if (pCharPoint==0) return pText; //no conversion needed for new character
<br /> int textlen=pText.length();<br /> int ncpos=textlen-1; //new char position<br /> int pcpos=ncpos-1; //prev char position
<br /> if (textlen==1)<br /> {<br /> return QChar(PAMap[pCharPoint][0]); //return its capital face<br /> }<br /> else<br /> {<br /> QString r = pText.left(textlen-2);<br /> QChar prevchar = pText[pcpos];
<br /> if (isSpecialChar(prevchar, pPrevCharPoint)) //if prev char is special<br /> {<br /> r''= prevchar; //leave the prev char as it was<br /> r ''= QChar(PAMap[pCharPoint][0]); //print the new char with its capital face<br /> }<br /> else<br /> {<br /> //check prev char to see if it is capital face<br /> if(prevchar  PAMap[pPrevCharPoint][0] ||
                    prevchar  PAMap[pPrevCharPoint][4]) //is capital<br /> r''=QChar(PAMap[pPrevCharPoint][2]);<br /> else //is not capital<br /> r ''=QChar(PAMap[pPrevCharPoint][3]);
<br /> r''= QChar(PAMap[pCharPoint][1]);<br /> }

return r;<br /> }<br />}

QString PAText::Translate(QString pText)<br />{<br /> QString r = &quot;&quot;;<br /> int charpoint=0;<br /> int prevcharpoint=0;<br /> int textlen=pText.length();<br /> for (int i=0;i&amp;lt;textlen;i++)<br /> {<br /> charpoint = CharInMap(pText[i]);<br /> if (charpoint==0)<br /> r = AppendChar(r+pText[i],charpoint,prevcharpoint);<br /> else<br /> r = AppendChar(r+QChar(PAMap[charpoint][0]),charpoint,prevcharpoint);

prevcharpoint=charpoint;<br /> }<br /> return r;<br />}<br />

Sample Code

#include "PAText.h&quot;
using namespace QPlugs;

void Widget::Test()
{
ui->textBrowser->setText(PAText::Translate("تست ميشود Testing&quot;));