Hi Ruson,
Patch is a command-line utility: https://en.wikipedia.org/wiki/Patch_%28Unix%29
I do not use patch from the command line, so I cannot help you with that. You can use this patch by just looking at the code changes it makes in the actual text of the patch (compare the + and – lines). Or you could use a text-editor with patch capabilities. I use Eclipse to this end.
The patch you mentioned does have a minor flaw: the function should return $locale and in the patched version it does not.
I have added a different patch to address the notice you found:
Index: htdocs/wp-content/plugins/qtranslate/qtranslate_hooks.php
===================================================================
— htdocs/wp-content/plugins/qtranslate/qtranslate_hooks.php (revision 823892)
+++ htdocs/wp-content/plugins/qtranslate/qtranslate_hooks.php (working copy)
@@ -48,17 +48,19 @@
global $q_config;
// try to figure out the correct locale
$locale = array();
– $locale[] = $q_config[‘locale’][$q_config[‘language’]].”.utf8″;
– $locale[] = $q_config[‘locale’][$q_config[‘language’]].”@euro”;
– $locale[] = $q_config[‘locale’][$q_config[‘language’]];
– $locale[] = $q_config[‘windows_locale’][$q_config[‘language’]];
– $locale[] = $q_config[‘language’];
–
– // return the correct locale and most importantly set it (wordpress doesn’t, which is bad)
– // only set LC_TIME as everyhing else doesn’t seem to work with windows
– setlocale(LC_TIME, $locale);
–
– return $q_config[‘locale’][$q_config[‘language’]];
+ if ( isset( $q_config[‘language’] ) ) {
+ $locale[] = $q_config[‘locale’][$q_config[‘language’]].”.utf8″;
+ $locale[] = $q_config[‘locale’][$q_config[‘language’]].”@euro”;
+ $locale[] = $q_config[‘locale’][$q_config[‘language’]];
+ $locale[] = $q_config[‘windows_locale’][$q_config[‘language’]];
+ $locale[] = $q_config[‘language’];
+
+ // return the correct locale and most importantly set it (wordpress doesn’t, which is bad)
+ // only set LC_TIME as everyhing else doesn’t seem to work with windows
+ setlocale(LC_TIME, $locale);
+ return $q_config[‘locale’][$q_config[‘language’]];
+ }
+ return $locale;
}
function qtrans_optionFilter($do=’enable’) {