Translated strings are generally 30% to 50% longer than the English strings which are typically used as the default language. This can lead to trouble fitting the translation in the available space.
When translating the text that appears on game components, it is sometimes necessary to make slight adjustments the layout of the component. This is easy to do if the plug-in author uses .settings
files to define the basic card layout. You can create translated versions in much the same was as for .properties
files, by adding suffixes for the appropriate locale. To work correctly, the plug-in author should use something like Language.getResourceChain
to load the appropriate files.
Some strategies that are used to fit translated design elements include:
If there is an “official” design for the component in the target language, you should try to copy whatever strategy is used there for consistency, even if it might be a suboptimal choice design-wise.
Interface layouts are generally more flexible than game component layouts because windows can grow and shrink to accommodate different text lengths. When the interface does break, one trick you can use is to change the text of labels and buttons to start with <html>
. This lets you use simple HTML tags (like <b>
…</b>
) in the label text. In particular, you can then force a line break within the text using a <br>
tag, as in <html>Gesundheit<br>Geistige
.