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.
The forum of the forums
2 posters

    Translation script

    avatar
    Guest
    Guest


    Solved Translation script

    Post by Guest November 7th 2014, 3: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, 1:58 am; edited 1 time in total
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Translation script

    Post by Ange Tuteur November 8th 2014, 2: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
    avatar
    Guest
    Guest


    Solved Re: Translation script

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

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


    Male Posts : 51554
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Translation script

    Post by SLGray November 8th 2014, 4: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.
    avatar
    Guest
    Guest


    Solved Re: Translation script

    Post by Guest November 8th 2014, 6:57 am

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


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

    Solved Re: Translation script

    Post by Ange Tuteur November 8th 2014, 3: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.
    avatar
    Guest
    Guest


    Solved Re: Translation script

    Post by Guest November 9th 2014, 4: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
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Translation script

    Post by Ange Tuteur November 9th 2014, 4: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+
    avatar
    Guest
    Guest


    Solved Re: Translation script

    Post by Guest November 10th 2014, 6:13 am

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


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

    Solved Re: Translation script

    Post by Ange Tuteur November 10th 2014, 6:48 pm

    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.
    avatar
    Guest
    Guest


    Solved Re: Translation script

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

    You're AMAZING! Thank you!!! Mr. Green
    Solved.~~
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Translation script

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

    You're welcome Translation script 1852325475

    Topic archived

    Have a nice day. Smile

      Current date/time is November 11th 2024, 1:22 pm