Translating a mix of preset configuration strings from module code and user entered strings

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

I am looking for the current best Drupal 7 practices of translating a mix of preset configuration strings from module code and user entered strings.

I maintain a contrib module that defines a set of (availability) states. On install it sets up a table with a default set of states (available, optionally booked, booked). But admins may edit this set and add, remove or change states. But now I have a table with states in 2 languages: English from the default set and the default language for the user entered states.

The article User provided vs. code provided translatables and translation sets from Gábor Hojtsy suggests that I should use st/t() on install. However, with the localization update module, translations are typically imported AFTER the module has been installed (hook_modules_enabled) and are thus not available during hook_install.

How should I, as module developer, handle this (all too common case)?

Internationalization

Group organizers

Group categories

Group notifications

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

Hot content this week