Java properties files (.properties)
You see this window when you need to localize Java programs. Text that Java programs display usually exist in .properties files. In this window, you can fine-tune how memoQ imports them.
How to get here
- Start importing a Java .properties document.
- In the Document import options window, select the bilingual Java .properties documents, and click Change filter and configuration.
- The Document import settings window appears. From the Filter drop-down list, choose Java .properties filter.
What can you do?
A Java .properties file contains text properties. Each property is a line of text that the Java program displays. Each property has a name and the value. The value is the actual text that needs to be translated.
A Java .properties file is not running text. To return context matches (101%), memoQ needs something else for the context.
The perfect context for a Java property string is the name of the property.
- Normally, memoQ imports the property name as the context of the string, so that memoQ can match it with the context later on (when it needs to be pre-translated from a translation memory).
- memoQ also imports the property name as a comment, so that the translator can see the property that the segment belongs to.
You exclude the property name from the import (by clearing the Import property name as context ID and/or the Import property name as comment check boxes), but it's not recommended.
Java programs, especially those that run on web servers, produce interactive web pages. A Java property string often contains HTML tags and entities (e.g. ). These should be preserved in the translation.
Normally, memoQ imports these tags and entities as inline tags. When you translate the document, you can easily copy these tags to the target segment. This makes sure they are not corrupted along the way.
You can stop making the inline tags, and import them as normal text instead (clear the Import HTML tags and entities as <tags> check box), but it's not recommended.
A Java property string can contain newline characters (\n).
Normally, memoQ doesn't start a new segment when it finds a newline character. In software localization, a single string must not be broken up into several segments, no matter how many lines it has.
To start a new segment at newline characters: Check the Newline induces segment break check box.
Don't import extra backslashes (\): Don't clear the In values, drop backslash if it is not part of a valid escape sequence check box. Java property values may contain backslash (\) characters in an incorrect manner. Backslash characters can be used only to introduce escape sequences. If this check box is checked, and the backslash does not form a valid escape sequence with the subsequent characters, memoQ omits the backslash character from the imported text. This check box is checked by default, and it's not recommended to clear it.
Java properties files may have properties that do not represent text. A Java program can store any kind of data structures in property files. You can exclude those properties that don't make sense to translate. Under Include or exclude items, you can list properties or property name patterns.
First, decide what happens to properties that are listed:
To ignore the properties that are listed: Click the Exclude properties that match any pattern below radio button. All other properties will be imported. Normally, memoQ does this.
To import only the properties that are listed: Click the Include properties that match a pattern below radio button. All other properties will be skipped.
You list patterns of property names, not exact property names.
To add a property name pattern, type it in the text box next to the list.
- The patterns can end in a *: This pattern matches anything that starts with the characters before the *. Example: base* will match all property names starting with the "base" word, such as "basegroup", "baseline" etc.
- The patterns can start with a *: Such patterns match anything that ends in the characters following the *. Example: "*.text" will match any property name ending in the ".text" string such as "basegroup.text", "PasswordLabel.text" etc.
- If a pattern starts with a *, and also ends in a *, the pattern will match anything that contains the characters between the asterisks.
After you type the pattern, click Add item above.
To remove a pattern from the list: Select the pattern. Click Remove selected.
Normally, a Java .properties document is encoded in UTF-8.
But it can be encoded differently, and memoQ may not be able to recognize it.
Under Encoding, check if the text in the Preview box is readable and if all characters are correct.
If the text isn't readable or not all characters are correct: From the Input encoding list, choose a different encoding. Try another encoding until the text in the Preview box is fully correct.
If the input encoding isn't Unicode (e.g. UTF-8), and the target language uses a different script: Choose the encoding for the translated document from the Output encoding drop-down box. Normally, it's Same as original, but it may not be correct if the script of the target language is too different.
When you finish
To confirm the settings, and return to the Document import options window: Click OK.
To return the Document import options window, and not change the filter settings: Click Cancel.
If this is a cascading filter, you can change the settings of another filter in the chain: Click the name of the filter at the top of the window.
In the Document import options window: Click OK again to start importing the documents.