MyBB Community Forums

Full Version: MyBB Translator script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
I am in process of creating a translator script for MyBB, much like Choli's Translator for Messenger Plus! (for those who know what I'm talking about).

As I can't say yet if it's safe to use I won't submit any files yet. The only thing I can say is that it's just one php script you may place wherever in your mybb folder, you only have to copy the english lang files to a new folder with the name of the translation language and set the folder-name in the file.

I still didn't even try to add it to the admin CP, since that could be a real hassle, but the problem is that anyone may access it as it is now.

Here's a screenshot:
looks good, keep up the great work and look forward to download when its done.

However, one question, how does it work?? Does it open up a file, find each line, when you hit save button it overided it, it replaces and saves??

And fianally a suggestion list:

1) Make sure you cant accedently overwrite the english files. Make it stop you from doing so.

2) Change myBBoard to myBulletinBoard

3) A reset changes button.

4) A pop-up panel for lanaguage pronounces (forgot what they are called). They look like the i in the translated text. Not all keyboard support them.

5) A tutorial button and tutorial

6)
Quote:I still didn't even try to add it to the admin CP, since that could be a real hassle, but the problem is that anyone may access it as it is now.
First-of, adding it the admin cp would be a good idea as it would give limited access. Secondly, have some type of protection from people downloading it and using it on anyone server.

7) ~ Symbols before the headings Annoucments, Calender etc. It looks nicer.
Looks promising, nice work Smile
k776 Wrote:However, one question, how does it work?? Does it open up a file, find each line, when you hit save button it overided it, it replaces and saves??
It includes the lang files. As you save it overwrites the full file with the fixed entry. (Still some problems with multilines).

Quote:1) Make sure you cant accedently overwrite the english files. Make it stop you from doing so. Will be done

2) Change myBBoard to myBulletinBoard Is indeed just the working text

3) A reset changes button. Would make sense when editing big texts

4) A pop-up panel for lanaguage pronounces (forgot what they are called). They look like the i in the translated text. Not all keyboard support them. I don't get you Confused

5) A tutorial button and tutorial I don't think it's very difficult to use

6)
Quote:I still didn't even try to add it to the admin CP, since that could be a real hassle, but the problem is that anyone may access it as it is now.

First-of, adding it the admin cp would be a good idea as it would give limited access. Secondly, have some type of protection from people downloading it and using it on anyone server. I would place it in languages, but it screws up the languages (an additional language appears and every page includes the translator, believe me, horrible). I could try to force it to be in languages/translator/ to work

7) ~ Symbols before the headings Annoucments, Calender etc. It looks nicer. Well, why not?

Thanks a lot for your suggestions. Smile

Tochjo Wrote:Looks promising, nice work Smile
Ty Smile

KeyStorm Wrote:
k776 Wrote:However, one question, how does it work?? Does it open up a file, find each line, when you hit save button it overided it, it replaces and saves??
It includes the lang files. As you save it overwrites the full file with the fixed entry. (Still some problems with multilines).
ok, cool. Looking forward to it.

Quote:1) Make sure you cant accedently overwrite the english files. Make it stop you from doing so. Will be done Awesome Smile

2) Change myBBoard to myBulletinBoard Is indeed just the working text ??? Dont understnad what you said. Does that mean you will change it or not??

3) A reset changes button. Would make sense when editing big texts Cool Smile

4) A pop-up panel for lanaguage pronounces (forgot what they are called). They look like the i in the translated text. Not all keyboard support them. I don't get you Confused Well, in your screenshot, in the textarea for translated text, you will see an i with a ' above it. Not all keyboard support this so can you have a pop-up panel box that allows you to click and insert special charactures??

5) A tutorial button and tutorial I don't think it's very difficult to use True, atleast a txt file with instruction, eh??

6)
Quote:I still didn't even try to add it to the admin CP, since that could be a real hassle, but the problem is that anyone may access it as it is now.
First-of, adding it the admin cp would be a good idea as it would give limited access. Secondly, have some type of protection from people downloading it and using it on anyone server. I would place it in languages, but it screws up the languages (an additional language appears and every page includes the translator, believe me, horrible). I could try to force it to be in languages/translator/ to work ok, well, hope you can Smile

7) ~ Symbols before the headings Annoucments, Calender etc. It looks nicer. Well, why not? Awesome. It looks better that way.

Thanks a lot for your suggestions. Smileno problem, if I think of more, ill let you know.
When can we expect a alpha, beta or first release??
I would like to fix the issue with multiple lines first. I'll release then a .txt for testing, don't want people to happily use it until it's built.

About the accents and umlauts and other dodgy letters... I suppose the translator for that language has the proper keyboard, so I don't really think that's needed. Also, I can't guarantee the international support for complex alphabets. I would htmlspecialentities'e it all, but I'm not sure if that would be problematic with emails. So I can't do that.

About the Readme file, sure. I need to tell people how to install and remind them to chmod all lang files to 777 (you never know what kind of dodgy PHP configuration they have), but I may be wrong in this point.

With working text I mean current provisional title. I'll also improve the text.
I was actually hoping someone would create something like this.

Well done KeyStorm, and thanks for the effort!
Ok, first pre-release.

Keep your fingers out of this if you a) don't know what you're doing b) are going to use it on a critically running board (this means, don't if you don't want to screw it up).

You have to rename the file to translator.php and place it in the inc directory.

Pick your FTP client and duplicate the 'english' folder and the english.php file in your /inc/language/ directory (yes, on your server).

Rename the new folder to the name of your language and the php script to the name of your language + '.php'
Edit this php file: set the values properly.
(I guess $langinfo['admin'] means 1 'pick up also AdminCP translation' or 0 'pick up the english adminCP version', but I'm not sure, couldn't bother to test Big Grin)
Save the changes.

Edit translator.php: set the first value to you language name (it must be the same name you set the folder and the php file to).

Run from your browser.

Enjoy Translate!

Chris Boulton Wrote:Well done KeyStorm, and thanks for the effort!
I sortof owe you one Wink

Changes:

Bleh, it's the first version, can't bother Big Grin


Edit: You should use a W3C CSS2 compliant browser, like Mozilla to have the hover effects in the list. However, it's not very relevant.
code start @ line 252 (iframe name missing)

<iframe name="list" src="<?= $_SERVER['PHP_SELF'] ?>?file=<?= $_GET['file'] ?>&amp;show=list<?= isset($_GET['edit']) ? '#'.$_GET['edit'] : '' ?>" width="100%" height="100%" frameborder="0"></iframe>
<iframe name="body" src="<?= $_SERVER['PHP_SELF'] ?>?show=body&amp;edit=<?= $_GET['edit'] ?>&amp;file=<?= $_GET['file'] ?>" width="100%" height="100%" frameborder="0"></iframe>

code line 56:

$file = "<?php\r\n\n".$file."?>";

One nice feature can also to display "~announcements +" in green if all translations finished in this group.
changed line 222 (else it change umlauts or special chars back):

<textarea name="write_translation" cols="40" rows="5" style="overflow:auto"><?= htmlspecialchars($trans[$_GET['file']][$_GET['edit']]) ?></textarea>
Huh, I don't know what or who ( Rolleyes ) stripped those parameters out of iframe. It just won't work without them Undecided

Else, thanks a lot for your fixes and ideas. Smile

But I'm not sure why you add another NEWLINE character to the line 56.

Actually it doesnt change weird letters in latest browsers, but I'll add the htmlspecialchars anyway.
Pages: 1 2 3 4 5 6 7