edvin/tornadofx-idea-plugin

Don't find translate in gloobal file and don't add missing translation

Closed this issue · 10 comments

Hi, plugin don't find key in gloobal properties (Messages.properties). When i click in "Add missing translation" nothing happens

I have tornadofx plugin in version 1.7.17.1 and intelij version 2018.3

Just to make sure I understand this correctly: You have a class called Messages and you want to add a translation. You also have a file Messages.properties in your resource path. Does the properties file's path match the package of your class?

If possible, can you share the relevant directory structure?

image

It is my directory structure, file when i try use i18n, and messages.properties. Plugin don't see if have translation in Messages.properties file

edvin commented

messages[welcome_message"] will look in the file resources/pl/edu/pwr/weka/sipprogram/gui/view/WelcomeView.properties for your welcome_message= line.

Ok, but in documentation about i18n is, if i can generate default global messages file. Should the plugin also review the default file ? And one more thing that the plugin does not create a file with the translation when i click in "Add missing translation"?

image

edvin commented

The plugin doesn't look in the global messages file yet, but you're right, it should support this. I guess "Add missing translation" could ask if you want to add to the global or local messages file even, or just supply two intensions "Add missing translation to global bundle" along with the existing one.

Ok, i wait for a improve it^^ And when file don't exist plugin should create it.

I didn't even know about the global file :x

The translation support is still somewhat limited. I'll make sure to at least document these wishes in form of tickets.

Edit:
I think there was a misunderstanding. The "global file" is the file without a language suffix.
Therefore the global file is resources/pl/edu/pwr/weka/sipprogram/gui/view/WelcomeView.properties and the file for the english language would be resources/pl/edu/pwr/weka/sipprogram/gui/view/WelcomeView_en.properties.

Tornadofx cannot associate your file to the correct Component if you would have multiple Components with the same name in different packages. Therefore you need the package prefix in your resources.

So this not a bug™.

I didn't even know about the global file :x

The translation support is still somewhat limited. I'll make sure to at least document these wishes in form of tickets.

Edit:
I think there was a misunderstanding. The "global file" is the file without a language suffix.
Therefore the global file is resources/pl/edu/pwr/weka/sipprogram/gui/view/WelcomeView.properties and the file for the english language would be resources/pl/edu/pwr/weka/sipprogram/gui/view/WelcomeView_en.properties.

Tornadofx cannot associate your file to the correct Component if you would have multiple Components with the same name in different packages. Therefore you need the package prefix in your resources.

So this not a bug™.

But when don't find language file about component it take global i18n, look about it

And i have only one class with this name:
image

Oh, it has to be named Messages.properties. You are right. Will fix this.

This still does not work?
I have a Messages.properties file on the root of the resources directory and the translation of the app works, but I still get the warning of missing translations.