The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Translation script

2 posters

Go down

Solved Translation script

Post by Guest November 7th 2014, 9:45 am

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:
Translation script Translate

Thanks.


Last edited by Fédra on November 11th 2014, 7:58 am; edited 1 time in total
avatar
Guest
Guest


Back to top Go down

Solved Re: Translation script

Post by Ange Tuteur November 8th 2014, 8:06 am

Hello Fédra,

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&nbsp;:&nbsp;',legend).replace(/There are currently (<strong>\d+<\/strong>) user\(s\) on the ChatBox&nbsp;:&nbsp;/,inchat);
});

If there's more that you want to translate, let me know and I'll add the variables. Wink
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Translation script

Post by Guest November 8th 2014, 9:35 am

Hai Ange Tuteur!  Mr. Green
Thank you, but unfortunately, it doesn't work. Translation script Oops
avatar
Guest
Guest


Back to top Go down

Solved Re: Translation script

Post by SLGray November 8th 2014, 10:46 am

Did you activate JavaScript Management?


Translation script Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51452
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Translation script

Post by Guest November 8th 2014, 12:57 pm

Yes, and it's like this. Translation script Mouais

(Actually, if I use the full code, the birthday message is translated, but I don't even want it to show up. Very Happy The rest would be more important to be translated.) 
Translation script Nogood
avatar
Guest
Guest


Back to top Go down

Solved Re: Translation script

Post by Ange Tuteur November 8th 2014, 9:22 pm

Here try now :
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&nbsp;:&nbsp;',legend).replace(/There are currently (<strong>\d+<\/strong>) user\(s\) on the ChatBox&nbsp;:&nbsp;/,inchat);
});

I forgot to replace the number with a digit metacharacter.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Translation script

Post by Guest November 9th 2014, 10:00 am

I forgot to replace the number with a digit metacharacter.
I wish to understand this one day! Mr. Green


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.
Translation script Almostxddddd
avatar
Guest
Guest


Back to top Go down

Solved Re: Translation script

Post by Ange Tuteur November 9th 2014, 10:59 pm

Super Very Happy

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. Smile

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+
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Translation script

Post by Guest November 10th 2014, 12:13 pm

Members connected during last 24 hours doesn't work. Lol  And the birthday one, but I'll remove that part anyway, so it's not important. :'D

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&nbsp;:&nbsp;',legend).replace(/There are currently (<strong>\d+<\/strong>) user\(s\) on the ChatBox&nbsp;:&nbsp;/,inchat);
});


P.S.
Thank you very much for the explanation! Mr. Green
avatar
Guest
Guest


Back to top Go down

Solved Re: Translation script

Post by Ange Tuteur November 11th 2014, 12:48 am

Here try 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&nbsp;:&nbsp;/,legend).replace(/There are currently (<strong>\d+<\/strong>) user\(s\) on the ChatBox&nbsp;:&nbsp;/,inchat);
});

I made a mistake by using a string instead of a regular expression.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Translation script

Post by Guest November 11th 2014, 7:56 am

You're AMAZING! Thank you!!! Mr. Green
Solved.~~
avatar
Guest
Guest


Back to top Go down

Solved Re: Translation script

Post by Ange Tuteur November 11th 2014, 9:32 am

You're welcome Translation script 1852325475

Topic archived

Have a nice day. Smile
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum