Adding Java .properties files to Pootle - java

I am attempting to add .properties files to Pootle and am trying to get it to recognize the English properties file as the template file. For some reason Pootle is failing to do this and I am not sure why. I can successfully add all of my properties files in whatever languages I want to Pootle, but then when I try to start translating Pootle fails to match the keys and show the English template strings in the translation interface. Just wondering if anyone else has come across this or has any ideas.
Thanks!

I actually figured this out on my own already. In case anyone else comes across this and still needs an answer, you simply have to change Project Tree Style to "GNU style: files named by language code" under the Administration/Projects tabs.

Related

Creating or reading files on any computer

my program on startup will:
1. search for a file
2. read the file
3. and set a string to the files contents
But the way ive done it it will only work if they have the exact path that i am hard coding in.
i want the path to adapt to other computers. I think i should use the Path class but ive just heard about that so not sure where to go.
basically i want it to search for a file on any users desktop, and if its not there make it.
if you need some code to clarify i can post it just let me know
I could think of two options.
You can simply specify a file name such as "myFile.txt", so the program will search this file in its program/project folder.
If it does not exist you can write the code to create it in the program folder, instead of hard coding any absolute path.
Else, you can try using the javax.swing.JFileChooser class to pop up an Open and Save dialog box.
This will give the end-user the freedom to select any file for reading and writing.
I found below two articles with some example on how to use the class. Please refer them for more information.
https://www.codejava.net/java-se/swing/show-save-file-dialog-using-jfilechooser
How to "Open" and "Save" using java
Thanks.
You can use the path "./yourfile.txt". It will search for "yourfile.txt" in the directory ".". That means the project's current directory. Maybe it can help you.

Gradle fill .properties-Files dynamically

For a project I have a set of old .properties files, some are templates with
${placerholder} values and some are the "real" properties files that have key-value settings.
Depending on the start parameter, the .properties template files have to be filled with the real values.
The placeholder can be written with one or more dot annotations such as ${acount.money.euro} etc.
I cant seem to find a gradle way of filling those properties if:
the value is missing or should just be empty or have the placeholder
the value is written in dot annotation
I can do it in ANT but cant find a way to do it in gradle. Either the value cant be found for the dot annotations or the values are not filled at all or the missing value for the placeholder is making the script crash.
Anyone knows the right way to configurate .properties in gradle style? There are no real tutorials for it.
Did you try to use ant task? or write a custom task or a groovy class? or search on stack overflow? at least google? there are millions of answers on this, its one of the most common questions I think.
What do you mean:
There are no real tutorials for it.
Please check those links, try something show us your effort and then come back if you are stuck.
How can I transform a .properties file during a Gradle build?
Different ways to set properties
Gradle write properties
Groovy Reading a writing to properties file
and on, and on, and on....

Google translate project for java properties files

I am looking for a project to automatically translate my java properties files!
I just tried copy/paste the entirety of a properties file in translate.google.com and it the translator respected the file format keeping the keys intact while translating only the values!!!! Amazing job Google.
Depending on the number of files you have to translate it might be a long process to do it one by one (there is also 5000 character limit) but in the case of few files, it is a very viable solution to automation.
I have found a recent and maintained project for google translate of java properties files:
translate
Unfortunately I need an api key and for that a business account, which I do not have...
I still cannot translate my java properties files :-(
I cannot recommend to auto-translate. But I can recommend to maintain your translations in better way than properties files. This plugin will automatically compile your translations into properties files: https://github.com/hoereth/i18n-maven-plugin/blob/master/doc/README_JAVA.md
Feel free to ask me if you have troubles using it.

Prevent setup file from being openned as text in notepad

Im pretty sure this is a question that someone already has made, but Im also sure that this has a concept name which I dont know and I would like to get known, therefore I can research more about.
My java app has some setup files, which can be openned as a txt file to manually modify. I would like to prevent those files from being openned manually (by that I mean through the explorer and notepad), I only want them to be modified thorugh the GUI of my application. How people handle this? Some sort of cryptography for each setup file?
I don't think that it is possible to prevent opening a file. But you can put them in system folders e.g. %PROGRAMDATA%. Not exactly what you are asking for but hides them at least from an "average" user and is a common practice.
You could also serialize and deserialize your setup files in binary format.
Another way is - like you proposed - crypting them.
It depends on how secure you want it to be. If you just want to prevent modification by casual users, you could pass some sort of obfuscation over the text to discourage people (e.g. xor with a known value), or you could zip each file.
If you want it more secure, such that even someone with some smarts can't get into them, then you would want to encrypt the files. You could do a search for "java encryption" to see where people have gone with that.

Using Clear parser for semantic role labeling

I want to use the Clear Parser for extract semantic role label of the input sentence. I downloaded the jar file here but I don't know how to use this jar file.
I search on the web but there isn't good guideline for using it.
Please help me to solve this problem (My project is in eclipse on windows).
Mind that Clearparser is now ClearNLP. For an idea how to use the ClearNLP API, check out the DemoNLPDecoder linked from their project page. In fact, that's a small runnable application to which you pass all the models as command line arguments, along with an input and a output file.

Categories

Resources