diff --git a/modules/og_notifications/og_notifications.module b/modules/og_notifications/og_notifications.module
index ab7612d..3ab97cb 100644
--- a/modules/og_notifications/og_notifications.module
+++ b/modules/og_notifications/og_notifications.module
@@ -83,7 +83,7 @@ function og_notifications_form_alter(&$form, $form_state, $form_id) {
$nodetypes = node_get_types();
$ogtypes = og_get_types('group_post');
foreach ($ogtypes as $ntype) {
- $select[$ntype] = $nodetypes[$ntype]->name;
+ $select[$ntype] = og_tt("nodetype:type:$ntype:name", $nodetypes[$ntype]->name);
}
$form['group']['og_notifications_content_types'] = array(
@@ -514,7 +514,7 @@ function _og_notifications_node_options($account, $node) {
if (og_is_group_type($node->type) && isset($account->og_groups[$node->nid])) {
foreach (array_filter(variable_get('og_notifications_content_types', array())) as $type) {
$options[] = array(
- 'name' => t('%type posts in %group', array('%group' => $node->title, '%type' => node_get_types('name', $type))),
+ 'name' => t('%type posts in %group', array('%group' => $node->title, '%type' => og_tt("nodetype:type:$type:name", node_get_types('name', $type)))),
'type' => 'grouptype',
'fields' => array('group' => $node->nid, 'type' => $type)
);
@@ -528,7 +528,7 @@ function _og_notifications_node_options($account, $node) {
if (isset($account->og_groups[$gid]) && in_array($node->type, array_filter(variable_get('og_notifications_content_types', array())))) {
// Content type
$options[] = array(
- 'name' => t('%type posts in %group', array('%group' => $node->og_groups_both[$gid], '%type' => node_get_types('name', $node->type))),
+ 'name' => t('%type posts in %group', array('%group' => $node->og_groups_both[$gid], '%type' => og_tt("nodetype:type:$node->type:name", node_get_types('name', $node->type)))),
'type' => 'grouptype',
'fields' => array('group' => $gid, 'type' => $node->type)
);
@@ -577,4 +577,4 @@ function og_notifications_autosubscribe_map() {
0 => t('Disabled'),
1 => t('Enabled'),
);
-}
\ No newline at end of file
+}
diff --git a/modules/og_notifications/og_notifications.pages.inc b/modules/og_notifications/og_notifications.pages.inc
index 18b6832..f70536c 100644
--- a/modules/og_notifications/og_notifications.pages.inc
+++ b/modules/og_notifications/og_notifications.pages.inc
@@ -48,7 +48,7 @@ function og_notifications_add_form($form_state, $account, $groups) {
$content_types = array_filter(variable_get('og_notifications_content_types', array()));
$content_names = node_get_types('names');
foreach ($content_types as $type) {
- $content_types[$type] = $content_names[$type];
+ $content_types[$type] = og_tt("nodetype:type:$type:name", $content_names[$type]);
}
$defaults = _notifications_subscription_defaults($account);
$send_methods = _notifications_send_methods();
diff --git a/og.module b/og.module
index ef6a439..7aaa3f5 100644
--- a/og.module
+++ b/og.module
@@ -2206,7 +2206,7 @@ function og_form_add_og_audience(&$form, &$form_state) {
'#multiple' => TRUE);
}
else if ($required) {
- form_set_error('title', t('You must join a group before posting a %type.', array('@join' => url('og'), '%type' => node_get_types('name', $node->type))));
+ form_set_error('title', t('You must join a group before posting a %type.', array('@join' => url('og'), '%type' => og_tt("nodetype:type:$node->type:name", node_get_types('name', $node->type)))));
}
}
@@ -2749,7 +2749,7 @@ function og_og_create_links($group) {
foreach ($post_types as $post_type) {
// We used to check for node_access(create) but then node admins would get a false positive and see node types that they could not create.
// When this becomes a proper menu in D6, we get sorting for free
- $type_name = $types[$post_type]->name;
+ $type_name = og_tt("nodetype:type:$post_type:name", $types[$post_type]->name);
$type_url_str = str_replace('_', '-', $post_type);
if (module_invoke($types[$post_type]->module, 'access', 'create', $post_type, $user)) {
$links["create_$post_type"] = l(t('Create !type', array('!type' => $type_name)), "node/add/$type_url_str", array(
@@ -2887,3 +2887,15 @@ function og_check_token($token, $seed) {
function og_broadcast_access($node) {
return og_is_group_admin($node) && module_exists('og_notifications');
}
+
+/**
+ * Wrapper function for tt() if i18nstrings enabled.
+ */
+function og_tt($name, $string, $langcode = NULL, $update = FALSE) {
+ if (module_exists('18nstrings')) {
+ return tt($name, $string, $langcode, $update);
+ }
+ else {
+ return $string;
+ }
+}