Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Internationalization (v4)
 Give it a try: FlangSP (Singular/Plural)
 Forum Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 3

Deleted
deleted

4116 Posts

Posted - 02 October 2002 :  12:42:20  Show Profile
Yeah <

Stop the WAR!
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 02 October 2002 :  13:11:09  Show Profile
Check it now.

Test: Nums=4||4


Test#1: Nums=1||11
Test#2: Nums=2||6
Test#3: Nums=5||11
Test#1: Nums=5||25

[edit]Links corrected by bozden, so that I can send the link to survivor to check[/edit]
<

Edited by - GauravBhabu on 02 October 2002 13:27:23
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 02 October 2002 :  13:22:31  Show Profile
Seems OK to me, but I don't know Russian . I'll send an e-mail to survivor...
<

Stop the WAR!
Go to Top of Page

Survivor
Starting Member

Russia
10 Posts

Posted - 03 October 2002 :  05:59:34  Show Profile
I revisited some cases about problem with singula/plural forms:

For string below:

strLangTest = "There [%1]is|are[/%1] %s1% [%1]topic|topics[/%1] in %s2% [%2]forum|forums[/%2]." - original
strLangTest = "Èìååòñÿ %s1% [%1]òåìà|òåì[/%1] â %s2% [%2]ôîðóìå|ôîðóìàõ[/%2]." - in russian


for "topic/topics" in russian - IT STILL THE SAME:

When number ended with 1 (example: 1, 21, 51, etc) it must be writed as "òåìà" (in russian)
When number ended with 2 to 4 (example: 2, 23, 54, etc) it must be writed as "òåìû"
When number ended with 5 to 10 (example: 0, 5, 27, 60, etc) it must be writed as "òåì"

for "forum/forums" - IT REVISITED:

When number ended with 1 (example: 1, 21, 51, etc) it must be writed as "ôîðóìå" (in russian)
When number >1 (example: 2, 23, 54, etc) it must be writed as "ôîðóìàõ"

It will be more correct for russian ...

Examples above works fine with topic/topics, but forum/forums can be as original .
Can you made this ?

BTW, this works on this string. It another stings like this (I want to see on it) ?

But i still think, that it could be better to use form something like this:

Current status - Topic(s): %s1%, Forum(s): %s2%

Such form can solve all problems...
<

Edited by - Survivor on 03 October 2002 06:06:51
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 11 October 2002 :  10:27:33  Show Profile
GB, can you share the latest version here?<

Stop the WAR!
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 11 October 2002 :  10:56:57  Show Profile
The one for the Russian?<
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 11 October 2002 :  11:13:05  Show Profile
<%

function SingularPlural(strlangTest, strNumerals)
   dim arrlangTest, arrNumerals, strTemp, arrTemp, strSP, arrSP, i, j, k
   arrlangTest = split(strlangTest, "[%||%]")
   arrNumerals = split(strNumerals, "||")
   if ubound(arrlangTest) <> ubound(arrNumerals) then 
    ErrMsg = "Both arguments must have equal number of separators"
    Response.Write "<P ALIGN=""Center""><FONT SIZE=""6"">English</FONT></P>"
    Response.Write "<P ALIGN=""Center"">" & strlangTest & "</P>"
    Response.Write "<P ALIGN=""Center"">" & strNumerals & "</P>"
    Response.Write "<P ALIGN=""Center""><FONT SIZE=""6"">" & ErrMsg & "</FONT></P>"
    Exit function
   end if
   for i = 0 to ubound(arrlangTest)
    strTemp = arrlangTest(i)
    strTemp = Replace(strTemp, "[%N%]", arrNumerals(i))
    arrTemp = split(strTemp, "[%sp%]")
    k = 1
    if arrNumerals(i) = "" then 
     ErrMsg = "Error in Argument 2"
     Exit function
    end if
    if arrNumerals(i) = 1 then k = 0
    for j = 0 to ubound(arrTemp)
     if Instr(arrTemp(j),"|") then
      arrSP = split(arrTemp(j), "|")
      strSP = arrSP(k)
      arrTemp(j) = strSP
     end if 
    next
    strTemp = Join(arrTemp)
    arrlangTest(i) = strTemp
   next
   strOut = Join(arrlangTest)
   SingularPlural = strOut
end function
function SingularPluralRussian(strlangTest, strNumerals)
   dim arrlangTest, arrNumerals, strTemp, arrTemp, strSP, arrSP, i, j, k, ErrMsg, bln1120
   arrlangTest = split(strlangTest, "[%||%]")
   arrNumerals = split(strNumerals, "||")
   if ubound(arrlangTest) <> ubound(arrNumerals) then 
    ErrMsg = "Both arguments must have equal number of separators"
    Response.Write "<P ALIGN=""Center"">" & strlangTest & "</P>"
    Response.Write "<P ALIGN=""Center"">" & strNumerals & "</P>"
    Response.Write "<P ALIGN=""Center""><FONT SIZE=""6"">" & ErrMsg & "</FONT></P>"
    Exit function
   end if
   for i = 0 to ubound(arrlangTest)
    bln1120 = false
    strTemp = arrlangTest(i)
    strTemp = Replace(strTemp, "[%N%]", arrNumerals(i))
    arrTemp = split(strTemp, "[%sp%]")
    if ubound(arrTemp) < 1 then
     arrTemp = split(strTemp, "[%spl%]")
     bln1120 = true
    end if
    k = getIndex(arrNumerals(i), bln1120)
    if k = "Error" then 
     ErrMsg = "Error in Argument 2"
     Exit function
    end if
    for j = 0 to ubound(arrTemp)
     if Instr(arrTemp(j),"|") then
      arrSP = split(arrTemp(j), "|")
      strSP = arrSP(k)
      arrTemp(j) = strSP
     end if 
    next
    strTemp = Join(arrTemp)
    Erase arrTemp
    arrlangTest(i) = strTemp
   next
   strOut = Join(arrlangTest)
   SingularPluralRussian = strOut
end function

function getIndex(num, bln1120)
    dim numdigit
    if num = "" then getIndex = "Error" : exit function
    if bln1120 then 
     if num > 10 and num < 20 then getIndex = 2 : exit function
    end if 
    if len(num) > 1 then 
     numdigit = right(num,1)
    else
     numdigit = num
    end if
    if numdigit = 1 then 
     getIndex = 0
    elseif numdigit = 0 or numdigit > 4 then 
     getIndex = 2
    else
     getIndex = 1
    end if
end function

strLangTest = "Èìååòñÿ [%N%] [%sp%]òåìà|òåìû|òåì[%sp%] [%||%] â [%N%] [%spl%]ôîðóì.|ôîðóìà.|ôîðóìîâ.[%spl%]" 
strNumerals = "5||11"
'strNumerals = Request.QueryString("Nums")
Call SingularPluralRussian(strLangTest, strNumerals)
strNumerals = strNumerals
strLangTest = "There [%sp%]is|are[%sp%] [%N%] [%sp%]topic|topics[%sp%] in [%||%] [%N%] [%sp%]forum.|forums.[%sp%]"
Call SingularPlural(strLangTest, strNumerals)

%>


The [%||%] is important.<

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page

Ez4arab
Junior Member

479 Posts

Posted - 14 October 2002 :  11:50:02  Show Profile  Visit Ez4arab's Homepage
Response.Write " <td bgcolor=""" & strForumCellColor & """ colspan=""" & sGetColspan(6,5) &_
""">" & _
"<font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """>يوجد "
' if intTopicCount = 1 then
' Response.Write "is "
' else
' Response.Write "are "
' end if
Response.Write " حاليا "
if intTopicCount > 0 then
Response.Write intTopicCount
else
Response.Write ""
end if
if intTopicCount = 1 then
Response.Write " موضوع واحد "
else
if intTopicCount = 2 then
Response.Write " موضوعان "
else
if intTopicCount < 2 and intTopicCount > 11 then
Response.Write " مواضيع "
else '' 11 and more
Response.Write " موضوع "
end if
end if
end if
<

Ez4arab web site Ez4arab |
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 14 October 2002 :  13:32:22  Show Profile
So, does this mean that it is also a problem with Arabic?

I think your formulations (i.e. with "<" & ">") have problems.

Negatives => ?
0 => ?
1 => موضوع واحد
2 => موضوعان
3-11 => مواضيع
11-... => موضوع


Question: Is this a general rule or is it just valid for the word "topic" and different numbers/number ranges in "forum" or "post" etc?
<

Stop the WAR!
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page
 Forum Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000 Version 3.4.07