Database messages translation tool

Hello,

I’m developing a tool for manage the messages stored in the database for localization (when using CDbMessageSource)

Its stil in early stage as you can see, but maybe you can get the idea:

In the project files you define the projects you are working on and want to translate and then set the one active for editing… (don’t pay attention to the “selected target language” column… I’ll have to remove it)

Then in the translate page you have a dropdown menu with the list of target languages for the active project that you defined in the project settings… when you select another language the form and the form data are loaded with ajax without reloading the page thanks to jQuery ;D

For now the project name is called YiiMessageDb but if you think it could have a better name feel free to tell me…

But mainly I’d like to have from you all some tips and some help… if someone would like to join me in this project (will be released with BSD license and hopefully it could be downloaded from the Yii website if qiang agrees) let me know and I can open a svn repository on google code…

let me know! ;)

bye,

Giovanni.


Download from:

http://code.google.com/p/yiimessagedb/

Browse the code:

http://code.google.com/p/yiimessagedb/source/browse/

Svn checkout:


svn checkout http://yiimessagedb.googlecode.com/svn/trunk/ yiimessagedb-read-only

From the GUI, it looks great! Perhaps you can provide the code for people to try it out? Don't worry if it is not perfect yet. We are all here to make it better.

Quote

From the GUI, it looks great! Perhaps you can provide the code for people to try it out? Don't worry if it is not perfect yet. We are all here to make it better.

Yep I’ll make the source available for download asap… the GUI is very basic right now and I’m started with the webapp tutorial that was nice to do what I had in mind ;) Right now is not fully functionally but I’m adding the last things to have a “preview release” (still not 100% usable) for people to download to. As I wrote I’m considering to put it on svn cause this would make it easier to me to keep it up to date as if I have some users downloading a .zip file it will quickly become outdated as the project is evolving fast (as I told even the screen shots are not 100% up-to-date and I made it just yesterday evening… hehe)

let me know, thanks for your feedback!

bye,

Giovanni.

Yeah, start a Google project (really easy) and put your code in SVN.

Quote

Yeah, start a Google project (really easy) and put your code in SVN.

Easy and free  :D

…Done.

Here is the code:

http://code.google.c…nk/YiiMessageDb

to checkout:

svn checkout http://yiimessagedb.googlecode.com/svn/trunk/ yiimessagedb-read-only

if someone is interested in joining this project just pm me with your google accound id and I'll give you member access. thanks.

let me know  :)

bye,

Giovanni.

p.s.

for now I'm using mysql database but once done it could just use sqlite so it won't require a db server and would be more portable… anyway… just load the .sql file you find in the sql folder, rename main-dist.php to main.php in the protected/config folder and set you db user and password and you're ready to go!

Looks good. BTW, you should not add stuff under /assets to SVN.

Quote

BTW, you should not add stuff under /assets to SVN.

you're right… so I just have to commit the empty assets folder right?

let me know if you look at the code and/or have some more tips, thanks :)

bye,

Giovanni.

You can set the svn:ignore keyword to * on the assets folder. Make sure, to commit an empty folder first. Otherwhise already existing files will remain even after setting the keyword.

I've removed from SVN the content of the assets folder and commited some new updates.

Still not fully functional but for the first “useful” version I just need to compare the translated strings with the untranslated ones and then create or update the corresponding records in the db… (now it populates the SourceMessage table but deleting all the rows so the id are lost and this would break the relations with the Message table … but it was just a test  ;))

bye,

Giovanni.

…I've a question:

I've recently added a status icon to the "active" column in the project admin page that I've used also to set the active project "on the fly" using an ajaxLink… it works but I don't know how to refresh the column in order to have the clicked item having the right icon and being no longer a link and all the others should have the "not active" icon and should be a link…

As you can see from here:

http://code.google.c…t/admin.php?r=8

I've already set a call back (refreshColumnActive) that is just a test for now… I saw that with jquery you should be able to do an each through elements so I was thinking about trying that way maybe setting a common class or id or name to the column cells … but was not sure about that. and also I should be able to retrive (or pass to the callback) the id of the clicked item (project) so that when I do the cycle I know which one to set as active and which ones should be set to inactive.

thanks.

Giovanni.

I also have a doubt:

in the Message table should I save translations only for the target languages or also for the source language?  ::) ??? I guess the first one but would prefer to be sure  :P

thanks.

Giovanni.

p.s.

anyway… the first usable version will be online very soon  :D

As promised, here you have the version 0.1:

Posted ImagePosted Image

Download from:

http://code.google.com/p/yiimessagedb/

Browse the code:

http://code.google.c…nk/YiiMessageDb

Svn checkout:

svn checkout http://yiimessagedb.googlecode.com/svn/trunk/ yiimessagedb-read-only

If you have any question, tip, bug report, or anything else feel free to write me. thanks.

Features not yet implemented:

  • project should have more prefs. like custom sourcemessage and message table names

  • import / export

  • when clicking on the "activate project" link the status should be updated too

  • when saving a set of translations the log should appear in the log box instead in a new page using ajax

For this last two things I hope that you can help me and give me some tips on how to implement it. thanks.

Even if in early state, you can already use this 0.1 version for translate your projects, storing translations in the database… hope you’ll find it useful :)

(It is based on Yii Framework 1.0 and you must specify the path of it in the index.php file)

bye,

Giovanni.

Hi everybody… Just wanted to post this to let you know that I'm still here and I'll update YiiMessageDb in the next weeks / months.

In the meantime… feedbacks are welcome ;)

bye,

Giovanni.

Hi,

I've just uploaded on svn (r11) some bug fixes, tested with Yii 1.0.5 on windows, to avoid some notices error messages.

Also added some other small things…

But I have a problem with character encoding: sometimes it loses the utf8 encoding…

Maybe it is when the data are passed to javascript throught json …  ::)

  • The html has

    content=“text/html; charset=utf-8”
  • the database (mysql) and the tables (MyISAM) are using the “utf8_general_ci” Collation and default and I have

    default-character-set=utf8
    in my mysql.ini

The problem is that, if I save a string like “Qualità” using YiiMessageDb and then I re-open it going to the “translate” page … I can see it right… while if I then open the table using phpMyAdmin it shows “QualitÔ  ??? :-\

any idea? could you please try to download r11 from svn and help me understand where the problem is? (php/html, mysql settings, phpmyadmin… ?)

thanks a lot.

bye,

Giovanni.

p.s.

worked fine using linux… now I’m testing it on windows xp using WampServer that has mysql 5.1.33 installed.

It’s an interesting project. I made something like this before, but with a bad interface. Could you change the first screenshot link to http://img244.images…nslate02sr2.jpg ?

Hi,

thanks… if you want we could work together on it; I can give you svn access… And anyway feedback and comments are welcome… I hope to sort out that problem with character encoding  :P

Quote

Could you change the first screenshot link to http://img244.images...nslate02sr2.jpg ?

what do you mean? here in this thread or where? (here it is already pointing to that url… )

bye,

Giovanni.

Sorry, I was not clear.

In your project page, the both thumbs use the same link.

r12 is on svn!

http://code.google.com/p/yiimessagedb/source/checkout

thanks Qiang for helping me find out the bug :)

bye,

Giovanni.

r13 is on svn!

  • fixed string loading bug when using more than one category

hope to release a better version with some cool things before the Yii 1.1 release ;)

bye,

Giovanni.

p.s.

@Eliovir: I’ve also fixed the links to the screenshots, thanks.

Released r13 as 0.2 so that you can download it from:

http://code.google.com/p/yiimessagedb/downloads/list B)

Please read instructions on how to setup / use here:

http://code.google.com/p/yiimessagedb/

bye,

Giovanni.