3 ms·
To be quite honest, I dislike GetText() quite a lot. Drupal re-implements it as t(), but it still is fundamentally lacking in context, which Drupal later had t
by Svip 14y ago
To be quite honest, I dislike GetText() quite a lot. Drupal re-implements it as t(), but it still is fundamentally lacking in context, which Drupal later had to add as a second parameter. The English word 'order' can be translated to »sortering« or »bestilling« depending on context in Danish.
I much much more prefer MediaWiki's approach, by naming all message strings something related to their purpose, this often results in a name structure, that defines their grouping and purpose, takes up less space, and does not require context definitions, because it does per default.
As a result, you contain all your messages - per default at least - in a message file, such as this: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=languages/messages/MessagesEn.php;h=c5dba69dc0dbe10af14991d83a7b515ee75642f5;hb=HEAD https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a...
But each message can be altered, which is then saved in the database; if a message is not in the database, its default is used.