From 538a4c24bd9c942d8e0e9a58a650a29188fbd2ce Mon Sep 17 00:00:00 2001 From: Sem Date: Sun, 8 Jul 2012 10:42:17 +0200 Subject: Fixes #4004. elgg_logging when a language key is missing. --- engine/lib/languages.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engine/lib/languages.php') diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 15c48f902..e8e3d31af 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -50,8 +50,10 @@ function elgg_echo($message_key, $args = array(), $language = "") { $string = $CONFIG->translations[$language][$message_key]; } else if (isset($CONFIG->translations["en"][$message_key])) { $string = $CONFIG->translations["en"][$message_key]; + elgg_log(sprintf('Missing %s translation for "%s" language key', $language, $message_key), WARNING); } else { $string = $message_key; + elgg_log(sprintf('Missing %s translation for "%s" language key', $language, $message_key), ERROR); } // only pass through if we have arguments to allow backward compatibility -- cgit v1.2.3 From 25c324f5bf0f8737268c34626455a302b819651e Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 13 Jul 2012 01:32:44 +0200 Subject: Refs #4004. Downgraded to notice and warning. It also returns the complete language name. --- engine/lib/languages.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engine/lib/languages.php') diff --git a/engine/lib/languages.php b/engine/lib/languages.php index e8e3d31af..77128202f 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -50,10 +50,11 @@ function elgg_echo($message_key, $args = array(), $language = "") { $string = $CONFIG->translations[$language][$message_key]; } else if (isset($CONFIG->translations["en"][$message_key])) { $string = $CONFIG->translations["en"][$message_key]; - elgg_log(sprintf('Missing %s translation for "%s" language key', $language, $message_key), WARNING); + $lang = elgg_echo($language, array(), 'en'); + elgg_log(sprintf('Missing %s translation for "%s" language key', $lang, $message_key), 'NOTICE'); } else { $string = $message_key; - elgg_log(sprintf('Missing %s translation for "%s" language key', $language, $message_key), ERROR); + elgg_log(sprintf('Missing English translation for "%s" language key', $message_key), 'WARNING'); } // only pass through if we have arguments to allow backward compatibility -- cgit v1.2.3 From 185b73174fbd39e4b47c27f19839329438b8f3c2 Mon Sep 17 00:00:00 2001 From: Sem Date: Fri, 13 Jul 2012 14:39:32 +0300 Subject: Refs #4004. Used $CONFIG->translations instead of elgg_echo() --- engine/lib/languages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/lib/languages.php') diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 77128202f..219917b29 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -50,7 +50,7 @@ function elgg_echo($message_key, $args = array(), $language = "") { $string = $CONFIG->translations[$language][$message_key]; } else if (isset($CONFIG->translations["en"][$message_key])) { $string = $CONFIG->translations["en"][$message_key]; - $lang = elgg_echo($language, array(), 'en'); + $lang = $CONFIG->translations["en"][$language]; elgg_log(sprintf('Missing %s translation for "%s" language key', $lang, $message_key), 'NOTICE'); } else { $string = $message_key; -- cgit v1.2.3 From 0a54cabfe75fb0261fff12ee48cd868bfa8f06fb Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 14 Jul 2012 20:42:31 -0400 Subject: Refs #4004 decided to downgrage missing language keys to NOTICE for all languages. The plugin categories were causing problems at the WARNING level. This will be more useful when we move db queries off NOTICE --- engine/lib/languages.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/lib/languages.php') diff --git a/engine/lib/languages.php b/engine/lib/languages.php index 219917b29..98006f7cd 100644 --- a/engine/lib/languages.php +++ b/engine/lib/languages.php @@ -50,11 +50,11 @@ function elgg_echo($message_key, $args = array(), $language = "") { $string = $CONFIG->translations[$language][$message_key]; } else if (isset($CONFIG->translations["en"][$message_key])) { $string = $CONFIG->translations["en"][$message_key]; - $lang = $CONFIG->translations["en"][$language]; + $lang = $CONFIG->translations["en"][$language]; elgg_log(sprintf('Missing %s translation for "%s" language key', $lang, $message_key), 'NOTICE'); } else { $string = $message_key; - elgg_log(sprintf('Missing English translation for "%s" language key', $message_key), 'WARNING'); + elgg_log(sprintf('Missing English translation for "%s" language key', $message_key), 'NOTICE'); } // only pass through if we have arguments to allow backward compatibility -- cgit v1.2.3