I'm reviewing some translation-related patches for project*. What's the right way to handle big, complicated help text messages that involve multiple paragraphs, ul or dl lists, etc?
Here's the proposal:
return t('<p>The project module makes special use of the taxonomy (category) system. A special vocabulary, %vocabulary_name, has been created automatically.</p><p>To take full advantage of project categorization, add at least two levels of terms to this vocabulary. The first level will be the basic project types, e.g., "modules", "themes", "translations".</p><p>Subterms of each of these types will be the categories that users can select to classify the projects. For example, "modules" might have sub-terms including "mail" and "XML".</ p><p>Use the <a href="@taxonomy-admin">vocabulary admin page</a> to view and add terms.</p>', array('@taxonomy-admin' => url('admin/ content/taxonomy/'. $vid), '%vocabulary_name' => $vocabulary->name));
Is one giant t() call preferred, or should this be split into a separate t() for each paragraph, and keep the HTML out of it, something like this:
return '<p>'. t('The project module makes special use of the taxonomy (category) system. A special vocabulary, %vocabulary_name, has been created automatically.', array('%vocabulary_name' => $vocabulary->name)) .'</p><p>'. t('To take full advantage of project categorization, add at least two levels of terms to this vocabulary. The first level will be the basic project types, e.g., "modules", "themes", "translations".') .'</p><p>'. t('Subterms of each of these types will be the categories that users can select to classify the projects. For example, "modules" might have sub-terms including "mail" and "XML".') .'</p><p>'. t('Use the <a href="@taxonomy-admin">vocabulary admin page</a> to view and add terms.', array('@taxonomy-admin' => url('admin/ content/taxonomy/'. $vid)) .'</p>';
??
Thanks, -Derek