[gnome-web-wppo] translate properly RSS feed
- From: Vinicius Scopel Depizzol <vdepizzol src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-web-wppo] translate properly RSS feed
- Date: Sat, 10 Mar 2012 21:09:45 +0000 (UTC)
commit d32c5295078d2bf1e7ea7868538e3fb503666f5c
Author: Vinicius Depizzol <vdepizzol gmail com>
Date: Sat Mar 10 18:05:15 2012 -0300
translate properly RSS feed
wppo.php | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/wppo.php b/wppo.php
index 15fea1d..caef732 100644
--- a/wppo.php
+++ b/wppo.php
@@ -244,7 +244,10 @@ if (!is_admin()) {
* Apply translations for the website title and description
*/
- add_filter('bloginfo', function($bloginfo, $attribute) {
+ add_filter('bloginfo', 'parse_bloginfo', 10, 2);
+ add_filter('get_bloginfo_rss', 'parse_bloginfo', 10, 2);
+
+ function parse_bloginfo($bloginfo, $attribute) {
global $wppo_cache, $wpdb;
@@ -264,7 +267,22 @@ if (!is_admin()) {
return $bloginfo;
- }, 10, 2);
+ }
+
+ /*
+ * Display proper language in translated RSS feed
+ */
+
+ add_filter('pre_option_rss_language', function() {
+
+ $defined_lang = wppo_get_lang();
+
+ $defined_lang_array = explode('_', $defined_lang);
+ $defined_lang = strtolower($defined_lang_array[0]).'-'.strtoupper($defined_lang_array[1]);
+
+ return $defined_lang;
+
+ }, 10);
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]