protected static function i18n_string_textgroup_default::string_check in Internationalization 7
Check if string is ok for translation
2 calls to i18n_string_textgroup_default::string_check()
- i18n_string_textgroup_default::string_add in i18n_string/
i18n_string.inc - Add source string to the locale tables for translation.
- i18n_string_textgroup_default::string_update in i18n_string/
i18n_string.inc - Update / create / remove string.
File
- i18n_string/
i18n_string.inc, line 435 - API for internationalization strings
Class
- i18n_string_textgroup_default
- Textgroup handler for i18n_string API
Code
protected static function string_check($i18nstring, $options = array()) {
$options += array(
'messages' => FALSE,
'watchdog' => TRUE,
);
if (!empty($i18nstring->format) && !i18n_string_allowed_format($i18nstring->format)) {
// This format is not allowed, so we remove the string, in this case we produce a warning
drupal_set_message(t('The string %location for textgroup %textgroup is not allowed for translation because of its text format.', $i18nstring
->get_args()), 'warning');
return FALSE;
}
else {
return TRUE;
}
}