bjsion / tongue-tied

Translation and resource management tool
1 stars 0 forks source link

Feature Request: Import for JavaFX property files #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version Info
TongueTied: 1.3.5

This is feature request to have the posibility of importing and exporting
JavaFX language property files. They are very similar to Java property files:

Java:
LoginDialog.login=Login
LoginDialog.quit=Quit

JavaFX:
"Save"="Save"
"Cancel"="Cancel"

The difference is, that you typically use the language translation as the
key (but this is not required), but the key and the value are both in
quotation marks.

Original issue reported on code.google.com by adam.gie...@gmail.com on 3 May 2010 at 12:57

GoogleCodeExporter commented 9 years ago
Hi Adam,

In order to provide Java FX support the Importer class needs to be extended. 
You may
be able to leverage off the PropertiesImporter for some features. (Also check 
out
PropertiesImporterTest). Also it will require an addition to the "FormatType" 
enum
and finally to complete the circle a template is required for export. The 
templates
are made using freemarker. 

I have to admit I am not familiar with the Java FX format, so I will need to 
spend a
bit of time coming up to speed, but assuming that it is as simple as you 
described
without any extra escape sequences, it should not be too difficult. Always 
willing to
accept contributions of code but they will need unit tests ;)

cheers,
Ben

Original comment by bjs...@gmail.com on 4 May 2010 at 1:05

GoogleCodeExporter commented 9 years ago
See here for more details on javafx properties:
http://javafx.com/docs/techtips/Localize-JavaFX-Application/
http://blogs.sun.com/naoko/entry/javafx_localization

N.B. there is no need to escape characters for JavaFX properties files.

Original comment by bjs...@gmail.com on 5 May 2010 at 2:57

GoogleCodeExporter commented 9 years ago
Any progress here? We have had no time to look into this on our own yet...

Original comment by adam.gie...@gmail.com on 29 Jul 2010 at 8:33

GoogleCodeExporter commented 9 years ago
Not as yet. I can try to have a look at it this coming weekend. I don't think 
this will too difficult to implement. If I gave you a beta, would you be able 
to verify that it works correctly?

Original comment by bjs...@gmail.com on 2 Aug 2010 at 3:29

GoogleCodeExporter commented 9 years ago
That would be awesome! Testing a beta is the least I can do for that nice 
support! Drop me a note as soon as you have something to test!

Original comment by adam.gie...@gmail.com on 2 Aug 2010 at 9:37

GoogleCodeExporter commented 9 years ago
Any updates on that?

Original comment by adam.gie...@gmail.com on 8 Sep 2010 at 1:00

GoogleCodeExporter commented 9 years ago
Hi Adam,

I am such a drop kick. I released a beta version with Java FX support, exactly 
one month ago and forgot to update the issue. I assumed that you were the one 
who downloaded it when I saw the counter go up (what is it they say when you 
assume?).

Anyway long story short, a beta is available here:
http://code.google.com/p/tongue-tied/downloads/detail?name=TongueTied_1_4_0_Beta
1-20100809.war&can=2&q=

If you would be so kind as to provide any comments and testing on the beta. I 
would greatly appreciate that.

thanks and apologies for not informing you earlier.
Ben

Original comment by bjs...@gmail.com on 9 Sep 2010 at 8:39

GoogleCodeExporter commented 9 years ago
Hi Ben,

no worries, happy that you did it at all and that quick. We will test it these 
days and report back to you.

(I could have checked for new versions myself as well)

Cheers,
 Adam

Original comment by adam.gie...@gmail.com on 9 Sep 2010 at 9:00

GoogleCodeExporter commented 9 years ago
Hi Ben,

could you please provide a bundled version of the beta? Or tell me how I can 
extract the war into the current bundle version? I do not want to mess up the 
installation that we have to much ;)

Best,
 Adam

Original comment by adam.gie...@gmail.com on 23 Sep 2010 at 9:41

GoogleCodeExporter commented 9 years ago
Hi Adam,

I have uploaded a bundled version. See 
http://code.google.com/p/tongue-tied/downloads/list

However if you want to replace the jar it is pretty easy. These are the steps:
1. Stop the tongue tied server. 
2. Backup the old war file:
2.1 Go to <TONGUE_TIED_HOME>/webapps.
2.2 Copy "tonguetied.war" to "tonguetied.war.bak"
3. Drop the new beta into the <TONGUE_TIED_HOME>/webapps
4. Rename the beta war to "tonguetied.war"
5. Back up the old expanded war file.
6. Go to <TONGUE_TIED_HOME>.
6.1 Rename "tonguetied" directory to "tonguetied.bak"
7. Restart the tonguetied server.

any issues let me know.

Cheers,
Ben

Original comment by bjs...@gmail.com on 23 Sep 2010 at 10:12

GoogleCodeExporter commented 9 years ago
Hi Adam,

Any update on this issue? Have you managed to test the beta? If so any issues? 
If not I will close this issue and mark it as fixed.

Cheers,
Ben

Original comment by bjs...@gmail.com on 23 Oct 2010 at 12:29

GoogleCodeExporter commented 9 years ago
Hi Ben,

sorry for not reacting on this for a while, was busy with other stuff. I just 
did the update as you described and set it up to use our pre-beta database on 
mysql. Unfortunately, I get this:

Nested in org.springframework.dao.DataIntegrityViolationException: could not 
insert: [org.tonguetied.administration.ServerData]; nested exception is 
org.hibernate.exception.DataException: could not insert: 
[org.tonguetied.administration.ServerData]:
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 
'version' at row 1
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3560)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)

I have seen already some fixes by you for PostgreSQL, but as you see I use 
MySQL. Any ideas?

Best,
 Adam

Original comment by adam.gie...@gmail.com on 3 Nov 2010 at 9:07

GoogleCodeExporter commented 9 years ago
Hi Ben,

id did manage to fix the MySQL error by altering the server_data version column 
to varchar(12). You should adapt the sql scripts ;)

I have now successfully imported one file, bundle and language has been 
detected automatically! Second file gave an error (same bundle, different 
language):

Internal System Error

An internal error has occurred in the system. The action you were attempting 
cannot be recovered. Please inform your system administrator.

    java.lang.ArrayIndexOutOfBoundsException: 1
    org.tonguetied.datatransfer.importing.JavaFxPropertiesImporter.loadProperties(JavaFxPropertiesImporter.java:68) org.tonguetied.datatransfer.importing.AbstractPropertiesImporter.doImport(AbstractPropertiesImporter.java:61) org.tonguetied.datatransfer.importing.Importer.importData(Importer.java:73)

I just see, that the second language file has more properties, than the first 
one...

Original comment by adam.gie...@gmail.com on 3 Nov 2010 at 10:12

GoogleCodeExporter commented 9 years ago
Overall JavaFX import seems to work now. The error messages could be more 
improved, e.g., if you have "corrupted" files like only key, no value or "=".

Furthermore, there is a need for merging files. Say you upload version 1 to TT, 
non devs start to translate, then you upload v2 with new keys, but old values 
for the old keys. In that case, the edited values are overriden.

Original comment by adam.gie...@gmail.com on 3 Nov 2010 at 11:58

GoogleCodeExporter commented 9 years ago
Hi Adam,

Apologies for the DB issue. It is fixed for MySQL but only new DB, not existing 
DB's. I should write an update script for the DB.

Glad to hear it is working. I will close this issue and raise two new issues 
(113 [http://code.google.com/p/tongue-tied/issues/detail?id=113] and 114 
[http://code.google.com/p/tongue-tied/issues/detail?id=114]) for the points you 
raised.

Thanks for helping out with this issue.

Original comment by bjs...@gmail.com on 5 Nov 2010 at 10:14