Difference between revisions of "Translating Ad Manager"

From Dot2DotCommunications
Jump to: navigation, search
(Created page with "=== Do not tamper with the "%0", "%1", etc. placeholder sequences.=== Some of the messages contain placeholders which get replaced at runtime with actual values. The format ...")
 
Line 1: Line 1:
 +
== Rules ==
 +
 
=== Do not tamper with the "%0", "%1", etc. placeholder sequences.===
 
=== Do not tamper with the "%0", "%1", etc. placeholder sequences.===
 
   
 
   
Some of the messages contain placeholders which get replaced at runtime with actual values. The format of the placeholder is "%n" where n is a number (0, 1, etc.). Here's an example: "Serial number: %0\r\nUse expiry: %1\r\nSupport expiry: %2\r\nFaces: %3 (%4 used, %5 left)\r\nPlayers: %6 (%7 used, %8 left)". This is text displayed in the About box. %0 will be replaced with the serial number, %1 - with the expiry date, etc. If the placeholders are tampered with during the translation - e.g. "Número de série:% \ 0 \ r termo nUse:% 1 \ r \ termo nSupport: 2% r \ nFaces:% 3% (4 usados, 5% à esquerda) \ r \ nPlayers:% 6% (7 utilizadas,% 8 à esquerda)" - then the messages displayed by the software will make no sense at all.
+
Some of the messages contain placeholders which get replaced at runtime with actual values. The format of the placeholder is <code>%n</code> where <code>n</code> is a number (0, 1, etc.).  
 +
 
 +
Here's an example:  
 +
 
 +
Serial number: %0\r\nUse expiry: %1\r\nSupport expiry: %2\r\nFaces: %3 (%4 used, %5 left)\r\nPlayers: %6 (%7 used, %8 left).
 +
 
 +
This is text displayed in the About box. <code>%0</code> will be replaced with the serial number, <code>%1</code> - with the expiry date, etc. If the placeholders are tampered with during the translation - e.g. <code>Número de série:% \ 0 \ r termo nUse:% 1 \ r \ termo nSupport: 2% r \ nFaces:% 3% (4 usados, 5% à esquerda) \ r \ nPlayers:% 6% (7 utilizadas,% 8 à esquerda)</code> - then the messages displayed by the software will make no sense at all.
 
   
 
   
 
=== Do not tamper with the "\r\n" sequence. ===
 
=== Do not tamper with the "\r\n" sequence. ===
 
   
 
   
The "\r\n" sequence is a special character sequence. It means "continue on a new line" (see the example above). It should not be tampered with during the translation: "\ r \ n" is not a good translation, it's actually invalid and probably won't even compile.  
+
The <code>\r\n</code> sequence is a special character sequence. It means ''continue on a new line'' (see the example above). It should not be tampered with during the translation.
 +
 
 +
<code>\ r \ n</code> is not a good translation, it's actually invalid and will likely cause runtime errors.  
 
   
 
   
 
=== Use the "&" character correctly. ===
 
=== Use the "&" character correctly. ===
 
   
 
   
The '''&''' (ampersand) character has a special meaning: it designates the character immediately after it as a hotkey.
+
The '''&''' (ampersand) character has a special meaning: it turns the character immediately after it into a hotkey.
 +
 
 +
For example, <code>&File</code> is a string used in the menu bar; it will be displayed as '''<u>F</u>ile''' and when the user hits '''Alt+F''', the '''File''' menu will drop down.
 +
 
 +
<code>& Arquivo</code> is not a good translation, because it's going to show up as '''<u>&nbsp;</u>Arquivo''' and the hotkey will be the spacebar.
 +
 
 +
Some UI elements have standard hotkeys in all programs in a particular language, for example:
 +
* the menu commands: '''<u>F</u>ile''': '''<u>N</u>ew''', '''<u>O</u>pen''', '''<u>C</u>lose''', '''<u>S</u>ave''', '''E<u>x</u>it''', etc.,
 +
* the common dialog buttons: '''<u>O</u>K''', '''<u>C</u>ancel''', '''<u>C</u>lose''', '''<u>A</u>pply''', etc.  
  
For example, '''&File''' is a string used in the menu bar; it will be displayed as '''<u>F</u>ile''' and when the user hits '''Alt+f''', the '''File''' menu will drop down.
+
The translation should stick to that standard.
  
'''& Arquivo''' is not a good translation, because it's going to show up as '''<u>&nbsp;</u>Arquivo''' and the hotkey will be the spacebar.
+
All other hotkeys are usually elements in various dialog boxes; for them the translator should try to avoid hotkey duplication, although it's not fatal.
  
It's hard to translate the hotkeys, because ideally there shouldn't be duplicate hotkeys in the same menu or dialog window and you have to understand the context where the string appears by looking at it's ID. For example IDS_FILE is the '''File''' item in the menu bar, IDS_FILE_CLOSE is the '''Close''' command in the '''File''' menu, IDS_DLGADDRESS is the title of the address dialog, IDS_DLGADDRESS_CITY is the '''City''' label in the address dialog.
+
To properly translate hotkeys, you need to understand where the translated text will apear. The string identifiers provide a clue. For example:
 +
* <code>IDS_FILE</code> is the '''File''' item in the menu bar; <code>IDS_TOOLS</code> is the '''Tools''' item in the menu bar;
 +
* <code>IDS_FILE_OPEN</code> is the '''Open''' command in the '''File''' menu; <code>IDS_FILE_SAVE</code> is the '''Save''' command in the '''File''' menu;
 +
* <code>IDS_DLG_OK</code> is the '''OK''' button on all dialogs; <code>IDS_DLG_CANCEL</code> is the '''Cancel''' button on all dialogs;
 +
* <code>IDS_DLGADDRESS</code> is the title of the address dialog, <code>IDS_DLGADDRESS_CITY</code> is the '''City''' label in the address dialog.
  
If in doubt, it's better to remove the ampersand altogether.
 
  
Some UI elements have standard hotkeys in all programs in a particular language, e.g. the menu commands ('''<u>F</u>ile''' -> '''<u>N</u>ew''', '''<u>O</u>pen''', '''<u>C</u>lose''', '''<u>S</u>ave''', '''E<u>x</u>it''', etc.), the common dialog buttons (OK, Cancel, Close, Apply, ...); the translation should stick to that standard; these are recognizable by the string identifier (e.g. IDS_FILE,  IDS_FILE_OPEN, ..., IDS_DLG_OK, IDS_DLG_CANCEL).
+
The ids of strings that belong to the same dialog box have the same prefix (e.g. <code>IDS_DLGADDRESS_</code>). The exception are the common buttons (OK, Cancel, etc.) - try not to use their hotkeys elsewhere in the dialogs.
  
All other hotkeys are usually elements in various dialog boxes; for them the translator should try to avoid hotkey duplication, although it's not fatal; the ids of strings that belong to the same dialog box have the same prefix (e.g. IDS_ DLGADDRESS _); the exception are the common buttons (OK, Cancel, etc.) - try not to use those hotkeys elsewhere in dialogs.
+
Hot keys are important for the menus and the common dialog buttons; they are not critical for the rest of the UI.
  
Hot keys are important for the menus and the common dialog buttons (OK, Cancel, Close, Apply, ...); they are not critical for the rest of the UI; if in doubt, skip the &.
+
If in doubt, it's better to remove the '''&''' altogether.

Revision as of 16:15, 20 December 2013

Contents

Rules

Do not tamper with the "%0", "%1", etc. placeholder sequences.

Some of the messages contain placeholders which get replaced at runtime with actual values. The format of the placeholder is %n where n is a number (0, 1, etc.).

Here's an example:

Serial number: %0\r\nUse expiry: %1\r\nSupport expiry: %2\r\nFaces: %3 (%4 used, %5 left)\r\nPlayers: %6 (%7 used, %8 left).

This is text displayed in the About box. %0 will be replaced with the serial number, %1 - with the expiry date, etc. If the placeholders are tampered with during the translation - e.g. Número de série:% \ 0 \ r termo nUse:% 1 \ r \ termo nSupport: 2% r \ nFaces:% 3% (4 usados, 5% à esquerda) \ r \ nPlayers:% 6% (7 utilizadas,% 8 à esquerda) - then the messages displayed by the software will make no sense at all.

Do not tamper with the "\r\n" sequence.

The \r\n sequence is a special character sequence. It means continue on a new line (see the example above). It should not be tampered with during the translation.

\ r \ n is not a good translation, it's actually invalid and will likely cause runtime errors.

Use the "&" character correctly.

The & (ampersand) character has a special meaning: it turns the character immediately after it into a hotkey.

For example, &File is a string used in the menu bar; it will be displayed as File and when the user hits Alt+F, the File menu will drop down.

& Arquivo is not a good translation, because it's going to show up as  Arquivo and the hotkey will be the spacebar.

Some UI elements have standard hotkeys in all programs in a particular language, for example:

  • the menu commands: File: New, Open, Close, Save, Exit, etc.,
  • the common dialog buttons: OK, Cancel, Close, Apply, etc.

The translation should stick to that standard.

All other hotkeys are usually elements in various dialog boxes; for them the translator should try to avoid hotkey duplication, although it's not fatal.

To properly translate hotkeys, you need to understand where the translated text will apear. The string identifiers provide a clue. For example:

  • IDS_FILE is the File item in the menu bar; IDS_TOOLS is the Tools item in the menu bar;
  • IDS_FILE_OPEN is the Open command in the File menu; IDS_FILE_SAVE is the Save command in the File menu;
  • IDS_DLG_OK is the OK button on all dialogs; IDS_DLG_CANCEL is the Cancel button on all dialogs;
  • IDS_DLGADDRESS is the title of the address dialog, IDS_DLGADDRESS_CITY is the City label in the address dialog.


The ids of strings that belong to the same dialog box have the same prefix (e.g. IDS_DLGADDRESS_). The exception are the common buttons (OK, Cancel, etc.) - try not to use their hotkeys elsewhere in the dialogs.

Hot keys are important for the menus and the common dialog buttons; they are not critical for the rest of the UI.

If in doubt, it's better to remove the & altogether.