Yii Framework Forum: Database messages translation tool - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Database messages translation tool Rate Topic: ****- 1 Votes

#1 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 31 December 2008 - 10:33 AM

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:
Posted ImagePosted Image


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.c.../source/browse/

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

1

#2 User is online   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,855
  • Joined: 04-October 08
  • Location:DC, USA

Posted 31 December 2008 - 10:57 AM

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

#3 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 31 December 2008 - 11:02 AM

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

#4 User is online   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,855
  • Joined: 04-October 08
  • Location:DC, USA

Posted 31 December 2008 - 11:46 AM

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

#5 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 31 December 2008 - 12:03 PM

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.....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!
0

#6 User is online   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,855
  • Joined: 04-October 08
  • Location:DC, USA

Posted 31 December 2008 - 12:48 PM

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

#7 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 31 December 2008 - 12:52 PM

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

#8 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 01 January 2009 - 08:39 AM

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

#9 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 01 January 2009 - 06:45 PM

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

#10 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 03 January 2009 - 05:50 AM

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

#11 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 04 January 2009 - 02:36 PM

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
0

#12 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 04 January 2009 - 04:32 PM

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

#13 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 05 March 2009 - 04:16 AM


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

#14 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 22 May 2009 - 05:37 AM

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

#15 User is offline   Eliovir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 17-January 09

Posted 22 May 2009 - 09:17 AM

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 ?


0

#16 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 22 May 2009 - 07:22 PM


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

#17 User is offline   Eliovir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 17-January 09

Posted 23 May 2009 - 05:35 AM

Sorry, I was not clear.

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

#18 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 21 July 2009 - 10:48 AM

r12 is on svn!

http://code.google.c...source/checkout

Quote

fixed the db connection charset problem (see also changes to main-dist.php and
apply them to your main.php config file)


thanks Qiang for helping me find out the bug :)

bye,
Giovanni.
Yii Playground: collaborative demo app with small examples to play with.. join us ;) [Fork on github]

>> My Linkedin Profile
0

#19 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 20 August 2009 - 10:13 AM

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.
Yii Playground: collaborative demo app with small examples to play with.. join us ;) [Fork on github]

>> My Linkedin Profile
0

#20 User is offline   Giovanni D. 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 23-December 08
  • Location:London (UK)

Posted 20 August 2009 - 10:48 AM

Released r13 as 0.2 so that you can download it from:
http://code.google.c.../downloads/list B)


Please read instructions on how to setup / use here:
http://code.google.com/p/yiimessagedb/


bye,
Giovanni.
Yii Playground: collaborative demo app with small examples to play with.. join us ;) [Fork on github]

>> My Linkedin Profile
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users