Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[ticket/10157] Add notification to update cpfs when installing a language #451

Merged
merged 1 commit into from

2 participants

@nickvergessen
Collaborator

We currently just copy the language-strings from the default language. But the
admin should be reminded to change them.

http://tracker.phpbb.com/browse/PHPBB3-10157

phpBB/language/en/acp/language.php
@@ -59,6 +59,7 @@ $lang = array_merge($lang, array(
'LANGUAGE_PACK_DELETED' => 'The language pack <strong>%s</strong> has been removed successfully. All users using this language have been reset to the boards default language.',
'LANGUAGE_PACK_DETAILS' => 'Language pack details',
'LANGUAGE_PACK_INSTALLED' => 'The language pack <strong>%s</strong> has been successfully installed.',
+ 'LANGUAGE_PACK_CPF_UPDATE' => 'The custom profile fields language-strings were copied from the default language. Please change them if necessary.',
@p
p added a note

"The custom profile fields' language strings"

@nickvergessen Collaborator

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/includes/acp/acp_language.php
@@ -919,6 +919,9 @@ class acp_language
$default_lang_id = (int) $db->sql_fetchfield('lang_id');
$db->sql_freeresult($result);
+ // We want to notify the admin, that custom profile fields need to be updated for the new language.
@p
p added a note

Comma is not needed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@nickvergessen nickvergessen [ticket/10157] Add notification to update cpfs when installing a lang…
…uage.

We currently just copy the language-strings from the default language. But the
admin should be reminded to change them.

PHPBB3-10157
b2b0579
@nickvergessen nickvergessen commented on the diff
phpBB/includes/acp/acp_language.php
@@ -919,6 +919,9 @@ class acp_language
$default_lang_id = (int) $db->sql_fetchfield('lang_id');
$db->sql_freeresult($result);
+ // We want to notify the admin, that custom profile fields need to be updated for the new language.
@nickvergessen Collaborator

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@p p merged commit b2b0579 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 17, 2011
  1. @nickvergessen

    [ticket/10157] Add notification to update cpfs when installing a lang…

    nickvergessen authored
    …uage.
    
    We currently just copy the language-strings from the default language. But the
    admin should be reminded to change them.
    
    PHPBB3-10157
This page is out of date. Refresh to see the latest.
View
9 phpBB/includes/acp/acp_language.php
@@ -919,6 +919,9 @@ function main($id, $mode)
$default_lang_id = (int) $db->sql_fetchfield('lang_id');
$db->sql_freeresult($result);
+ // We want to notify the admin that custom profile fields need to be updated for the new language.
@nickvergessen Collaborator

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ $notify_cpf_update = false;
+
// From the mysql documentation:
// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
// Due to this we stay on the safe side if we do the insertion "the manual way"
@@ -932,6 +935,7 @@ function main($id, $mode)
{
$row['lang_id'] = $lang_id;
$db->sql_query('INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row));
+ $notify_cpf_update = true;
}
$db->sql_freeresult($result);
@@ -944,12 +948,15 @@ function main($id, $mode)
{
$row['lang_id'] = $lang_id;
$db->sql_query('INSERT INTO ' . PROFILE_FIELDS_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row));
+ $notify_cpf_update = true;
}
$db->sql_freeresult($result);
add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']);
- trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']) . adm_back_link($this->u_action));
+ $message = sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']);
+ $message .= ($notify_cpf_update) ? '<br /><br />' . $user->lang['LANGUAGE_PACK_CPF_UPDATE'] : '';
+ trigger_error($message . adm_back_link($this->u_action));
break;
View
1  phpBB/language/en/acp/language.php
@@ -59,6 +59,7 @@
'LANGUAGE_PACK_DELETED' => 'The language pack <strong>%s</strong> has been removed successfully. All users using this language have been reset to the boards default language.',
'LANGUAGE_PACK_DETAILS' => 'Language pack details',
'LANGUAGE_PACK_INSTALLED' => 'The language pack <strong>%s</strong> has been successfully installed.',
+ 'LANGUAGE_PACK_CPF_UPDATE' => 'The custom profile fields’ language strings were copied from the default language. Please change them if necessary.',
'LANGUAGE_PACK_ISO' => 'ISO',
'LANGUAGE_PACK_LOCALNAME' => 'Local name',
'LANGUAGE_PACK_NAME' => 'Name',
Something went wrong with that request. Please try again.