Home » Developer & Programmer » Forms » Translation of Oracle forms (merged 2) 10g
Translation of Oracle forms (merged 2) 10g [message #419757] Tue, 25 August 2009 08:17 Go to next message
rusina
Messages: 1
Registered: November 2006
Junior Member
Hi,

We are using Oracle Forms version 10g R2.

We are in the process of translating the Oracle forms from English to Arabic.

Is it the correct way to translate using translation hub.

Can the translation happen without importing the glossary.

Can anyone please guide me through the steps required to be followed.

Thanks and Regards,
Rusina
Re: Translation of Oracle forms (merged 2) 10g [message #419938 is a reply to message #419757] Wed, 26 August 2009 04:33 Go to previous messageGo to next message
sharjeelshafqat
Messages: 33
Registered: August 2009
Location: Pakistan
Member

https://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=511&lngWId=5
Re: Translation of Oracle forms (merged 2) 10g [message #419940 is a reply to message #419757] Wed, 26 August 2009 04:38 Go to previous messageGo to next message
sharjeelshafqat
Messages: 33
Registered: August 2009
Location: Pakistan
Member

create or replace function Num_ar (P_inp_num in NUmber,v_ce in varchar2 DEFAULT 'ÑíÇá íãäí',v_de in varchar2 DEFAULT 'ÞÑÔ',v_det in number DEFAULT 0,v_lan in varchar2 DEFAULT 'AR')
return Varchar2 as
-- ÃÊãäì Ãä íäÝÚ Èå ÇáãÓáãíä æáÇ ÊÍÑãæäÇ ãä ÏÚÇÆßã
-- Functions called : D3_To_Word
-- Maded By Naif Salim Al hamed In 8-7-2002 email u4_13@hotmail.com
L_Return Varchar2(1000) ;

m Number := 0 ;

V_inp_Num Number := 0 ;
V_inp_Int Number := 0 ;
V_inp_dec Number := 0 ;
V_Char Varchar2(100) ;
V_Temp Number := 0 ;

Type LionArray is table of Varchar2(500) ;
In_str LionArray := LionArray ( '',
' ÂáÝ ', ' ãáíæä ' , ' ãáíÇÑ ' , ' ÊÑáíæä ' ,' ÝÑáíæä ' , ' ÓÑÓáíæä ' , ' ÊÓÑÓáíæä ' , ' ÝíãÊæä ' );

-- ENGLSH VARIBLE
eL_Return Varchar2(1000) ;

em Number := 0 ;

eV_inp_Num Number := 0 ;
eV_inp_Int Number := 0 ;
eV_inp_dec Number := 0 ;
eV_Char Varchar2(100) ;
eV_Temp Number := 0 ;

Type eLionArray is table of Varchar2(500) ;
eIn_str eLionArray :=
eLionArray ( '',
'Thousand ' ,
'Million ' ,
'Billion ' ,
'Trillion ' ,
'Quadrillion ' ,
'Quintillion ' ,
'Sextillion ' ,
'Septillion ' ,
'Octillion ' ,
'Nonillion ' ,
'Decillion ' ,
'Undecillion ' ,
'Duodecillion ');

-- Function
function D3_To_Wordar (P1_number in number)
return varchar2 as
-- Pass only three digits
-- This function return word equivalent to its number
-- Accepted values are 0 to 999

L1_Return2 varchar2(500) := NULL ;

n1 Number := 0 ;
i1 Number := 0 ;
j1 Number := 0 ;
k1 Number := 0 ;
V1_inp_Number Number := 0 ;
V1_temp Varchar2(50) := NULL;

type OneArray is table of varchar2(50);
type TenArray is table of varchar2(50);
type hanArray is table of varchar2(50);

OneStr OneArray := OneArray('æÇÍÏ', 'ÅËäÇä ', 'ËáÇËÉ', 'ÃÑÈÚÉ', 'ÎãÓÉ', 'ÓÊÉ', 'ÓÈÚÉ', 'ËãÇäíÉ', 'ÊÓÚÉ', 'ÚÔÑÉ', 'ÅÍÏìÚÔÑ', 'ÅËäÇÚÔÑ', 'ËáÇËÉ ÚÔÑ', 'ÃÑÈÚÉ ÚÔÑ', 'ÎãÓÉ ÚÔÑ', 'ÓÊÉ ÚÔÑ', 'ÓÈÚ ÚÔÑ', 'ËãÇäíÉ ÚÔÑ', 'ÊÓÚ ÚÔÑ');
TenStr TenArray := TenArray('', 'ÚÔÑæä', 'ËáÇËæä', 'ÃÑÈÚæä' , 'ÎãÓæä', 'ÓÊæä', 'ÓÈÚæä','ËãÇäæä', 'ÊÓÚæä');
hanStr hanArray := hanArray('ãÇÆÉ', 'ãÇÆÊÇä', 'ËáÇËãÇÆÉ' , 'ÃÑÈÚãÇÆÉ', 'ÎãÓãÇÆÉ', 'ÓÊãÇÆÉ','ÓÈÚãÇÆÉ', 'ËãÇäãÇÆÉ','ÊÓÚãÇÆÉ');

BEGIN

V1_inp_Number := P1_Number ;
if V1_inp_number > 999 then
V1_inp_number := 0 ;
end if ;

V1_temp := LPAD(to_char(V1_inp_number),3,0) ;


-- Find Hundredth position
n1 := to_number(substr(V1_temp,1,1));

if n1 > 0 then L1_Return2 := hanStr(n1) ;
end if ;



i1 := to_number(substr(V1_temp,2,2));
j1 := to_number(substr(V1_temp,2,1));
k1 := to_number(substr(V1_temp,3,1));

if n1>0 AND (j1>0 OR k1>0) then L1_Return2 := L1_Return2 ||' æ';
End if;

if i1 > 0 and i1 < 20 then L1_Return2 :=L1_Return2 || OneStr(i1) ;
END IF;



if j1 >= 2 then

if k1 > 0 then
L1_Return2 := L1_Return2|| OneStr(k1)|| ' æ' ;
end if;

L1_Return2 := L1_Return2 || TenStr(j1) ;

end if;
if V1_inp_number=0 Then L1_Return2:='ÕÝÑ';
End If;

Return L1_Return2 ;


END D3_To_Wordar;
-- another function

function Digits3_To_Word (P_number in number)
return varchar2 as
-- Pass only three digits
-- This function return word equivalent to its number
-- Accepted values are 0 to 999
--
L_Return2 varchar2(500) := NULL ;

i Number := 0 ;
j Number := 0 ;
k Number := 0 ;

V_inp_Number Number := 0 ;
V_temp Varchar2(50) := NULL;

type OneArray is table of varchar2(50);
type TenArray is table of varchar2(50);
OneStr OneArray := OneArray('One ',
'Two ',
'Three ',
'Four ',
'Five ',
'Six ',
'Seven ',
'Eight ',
'Nine ',
'Ten ',
'Eleven ',
'Twelve ',
'Thirteen ',
'Fourteen ',
'Fifteen ',
'Sixteen ',
'Seventeen ',
'Eighteen ',
'Nineteen ');
TenStr TenArray := TenArray('',
'Twenty ',
'Thirty ',
'Forty ' ,
'Fifty ',
'Sixty ',
'Seventy ',
'Eighty ',
'Ninety ');

BEGIN

V_inp_Number := P_Number ;
if V_inp_number > 999 then
V_inp_number := 0 ;
end if ;

V_temp := LPAD(to_char(V_inp_number),3,0) ;

-- Find Hundredth position
i := to_number(substr(V_temp,1,1));
if i > 0 then
L_Return2 := OneStr(i)||'Hundred ' ;
end if ;

-- Find last 2 digits
i := to_number(substr(V_temp,2,2));
j := to_number(substr(V_temp,2,1));
k := to_number(substr(V_temp,3,1));
if i > 0 and i < 20 then
L_Return2 := L_Return2 || OneStr(i) ;
end if ;
if j >= 2 then
L_Return2 := L_Return2 || TenStr(j) ;
if k > 0 then
L_Return2 := L_Return2|| OneStr(k) ;
end if;
end if;

Return L_Return2 ;

END Digits3_To_Word;



Begin

IF v_lan ='AR' Then
V_inp_Num := ABS(P_inp_Num) ;
V_inp_Int := Trunc(V_inp_Num) ;
V_inp_Dec := V_inp_Num - V_inp_Int ;

-- To abort to 100
if V_inp_Dec > 0 then
V_inp_dec := V_inp_dec * 100 ;
V_inp_Dec := to_number(substr(to_char(V_inp_Dec),1,2)) ;
end if ;


V_char := to_char(V_inp_Int) ;

for m in 1..In_Str.Count Loop Exit when V_char is NULL ;

V_Temp := To_Number(Substr(V_char,(Length(V_char)-2), 3));

if V_temp > 0 then
L_Return := D3_To_WordAR(V_Temp) || In_str(m)||' æ' || L_Return ;
end if ;

V_char := Substr(V_char,1,(Length(V_Char)-3));

End Loop ;

L_return :=Substr(L_return,1,(Length(L_return)-1));

IF P_inp_num>=1000 and P_inp_num<2000 Then L_return:=Substr(L_return,5,Length(L_return));
End if ;

IF P_inp_num>=2000 and P_inp_num<3000 Then L_return:='ÇáÝÇä'||Substr(L_return,11,Length(L_return));
End if ;

IF P_inp_num>=3000 and P_inp_num<=10000 Then

L_return:=Substr(L_return,1,(INSTR(L_return,'ÂáÝ')-1)) || 'ÇáÂÝ' || Substr(L_return,(INSTR(L_return,'ÂáÝ')+3),Length(L_return));

End if ;

if v_det=1 then
if V_inp_Dec > 0 then
L_return := L_return ||v_ce||' æ' || to_char(V_inp_Dec)||v_de;
ELSE L_return := L_return ||' '||v_ce;
end if;
Else
if V_inp_Dec > 0 then
L_return := L_return ||v_ce||' æ' ||D3_To_WordAR(V_inp_Dec)||' '||v_de;
ELSE L_return := L_return ||' '||v_ce;
end if;
End if;

if V_inp_Int > 0 then
L_Return := L_Return;
elsif V_inp_Int = 0 then
L_return := '===' ;
end if ;
Return L_return;

ELSE
if P_inp_num < 0 then
eV_inp_Num := (P_inp_Num * -1) ;
else
eV_inp_Num := P_inp_Num;
end if;
eV_inp_Int := Trunc(eV_inp_Num) ;
eV_inp_Dec := eV_inp_Num - eV_inp_Int ;
if eV_inp_Dec > 0 then
eV_inp_dec := eV_inp_dec * 100 ;
eV_inp_Dec := to_number(substr(to_char(eV_inp_Dec),1,2)) ;
end if ;

eV_char := to_char(eV_inp_Int) ;

for em in 1..eIn_Str.Count Loop
exit when eV_char is NULL ;
eV_Temp := To_Number(Substr(eV_char,(Length(eV_char)-2), 3));

if eV_temp > 0 then
eL_Return := Digits3_To_Word(eV_Temp) || eIn_str(em) || eL_Return ;
end if ;

eV_char := Substr(V_char,1,(Length(eV_Char)-3));

End Loop ;

if eV_inp_Int > 0 then
eL_Return := v_ce||' '||eL_Return ||' and ';
elsif eV_inp_Int = 0 then
eL_return := v_ce||' Zero and ' ;
end if ;

-- Concatenate the word for decimal digits

if v_det=1 then
if eV_inp_Dec > 0 then
eL_return := eL_return || Digits3_To_Word(eV_inp_Dec) ||' '||v_de;
elsif eV_inp_Dec = 0 then
eL_Return := eL_return ||' Zero '||v_de;
End if ;

ELSE
if eV_inp_Dec > 0 then
eL_return := eL_return || to_char(eV_inp_Dec) ||' '||v_de;
elsif eV_inp_Dec = 0 then
eL_Return := eL_return ||' Zero '||v_de;
End if ;
END if;

Return eL_return;

End IF;
END Num_AR;
Re: Translation of Oracle forms (merged 2) 10g [message #422906 is a reply to message #419940] Mon, 21 September 2009 02:45 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Please use code tags.

David
Previous Topic: FRM-21011: PL/SQL unhandled exception ORA-306500
Next Topic: How to count characters typed in a text input field (as they type)
Goto Forum:
  


Current Time: Tue Dec 06 12:29:39 CST 2016

Total time taken to generate the page: 0.08061 seconds