Translation script
2 posters
Page 1 of 1
Translation script
Could I have a script for PunBB like the one given in the link? o.o
https://help.forumotion.com/t134243-how-to-change-these-signs-in-another-language
I want to translate these:
Thanks.
https://help.forumotion.com/t134243-how-to-change-these-signs-in-another-language
I want to translate these:
Thanks.
Last edited by Fédra on November 11th 2014, 7:58 am; edited 1 time in total
Guest- Guest
Re: Translation script
Hello Fédra,
Give this a try :
If there's more that you want to translate, let me know and I'll add the variables.
Give this a try :
- Code:
$(function() {
var last24 = 'Members connected during last 24 hours : ',
nobday = 'No users have a birthday today',
bdaytoday = 'Users having a birthday today',
nobdaynext7 = 'No users are having a birthday in the upcoming 7 days',
bdaynext7 = 'Users with a birthday within the next 7 days:',
legend = 'Legend :',
inchat = 'There are currently 0 user(s) on the ChatBox :',
who = document.getElementById('pun-info');
who.innerHTML = who.innerHTML.replace('Members connected during last 24 hours :',last24).replace('No users have a birthday today',nobday).replace('Users having a birthday today',bdaytoday).replace('Users with a birthday within the next 7 days: ',bdaynext7).replace('No users are having a birthday in the upcoming 7 days',nobdaynext7).replace('Legend : ',legend).replace(/There are currently (<strong>\d+<\/strong>) user\(s\) on the ChatBox : /,inchat);
});
If there's more that you want to translate, let me know and I'll add the variables.
Re: Translation script
Did you activate JavaScript Management?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Translation script
Yes, and it's like this.
(Actually, if I use the full code, the birthday message is translated, but I don't even want it to show up. The rest would be more important to be translated.)
(Actually, if I use the full code, the birthday message is translated, but I don't even want it to show up. The rest would be more important to be translated.)
Guest- Guest
Re: Translation script
Here try now :
I forgot to replace the number with a digit metacharacter.
- Code:
$(function() {
var last24 = 'Members connected during last 24 hours : ',
nobday = 'No users have a birthday today',
bdaytoday = 'Users having a birthday today',
nobdaynext7 = 'No users are having a birthday in the upcoming 7 days',
bdaynext7 = 'Users with a birthday within the next 7 days:',
legend = 'Legend :',
inchat = 'There are currently 0 user(s) on the ChatBox :',
who = document.getElementById('pun-info');
who.innerHTML = who.innerHTML.replace('Members connected during last \d+ hours :',last24).replace('No users have a birthday today',nobday).replace('Users having a birthday today',bdaytoday).replace('Users with a birthday within the next \d+ days: ',bdaynext7).replace('No users are having a birthday in the upcoming \d+ days',nobdaynext7).replace('Legend : ',legend).replace(/There are currently (<strong>\d+<\/strong>) user\(s\) on the ChatBox : /,inchat);
});
I forgot to replace the number with a digit metacharacter.
Re: Translation script
I wish to understand this one day!I forgot to replace the number with a digit metacharacter.
Thank you so much Ange, but it's still not working. I think it's not your fault, it must be me who messed up something somewhere. :'D I'll try to find it, thanks for the codes! I'm sure they'll be good!~~
Edit: oh yea, setting the language at the Profile settings can make wonders. :'D Almost perfect.
Guest- Guest
Re: Translation script
Super
Which translations do not work for you, and could you share the script with the translation made ? I can check to see if it's a problem with the regular expression, if you want.
P.S.
The digit metacharacter is a special character used to match a digit : \d
\d will match the numbers 0,1,2,3,4,5,6,7,8, and 9 in a regular expression
adding a + will match whole numbers like 90, 100, 1000 : \d+
Which translations do not work for you, and could you share the script with the translation made ? I can check to see if it's a problem with the regular expression, if you want.
P.S.
The digit metacharacter is a special character used to match a digit : \d
\d will match the numbers 0,1,2,3,4,5,6,7,8, and 9 in a regular expression
adding a + will match whole numbers like 90, 100, 1000 : \d+
Re: Translation script
Members connected during last 24 hours doesn't work. And the birthday one, but I'll remove that part anyway, so it's not important. :'D
The script looks like this now
P.S.
Thank you very much for the explanation!
The script looks like this now
- Code:
$(function() {
var last24 = '24 órája itt volt : ',
nobday = 'Senkinek nincs ma a szülinapja',
bdaytoday = 'Neki(k) van a szülinapja ma: ',
nobdaynext7 = 'Senkinek nincs szülinapja az elkövetkezendő 7 napban',
bdaynext7 = '7 napon belül ünnepli a szülinapját: :',
legend = 'Csoportok:',
inchat = 'Jelenleg senki nem chatel:',
who = document.getElementById('pun-info');
who.innerHTML = who.innerHTML.replace('Members connected during last \d+ hours :',last24).replace('No users have a birthday today',nobday).replace('Users having a birthday today',bdaytoday).replace('Users with a birthday within the next \d+ days: ',bdaynext7).replace('No users are having a birthday in the upcoming \d+ days',nobdaynext7).replace('Legend : ',legend).replace(/There are currently (<strong>\d+<\/strong>) user\(s\) on the ChatBox : /,inchat);
});
P.S.
Thank you very much for the explanation!
Guest- Guest
Re: Translation script
Here try now :
I made a mistake by using a string instead of a regular expression.
- Code:
$(function() {
var last24 = '24 órája itt volt : ',
nobday = 'Senkinek nincs ma a szülinapja',
bdaytoday = 'Neki(k) van a szülinapja ma: ',
nobdaynext7 = 'Senkinek nincs szülinapja az elkövetkezendő 7 napban',
bdaynext7 = '7 napon belül ünnepli a szülinapját: :',
legend = 'Csoportok:',
inchat = 'Jelenleg senki nem chatel:',
who = document.getElementById('pun-info');
who.innerHTML = who.innerHTML.replace(/Members connected during last \d+ hours : /,last24).replace(/No users have a birthday today/,nobday).replace(/Users having a birthday today/,bdaytoday).replace(/Users with a birthday within the next \d+ days: /,bdaynext7).replace(/No users are having a birthday in the upcoming \d+ days/,nobdaynext7).replace(/Legend : /,legend).replace(/There are currently (<strong>\d+<\/strong>) user\(s\) on the ChatBox : /,inchat);
});
I made a mistake by using a string instead of a regular expression.
Similar topics
» Suggested Script (Need Someone that can read script)
» register Script (I Need The Script)
» Script Src
» Where would i add this script?
» Script Tag
» register Script (I Need The Script)
» Script Src
» Where would i add this script?
» Script Tag
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum