Skip to content

Commit 216b2fa

Browse files
support for non Latin characters
1 parent c23cb4a commit 216b2fa

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

classes/Visualizer/Module/Chart.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ public function renderFlattrScript() {
379379
* @access public
380380
*/
381381
public function uploadData() {
382-
error_log( 'in uploadData ' . print_r( $_GET,true ) . print_r( $_POST,true ) );
383382
// validate nonce
384383
// do not use filter_input as it does not work for phpunit test cases, use filter_var instead
385384
if ( ! isset( $_GET['nonce'] ) || ! wp_verify_nonce( $_GET['nonce'] ) ) {

classes/Visualizer/Render/Page/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class="visualizer-select">
157157
</li>
158158
</ul>
159159
</li>
160-
<li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class' ); ?> ">
160+
<li class="group <?php echo apply_filters( 'visualizer_pro_upsell_class', '' ); ?> ">
161161
<h2 class="group-title sub-group"
162162
data-current="chart"><?php _e( 'Import from other chart', 'visualizer' ); ?><span
163163
class="dashicons dashicons-lock"></span></h2>

classes/Visualizer/Source/Csv.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function __construct( $filename = null ) {
6262
private function _fetchSeries( &$handle ) {
6363
// read column titles
6464
$labels = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
65+
$labels = array_map( 'utf8_encode', $labels );
6566
// read series types
6667
$types = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
6768

@@ -78,6 +79,7 @@ private function _fetchSeries( &$handle ) {
7879

7980
// re read the labels and empty types array
8081
$labels = fgetcsv( $handle, 0, VISUALIZER_CSV_DELIMITER, VISUALIZER_CSV_ENCLOSURE );
82+
$labels = array_map( 'utf8_encode', $labels );
8183
$types = array();
8284
}
8385

@@ -105,7 +107,10 @@ protected function _get_file_handle( $filename = false ) {
105107
// set line endings auto detect mode
106108
ini_set( 'auto_detect_line_endings', true );
107109
// open file and return handle
108-
return fopen( $filename ? $filename : $this->_filename, 'rb' );
110+
$fc = iconv( 'ISO-8859-1', 'utf-8', file_get_contents( $filename ? $filename : $this->_filename ) );
111+
$tmp = tempnam( sys_get_temp_dir(), rand() );
112+
file_put_contents( $tmp, $fc );
113+
return fopen( $tmp, 'rb' );
109114
}
110115

111116
/**

languages/visualizer.pot

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the GPL v2.0 or later.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Visualizer: Charts and Graphs Lite 2.1.0\n"
5+
"Project-Id-Version: Visualizer: Charts and Graphs Lite 2.1.1\n"
66
"Report-Msgid-Bugs-To: https://github.com/Codeinwp/visualizer/issues\n"
7-
"POT-Creation-Date: 2017-05-16 06:15:21+00:00\n"
7+
"POT-Creation-Date: 2017-06-01 12:26:17+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -102,7 +102,7 @@ msgid "Pro Addon"
102102
msgstr ""
103103

104104
#: classes/Visualizer/Module/Chart.php:298
105-
#: classes/Visualizer/Module/Chart.php:580
105+
#: classes/Visualizer/Module/Chart.php:579
106106
msgid "You have entered invalid URL. Please, insert proper URL."
107107
msgstr ""
108108

@@ -118,11 +118,11 @@ msgstr ""
118118
msgid "Insert Chart"
119119
msgstr ""
120120

121-
#: classes/Visualizer/Module/Chart.php:412
121+
#: classes/Visualizer/Module/Chart.php:411
122122
msgid "CSV file with chart data was not uploaded. Please, try again."
123123
msgstr ""
124124

125-
#: classes/Visualizer/Module/Chart.php:424
125+
#: classes/Visualizer/Module/Chart.php:423
126126
msgid "CSV file is broken or invalid. Please, try again."
127127
msgstr ""
128128

@@ -1500,6 +1500,16 @@ msgstr ""
15001500
msgid "Insert"
15011501
msgstr ""
15021502

1503+
#: vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-licenser.php:453
1504+
msgid ""
1505+
"Updating this theme will lose any customizations you have made. Cancel to "
1506+
"stop, OK to update."
1507+
msgstr ""
1508+
1509+
#: vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget-dashboard-blog.php:197
1510+
msgid "Install"
1511+
msgstr ""
1512+
15031513
#. Plugin Name of the plugin/theme
15041514
msgid "Visualizer: Charts and Graphs Lite"
15051515
msgstr ""

0 commit comments

Comments
 (0)