New i18n Coder Review

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
stella's picture

Doug and I are working on a new internationalization review for coder. The following checks are in the D6 dev version already (thanks to Doug!):

  • The $text argument to l() should be enclosed within t() so that it is translatable.
  • The $text argument to l() should be enclosed within st() so that it is translatable from within the install. (install files only)
  • Use get_t() or st() instead of t() in !hook_install(), hook_uninstall() and hook_update_N() (install files only)
  • The FAPI #title should be enclosed within t() so that it is translatable.
  • The $message argument to form_error() should be enclosed within t() so that it is translatable.
  • The 'title' option should be enclosed within t() so that it is translatable. (in hook_links() functions)
  • The $message argument to drupal_set_message() should be enclosed within t() so that it is translatable.
  • The $title argument to drupal_set_title() should be enclosed within t() so that it is translatable.
  • The $message argument to watchdog() should NOT be enclosed within t(), so that it can be properly translated at display time.
  • Menu item titles and descriptions should NOT be enclosed within t()
  • The $string argument to t() should not begin or end with a space.

The following ones will be added soon hopefully:

  • #312510 - check for t() in format_plural()
  • #311530 - incorrect usage of t() !placeholders
  • #311516 - leading/trailing spaces checks for format_plural(), watchdog(), etc
  • #311477 - check for \' within translatable strings

However, there's probably a lot more we could add. So if you know of any additional checks that could be done, please let us know by opening a feature request against the coder module. I'd be also be interested to hear your feedback and comments on other things we can do to help improve matters.

Also for those of you who aren't aware, if you enable both the coder and potx modules on your site, additional "Interface text translatability" reviews are available to run with coder.

Cheers,
Stella

Comments

great

Gábor Hojtsy's picture

It is great to see localization coder tests go forward. These are l10n, not i18n, so it would be good to stick to the right term here :) Also, these two are already checked and reported by the potx coder check, so it would be wise to let it do the work instead of doing code duplication:

  • The $message argument to watchdog() should NOT be enclosed within t(), so that it can be properly translated at display time.
  • Menu item titles and descriptions should NOT be enclosed within t()

http://drupal.org/node/312523 is involved with making the reporting from the potx coder review much more useful.

We really need this...

hass's picture

We really need this... thank you for working on this tests.

Error for l()

hass's picture

Also check if people are using l() inside the placeholder array. If they do - make it an context sensitive "error".

Code example can be found at http://drupal.org/node/310852#comment-1029681.

Internationalization

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week