| | 41 | {{{ |
| | 42 | The first problem for i18n are variables in the translation strings. While |
| | 43 | constants are recognized and added to the translation file during code |
| | 44 | compilation - variable strings are not added to the translation file unless |
| | 45 | you execute the code with all possible combinations: |
| | 46 | |
| | 47 | "If the string to be translated is not a constant but a variable, it will be |
| | 48 | added to the translation file at runtime to be translated later." (web2py |
| | 49 | manual). |
| | 50 | |
| | 51 | This is problematic, because you need to know which functions have to be |
| | 52 | executed and how in order to produce a complete dictionary, and at every code |
| | 53 | update, you have to do it again. Hence, it is likely that those strings will |
| | 54 | be missed by offline translations (i.e. pre-deployment), and have to be |
| | 55 | translated in the field. As an exception, this is acceptable. |
| | 56 | |
| | 57 | The other problem is that your construction assumes that number of words and |
| | 58 | word order in the respective phrases are the same in all languages, which is |
| | 59 | a typical idea of English native speakers - but not true. Especially we |
| | 60 | Germans use a quite different word order (which is totally twisted, as you |
| | 61 | know, but we're not the only ones), e.g. |
| | 62 | |
| | 63 | 'Add New ' + table_name |
| | 64 | |
| | 65 | must be German one of: |
| | 66 | table_name + " erstellen" (best option) |
| | 67 | table_name + " hinzufügen" (still ok) |
| | 68 | "Füge " + table_name + " hinzu" (imperative form, not good in German) |
| | 69 | |
| | 70 | where translating the "New" would introduce another problem which is about the |
| | 71 | grammatical gender: |
| | 72 | "New X" could be in German either of "Neue X", "Neues X" oder "Neuen X". And |
| | 73 | believe me not even I can explain the German use of gender (e.g. "Software" |
| | 74 | is female, i.e. "she" - and this is not even a German word; while a computer |
| | 75 | is male, i.e. "he", and that is not a German word either). |
| | 76 | |
| | 77 | And semantics make it yet harder. It might be possible to "Bearbeite |
| | 78 | Mitteilung" ("Edit Message"), which means to "modify the contents of a |
| | 79 | message", while it is not possible to "Bearbeite Person" ("Edit Person"), |
| | 80 | because that would mean to "make that person agree in something". |
| | 81 | |
| | 82 | Similar for "Löschen" (for "Delete"), which is pretty ambiguous as it stands |
| | 83 | for "Delete" (remove something from the computer memory) as well as |
| | 84 | for "Extinguish" (e.g. fire) and some other meanings. To use it |
| | 85 | with "Person", you'd need to use an object periphrasis like "Eintrag" |
| | 86 | ("entry") or "Personendaten" ("personal data"). |
| | 87 | |
| | 88 | Difficult, difficult. Therefore - use string constants. |
| | 89 | }}} |